Fix the flipping animation sometimes being played when pulling the quick
settings with two fingers.

Commit c5e8dca7f11d3c085dd1e98692fcc21f1bcc0f6f already tried to fix
this before, but was incomplete (and incorrect). The actual issue is
that on the first pointer down event, a 'peek' animation runs and
expands the notification panel by some pixels (on mako: 160). This
amount of pixels is significantly larger than the handle height (on
mako: 72). Depending on the timing between peek animation and the second
pointer down event, the flip animation would play (if animation already
revealed more than 72 pixels) or not.

Fix that by not playing the flip animation if only peeking, as the
actual panel content is not visible at that point anyway. Also remove
the previous incomplete fix in the process.

Change-Id: I8997dc7b70143940a519f41da29ffd4d738d8d0c
Check themes of current user, not user 0.

Change-Id: I5d685a04289b434a12e460b4fdacc43a41ff2be1
JIRA:CYAN-1303
NotificationManagerService: fix typo on led off time variable

Change-Id: Iade96474c26dbeb3a5a671170f563220562d9b3c
Finally fix incorrect flipping to quick settings.

Commit f6685c5ca84a42f5a47bf40827d6229dd998dee4 fixed this for the
two-finger pulldown. It reverted commit
c5e8dca7f11d3c085dd1e98692fcc21f1bcc0f6f in the process, which was
incorrect, but fixed another condition of this problem occuring
nevertheless. The actual problem the latter fix tried to fix was that
the flip decision was dependant on the timing of the view layout:
getMeasuredHeight() returned whatever was set in the last layout, which
might not have happened when hiding the view, so at the time of the next
ACTION_DOWN getMeasuredHeight() returned the height from the time the
panel was last visible.
Fix that problem by using the height scheduled for the next layout, so
we're always up-to-date.

Change-Id: Ib97f34f9aa0a6f28d48b4ec3e16c82a814cda0d0
frameworks/base: Simplified Chinese Translations

Copy of http://review.cyanogenmod.org/#/c/43192

Patch Set 2: Trigger Cid.

Change-Id: I397ea5616f4474e8b1c5cd1d39bd7f96b210f443
framework: Update German translation

Patch Set 1-2:  * revert all unnecessary changes
                  in strings.xml
                * move strings from strings.xml
                  to cm_strings.xml
                * add missing translations

Patch Set 3-4:  * use unicode for ellipsis
                * rename strings after comments

Patch Set 3:    * use 'UKW' instead of 'FM'

Patch Set 4-5:  * add all missing strings

Change-Id: Ic19896d6d8fa0411d8a8119bccca367daa385c06
Fix theme provider crashing for non-primary user.

PackageManagerService's context is for user 0, so if the theme provider
for other users was invoking the getInstalledThemePackages() method, the
themes provider crashed as it doesn't have the INTERACT_ACROSS_USERS
permission.
Fix that (and simplify code) by making getInstalledThemePackages()
return the installed themes for the current user, which was probably the
intent anyway.

Change-Id: I02002cee005b74128f3b2f7cc7a93b9b8514f1f3
Fix a number of multi-user bugs.

In particular, expanded desktop mode couldn't be enabled for non-primary
users as GlobalActions wrote the setting to the primary user's settings
DB.
Also fix some other cases where we didn't track the settings for
multi-user correctly.

Change-Id: I3bec45cb84903120639c2e85c1d71ec9a491933c
frameworks_base: ES translations

- Move cm_ to default. Same as AOSP.
- Reorganize some strings

Change-Id: I51c87e80e59d03832631f19c09b48a3730aad474
core: EL translations

Signed-off-by: Michael Bestas <mikeioannina@gmail.com>

Change-Id: I002f18400ed300616739ea067dd051fdcc174c6b
SystemUI: Add missing Af Translations

Change-Id: I504dec8e14f9be07a227dd1629040402ed44cebc
[1/2] Add triggers to change profile based on AP

Add data structure mWifiTriggers to store triggers per profile.
Add network change listener to switch to profile

Change-Id: I97e360d7783d3b0e2bbd70fe7a9a866d8c0fa7cd
Don't assume any ringtone is present on external storage.

If that assumption doesn't hold true, the user will lose his ringtone
and won't know why.

Change-Id: I89409e1351792d020c5458f5104f4bb9f2a040f2
Fix mobile data button in power widget.

Change-Id: Ide0417768350081250af24518b6831d70196ba73
JIRA:CYAN-1189
AssetRedirectionService: Check for permissions before running dump()

Fix android.security.cts.ServicePermissionsTest failure

Change-Id: I9d629d19f3ff231db477d156c8bf557d4b8ee861
Fix ringer mode being unneededly changed by setting ringer mode volume
to 0.

When having set the ringer mode to silent on a device with vibrator and
calling setStreamVolume() for the ringer stream again (e.g. in one of
the volume control dialogs in the settings app), the ringer mode is set
to vibrate, although there's no reason to do so.

Fix that by remembering the last non-normal (that is, either silent or
vibrate) ringer mode and using that when setting the stream volume to 0.

Change-Id: I27f1c75a0fef52bd63ac20f4101042808ce2c458
JIRA: CYAN-1403
SystemUI: zh-rTW translations

Change-Id: I69ae49bb775aa0cbc8ae1b66fd022a88cd73dcac
core: zh-rTW translations

Change-Id: I8301d7b0a07954cd52eec54739d2aa366c539992
ThemeUtils: Retain the original package name in themed UI context

In order for themes to reflect on system elements, we're changing
their context, including the package name.

This breaks anything that tries to identify system elements,
most notably any users of the uiautomator. Trying to do
'UiSelector().packageName("android")' to find, for example,
a force-close dialog will fail.

Fixes com.android.cts.uiautomatortest.CtsUiAutomatorTest#testUiWatcher

Change-Id: Ic05c3024b20ac3772ed5597846fbfa4a184ebb0d
Revert behavior of DateUtils.formatElapsedTime

Change Ib3c1e1aad05827df646aa18645cce19dffb7551f fixes the inability
to display more that 2-digit hour values, but also changes the behavior
of <10 minutes display by zero-padding the minutes. This makes
the Chronometer widget look different, and breaks Holo CTS.

Fix it so that for values under 600 seconds, the minutes don't
get padded

Change-Id: I34eb7f22e728c55bf3313ed1987ac32969cd5ed0