frameworks: add persistent notification when USB OTG is connected

Tapping the notification will take the user into Storage settings, and
highlight the 'Unmount' option.

Change-Id: I650f3874a8295b2b8ffdaef78aff4b68e9cd574e
Signed-off-by: Roman Birg <roman@cyngn.com>
Themes: Fix native crash in libandroidfw

If a missing attribute needs to be added in somewhere in the middle
of the bag, a segfault would occur because we change curEntry to a
value that is beyond the set's allocated space.  This patch stores
curEntry in prevEntry before changing it's value and memmove uses
prevEntry to index the set.

Change-Id: Ie70f2ad465097c3acf76caa729999c424fb01ee2
Move Gesture Strigns to pac_strings for crowdin

Change-Id: I1042f845f57d96d8593710aa57ceb16ff359e778
Signed-off-by: Lokesh Chamane <lokesh.c703@gmail.com>
Revert some of the recent commits

Revert "OCD: Kicked in"

This reverts commit 3583bc624556bfe1fd4f59c106450e69fe804c2e.

Revert "Fix cherry-picks"

This reverts commit bf6d12abfb149ac3b44e24c18032384972c03116.

Revert "UMS: Add the missing notification when USB connected"

This reverts commit cbb8205dbffc43a98df335d232ce4141e84c87ca.

Change-Id: I45859c0c49d414a0a0d98e95e929de928dae67c9

Revert "UsbSettings: Add UMS mode support"

This reverts commit 7d9885cd7df1bb21b87268d344a04f89fee63cc4.

Change-Id: I8f5cc8a7698111657e1c07e9ffc2ef79a0e13471
Signed-off-by: Lokesh Chamane <lokesh.c703@gmail.com>
SystemUI: Modify AOSP EL translation

It's too long to fit in the QS tile

Change-Id: Ib9c64c8b15909de629a70ede10777d06a416b715
Crowdin Translations

Change-Id: I48882f19bea8fbca6dc1dc7713b1bfd80f61cb62
frameworks: extend TorchService to be able to handle sysfs torch config

Some devices are still using a sysfs node to control the torch. Let's
support those configurations and properly shut the torch down.

Change-Id: I5fa1cccdcffad26dbfef4b2ee0eafe1218a5308b
Signed-off-by: Roman Birg <roman@cyngn.com>
Bring DownloadManager API inline with AOSPA

Change-Id: I9468e59617e2e6fd01a622c1c499ee52a096d291
Download: add to support pause/resume download by manual

We add pause and resume API here so that application can
pause and resume downloads manually by DownloadManager.
This contains two points:
1. add pause and resume download APIs.
2. add another paused reason for this download status.

Change-Id: I606b48ca20f43bcc6c119683818c2ab6ff03bfe5
do not garbage collect in ZygoteConnection

in preparation of https://gerrit.nameless-rom.org/#/c/9991/

Change-Id: I7dd84c092bb1084498a31c922db1c8212a217cda
Remove unnecessary explicit GC in ZygoteInit.

Removes > 1s of GC time and hundreds of GC during device boot.

Zygote size before: 8388608
Zygote size after: 8388608

No increase in zygote space size due to zygote compaction.

Bug: 16398684

Change-Id: I3c6f5a0b26a207ab39bb0a952400d7488e42f00c
[ActivityManager] Fix race condition in pss collection

Symptom:
There has a race condition that two threads are accessing
the mPendingPssProcesses simultaneously. One of the thread
is collecting the process pss by looping the mPendingPssProcesses.
The other thread is requesting to collect pss of all processes,
which clears mPendingPssProcesses and adding processes back.

Solution:
Avoid race condition by adding synchornized protection.

Change-Id: Ifb090eda9c4a1b8e3fd980fe0171e9dd77773b46
[ActivityManager] Fix ServiceRecord leakage

Symptom:
The first step of cleaning up application services is
to clear the app state from services (which set sr.app
to null). Then it clean up the service connections.
In some scenario, the Service might be removed during
the connection cleanup (i.e. the Service is no longer
needed). In that case, the Service will be removed from
ServiceMap, but won't be removed from r.app.services
(line 1612) because the r.app is null.

Solution:
Remove the service connection first.

Change-Id: I644d73af58fe0e7c1c4a6c9779fe6b5d747b880d
Skip receiver if failed linkToDeath to ILocationListener

linkToDeath may failed when app was dead immediately after
starting the call to requestLocationUpdates in Location
service. If receiver still record in maps, an exception
will occurred when try to remove receiver's update because
unlinkToDeath will failed.

Change-Id: Id9b00da3b17c1371d61ab4644a70cf9ee934cdcc
missing recycle call, catch possible exception when unregistering

Change-Id: Id8d5ff359fc7b2f90b3188e593edc5948c58df74
Fix to double deletion of StreamingZipInflater object.

Race condition can cause double deletion during stability runs
of StreamingZipInflater object. This is possible due to delete
of mZipInflater occuring at two seperate locations in owning
_CompressedAsset object. Fixed by securing object is set to
null on member reference before calling delete. Also secured
that all deleted objects in StreamingZipInflater are set to
null after delete.

Change-Id: I87ef0fa78835ea05c524b3d818c8e6aa2aee1fe4
Prevent MediaScanner infinite loop with invalid path

including double slash  "/storage/sdcard0/xx//xxx/xxxx"

Change-Id: I112a70c88b5ec662482b79c3151310b9b9b52e40
Text size for empty view shall be styled according to theme

In activity_list.xml the empty TextView has set a
textAppearance which allows the theme to set the font size.
However, for preference_list_fragment.xml the textAppearance
is missing but should follow the same style as
activity_list.xml

The missing textAppearance makes the empty text in
Settings->Wifi and Settings->Bluetooth look small if
no networks are found.

Change-Id: I9320b37cfeec0d9505d73650696eaf534fc4a321
Fix a bug: unable to start activity when AM is killing the process.

Symptom: No activity was started for startActivity, low repro rate.
Root Cause: Starting activity on a process which was killed by ActivityManagerService.killUnneededProcessLocked() and before receiving AppDeathRecipient of it.
Solution: Choose the flow of starting a new process if ProcessRecord.killedByAm is true.

Change-Id: Ida2639b0fb4631222fc92d65aadc9fd2da637b45
Add a null check in exifParser to avoid crash while setting Wallpaper.

For some images, while setting as Wallpaper, the src array in
System.arraycopy was null in exifParser, which leads to crash.
This change adds null check to the array used in System.arraycopy.
Also, a safe check is made to ensure start index is not negative.

Change-Id: I46a16b6943aaeeb2395e335bf3926988b881be7a