[1/2] Frameworks: Optional statusbar battery icons (Squashed)

    * Circle battery and circle battery percent (from CM <Sven Dawitz>)
    * Battery bar percent from Google
    * Quicksetting battery tile reflects status icon (from SlimROM <kufikugel>)

Part 2: packages_apps_Settings

Patch set 2: clean white spaces
Patch set 3: fix conflicts

Signed-off-by: Anu6is <curtis.mayers@gmail.com>

Change-Id: Ic4056d08874672263444152813a4a8e805a4abf3

Conflicts:
	core/java/android/print/IPrintDocumentAdapterObserver.aidl
	core/java/android/provider/Settings.java
	packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettings.java

PS 4: Battery status icon tweaks

    * Circle battery color and size adjusted
    * Battery bar text color
        - Black above 50%
        - White 50% & under
    * PS2: Use kitkat holo white

    :) :) :) :) :D

Change-Id: I28e3da69130bd088849133bb9c504e1f21897d0c

PS 5: Fix: Battery Status Icons

    - Dim circle battery icon on opaque status bars (reflect stock behavior)
    - Reduce size of circle battery
    - Reset battery bar text color when it crosses the 50% threshhold

Patch Set 1: Initial Commit
Patch Set 2: Remove pa_colors

Change-Id: If182ee6e3c5f10a8b9354ae77094fb659108454a

PS 6: Battery Text: Fix rounding issues and take density into account

We are a Multi-Dpi ROM... on 4.2 and 4.3 the text in the circle battery icon
was a small bit up on a lower dpi. The original author compensated this with
just a +1 to the Y value. Thats not the right way...
Calculate the current dpi into the offset and all is well.

We want a perfect 4.4...so this nitpicks even if we are talking about
0.5dp should be fixed

Change-Id: I5c6c1e237cd9049101ee88347a9b4d4b5a2b9682

Conflicts:

	core/java/android/provider/Settings.java
(Squashed) PA Style Quicksettings
This is a squash of nearly all commits needed for PA Style Quicksettings
Additionally, "Quicktoggles" is needed and "[1/2] Frameworks: Optional statusbar battery icons (Squashed)" might be usefull

Immersive mode on quick settings

This adds the ability to toggle statusbar / navbar via quicksettings (former expanded desktop), but
using the new 4.4 APIs that allow a swipe-up, swipe-down gesture, to restore bars.

Credits to CM project for the implementation
http://review.cyanogenmod.org/#/c/53468/

Drawables by Arz Bhatia

Patchset 2: Rebase
Patchset 6: Fixes from CM

Change-Id: I1f694d87f0364aed7b6951714ea2bfbfd8555064

Conflicts:
	media/java/android/media/IMediaRouterClient.aidl

Fix quicksettings issues

Also add rotation tile

Change-Id: I315745ee60030eb8ead4ee1798940b45af91449a

QuickSettings: Immersive: Collapse panels on click

Most of the time users will want to enable immersive mode and go right back to the app.  This simplifies this process by closing
the quicksettings panel after immersive is activated or deactivated.

Change-Id: I7bb154941405e8efb568cf5c3cce92e963539ff8
Signed-off-by: Evan Anderson <evan1124@gmail.com>

Quicksettings: Immersive: Fix collapse panel animation.

Right now it collapse after the ui goes into immersive mode so the collapse animation is not showed.
First collapse the panel then go into immersive mode so we see the animation.

Signed-off-by: Carlo Savignano <stevewatersy@gmail.com>

Change-Id: Icf2925fa517fc077929e02d1f96a8cd51163b809

Fix immersive mode recents animation.

Inspired on this https://github.com/CyanogenMod/android_frameworks_base/commit/be9c31709e2b90bc85ef1814b22df1785515d23d

Signed-off-by: Carlo Savignano <stevewatersy@gmail.com>

Quicksettings: Long press actions.

* Long click action for user tile (opens sync settings).
* Long click action for rotation tile (opens accessibility settings).
* General cleanup.

Signed-off-by: Carlo Savignano <stevewatersy@gmail.com>

Quicksettings: Hardcode quick pulldown from right status bar side.

* Still works 2-fingers pull down.
* Quick pull available in the up-right 20% of status bar.

Signed-off-by: Carlo Savignano <stevewatersy@gmail.com>

Conflicts:
	packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java

PhoneWindowManager: fix navbar behavior in expanded mode after 4.4.2 merge.

Change-Id: I00f814db6c3800b8eb1cf20004ecdfb8d1ee7036

Fix: Ensure immersive tile state (on/off) persists after reboot

If immersive mode is enabled, the immersive tile icon should be white,
with the appropriate text "IMMERSIVE" as opposed to grey with text,
"IMMERSIVE OFF".
When rebooting the device, the tile shows "IMMERSIVE OFF" regardless
of if immersive mode is on or off.

Change-Id: Id805fcb6c6fded41e1d3a38e9a1bc46b7a2a7d1e

QuickSettings: Tile Actions

    Mobile Data Tile:
        - Click to toggle mobile data
        - Long press to enter data usage statistics

   Alarm Tile:
	- Fix launching alarm on click

PS1: Edit mobile data tile actions
PS2: Fix type in commit message
PS3: Fix bug in Alarm tile implementation

Change-Id: I21eef91114a3119834db7181dc3b35d4eb56c90b

[1/3] Frameworks: Add Network Tiles & Lightbulb Tile

      Add an LTE tile and a 2G/3G mobile network tile.

      The LTE tile requires that at least one (1) of the following configs
      be present in the device's build.prop in order to show:
          telephony.lteOnCdmaDevice=1
          telephony.lteOnGsmDevice=1

      The 2G/3G tile toggles between 3G Only, 2G Only and 2G/3G.

      If LTE is turned on the 2G/3G tile is disabled (shows unknown).
      The reverse is also true, turning on the 2G/3G tile disables LTE tile.

PS1  : Network tiles (LTE & 2G/3G)
PS2-3: Clean up
PS4  : Add Lightbulb tile
PS5  : Add lightbulb icons & permissions
PS6  : Check for LTE support only after device boot completes

Linked commits:
      frameworks/opt/telephony
      packages/services/Telephony

Change-Id: Id64c061227efd557416de312c4e5972725c29e71

Conflicts:
	packages/SystemUI/res/values/pa_strings.xml
	packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettings.java

Quicksettings: Sleep tile.

* Click goes to sleep.
* Long click opens display settings.

Signed-off-by: Carlo Savignano <stevewatersy@gmail.com>
Change-Id: I3eeae514535e9edff72f233e18d8f8dfaadf3517

QS: Update edit mode icon

Uses the correct transparency so that it matches the rest of the pulldown icons.

Change-Id: I783c4b4038b536dfb6d3c73fac3c739895e9cac6
Signed-off-by: Evan Anderson <evan1124@gmail.com>

[1/2] Frameworks: Combine LTE & 2G/3G Tiles

This combines both network tiles into one tile.
2G -> 3G -> 2G3G -> LTE

Linked commit: packages/services/Telephony

Change-Id: Ia0d8edaec0e920b9ba174ec6ce49c5e7b832a5ab

Quicksettings: USB Tether tile

courtesy of OmniRom
based on: http://goo.gl/0RfbFy

PS3: add "private ConnectivityManager mCM;" variable
PS4: compiles, not yet tested
PS5: derp forgot to initialize mCM which caused a NPE
(http://developer.android.com/reference/android/net/ConnectivityManager.html)
PS6: fixed some connectivity manager redundancies in qs.java
PS8: make tile temporary, only appears when connected to usb.
PS10: fix conflicts in pa_strings and QuickSettingsModel after recents merges.
      clean up commit message's conflicts.
PS11: Remove unnecessary resources
PS12: Don't show tether tile is feature is not supported

Signed-off-by: Andre Saddler <dresadd09691@gmail.com>
Change-Id: I856f1a1f954544cb9e1b78f504fde8916b94235e

Fix: Don't disabe rotation lock tile

     Rotation lock tile was disabled if the user unchecked the Auto-rotate
     screen option directly from within the accessibilty settings.

Change-Id: I8a4fd11b9046507f8f07db515022ea6a4210bac5

Quicksettings 3.0

* Improve code (cleanup, indenting, redistribute resources, some comments updates and more).
* Fix: Restore stock aosp transition for quick settings on rotate (the rebuild animation
       executed when you are on quick settings panel and rotate the screen is not always showed).
* Animated Dual Tiles
    Animation: Added new animation by Jesus David (@D4rKn3sSyS):
     -Up/Down switch animation.
     -Moron Effect: Reminds you to turn on main tile before acting with related extra one.
    Follow aosp quick settings style (as for Quicksettings 2.0) and improve it. Add specific classes
      and constructors for tiles that have their own layouts.
    Add dedicated classes for rssi, wifi and basic dual tiles.
    Evolve dual tiles concept making them dual tiles for real.
    Integrate dual tiles into edit mode.
    Tiles added:
     -Wifi AP Tile (Dual): Made the aosp way. Created receiver for the main intent sent to change
      wifi ap state (also toggling with apps will refresh it). Integrated with Wifi Tile. Thanks
      CyanogenMod for the drawables.
     -Screen Timeout Tile (Dual): Integrate it in the sleep tile previous added. Cleaner implement.
      Thanks Yanuar Harry (@squadzone) for cleaning my code :) Thanks Lo Huot for the drawables.
     -Bluetooth Extra Tile (Dual): Original from OmniRom. Partially rewrote it. Use android stock
      classes, methods and constructors. Toggles discoverability. Thanks Lo Huot for the drawables.
     -Location Extra Tile (Dual): From OmniRom (Yanuar Harry, @squadzone). Changed methods labels,
      add moron effect with main location tile, added its own icons. Thanks Lo Huot for the drawables.
    Tiles cleaned/updated:
     -Mobile Network Modes Tile: Fix icon refresh at boot.
     -Immersive Tile: Completely rework. Redistribuite resources, improve the code, add triple immersive
      mode (Off-Full/Navbar/Statusbar).
     -Brightness Tile: Long click toggles auto-mode.
     -RSSI Tile (Dual): Rework and simplify. Show off indicator when disabled. Merge in Mobile Network Modes Tile.
     -General Basic and CustomBasic Tiles: Clean up.

PS2:  Fix rssi front tile construction.
PS3:  Clean up wrongly added file.
      Some fixes and updates for rssi tile.
      Solve recent merge conflicts.
PS4:  Rebase:
      Fix traces of not solved conflicts after recent merges rebase.
      Improve the dual tile logic, reduce code in QuickSettings class.
      Improve screen timeout (sleep sub-tile) code, thanks Yanuar Harry.
      Don't return dual (flip) animator touch event on edit mode. (Need test)
      Nitpicks cleanup.
      Update main commit message.
PS5:  Continue rebasing:
      General code cleanup.
      Improve strings and drawables labels.
      Fix wifi ap tile construction and NPEs.
      Remove unused imports.
      Cleaned dual sleep tile implement (more polish methods names).
      Cleaned paired device bluetooth extra tile traces (added some todo).
      Update edit mode integration.
      Added a refresh callback sub-class for network tile (now contructed with
      new Basic Network Tile class). Not yet used and (EDIT: Removed).
      Update commit message (added some TODO).
PS6:  Finish bluetooth extra tile. Add drawables, refresh resources.
      Improve immersive tile.
      Traces of previous rebase.
PS7:  Fix missing icon and signal activity state for rssi tile.
      Restore rssi refresh method to aosp state (temp).
      Try to restore wifi signal activity (it doesn't show up and don't know why, yet).
PS8:  Rework the whole concept:
      Cleaned and simplify the whole code.
      Added our new animations.
      Updated copyrights.
      Added location extra tile (Yanuar Harry).
      Add wifi basic tile class to handle its layout (it has signal activity layout defined there).
      Ditch omnirom flip implementation and rework dual tiles constructor.
      Rewrote tiles layouts to host a switch button.
      Cleaned up user tile too (make its own class and save code in QuickSettings class as for the others).
      Remove unused stuffs.
      Big thanks to Jesus David that helped me making this new concept :)
      Updated main commit message.
PS9:  Forget new layouts X]
PS10: Add spanish translations.
PS11: Rebase with latest git merge.
PS12: Improvements and fixes:
      Fix switch button layout/view (derp while preparing patchset :P).
      Rework immersive tile. Upgrades modes to three (Full/Navbar/Statusbar).
      Cleanup Wifi Ap Tile code, improve code aspect.
      Improve/add strings.
      Fix Network Modes Tile icon refreshing at boot, sometimes not displayed until you toggle.
      Add hdpi and mdpi drawables for all icons added.
      WIP: Perfect edit mode integration and new immersive drawables.
PS13: Crediting @david96 for inspiring new immersive tile concept.
PS14: Added new immersive modes drawables. Thanks Lo Huot.
      Added new sleep time ones, more polished. Thanks Lo Huot.
      Improved strings.
      Updated some spanish translations.
      Code style for strings.
PS15: Fixed edit mode
      Removed WIP tag. Ready for merging
PS16: Code cleanup
PS17: Latest cosmetic changes:
      Whitespaces.
      Remove collapsing for high accuracy mode (location back tile).
      Copyright and last general clean up.

Signed-off-by: Carlo Savignano <stevewatersy@gmail.com>
Signed-off-by: Jesus David <jesdga95@gmail.com>
Change-Id: Iceccd6a489c23286d8bc4e285fbb87b77509cd29

Conflicts:
	packages/SystemUI/res/values-es/pa_strings.xml
	packages/SystemUI/res/values/pa_strings.xml
	packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettingsTileView.java
	packages/SystemUI/src/com/android/systemui/statusbar/policy/DeadZone.java

A couple of improvements to edit mode

* Fadeout selected dragging item to 5% opacity
* Disable hovering on touch

Change-Id: Ie2be81f83e72c83071577a2e56b90160dc701370

Conflicts:
	packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettingsModel.java

Fix: Network tiles for CDMA devices

PS 1: initial fix
PS 2: remove 3G Only for CDMA
PS 3: rebase for QS 3.0 changes

Change-Id: I2e526c8d94cc561c48c2a9198311e03b4f18328d

Fix issue while scrolling on edit mode

Thanks to @rob43 on XDA-developers for this fix

Change-Id: I0e5cd1c2472415dcb8f003b5dc88a7e4d7b55bbf

Fix double finger to pulldown statusbar when QuickPulldown is disabled

PS2: Better fix

Change-Id: I738d8113be5b6fd04417b7e2d2ba31a710bd7615

Conflicts:
	packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java

Quicksettings 3.1

Minor post update.

* Update Recents animation with new immersive modes. Continue this https://github.com/AOSPA/android_frameworks_base/commit/48be6b18bbf2d676da75eb031ee76b282635713a
* Sleep Tile
  Cleanup code.
  Add new holoish drawable.
  Long press now opens power menu (pure emulation of power button). Thanks to @cristianomatos
* Immersive
  Back on our first concept of having the tile dualized and change it:
  - Front: Toggles Global On/Off.
  - Back: Toggles modes (Full/Nav only/Status only).
  The tile now stores last immersive state, thanks @David96 for the idea.
  Fixed a critical bug with status bar hidden only, thanks to @David96.
* Rssi Tile
  Restore long press action to data usage on front rssi tile
  Fix icon overlay, restore blank overlay on disable and while wifi is on.
* Code indenting and cleanup.
* Update dual switch icons, less bright.
* Restore a previous fix that relays on immersive.
* Get rid of some useless imports and code in quick settings, make a class for battery tile.

PS2: Update dual switch icon brightness.
PS3: Spanish translations.
PS4: Translation fix.
PS5: Translation derp.
PS6: Cleanup.
     Add battery tile class.

Signed-off-by: Carlo Savignano <stevewatersy@gmail.com>
Change-Id: I076d4c2be5f22df7cf1f04d5487c699d90d663f7

Conflicts:
	core/java/android/view/WindowManagerPolicy.java
	packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettings.java
	services/java/com/android/server/wm/WindowManagerService.java

Set id for battery tile (wrongly removed on previous rework).

Signed-off-by: Carlo Savignano <stevewatersy@gmail.com>

Modify network disabled toast message

Also add spanish translation

Change-Id: If689aceccb0c14e3f5f42011cd4ac2c9c5306cfd

Conflicts:
	packages/SystemUI/res/values/pa_strings.xml

Update immersive confirmation.

1. Disable panic mechanism for expanded desktop.
2. Separate confirmation for each expanded desktop style.
3. Add new layout for the case when navigation
   bar is hidden but statusbar is visible.

PS1: Adapt to our immersive and fix conflicts.
PS2: ???
PS3: Hopefully restore previous state.
PS4: Spanish translations

Signed-off-by: Carlo Savignano <stevewatersy@gmail.com>
Change-Id: I5914d655bd5f9315ac4cc6fc7d70cc4ee45bb7b2

Conflicts:
	core/res/res/values-es/pa_strings.xml
	core/res/res/values/pa_strings.xml

QS: RSSITile: Finally fix the data indicator

The X for data off now changes based on the mobile data enabled setting.
If mobile data is enabled, the rssi tile behaves like stock.
If mobile data is disabled, the X shows to indicate that the user disabled data.

PS1: Inital commit
PS2: Nothin to see here...
PS3: Remove uneccesary wifi check.
     The overlay should be nulled any time the other conditions aren't met
PS4: Remove unused import

Change-Id: I76e63c606f2651a8463f9cd0b3665543b420d72c
Signed-off-by: Evan Anderson <evan1124@gmail.com>

Quicksettings: Rework behavior on edit mode for temporary tiles.

* Animation:
  - Make them disappear when edit mode is enabled.
  - Put them back when edit mode is disabled.
* Fix broken touch listeners after toggling edit mode after boot.
  Adressing JIRA AOSPA-4 issue.

PS2: Simplify logic and code.

Signed-off-by: Carlo Savignano <stevewatersy@gmail.com>
Change-Id: I4da623ec5fffad4ddf414c70a18f3ee547d83fc5

QS: Use AnimatorListenerAdapter

No need to implement all the unused methods

PS2: Underp and better commit name

Change-Id: I12116e06950e5162fdfb5b63e22531a5df1ad691

Quicksettings: Remove edit mode button flip animation.

Make things less fancy.

Signed-off-by: Carlo Savignano <stevewatersy@gmail.com>

Quicksettings: Few misc adjustements and fixes.

* Fix sleep time tile label on clean flash boot, was showing unknown till you set it in settings.
  Initialize screen timeout with default 30 seconds (wrongly initialized with 0 that is never compared).
* Use switch statement (better performance wise).
* Bit cleanup for wifi ap tile, useless resources reload.

Signed-off-by: Carlo Savignano <stevewatersy@gmail.com>

Quicksettings: Fix derp in QuickSettingsTouchListener.

Change-Id: I08b6019fcdfeed042f8f7c532a52289e2417b7c7

Quicksettings: Immersive: Make last active state a system variable.

Will persist after reboot.

Signed-off-by: Carlo Savignano <stevewatersy@gmail.com>
Change-Id: I8f9f62d67e7de079e59ce5292604efacec042bcf

Conflicts:
	core/java/android/provider/Settings.java

Switch quick settings drag to long click

PS2: Remove unused variables
PS3: Fix build

Change-Id: I441b7467127990f387d976132bffc8f881a55095

Fix derp on imports

Change-Id: I3ea2b1767d8788e7ab1ce3972d38b8d1a96477ff

Fix indirect misuse of $(my-dir).

Change-Id: I20a98a8e1378da3a53e6a6d599c8fc0100f7f87a
Signed-off-by: houst0nn <houstonn@gmail.com>

Quicksettings: Bump dual switch icon(s).

* Replace with less intrusive ones one more time, these looks beautiful.
  Drawables by Arz Bathia.

Signed-off-by: Carlo Savignano <stevewatersy@gmail.com>

Quicksettings: New transition animation.

Also new moron effect :D

Signed-off-by: Jesus David <jesdga95@gmail.com>
Change-Id: I7838bced9568c30237a2839e4ef68b24f884d8a5

Quicksettings: Better switch effect.

* Take switch outside tile animation.
* Change a bit new X axis animation.

Signed-off-by: Carlo Savignano <stevewatersy@gmail.com>
Signed-off-by: Jesus David <jesdga95@gmail.com>
Change-Id: Iad3ff92dddea4bf86650c7269a859ac577063432

Guidelines cleanup for some immersive stuffs.

PS2: Also fix a logic derp when calculating display size.

Signed-off-by: Carlo Savignano <stevewatersy@gmail.com>
Change-Id: Iec47fcd47b0ae93e404ff146c9cdbcfd8cbd0007

Give public access to immersive mode static vars

They are needed by recents

Change-Id: I641f0d9cf5d7263a1433147b8f57ec5fa8286396

Quicksettings: Sound tile

Dual Ringer & Volume tile.

* Click on front goes to next ringer mode (silent, vibration, sound).
* Click on back goes to volume change.
* Long click goes to sound settings.
* Handles Vibrate when ringing.

Screencast: http://www.youtube.com/watch?v=gqlPhRBruSU

Based on commit: https://gerrit.paranoidandroid.co/#/c/522/ by cristianomatos.

PS2: Removed tabs.
PS3: Clean up
PS4: Remove pie references
PS5: More pie stuffz!
PS6: Not all devices can vibrate

Change-Id: Ida4b0f05e8a886b5249d758f1efb36bb364275cf

Conflicts:
	packages/SystemUI/res/values/pa_strings.xml

Quicksettings: Upgrade immersive drawables with more polish ones.

* Thanks to Lo Huot for the drawables.

Signed-off-by: Carlo Savignano <stevewatersy@gmail.com>

Quicksettings: Fix immersive icons mismatch.

* Flip hide only navigation bar and status bar.

Signed-off-by: Ricky Salinas <rsalinas1@mail.usf.edu>

What the heck....
did git has done here ?

 Fix some merging derps from QS

another mass of merge derps from pa qs

Conflicts:

	core/res/res/values/psx_symbols.xml
	packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java
	policy/src/com/android/internal/policy/impl/PhoneWindowManager.java