Research in Motion is hoping to get its groove back with the upcoming launch of BlackBerry 10, but whether it will work is anybody's guess.

For now, investors are willing to give the company somewhat of a chance. Shares of RIM (RIMM) rose 5% Thursday following news that the U.S. Immigration and Customs Enforcement agency will begin a pilot program early next year to test the company's new smartphones and the operating system.

It's a curious move. Just two months ago, it seemed that the federal agency was moving away from BlackBerry devices to Apple (AAPL) iPhones. In fact, it said it was ordering more than 17,000 iPhones for its employees, at a cost of more than $2 million.

But it seems ICE isn't making a decision one way or the other just yet.

"We're not backing away from BlackBerry or iOS," said ICE spokesman Barbara Gonzalez. "We've had a long and good relationship with RIM and plan to continue that."

While some ICE employees are using iPhones, some have continued to use BlackBerry phones as well, she said. And for now, the agency is going to maintain "a set of services"-- meaning both options.

While Gonzalez declined to provide details on the pilot program, she said the agency is developing mobile applications for law enforcement agents and exploring how BlackBerry 10 will fit in with the agency's mobile solutions in the future.

The development fired up quite a bit of chatter among StockTwits traders:

Captain_Power:$RIMM It never made sense that government agencies would adopt a BYOD or iphone policy. They were ok with trading security for fashion tech?

While BlackBerry's security and email delivery capabilities once gave RIM an edge, they have been nearly matched by other phone makers, including Apple. That has led to a phenomenon known as Bring Your Own Device, in which corporate customers have also been increasingly willing to let employees work on phones of their choosing.

And, of course, ICE is not the only government agency to begin making a shift. Earlier this year, the Bureau of Alcohol, Tobacco, Firearms and Explosives and the National Oceanic and Atmospheric Administration also announced they were switching from BlackBerrys to iPhones for their staffers.

paulwoll:$RIMM Blackberry 10 hopes reminds me of Palm OS launch w/too few apps that few are developing for. Looks like run to 15 likely technically.