Add preference for Trackball wake

Originally by drewis. Doesn't work properly when cherry-picked.
Restore "advanced power menu" which has been accidentally deleted
Revert "Restore "advanced power menu" which has been accidentally deleted"

This reverts commit d01d732e563f5a1abd8cde9b72c650f7f0556543.
Revert "fb: Slims new Power Menu (1/2)"

This reverts commit 64975265b06e3816f5aec48cd0395c077605ca8b.
Disable Camera shutter sound [2/3] Credits lion0738

frameworks_base

Change-Id: I8cdc6e2b65ee4ca946e69aa43d2a4ff13ced225f
Signed-off-by: STELIX <ssspinni@gmail.com>
Screen Timeout Tile allow infinity [1/2]

Change-Id: Id68063b8b00fc465a908d1af62ad37902a235792
Free modification of CarbonDev/CM code
Signed-off-by: STELIX <ssspinni@gmail.com>
Return: Smart Pulldown [1/2]

Adds the ability to directly open the QS panel when there are
no notifications present in the notification panel.
This commit combines the enhancement by HardCorePawn for detectin
notification types for the same.

Credits: kufikugel, HardCorePawn

PS 2-4 : Cleanup

Conflicts:
	core/java/android/provider/Settings.java
	packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
	packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java

Change-Id: I3c9b048f2616d2b8950930cc5bfac27c2364e826
Use java.util.Objects instead on internal API

Not needed since java.util.Objects implements all the needed
functionality.

Change-Id: I996cce37c44fc7325a1824bb51ccf8bee17364b0
Untangle the statusbar for dual sim

This is just enough to get the statusbar to not forceclose.

TODO in future patch set:
  Implement signal text for dual sim.
  Implement hidden view for dual sim.

PS: update msim_layout with our own batteries

Change-Id: Ieeb95e3a0b1653b0e80527e1a388075654097b89
SystemUI: Only show H+ if config_hspa_data_distinguishable is set

Currently the UI is not consistent. If config_hspa_data_distinguishable
is not set you get 3G icon on HSPA and H+ icon on HSAPP.

Change-Id: I09db3a2902e30290206eafd1f64c940bab5b89e6
Forward port Status Bar interface (1/2)

Signal / Clock / Notification Count
Change-Id: Iecd4bb06b95b14888916331f5d36327f3206aeef

Port "Fix display of mobile status bar icon when using airplane mode"
Change-Id: Icb5b33008f97eaefd67bb4e5acd1e38bcf2dcb70

Forward port from cm-10.2, adjusted for 4.4

PS: udpate with msim stuff

Change-Id: Iecd4bb06b95b14888916331f5d36327f3206aeef
Signed-off-by: Arnav Gosain <nolinuxnoparty@gmail.com>
Merge branch 'kk' of https://github.com/CarbonDev/android_frameworks_base into HEAD

Conflicts:
	core/res/res/values/cr_symbols.xml
Merge "Untangle the statusbar for dual sim" into kk
Merge "SystemUI: Only show H+ if config_hspa_data_distinguishable is set" into kk
Merge "Forward port Status Bar interface (1/2)" into kk
Don't show notification count for a notification with just one item

For example, the Play Store sets the number attribute to 1 for a single
app update. No point in showing a counter for that.

Change-Id: I818622419f4f043fa8f04339ab24744aca7c1584
PackageManager: Fix reconnection logic in Installer.

Change-Id: Id4b352647ed51aaf64bb85dff9030a25e295758f
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