Automatic translation import

Change-Id: I21d013b7b5d2c17cf99ed1f2f1a01c947eadffaa
Automatic translation import

Change-Id: I15676e45f1f94f85d626400c0dbd1a7adcbc50e8
Automatic translation import

Change-Id: I7778a04e07adb06e005237b7da71858f2c7464cc
DeskClock: restore vibrations after screen is turned off

android.server.VibratorService forcefully clears out all vibrations
after the screen is turned off. If an alarm is going off, we do not want
the power button to only stop vibrations.

Change-Id: Ic7bc556d7cf5529b23b482c34e986853ad4ba4f2
Signed-off-by: Roman Birg <roman@cyngn.com>
Automatic translation import

Change-Id: I4355dc9df5958cf5504aff26cd03f6e6d5732e05
DeskClock: Add selection for external device

User can choose external audio file as the ringtone for each alarm.

Change-Id: I98fe4f823e29161f4aa45d0bbca6c90d94c689f9
WorldClock: Add some worldwide cities and update timezone

Add some cities info to xml.
When local is changed, the timezone in setting page should be
refreshed.

Change-Id: If13beeb3c92227f67819f016e4631913fc6daca7
WorldClock: Fix cities/time zone entries

* Remove duplicate entries
* Fix time zones for cities

Change-Id: I90a70b3059595f429eb5b12ad62aad953773d29c
DeskClock: Sometimes alarm can't stop while coming a MT voice call

Alarm can't stop sometimes.
Add stopCurrentAlarm() in PhoneStateListener to stop Alarm when receive a call.

Change-Id: Ie9dadb5f050ec066e7c3e0156bdf8f40f398e9c7
CRs-Fixed: 620428
DeskClock: Alarm Vibrator can't stop while coming a MT voice call
- Alarm Vibrator can't stop while coming a MT voice call
- Add inTelephoneCall condition to stop Alarm Vibrate when receive a call.

Change-Id: I2728a217ac3b9d962c61a7291bb65178a7518436
CRs-Fixed: 635036
DeskClock: Search cities with any part of the name

Only the the starting part of the name could be used to search.
Therefore, when try to search the cities with the middle or ending
part of the name, no expected result will be listed.

Use contains() method instead of startsWith() to match the search,
so that all the names containing the search string will be listed
in the result.

CRs-Fixed: 637280

Change-Id: I670a163b9c4df575445b58eeb1cc5070a557550e
DeskClock: Avoid alarm ringtone changed as silent

When rotating the device, the alarm activity will recreate and
set default ringtone as silent, which lead to the music picker
unavailable. Add configChanges property for the activity.

Change-Id: Ia14d7d431a96709aafd707217f139415ccaedb49
CRs-Fixed: 640960
DeskClock: Fix the delay or missed condition of the alarm after boot

After boot completed, if low memory condition happens or some ordered
broadcasts have time out,it will cause some delay to some other ordered
broadcasts like "change_state" broadcast for alarm. Because alarm is
very sensitive to the time, its broadcast should be changed into one
with high priority. And the priority of AlarmInitReceiver should be
impoved to receive the BOOT_COMPLETE action in time. Otherwise the
alarm will be missed if AlarmInitReceiver receive the action after
the alarm time.

CRs-Fixed: 621073
Change-Id: I18f37378e5eef0504c9c412d3a2ff85487093245
DeskClock: Fixed the ringtone name display incorrect when delete music file

It only displays FALLBACKRING when set alarm ringtone by file explorer,
is caused by that it not handle the file uri which from file explorer
in getRingToneTitle method.

Add the judgement to get the file uri and get the right title of alarm
ringtone.

CRs-Fixed: 546747

Change-Id: I50ac325c1a636fb2a2985fbc15839fab9e31e0cc
DeskClock: handle call events on alarm

Alarm clock ringing while incoming call received.

When call ringing,alarm clock time arrived.Only Call ringing and no alarm
clock ringing.and after hang up the phone,alarm start ring.
When alarm ringing,receive a call,the alarm is stopped,and it can answer
or hang up the phone.after hang up the phone ,there has some reminder.

CRs-Fixed: 638868

Change-Id: If26b4f1f50f76ee4bd2873fefbda5d22551b002d
DeskClock: handle call events on alarm

Alarm clock ringing while incoming call received.

When call ringing,alarm clock time arrived.Only Call ringing and no alarm
clock ringing.and after hang up the phone,alarm start ring.
When alarm ringing,receive a call,the alarm is stopped,and it can answer
or hang up the phone.after hang up the phone ,there has some reminder.

Change-Id: Id1bdf689f709e78ced30cec06cbc93a7a06a5b3b
CRs-Fixed: 638868
DeskClock: Request user to confirm power-on device on power-off alarm event

Show a dialog to request user confirmation to power on the
phone when power-off alarm pops up and user dismisses it.
On user confirmation power-on the phone.Otherwise,keep the
phone switched off.

CRs-fixed: 637275

Change-Id: I20250fa3a86bc51cfaa3bd8b26906755f2726556
WorldClock:The Next icon is not working when search city on World clock

The Next icon is not working when search city on World clock

Change the Next icon to Done icon, when tap the Done icon, hide the
SoftInput.

CRs-Fixed: 655251

Change-Id: I40944db97cbd285f70556c0afb4dab9498221b19
DeskClock: Avoid DeskClock layout displays abnormally on landscape.

- ConfigChanges property for DeskClock activity won't let the activity
recreate and re-layout when rotating the device.
- Delete the activity property. Meanwhile, when the activity recreate
it will reset music seletion source to be zero which lead to the music
picker uri null. Save and restore the seletion before re-createing.

Change-Id: If680f0b262231cf3b8b7186c9dbacea7c0d1574e
CRs-Fixed: 655098
DeskClock: Fix DeskClock crash when click dismiss clock

It is the NullPointerException which cause this crash happen

Add a condition to exclude the NullPointerException.

CRs-fixed: 650830

Change-Id: Id45a1ce757dc1876f56bd5d49ba5376760ec4cb8