Tidy up reboot menu

Change-Id: I63b09b03ca9a0ca7a6d37b320f855781befb9dae
Merge branch 'kk4.4' of https://github.com/SlimRoms/frameworks_base into kk4.4
Fix broken assumptions in LocalePicker.

This code assumed that the locale is always 5 chars in
length and was of the form xx-YY. This is not necessarily
true. The language can be 3 letters in length and the locale
might have a script and variant.

Also cleans up several nasty pieces of code and eliminates
unnecessary array copies and improves readability by using
idiomatic java.

bug: 15873165
bug: 10090157

Change-Id: Iab1cfd7b78e5772b1245654f2153caf63a96033d
Remove bogus 2 char limit for locales and countries.

Locale settings are persisted to system properties
and not to system settings, so the values read here
are used pretty much everywhere.

bug: 15873165
bug: 10090157

Change-Id: Ie7cda166439112c615afbd38253cf4fbb5791242
Fall back to "tl" if "fil" is absent.

For JB-MR1, there was a hack that used "tl" where
we really meant "fil" because ICU didn't have localizations
for "fil". This has now been fixed, and we now support 3 letter
language codes for AAPT so we can use "fil" where required.

For the benefit of apps that need to target older platforms,
we fall back to "tl" if the app has assets for "tl" and the
resource locale is "fil".

See bugs 7291355, 7207176 and 8049507 for more context.

Change-Id: I1ac8502525f99b40f9091d5efd2df33518d47a41
Fix LocalePicker locale filtering.

This was broken by commit b27c137087ee92674 which
removed a badly phrased check. Prior to that commit,
there was a check that excluded locales whose toString()
length was not 5.

This change reinstates that check in a less roundabout
way, by excluding BCP-47 tags that don't have a country
subtag.

bug: 16038949

Change-Id: Ic24b1df87b2e2ce47d9ae04c7759088721f27b4f
fix AudioTrack and AudioRecord JNI

AudioTrack and AudioRecord JNI should not cast
jshortArray to jbyteArray. This appeared to work with Dalvik
but causes data corruption with ART.

(cherry picked from commit 9d02848e902d04417df616354db3a18c03e639b7)

Change-Id: Ie36624d3ea06042373c64edced4b5e30b7b1ee86
Revert "listview: ensure active views are filled prior than scrap views"

This reverts commit 7974ebe26e676c3fa2ca293d1be5c814f3fbe4cb.