core: AST translations

Change-Id: Ic76c1cf2067ceff5896ee6340b16e84803f66d2f
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
Improve scrolling cache

Scrolling cache helps make short scrolls/flings smooth but will
cause stutter when long flings are made. This patch disables
scrolling cache when long flings are made.

This patch also fixes a related bug where scrolling cache will
not be enabled properly when transitioning from flinging to scrolling.

Patch Set 2: Calculate threshold based on maximum velocity (Sang Tae Park)

Credits: Pawit Pornkitprasan

Change-Id: I1fdbaad92263c9f983a32900e74eba1f0367902b
Signed-off-by: Arham Jamal <arhamjamal@gmail.com>
Smoother Upload and Download Animation

Change-Id: I6e6409cc85ad951019dbac10156d4aed92f4c5bc
services: don't clear wallpaper when SystemUI
disconnects.

When we restart SystemUI (or the user), sometimes
the wallpaper would get cleared. This patch just
captures its originating component and
if that is our SystemUI component, ignore the event.

Change-Id: I3e159dc2c013e7d7e552e3c0cef55e3ab970ca87
Signed-off-by: Roman Birg <romanbirg@gmail.com>
Advanced reboot enabled by default (1/2)

Change-Id: Ie8ab34ecc532d14d296e33fa568e6cf3ebc681e8
MediaScanner behavior on boot (1/3)

Lets you enable/disable/ask (with a notification) media scanning on boot.
Can speed up boot and reduce initial boot lag from MediaScanner

Change-Id: I634ae96b1dcb493b966b4653589cd97523b63da7
disable camera sounds (2/3)

Change-Id: Iaa37bc6790fe32664f8b52178c14fe926ca7d4ce
Signed-off-by: sethyx <sethyx@gmail.com>
AOKP custom system animations (1/2)

Ported from here: http://gerrit.aokp.co/#/c/12304/

Thanks to Steve Spear

Change-Id: I38bc7b83edaff3c455f0dfe3ea5ede54a20ae07c
App sidebar [1/2]

Change-Id: I600a21fd780587ef84c8e1994adbaccc6098254d
add needed boolean methods

Change-Id: Id1620eb0f98bcdbbf70102d3911e3e11eda42f8a
[1/2] ElectronBeam: Add an alternative screen-off animation

Adds a "scale down" screen-off effect. This is one experiment to see
how we can become more creative to make some cool screen-off anims.

Change-Id: I5f364512792d5723d3a8745169abdddda5959b92
[1/2] Add battery level around unlock ring

PS2:
added missing change in KeyguardSelectorView.java

Change-Id: Ia4dbc2335657c096c34349ec67c4adfec0aeb91b