SystemUI: Fix Advanced Custom Tile location_mode

	location_mode resolver needs to be set
	to "location_last_mode" while the setting
	stored to update location method
	needs to be set to "location_mode"

Change-Id: I744b7c5ea87556825119a7f2bdae0fb988251a58
[ActivityManager] Fix a bug: unable to start activity after starting activities during screen off.

Symptom: Unable to start any activity.
Root Cause: ActivityStack.mPausingActivity() points to a destroyed activity of a died process, so that ActivityStackSupervisor.allPausedActivitiesComplete() always returns false.
Solution: Set mPausingActivity to null in ActivityStack.cleanUpActivityLocked().
Reproduce steps:
    a. Turn screen off.
    b. A background service starts an activity X (in process X).
    c. A background service starts a no-history activity Y (in process Y), but the main thread of Y was blocked.
    d. A background service starts Y 3~4 times --> this causes am_failed_to_pause on X.
    e. Main thread of Y is freed finally --> this causes Y crash for android.view.WindowManager$BadTokenException.
    f. Turn screen on, X is shown on screen, but neither back key nor home key can work because mPausingActivity is Y.

Change-Id: I320b3db407e2d4cc745c8ca22a6e548742234242
Mark constructor as accessible in LayoutInflater.

Needed to bypass new access checks for fields, methods, and
constructors.

Change-Id: I8ff0b44a6cb4f4af1c72734bca366d8b89528030
Marquee text RTL improvements

Changed marquee text to scroll according to
the reading direction. Arabic text will
show the right edge and scroll towards
the left edge and vice versa for Latin.

Corrected marquee flicker when scroll animation
finished. The ghost scroll's x position was cast
to int and it made the text flicker when
marquee stops.

Ghost part didn't display for RTL languages.
Added multiplication with
getParagraphDirection to negate the ghost
offset.

Change-Id: I689039118df01a62f73ef0079c857fea1bfcc5a0
Always call super.onCreate().  Always.

Bug 12991134

(cherrypick of commit 9d6376a1d88ab5b3a41ee4400e3aaa4c4ee69e2a)

Change-Id: Ife16ef93408253e3318a06dc0206ab4b88c7f367
[ActivityManager] Reduce report ANR on wrong activity.

Symptom: ANR report on wrong activity.

Root Cause:
  KK changed resume behavior that will not update focus when only resume,
if the activity blocked, it may report ANR on previous focus.
  By original concept, it will try to correct the ANR target,
but the stack of waiting(waitingVisible=true) activity may
different with current top stack.
  If it gets key dispatch timeout, mResumedActivity and mPausingActivity
of its stack will be null becuase it is not top stack.
Then it is unable to change ANR target to the real no response activity.

Solution:
 Use focused stack to get the real culprit.

Reproduce steps:
1.Launch an Activity X from launcher, press home key.
2.Launch X from launcher again, X blocks(sleeps 15sec) in onResume, press back key in the beginning of blocking duration.
3.ANR dialog shows launcher is no response.

Change-Id: I99416ad91e349096f995990f2240a97616fbaf28
Don't allow MemoryFiles of negative length.

Prevents us from converting a (signed) jint into an
(unsigned) size_t and having horrible things happen.

Change-Id: I0f04e2eb9852ae7fc49b435fd0974f56e86751a4
Framework: Minor shake to secure fixes

Match insecure lockscreen feel completely:
	Allow camera roll to be viewed while
		shake to secure enabled and
		device is currently insecure
	Launch activities as though insecure
		which makes the process faster
		and uses the correct animation

Change-Id: I5752e68c022cdb9b9cbffa1bae4dcb901e23137b
Frameworks: IME cursor controll be consistent

If user has enabled volume button IME cursor control do not show
navbar IME cursor control. One is enough and can be asumed to be the
default one the user is using. So be consistent and just have one enabled.

Change-Id: I1981579ef3ced52ba94bd84d4f4675cea379562e
Merge remote-tracking branch 'slim/kk4.4-caf' into ose

Conflicts:
	packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java