Relocate and cleanup new app ops features and PGify it
Revert "Revert "Block application install from unknown sources through adb""

This reverts commit 82b0dd815c827ff68f201d752cdd5c1d08fb39a6.

Change-Id: I4ba932d9e71157235721336040582f5280c0c131
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
Fix tracking of broadcast reference count

Decrement the mBroadcastrefCount when an element is
deleted from mTriggeredUids list. And in failure case
reset mBroadcastRefCount to 0.

Change-Id: Id002bb7a8439ef93eabe031bf318bd424cefc88b
Bluetooth-OBEX: Reduce the MTU size if default OBEX MTU > 8k

Add a check for default OBEX MTU. If MTU is greater than 8k and
setMTU flag is true then reduce the MTU to 8k.

CRs-Fixed: 613931
Change-Id: I5785fd372241f682427ea3aca0b56ac747820d52
VideoView: Correct a type error in the previous patch

- Correct the type error, change "http://" to "https://"

Change-Id: Id914d669a5c9e1fc73f51f428abdc2249b2d52b9
Bluetooth: Fix for FileDescriptor leakage causing ANR

Fix to close the native fds gracefully. detachFD has been removed
in order to close the native fds

Change-Id: I6afca60bcf6adc82ad6a63d8706267d8ed3bd579
CRs-fixed: 623575
Bluetooth: Added new key to store last connected A2dp Sep type

Changes made to add new key and API to store, retrieve the last
connected A2dp Sep type using Content Resolver.

CRs-fixed: 599358
Change-Id: I2648603cc456921ec1896fb498b602416bd79e72
Re-do contextual notification header images

PS2: morning
PS3: night
PS4: new night image
PS5: new morning image
----------------------After Rescue-----------------
PS6/4: Shift morning image
PS7/5: New Years image
PS8/6: New morning image (Credits: Lokesh Chamane)
PS9/7: Revert back to old morning image
PS10/8: new Christmas image

*I cropped these for the different resolutions instead of scaling. Let me know what you think*

Change-Id: I1f713f12b425dd63a98ec85f185606e36411c308
Add evening time to header

Change-Id: I5d9a41d92803d64f67cf2fb9dd2c4294a947efc3
needed for slim recents

Change-Id: Iccddff7d08de51882fd425521cb4be24a415c142
Signed-off-by: scott <scott@ubuntu.com>
Frameworks: Slim recent app screen
slimrecents trds

Change-Id: Ieccb0d4dd7cfa188525939749e2be8b52db5ed4b
Signed-off-by: scott <scott@ubuntu.com>
make slimrecents optional

original commit and credit to codex-corp (hany)

Change-Id: I96839f66e2585887b99a99dde8b802cc81c721b4
Signed-off-by: scott <scott@ubuntu.com>
Frameworks: slimrecents: call app details screen correctly

So feedback shows that we only have 2 bugs. For the one patch is up. The other
one is fixed here.

two problems

1. Longpress opened the detail screen twice and wrong

2. It shows up in the task list which it should not. Going inline
   with the AOSP implementation of it.

use TaskStackBuilder to call it proper with our animation on top.

Change-Id: I18ba0a23ee91fe259143567d157bf24a72e1036a
Frameworks: slimrecents: allow closing recents in middle of the open animation

As reported by Tejus Kandachar steps to reproduce:

Press Recents button and very quicky tap on one of the apps in the recents list,
just as recents list is sliding in. If done fast, the app opens but recents screen does not close.
If done normally it slides away as expected.

Fix it with allowing to close the pannel as well on animation in state.

Change-Id: I4c52e6e6a4fd4b3a2a63bc364ead055f0e619faf
Frameworks: Slimrecents: cover bad 3rd party apps behaviour

Recent app screen as well the original AOSP one needs a proper preloading.
We discovered due of reports that a lot apps (launcher etc) just call over
the SystemUIService some even with reflection :/ just the toggle and no
preload at all.

Whatever we cover this behaviour due that we do not want to break 3rd party
apps. If someone calls the toggle without proper preload we preload them first before
the recent starts animating. Listener takes already care on it for low end devices. We
just use this now and let the taskloader in this case decide when the recent app screen
can be shown.

As well this commit disables the logcat spam lol. Forgot to disable debug on the relase
commit

PS:
- fixed code style issue
- go on out animation down in the runable delay. Not needed to be that long at all

PS:
- add another safety check

PS
- another one

Change-Id: I43a47185da446b9ecaec114c1835ecfd20c3ac73
Frameworks: keep IME keyboard alive due recent is showing

Change-Id: Ieae9b899afa99739cc5cfa536a03d6827567c24b