LightsService: Turn light off after pulse

Turn the light off after a pulse instead of resetting the light
to the pulse color and leaving the light solid on.

Change-Id: I711e8f01c72cc1dd1c80908c74c17ad55d80c57e
Fix swollen back softkey icon on phones

For some reason, scale_center was set in xml.

Change-Id: I65a593aa8bcfcc9aed30ff633e39668da6121469
[Resources] fix preload drawables low issue

Symptom: preload drawables too few
Root Cause: verifyPreloadConfig() function not correct. We need to
convert the config to native config and mask the 0x40000000 bit.
Solution: correct the verifyPreloadConfig() function.
Project: AOSP
Note:

Change-Id: I63eb2a7bf50c89fcb37e62423aae8f4f7e81c6aa
[ActivityManager] Finish the failed-to-pause activity

Symptom:
In some scenario, the mPausingActivity may be replaced by other activity.
When previous activity paused, the completePausedLocked() won't be invoked
because it is no longer the mPausingActivity. If the activity is also
pending to finish, it would never be done because the activity kept in
PAUSING state. Since the activity's window also remain visible and is
above on Wallpaper, user would see it when back to home.

Solution:
Finish the failed-to-pause activity if the activity is pending to finish

A Real Case:
(1) Screen turn off
(2) The top activity T1 crashed
(3) When finish activity T1, the next top activity T2 will be scheduled
    to resume and pause (due to screen off).
(4) The activity T2 is also set to finishing due to T1 crashed.
(5) Before T2 paused and before paused timeout occurs, there has a new
    process started which brings up the next top activity T3 to resume
    and pause. So the pausing activity is now replaced.
(6) When activity T2 paused, it cannot completed the pause operation.
    T2 will remain in PAUSING and finishing state with its window visible.
    The process won't be killed because the oomadj stays at 1 (Visible).

Change-Id: Ib10fded891b21c774b26a93071c717fa50516e22
[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