fix halo button
Change SQL to improve performance.

To know the number of images, use "COUNT(*)" instead of "_id" in SQL.
Using "_id" gets all result set. and when getCount() is called, CursorWindow is filled.
But using "COUNT(*)" gets just 1by1 data.
So using "COUNT(*)" is more faster than now.
And this SQL is called everytime per a file during a file transfer in MTP
The better way is by using "EXIST".
But if using "EXIST", modify MediaProvider.call() method.
So i applied just a "COUNT(*)"

Change-Id: Ic5882af0fad2304f836b7b7043a4746359391609
Signed-off-by: muzbit.kim <muzbit.kim@lge.com>
SlimPie fixes

Frameworks: Add user protection and pie/navbar toggle to SlimActions

Add drawables for it and enable it for navbar, pie, hwkeys
and GlobalMenu and whatever other shorcutfeature want to have it

Keep the user save and do not allow to disable all navigations to keep
the device usable. User will be notified

In Settings user get the choice to enable the other navigation method. Of course
only on navbar devices due that hw key devices always have a working navigation

PS
- extend it and make the actions on global menu as toggle action
  to show on/off and reflect it on the icon as well

Change-Id: I69227e6653f4fe780aa41a91e3d4896d9ccc0f0a

Frameworks: fix navbar and pie icons for tablets and RTL

well due that we use a completly other attempt then googles navbar we do not
need to rely on different sized icons for portrait and landscape. So just a square
icon fits our needs perfect (which is so or so everwhere in AOSP default to use square ones).

Whatever recents pie feature showed us that we still forgot to size the pictures for our tablets
and as well for RTL user.

So let us do it now to fix any resizing issues on navbar and or SlimPie

Change-Id: I5257b789a5450754a296141b0af63d2eacaa87c9

Framworks: clean up the AOSP tablet icon mess

well.....on grouper the overlay size for the navbar is/was 56dp...so
google added bigger icons then the usual ones into the sw600dp folders.
Well newer tablets have 48dp as default like the phones so the slightly bigger
icons do not fit 100% correct. It is not much but it is noticable.

So all devices have same navbar default height...so all icons should have same size
as well. Just remove the overlay icons so that the system automatically chooses the right
one from the default screen qualifier.

Change-Id: I4e4d87d70996ed1def359149cea829b5794f2448

Frameworks: EdgeGestureService give abbility to reduce the left and right trigger height if IME shows up

This patch gives the abbility that features can set the IME_CONTROL flag in addition to the position flags
to enable reducing trigger heights on the left and right edge to avoid conflicts with swipe keyboard.

Although the inputfilter lets come presses to the application trough the normal user behaviour is to start keyboard swiping
before they really even pressed the char button which results in conflicts with whatever feature is using the left and right
edge as trigger.

Features who want to use it need to set IME_CONTROL flag. As well if notification drawer was pulled down or global menu is
shown on top of the IME keyboard the original size gets restored till they are dismissed/closed

This patch adds only the support for it.

PS
- Fix small logic derp in BaseStatusBar
PS
- follow Josues suggestion and make the trigger a bit bigger

Change-Id: I51804d6e0768cc7770a6e52fac454dbad0ab632b

Frameworks: SlimPie give user ability to reduce trigger heights if IME keyboard shows (1/2)

Add a user option to reduce left and right trigger of SlimPie if keyboard shows up
(especially usefull for swipe keyboard which most keyboards are nowadays). Enabled
by default user can disable it in settings.

Change-Id: I5dce4f36f5b14320f806ac60ad75931fa7f2873b

Frameworks: Respect and handle shorcut custom icon resources (2/2)

If a activity shorcut has an extra icon resource or drawable we need to handle
it. Fix this for all out shortcut features. Most is centralized so a small change

fix as well to small sizes of custom icons on QS

Change-Id: I4f1b78e5979e23f5edd0c670510ab5d718710a93

Conflicts:

	core/java/android/inputmethodservice/InputMethodService.java
	core/res/res/values/crom_strings.xml
	core/res/res/values/crom_symbols.xml
Framework: Lockscreen Slider Logic && Fix

Part 1: Keyguard array points directly to
	unlock handle and unlock handle
	ONLY.  Assist/Camera intents will
	never be used. It seems this logic
	in the code was devalued %100 by
	an array change that we'll never
	take advantage of.  I assume this
	was done so OEMs can revert the
	array and get camera/assist
	slider targets with minimal effort.

Part 2: Fix unlock icon colorizing if user
	lock targets are null.

Change-Id: I58206829de03828c7a0b838a4bbc56dbbc33c0c9
Revert "base: fix init of ringer/notification volume linking"

This reverts commit 30275f208cac743e566794dc79c6849d2e08c0e6.
Frameworks: Fix linked volume does not persist after reboot.

The controling boolean value must be set before updateStreamVolumeAlias
is called first time. Otherwise updateStreamVolumeAlias will assume
it is always false till user toggle it in settings again.

Change-Id: I53455249909fa6ad69fa0ea6930f9065e5a14fdf
Frameworks: fix possible NPE + and missing expandable panel

Steps to reproduce for NPE:
- go into volume style settings
- switch to disabled
- switch to expanded
- NPE and hotreboot

Fix:
Check if mStreamControls is initialized and if not lock it and do it.

Steps for expandable error:
- go into volume style settings
- switch to disable
- press one time the volume button
- change to expandable
- change the volume and press the expanded icon
- result is it does not expand and is empty due of the missing volume panels.

Fix:
- if it was changed from disabled to expanded be sure that the additional volume panels
are recreated.

PS:
- fix another exception

Change-Id: I58d63d34f831b6a6f60f6eddb3a07fc916d464f3
Frameworks: Fix memory leak + cleanup

Do not create new Objects onDraw + cleanup

Change-Id: Id1dc9ae85ccf820f2047528e12c4ecdc525f12d2
Frameworks_base: Port BatteryBar [1/2]

{x} Adds Battery bar with following features:
{x} location set
{x} color
{x} aligment
{x} thickness
{x} charging animation

Change-Id: Ibdd29738aacd60b8bc34f259cfdcd154e63327cd
Signed-off-by: STELIX <ssspinni@gmail.com>

Conflicts:

	packages/SystemUI/src/com/android/systemui/statusbar/policy/Prefs.java
Augment SELinuxMMAC functionality.

* No longer support a package name stanza outside of
  a signature tag. Package names, by themselves, have
  no security associated with them in Android and thus we
  should not be allowing or encouraging this
  type of policy.

* Allow for nested package name stanzas inside
  signature stanzas. There are cases where a finer
  distinction needs to be made among apps signed with
  the same cert. New code allows a different seinfo
  tag to be assigned to the listed package names
  signed by the parent cert. When a determination needs
  to be made concerning seinfo assignments, the inner
  seinfo tag takes precedence over the outer seinfo
  labels which are assigned to just the signature.

* Temp structures are now used to parse new policy files
  until the entire xml file is parsed and deemed correct,
  at which time the temp structures are copied over to the
  permanent class structures. This ensures that any structural
  errors with the policy will not result in partial loads.

* Valid stanzas look like the following with the inner
  package piece being optional.

   <signer signature="">
     <seinfo value=""/>
     <package name="">
       <seinfo value=""/>
     </package>
   <signer>

   <default>
     <seinfo value=""/>
   </default>

Change-Id: Ia204d71211776dcf9b2dcc86ad6d77c4ad39dc25
Allow PMS to restorecon directories under /data.

This change applies a relabel to both /data/data and
/data/user directories on boot. Not every boot will
apply this relabeling however. The appropriate
seapp_contexts is hashed and compared to
/data/system/seapp_hash to decide if the relabel
should occur.

Change-Id: I05e8b438950ddb908e46c9168ea6ee601e6d674f
Signed-off-by: rpcraig <rpcraig@tycho.ncsc.mil>
Convert all selinux_android_restorecon and _setfilecon calls to new API.

libselinux selinux_android_restorecon API is changing to the more
general interface with flags and dropping the older variants.

Also get rid of the old, no longer used selinux_android_setfilecon API
and rename selinux_android_setfilecon2 to it as it is the only API in use.

Change-Id: I1e71ec398ccdc24cac4ec76f1b858d0f680f4925
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
Change notification background from holo to kitkat grey

Change-Id: I78a96eaa4929dee245c69ffa5ab8197ed7bfa84a
msim: Add support for H+ icons

Change-Id: I9e0cb93b0414f55c51aea7425ab8e02ef5f12095
C-RoM!!!
Fix WifiHandler for MSim

Commit 7c26a5cce74332bc48da9e894a835f2fe795431c attempted to fix
this issue by adding back the old code, but it needs to be a method
that can be called by MSimNetworkController. So sync it back to caf
to fix the merge issue.

Change-Id: Ifc721cbf372ec50810924d7ac6d55f54663458a1
Keyguard: do not show maximized on simpin and several fixes

- to show a maximzed widget container on first boot when simpin
  or puk is requested does not make any sense. In this case
  show it as normal view
- fix sometimes unresponsive unlock handle on maximized widgets
  and bring it to front (happened only in combination with
  lock before unlock)
- a bit codecleanup and centralize
- fix animation was visible on screnn turn on. Now it is directly
  maximized visible

Change-Id: I9ba5d8f9537c68d3590826eb8d1483a02cfe3266
Keyguard: fix codestyle

Change-Id: I3f1fbab0ae5434b09766cd69c39a133f4a7039d0
Fix CYAN-3555 bug

This commit fixes typo which is in AOSP tree.
I hope it's possible to merge it.

Change-Id: Ifdf9c5d90b9850b6112ee11a9b1aa3b1576348a0
Signed-off-by: jereksel <jereksel@gmail.com>
Avoid collision with RIL constant 1138, used in some Samsung devices for RIL_UNSOL_TETHERED_MODE_STATE_CHANGED.
Needs http://review.cyanogenmod.org/#/c/61292/
Thanks to iptux on XDA for pointing out the change in constants between
CM-10.2 and CM-11.0.

Change-Id: I64011408f4cce9aeb1b56e325226f8e649eff2b6