Quiet Hours: Add 4 states

off, timed inactive, timed active, and forced on

Signed-off-by: Chintan Shah <cgintan1998@gmail.com>
Quiet hours: option to disable system sounds (2/2)

Thanks to CM

Conflicts:

	core/java/android/provider/Settings.java
UserTile: Fix displaying user information for multi-user devices

In commit 89ab0eb097322ac8eec40159b888dfb03b9413e9, we improved
the handling of single user devices but appear to have also
entirely deleted the name / avatar for multi-user devices.

This commit restores the deleted code for multi-user devices.

This fixes CYAN-4023.

Change-Id: I69fe1504da2b32cd5bf0fdc87f8f78c960e9c77f
Fix (subtle) notification vibration during calls.

Thanks to @maniac103
QuickSettings : Add BatterySaver Tile (1/2)

Conflicts:

	core/java/com/android/internal/util/mahdi/QSConstants.java
AudioService: fix safe volume enforced even when disabled

On onConfigureSafeVolume, the proper API was not used, leading
to the setting not being respected. Sometimes after boot, the
heaadset volume will be set back to the safe volume.

Change-Id: I5ba8bb1a18ce97ed64646663c7e75cb277356778
Avoid SystemUI crash due to NPE

BaseStatusBar.createNotificationViews() returns null
when it reports handleNotificationError(), leading to
a forced crash of the misbehaving app. However, it
should not add a null object of Notification.Entry
since it will also crash SystemUI (crashing at compare).

Change-Id: I86678c8024e931420b0fbab1f36b330e7e75d581
National Roaming: Allow T-Mobile AT (MNC03) to roam on 3 AT (MNC10) in Austria

Change-Id: Ief827259fdcb5bfa13bd643f80a8547a56cc934c
NotificationManagerService: fix less frequent notifications sounds
AppOps: Don't apply OP_ALARM_WAKEUP to system components

System can freely invoke and manage alarms. Preventing it from doing
so interferes with remote components like the backupmanager (backing up alarms)
due to the mismatched uids between the invoking app and the running
service that takes the action.

Change-Id: I079df8d2522642d6d9194781207df7dd67b715b2
Clear cached locations when location providers disabled Bug: 12118307

(cherry picked from commit b084fef18ee1b5d24d15cff37dc3a053933d361e)

Change-Id: Ief869b9e38858092bfa3f8d6d090a278dee7d86c
AlarmMangerService: Fix the delay of ACTION_TIME_CHANGED for time-services

After boot completed, if low memory condition happens or some ordered
broadcasts have time out, it will cause delay for some receivers to
receive ordered broadcasts. Adding FLAG_RECEIVER_FOREGROUND into
time changed action will make TimeServiceBroadcastReceiver receive
ACTION_TIME_CHANGED in time.

CRs-Fixed: 630982
Change-Id: Id789d0b3c969af6b92f62612602ba119613382ab
ExtMediaPlayer: Increase parcel pool size to 30

Increase MAX_NUM_PARCELS to 30. This is to handle
parcel override issue when textsamples are sent at
a fast pace from mediaplayer.
Usecase: With CEA CC streams, dashplayer sendTextPacket
embedded in each video sample as soon as decoded.
No realtime offset delay sync logic for text samples
as with A/V samples. When samples drained in batch,
can have more than 5 textsamples sent in flurry

Change-Id: I4c4c63b9c9c296dbb387c4da9e70c040b75f92b6
AppOps: fix framework reboot issue when AppOps enabled

When AppOps security feature enabled, there will be a prompt when
someone call the protected operation. If no user click on the
dialog button, it will be always blocked there. This action may
cause watchdog timeout in some service.

Change-Id: I114bfef22502b81887a84b218e1548de29be3f69
Fix socket descriptor leak from Zygote to child app

Due to an API change in LocalSocket, Zygote must now
manually close the FileDescriptor it created when it
registered a LocalServerSocket.  The LocalSocket.close()
routine will no longer do so.
Bug: 12114500
(cherry picked from commit 70ef29b04ee4ef7d7acfec79041dbe800961195e)

Change-Id: Ief23a3c99e007dc4aa6f94dfb47a1b2b6c854dad
Alarm: ignore less than 2 mins upcomming power off alarm

2 minutes is our define for enough boot up time for a power off alarm.
For current design, it can only afford upcoming power off alarm which
is later than 2 minutes. Kernel alarm driver only take care the power
off alarm which is 2 minutes later. And the framework only pass the
first power off alarm to kernel. So we need to find the first 2
minutes later upcomming power off alarm to kernel, otherwise it will
be no power off alarm from kernel's perspective. Fix the bug by
ignoring less than 2 mins upcomming alarm as power off alarm, and
only treat it as a normal alarm.

CRs-Fixed: 624561
Change-Id: I91379ecb2b378441ac2edb36212531ba6f203d8a
AppOps: don't make delay for permission dialog

Permission dialog is unclickable for 1 sec. To remove this delay
for better user experience.

Change-Id: I9dfc90c1fe5b057d4379a8acb05ac21b913b7360
Don't animate the circle battery meter when battery is fully charged

Rotating a full circle is unnecessary, no need to redraw the battery
meter every 50ms

Change-Id: Ibc7232ccd296ddbcf7c920aa6d8f01baa92a06d7
Fix circle battery opaqueness for the low battery color

Because of the DST_ATOP Xfermode the color was drawn below the full
gray ring resulting in a washed out red. Fix this by not setting an
Xfermode and drawing the color normally.
This does not affect the non-low color as it cannot get any whiter.

Fixes: CYAN-3282

Change-Id: If1183dcb272e84858371be3765ba758fa2560eeb
immersive mode: don't unconfirm a package, that's just dumb

* This is very annoying for specialized apps
* See here for a great explanation http://stackoverflow.com/a/20309721
* The fact that it doesn't even notify the user until the NEXT time they
  run it makes it completely pointless in my opinion anyway.

Change-Id: I423611efc07d467e1d81c66d58adcff331be8b38

Conflicts:
	policy/src/com/android/internal/policy/impl/PhoneWindowManager.java