On Tuesday Google announced that the next version of Android will be named "KitKat," after the ubiquitous chocolate bars sold around the world. It's the first time a mainstream operating system has been given a licensed name, and the deal with trademark owner Nestle took time to complete: the BBC reports that Google director of Android global partnerships John Lagerling first called Nestle about the name in late November of 2012, and that the deal was only finalized at Mobile World Congress in Barcelona in February of this year. "We decided within the hour to say let's do it," said Nestle executive vice president of marketing Patrice Bula.

Zz4653a4ac

There's no exchange of money involved, but there is a significant promotional element: 50 million KitKat bars in 19 countries will have prominent Android branding and offer buyers the chance to win a Nexus 7 tablet and Google Play gift cards. All those wrappers started production two months ago in secret so they would be ready for the promotion; not even Google employees knew about the new name. "We kept calling the name Key Lime Pie internally and even when we referred to it with partners," Lagerling told the BBC. Adding to the air of intrigue, Nestle is commemorating the partnership with 500 specially-produced KitKats in the shape of the Android logo that the company claims took "weeks" to create in "a secret location in Europe."

"We decided within the hour to say let's do it."

But secret meetings in Barcelona and commemorative chocolates aside, the deal did have some wrinkles. Nestle owns and control the KitKat brand throughout the world, but Hershey's licenses the brand and manufactures the candy in the United States — obviously a key market for Google and Android. As the deal began to take shape with Nestle, Google also had to reach out to Hershey's and work out an arrangement. And while sources say the final deal is entirely between Google and Nestle, Hershey's KitKats and new KitKat minis in the United States will indeed carry the Android logo and giveaway information.

So why the name change? A Google spokesperson tells The Verge that KitKats have long been Android engineering head Hiroshi Lockheimer's favorite candy bar — his Gmail avatar was a KitKat icon several years ago. At one point in 2010, the Android team even decorated Lockheimer's entire office door with KitKats, pictured here. Given the wide variety of new wrappers and branding that will appear on KitKats throughout the world, it appears that another opportunity will soon be well at hand.