power menu: update dialog to reflect expanded desktop preference

Change-Id: Ie63593ead79a50df3f9c706e1e2522d33c2b77d2
Merge "power menu: update dialog to reflect expanded desktop preference" into kk44
battery saver mode: a bit of a revamp

credits to Yanuar Harry
<ai.the.smarties.physics@gmail.com>

Change-Id: I22e45d652a1823698927d72f88daa9ad8bf55737
Signed-off-by: Dan Trifan <jimsth@gmail.com>
Progressbar customizations squash

commit 246fac886ef7c952ceade2baaba976c461efd514
Author: hany <hany.alsamman@gmail.com>
Date:   Tue Feb 18 20:18:23 2014 +0000

    Add ContentLoadingProgressBar support

    ContentLoadingProgressBar allows developers to follow the policy for loading content
    laid out in the style guide. The progress view will only show if MIN_DELAY
    passes before the view is hidden. The progress view, if shown, will always
    show for at least MIN_SHOW_TIME ms.

    https://github.com/android/platform_frameworks_support/commit/befff92741b1f0629d9a9389a3889cca56d914a2

    thanks @castorflex

    Signed-off-by: hany <hany.alsamman@gmail.com>

commit c6055f2d92d42a37c29e0f5c3f90266a557b9a12
Author: hany <hany.alsamman@gmail.com>
Date:   Tue Feb 18 19:10:40 2014 +0000

    SmoothProgressBar: Accelerate and Interpolator

    PS1 : reformat the code
    PS2 : use android animation interpolator

    Signed-off-by: hany <hany.alsamman@gmail.com>

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

commit 50a1fb8700ab611dc45a4a31ec0f29e4f386e69b
Author: codex-corp <hany@codexc.com>
Date:   Sat Jan 25 02:44:15 2014 +0900

    Port SmoothProgressBar: User Custom ProgressBar Setting[2/2]

    Sample : https://github.com/castorflex/SmoothProgressBar
    http://antoine-merle.com/images/smoothprogressbar_all.gif

    thanks Dokdo Project

    Change-Id: If476fb2a4fa9a988c73364107555b5e7624dea53
    Signed-off-by: hany <hany.alsamman@gmail.com>

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

commit bf460a3c6c28c8c0dea8b9b9f7e2544834faa4cd
Author: GwonHyeok <kh4975@naver.com>
Date:   Fri Jan 24 14:42:15 2014 +0900

    SmoothProgressBar: Initial Commit

    Change-Id: Ic48f7ff57f76c933808f2ea4a6be49e949ce2c00
    Signed-off-by: hany <hany.alsamman@gmail.com>

    Conflicts:
    	core/res/res/values/symbols.xml

    Conflicts:
    	core/res/res/values/pa_symbols.xml

Change-Id: I8d1cd5ae9653e035525a79527a84b613c07fd3a8
Recents clear all app lock option

Change-Id: I254ecbe45c14d47a60e7d39c011421e4c9c276a0
reset progressbar defaults to ~ what we had before

Change-Id: I29942eb462bee71299d35f784dfc5b8033d613ea
core: AST translations

Change-Id: Ic76c1cf2067ceff5896ee6340b16e84803f66d2f
Merge branch 'cm' into HEAD
Quicktiles: support flipping at every tile

Squashed following commits:
SystemUI: QuickTiles: add support for gestures
https://github.com/Mahdi-Rom/android_frameworks_base/commit/d45ed76afcd8816907a21d188adaf9ff9ccc6d53

SystemUI: QuickTiles: Allow up to 4 flip animations
https://github.com/Mahdi-Rom/android_frameworks_base/commit/92a87cdaceb438523434c914f6c945d067e27638

sorry but the previous implementation was a bit stupid.
DRY (Don't Repeat Yourself)

implement flipping in OnClick, so that every existing and comming tile
supports it.

Conflicts:
	packages/SystemUI/src/com/android/systemui/quicksettings/AirplaneModeTile.java
	packages/SystemUI/src/com/android/systemui/quicksettings/GPSTile.java
	packages/SystemUI/src/com/android/systemui/quicksettings/PerformanceProfileTile.java
	packages/SystemUI/src/com/android/systemui/quicksettings/QuickSettingsTile.java
	packages/SystemUI/src/com/android/systemui/quicksettings/QuietHoursTile.java

Conflicts:
	packages/SystemUI/src/com/android/systemui/quicksettings/CustomTile.java
	packages/SystemUI/src/com/android/systemui/quicksettings/ImmersiveModeTile.java
	packages/SystemUI/src/com/android/systemui/quicksettings/MusicTile.java
	packages/SystemUI/src/com/android/systemui/quicksettings/NavBarTile.java
	packages/SystemUI/src/com/android/systemui/quicksettings/NetworkSpeedTile.java
	packages/SystemUI/src/com/android/systemui/quicksettings/QuickSettingsTile.java
	packages/SystemUI/src/com/android/systemui/quicksettings/QuietHoursTile.java
	packages/SystemUI/src/com/android/systemui/quicksettings/WiFiTile.java

Change-Id: I6bb64502d4e4b7695dcdf32fccec834d7edba302
Location Tile: add swipe actions to switch mode

Also Squashed:
Music Tile: add swipe gestures to skip tracks
https://github.com/Mahdi-Rom/android_frameworks_base/commit/62cfb6f0a6bc303cd298156426c9e27d2227c46b

Change-Id: I96fdcb6f557d811ea9f081f654bdf225f952a971
app ops: New ops, features, and modes

AppOpsService: Add MODE_ASK support to AppOps.

Add support for new mode(MODE_ASK) in AppOpsService to show a permission
dialog box to user to confirm user permission before allowing or ignoring
that operation.

All strict operations (defined in AppOpsManager) are going to be in
MODE_ASK by default.

Operations will be moved to MODE_ALLOWED or MODE_IGNORED according to
user's choice.

Change-Id: I1314125a2b8be558e422e4a9eea0ff066c21bf94

AppOps: Add support for whitelist of packages.

By default AppOps gives MODE_ASK permission to all strict operations.
This can degrade user experience for pre-installed apps.

This change adds support for passing a whitelist XML file to AppOps.
Operations requested by packages listed in whitelist file will be set
to MODE_ALLOWED by default.

User can still go into settings and override permissions of these
operations.

Whitelist XML file should have following format:
Example: whitelist_appops.xml

<whitelist-pkgs>
    <pkg name="com.android.settings"/>
    <pkg name="com.android.systemui"/>
    .
    .
    .
</whitelist-pkgs>

Change-Id: I78bf5e7baa95f0e86f9856fb38bf1ca238691303

wifi: Confirm user permission before toggling wifi.

Check user permissions before enabling/disabling wifi.

Change-Id: I1ddae6e47f42b6d3fc831c2c135ece75cf9e935d

AppOps: Add Bluetooth enable control into AppOps

Check user permission before enabling bluetooth.

Change-Id: I9af341157df05104d3c5a52874538eefdbe14c4b

AppOps: Add data connect control into AppOps

Check user permission before enabling/disabling mobile data.

Change-Id: I6e1895b130788dfccbc0a8523dadf1559b698988

AppOps: Fix mms control in AppOps.

Add support to check user permission before sending MMS.
Also seperate out SMS operations from MMS operations.

CRs-Fixed: 549192
Change-Id: Ia5b73e6b6a2c48b608a0ef1d199429c6c0e21f75

AppOpsManager: set default mode for sms write operation to MODE_ALLOWED.

The default mode for sms write operation is set to
MODE_IGNORED, so this was not allowing Bluetooth Map application
to do any write operation of SMS. So set the default mode to
MODE_ALLOWED.

Change-Id: I9fe7144d73a3b8bff99d4ab1c663b69007c32b66
CRs-fixed: 556330

AppOps: Add null pointer check for USERAGENT parameter.

Fix the Java exception which is caused by null pointer issue in
AndroidHttpClient.

Change-Id: If7e36298f94ca164b87e1b0604f49156bdfd4513

AppOps: Add BOOT_COMPLETED operation.

Add BOOT_COMPLETED operation in AppOps.

This operation is used to allow user to control auto start of
applications and services at bootup.

Change-Id: Ie8488ec1b4683c8617ca569cfc858709f0d35ba2

AppOps: Add Chinese support for AppOps dialog.

Add Chinese string for AppOps Permission dialog.

Change-Id: I8d17262ea7ae564c7927be32e91742e1e5f93ce1

AppOps: Always remember user choice in ASK mode.

Remove 'always ask' option from AppOps. Remember user choice for
all operations.

Change-Id: If16a96eb95437ce54ee8d27b84ac6c284a110147

AppOps: Add Ops check for audio recording by AudioRecord API

Confirm user permission before audio recording by AudioRecord API

Change-Id: Ib534a2872d0743a8124b403a2f20465ceb467f64
Use MODE_ASK as the default ops mode in Privacy Guard

 * Prompting the user is far more useful as a default behavior. The
   choice will be remembered after the first request.

Change-Id: Ie62f932047f8b761bd0dd9f836bcd1132062edf5
Relocate and cleanup new app ops features and PGify it

Change-Id: I4eb65f6f88c2f2aecdf054ffd52c31c4d5866900
Revert "Revert "Block application install from unknown sources through adb""

This reverts commit 82b0dd815c827ff68f201d752cdd5c1d08fb39a6.

Change-Id: I4ba932d9e71157235721336040582f5280c0c131
Fix for positioning of glyphs within a bitmap

For positioning of glyphs within a bitmap, roundf(int + float) is used,
where the float is the glyph position and the int is the text position.
When the text position is varied, this may lead to the sum being rounded
in different directions, due to floating point rounding, caused by that
floating point numbers have different precision in different ranges.

This may therefore lead to slightly different positioning for glyphs and
therefore slightly different widths and heights for text strings,
depending on the position they are rendered at.

The solution in this patch is to use int + (int) roundf(float), which
has consistent rounding, and also enables us to use the full range of
ints.

Change-Id: Id1143cdfcbdfa9915ced878ae04df589a3e03cee
Release locked buffer when it fails to acquire graphics buffer

The JNI buffer in ImageReader_imageSetup is not released when
it fails to acquire graphics buffer. After all JNI buffers are
exhausted, ACQUIRE_MAX_IMAGES will be returned and leads to
error. The JNI buffer should be released when it fails to acquire
graphics buffer.

Change-Id: I3319a58ac44e36c8593b404672a685c4b589a735
Fixed upgrading from forward-lock application to system application

Fixes the case when the app on system is newer than the
currently installed. Something that can happen e.g. after
a FOTA update.

Change-Id: I102e9cdd5693d5e66667c0c8989dc2643c72dd16
Fix graphics corruption caused by HWUI caches

Some caches(PatchCache, TextureCache, PathCache) for HWUI
uses deferred removal for their cache entries even though
actual resource objects are immediately freed by
ResourceCache.
For this reason, the uniqueness of a resource address in
the caches is not guaranteed in specific cases.
(Because malloc() can return the same address when malloc()
and free() called very frequently.)

So it can be possible the cache have two cache entries for
two different resources but the same memory address.
(Of course one of the resources is already freed.)
It also can be possible mGarbage vector in PatchCache has
duplicated addresses and this can lead to duplicated free
blocks in the free block list and graphics corruption.
(Deferred removal was implmeneted based on an assumption of
unique resource addresses.)

So this patch makes sure resource objects are freed after
the resources are removed from the caches to guarantee
the uniqueness of a resource address and prevent graphics
corruption.

Change-Id: I040f033a4fc783d2c4bc04b113589657c36fb15b
Signed-off-by: Sangkyu Lee <sk82.lee@lge.com>

Fix AOSP build - DO NOT MERGE

Change-Id: I42b420c2ce89ce364a2809b28b827964e6923fa1
Merge "Recents clear all app lock option" into kk44
Merge "Quicktiles: support flipping at every tile" into kk44