Left handed navbar: fix keyboard placement in immersive mode

when using immersive mode with left handed navbar in landscape the keyboard doesn't account for
the navbar appearing from the left and leaves an empty layer on the right, we need to use mStableLeft
so it takes its position accordingly.

Change-Id: I937e46661673b8560357afd4cbd7289bae87734f
SystemUI: Rework SearchPanelView calculations

Make isScreenLarge calculations match how the system calculates where to put the navigation
bar. This fixes certain cases where the quick launch buttons on the glowpad of the
navigation bar is improperly oriented.

Patch set 2: The eval should be greater OR EQUAL to 600, not just greater. Also cache result
into a boolean before returning it.

Patch set 3-4: Actually cache it this time.

Patch set 5-6: Make it final.

Change-Id: I5703578b4d49a6eeab100bb23167abd5cf9a326d
SystemUI (MSIM): Add extra vaules for sim state ready

From: https://www.codeaurora.org/cgit/quic/la/platform/frameworks/base/commit/packages/SystemUI/src/com/android/systemui?h=LNX.LA.3.7.2.c5&id=8489b3de7da4efef624bacc6a1d5cf31bd922475

Change-Id: I14176d4cab14bc90198cefd3f4b4880b6d14f566
Themes: Force recompiling common resources when scanning theme

If a theme is re-installed multiple times and in less time than
the 3 minute timout for common resources, it is possible for the
installation to fail because it does not compile the common resources.
This is not something an average user would encounter normally but
theme designers that are working on there theme and constantly
installing updates have a better chance of encountering this situation.
We simply remove the theme from mAvailableCommonResources which will
allow them to be recompiled.

Change-Id: I04b64645157dbb1d0c26fab95c851b34bfff3f42
SystemUI: Fix data activity arrows for MSIM

PS5: Fix CAFs bad camel case

Change-Id: I77d4ce6d9707d621f417afadf0063a61777bb0bb
Automatic translation import

Change-Id: I7924f25b6405d5a5fa626eb2ba33ea8bd34190ff
Only start one WifiClientScanner

*) Fixes unexpected soft reboots.
E/AndroidRuntime(18586): *** FATAL EXCEPTION IN SYSTEM PROCESS: WifiClientScanner
E/AndroidRuntime(18586): java.lang.IllegalStateException: Cannot execute task: the task is already running.
E/AndroidRuntime(18586):     at android.os.AsyncTask.executeOnExecutor(AsyncTask.java:576)
E/AndroidRuntime(18586):     at android.os.AsyncTask.execute(AsyncTask.java:535)
E/AndroidRuntime(18586):     at com.android.server.connectivity.Tethering$WifiClientScanner.handleMessage(Tethering.java:596)
E/AndroidRuntime(18586):     at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime(18586):     at android.os.Looper.loop(Looper.java:136)
E/AndroidRuntime(18586):     at android.os.HandlerThread.run(HandlerThread.java:61)

*) Remove unnecessary mDoScan class member variable.

Change-Id: I17ab368366b9a3456a625974c461783c428efec2
Revert "Avoid collision with RIL constant 1138, used in some Samsung devices for RIL_UNSOL_TETHERED_MODE_STATE_CHANGED."

Later Qualcomm RILs will use the STK_CC_ALPHA_NOTIFY message, and this
causes the radio to parse the parcel in a very incorrect manner.

This reverts commit 8e3fee66ff3a1d55f1aa69df7b52fdcab33f1f82.

Change-Id: I94e2867f130b88c4c9eff17293edd0b64dda516a
Fix wrong scaling of QS tiles

Also increase margin with the number of tiles shown
and tweak sizes for better usability

PS2: Whitespace fix

Change-Id: I78a1e0d41d487ac48edc5f8992b7d5c95fbbfa71
SystemUI : RemoteDisplayTile use executor

The registering/updating causes jank when done on main thread.

Change-Id: I3a07ddeeddf480641a8b1f55684983b24cd693d1
Update SET_ACTIVITY_WATCHER protection to signature|system

Change-Id: Iabf8ad2fc4b298e96b494917a140e0e4ea4e26e2
PackageManager: Add optional prelaunch check step

This ability is protected by config overlays.

Change-Id: I0c80bd9ec6bda3d21557aaa9503f05ff86adf434
Provide non-interactive APIs to BackupManagerService

- Add return codes for backup and restore in FullBackupRestoreObserver
- Add non-interactive backup and restore methods in BackupManagerService
- Add per-file filters for backup in BackupAgent

Change-Id: Ic1dfd5d144507263baad76f7088a52eab2fb283a
Add Secure.Settings.RECENTS_LONG_PRESS_ACTIVITY

This Secure.Setting specifies the activity component to handle
Intent.ACTION_RECENTS_LONG_PRESS.

Change-Id: I689e8b5c26b39e100cb166d2f93e7ee49e83f93a
Recents long press: add pluggable implementation

Adds a new intent ACTION_RECENTS_LONG_PRESS for the
long press of the recents button. Other system applications
can register for the intent to provide custom handling.
Handlers of this intent are queried for in the settings
application, and if no handlers are found, the default
implementation falls back on ActionUtils.switchToLastApp().

The long press listener on the recents button is replaced
with a touch handler to allow for more custom handling.

Change-Id: I8a27ae0fe58d92a1626f0bd661c5f57c589fac17
Keyguard: Allow applications to customize left-corner widget

Adds ability for trusted applications to set the application widget and
action in the lower left corner of the Keyguard.  Its behavior is
modeled against the on-screen camera widget most commonly found on the
lower right corner of the Keyguard.

Three intents are defined: one to set the widget, one to clear the
widget, and one to notify when the widget is activated.

Applications calling this intent must have this permission:
android.permission.SET_KEYGUARD_APPLICATION_WIDGET.

Change-Id: I8c5b11fd1cc1888c710bf3736e3c28d77fc57e37
Support full size application screenshots

Add optional width and height parameters for
ease of capturing entire application screenshots

Change-Id: I6d154f6b33bfb8ec90e3757a40382c1dc6feaad3
extmediaplayer: miscellaneous fix

Fix for issue 20936 reported by KW.

Change-Id: I512657696d99bbe64edfffa0ad7c687651a31acc
Fix memory leak in nativeDecodeFileDescriptor

Fix memory leak in nativeDecodeFileDescriptor:
SkFILEStream::kCallerRetains_Ownership is used to keep
life cycle of file in Java,so fclose is not called when
destruct SkFILEStream because ownership not belong to
native here, while when file is closed in Java, close
is called instead of fclose,that means buffer allocated
by malloc in fseek, when create SkFrontBufferedStream
with this filestream, will not be freed, because this
buffer will only be freedin fclose.
To fix this issue: duplicate this fd, and use
SkFILEStream::kCallerPasses_Ownership for SkFILEStream,
means Java and native manage file life cycle separately.
CRs-Fixed: 718738

Change-Id: I1c664551ab8d381db2e1f948a2207bc6fb7a11f9
AudioService: Fix monitorRotation for landscape applications

Current implmntation only sends rotation updates on orientation
changes, so does not handle direct 0<->180 or 90<->270 transitions.

Update rotation based on an OrientationEventListener instead of
Intent.ACTION_CONFIGURATION_CHANGED

Bug 17606902

Change-Id: I01dfcd1c587f5b2e8a96365c2389782ad77936ef