Fix NPE in ConnectivityService

Could occur when requestRouteToHostAddress is called on a network
with no associated tracker.  Code later in the method handles
this case gracefully but code introduced in JB throws an exception.

Change-Id: I6c8a0e313ecbcca120aeb5dd0802a72114749aa1
Fix a JNI local reference leak in JNIMediaPlayerListener::notify.

Bug: https://code.google.com/p/android/issues/detail?id=62137
Change-Id: I776cd83a66de37fdbbe8af367bf1b26e5e0c7247
Frameworks: Listanimation views and interpolator (1/2)

thanks team ThinkingBridge for it. Difference to original implementation

- code cleanup
- some smaller code fixes
- remove of rotation animation due it is to laggy
- multiuser support

Change-Id: I255b60dd963c616fb5c0aa583c23d52a7a5108f8

Patchset: 1
https://gerrit.omnirom.org/#/c/2862/
AOKP custom system animations (1/2)

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

Thanks to Steve Spear

Change-Id: I38bc7b83edaff3c455f0dfe3ea5ede54a20ae07c
Fix notification cutoff at slim dpi

Change-Id: I0dc2cc2a7748463c4392ba8d9145e3cc0d95edf2
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
Remove duplicates & fix build

Conflicts:

	packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
Make implementation of isEmpty consistent with implementation of getCount in HeaderListViewAdapter

Fix for Issue ID 18316. Make isEmpty() return false when getCount() returns a non-zero value. So that the list cannot be considered empty when a header or footer is present.

https://code.google.com/p/android/issues/detail?id=18316

Change-Id: Ib69201e9d5ef3efcbb68ea298b8cc8ca6e027246
Signed-off-by: Emma Sajic <esajic@effectivelateralsolutions.co.uk>
Check ProcessesReady before broadcast

Most of the time testIsSystemReady is used to know if we are allowed to broadcast intents.
But in broadcast intent method we check mProcessesReady flag (not mSystemReady).
If we broadcast after systemReady flag but before ProcessesReady flag, system will crash

Adding condition to check if system & processes are ready fix that race condition

Change-Id: I17e42bff957164b139f85ee92ace1c5867e7265a
Signed-off-by: Fabien DUVOUX <fabien.duvoux@gmail.com>
Fragment animations are not being saved across configuration changes

As per comment #5 in issue #25994:

The problem here is not that the state isn't saved and restored, the problem is how the BackStackRecord is rebuilt.  The ops themselves do save and restore the state, the problem is in BackStackRecord#addOp.

    void addOp(Op op) {
        if (mHead == null) {
            mHead = mTail = op;
        } else {
            op.prev = mTail;
            mTail.next = op;
            mTail = op;
        }
        op.enterAnim = mEnterAnim;
        op.exitAnim = mExitAnim;
        op.popEnterAnim = mPopEnterAnim;
        op.popExitAnim = mPopExitAnim;
        mNumOp++;
    }

The enter, exit, popEnter and popExit animations are overwritten with whatever is currently in the record, which during the restoration process these are 0 so the values which were saved in the ops is lost.

Change-Id: I095cc7ff4ae65581d728f34217fb873ad2f0c574
NotificationManagerService: notifications with icon==0 are FINE WITH US

This warning reminds me of that saying about squeaky wheels... "the squeaky wheel gets PUNCHED IN THE HEAD"

Change-Id: I3e1a1e55ce3ce1f70c7b187a237625257bdbd591
Signed-off-by: pcarenza <pcarenza@gmail.com>
Refactor
[1/3] Flip to Mute/Reject Call

saving flip action value to Setings container

Change-Id: Ie72dda49d78b23b9bc7d8a886f6916f678c918d1

Conflicts:

	core/java/android/provider/Settings.java
[1/3] TeloRadio
Author: telo46
thanks DHOMD

Change-Id: I7f75c790eee87861adccb2b9ba83aeb33ed2c2cf

Conflicts:

	core/java/android/provider/Settings.java

Conflicts:

	core/java/android/provider/Settings.java
Fix null check for BaseObj.equals.

Change-Id: I4f060697db175cbf0b5617c1220db853bbe53f1f
Avoid duplication of AppWindowToken in created Task

When WindowManagerService creates a new Task, it passes atoken to the
Task constructor. In this case atoken is added to mAppTokens list by
the Task constructor and then it is added manually again by calling
newTask.mAppTokens.add(atoken). As a result, the same atoken is present
in mAppTokens list twice.

When another window token is added to the list, it may be placed in
beetwen duplicated tokens and corresponding window will be hidden from
the screen by corresponding duplicated windows.
From user perspective it means that some windows will not be displayed
on the screen.

The issue is fixed by avoid adding atoken to mAppTokens list manually
when it was added already in Task constructor.

Change-Id: I10628e68186160fffdde07beb7d84ab3cecb7051
Harden NsdManager against null-dereference crashes

Due to race conditions or programming errors, the NsdManager
can attempt to process an asynchronous status message (and issue
a callback to the listener) after the listener has already been
removed from the NsdManager state.  This causes dereferencing of
null objects, and a crash.

Split out the three async-queue message cases:  these are ones
in which message.arg2 does not hold an NsdManager array index
and the code should not interpret this field as if it were.

Add an explicit check for "null listener" (the array index in the
message has already been released), log a warning, and exit early.

Safeguard accesses to the "NSD service type" string from a (possibly
null) NsdServiceInfo object... return a constant "?" string rather
than crashing.

Bug: 9016259

Change-Id: I40aabdfc65d86fdd0eaac7a1e7e56e6ff69796cf
Validate objects are from the correct context.

Change-Id: I7d87b0e253b8d2e36d1aed790cfe3a7dd23e158f
Fix descriptor leak after accepting connections

After accepting a connection on a listening socket and
storing the resulting FileDescriptor into a newly created
LocalSocketImpl, the new impl's "descriptor was created
locally and should be closed normally" flag should be set.

(cherrypicked from 3e7305c6bf6062b5cb1e2ddcec6c6d30b4a8bc0d)

Bug: 11805817
Change-Id: I0a1a7c62ec3fbcf647a44a22110ddc778d14e5f4