enable market restore

Change-Id: I79067023cd1b3575bad14fae752049622d11c100
Fallback to fallbackring if ringtone can't be played.

If the specified ringtone file exists but cannot be played
the Ringtone will try to play the ringtone in a remote player.
But since the file is corrupt it will not be played in the
remote player either.
According to the documentation it should attempt to
fallback on another sound. This commit will do that.

Change-Id: I0216d61ca874eef0f168ad4d5bfb07491e01e654
LockScreen: Add option to start widgets maximized

Sources from AOKP with some modifications

This will allow the user to choose wether the lockscreen
challenge (circle, pattern, pin) is minimized when the screen
is turned on.

Patch Set 3: Remove visual jump and adhere to setting on initial inflate
Patch Set 4: Remove accidental dependency
Patch Set 5: Fix potential multi-user problem.

Signed-off-by: Dirk Rettschlag <dirk.rettschlag@gmail.com>
Change-Id: Ib5bd0a84e5542a49d34ed8c8541e10a7878a616c

Conflicts:
	core/java/android/provider/Settings.java
TIME_TICK was not occurred for one hour

TIME_TICK was not occurred at the end of DST for one hour

Step to reproduce:
1. Settings -> Date & time
2. uncheck Automatic date & time and Automatic time zone
3. select Time zone -> select Brussels
4. set date -> Oct. 28. 2012
5. set time -> 1:59 AM

Bug: 7922117
Change-Id: I2e78bd97b508d6a38471425cfbaca45fb4b89c1e
Handle nested folder case

Change-Id: Id6d6a5899e8255d18192adbc766d8d9a0e6825d0
Signed-off-by: Roger Chen <cxr514033970@gmail.com>
Use most specific attributes for distinguished name display

Bug: 7894348
Bug: http://code.google.com/p/android/issues/detail?id=41662
Change-Id: I8048a53b8a9a17b384f12b6a4f40071bb3dd3e04
Set "isdrm" info in Mediastore

The mediascanner member mIsDrm was never set
according to the drmframework canHandle call.
This subsequently caused that the isdrm column
in mediastore was never set, and was defaulted
to false for all files.
mIsDrm is now set according to drmframework
canHandle result for each files that is scanned.

Change-Id: Id557d921c4e3e3dfc35da56b69471f4bd6b3c8bf
Handle errors from AudioEffect::queryNumberEffects

There may be cases where queryNumberEffects fails leading
to the usage of the uninitialized numEffects.

Change-Id: If6d46987021ff6f0c9a2123d8714ff5fdf9ced45
A tiny optimalization

Change-Id: Ib2cb773ffe5cb579c2b46bd0e6a5a3f2c55d190d
Wi-Fi: Ping the driver for wifi-only devices

Wifi-only devices are not capable to find APs with hidden SSID unless a DRIVER COUNTRY command
will send to wifi driver. This change has:

- Send DRIVER COUNTRY command to ping the driver (to correct the seek of hiddens SSIDs)
- Save mCountryCode as uppercase because the wifi_countrycode_values array is in uppercase.
  Otherwise the preference will not be found.

Patchset 7: Rebase
            Do not set mCountryCode if country is null

Change-Id: Ie0f838aef07eaf683b713f7f0e46ff3c751523ab
Fix the spelling of "retrieves"

Change-Id: I33360c573a6ca7b88d0cac834caad547d66b0b2a
Add config_speed_up_audio_on_mt_calls option

Bug: 7612431
Change-Id: Ia2758f81b78a2576df8dd23c700dba3eaaef8efc

Conflicts:
	core/res/res/values/config.xml
0,90,180,270 degree rotation. Thx Cm team. (1/2)
Option to adjust navbar glow animation duration (1/2) Thx Rick C
Fix autorotation sensor loop being reactivated even when off

The sensor loop was reactivated even if turned off after a wake up
=> consider it disabled also if !mEnabled
+ turn debug mode on in case there's another issue.

Since the current autorotation sensor loop is generating 3-4% cpu eating,
we really need a way to turn it off for good for the moment.
System_server now seems to stay at 0.0% cpu with this change & autorotation off on TF101

Change-Id: I5ed3c95809f6d789222819466dacc625ac2d9f1d
Decrease lag generated by autorotation on

There are different issues from what I understand:

1) Discarding of events too close to each others is broken
as mAccelerationTimestampNanos is conditionned by isAccelerating()
on TF101 no events are discarded anymore, and so it creates an update every ~50ms
filing up the android notification message queue quite a bit for nothing and so generating lag.
2) isAccelerating seems incorrect to me too, the code means more that it's accelerating "out of range" and should be discarded in that case.

=> Discard the sample if outOfRange and don't condition the update of mAccelerationTimestampNanos that way next time we come back "too soon"
the sample will be properly discarded.

3) with events being discarded properly on the WindowOrientationListener
the SensorManager can now update every 20ms instead of 50ms
but that is definitely overkill.
=> add SystemProperty sensor.loop.minms with a default value of 50ms to throttle the notifications.
That way the thread sleeps properly instead of sending events as fast as it can.

(increasing up to 100ms can be ok depending if you want faster response or not.)
This can be positionned on a per device prop too.

4) Add 2 SystemProperties:
one on the SystemSensor side: sensor.magnitude.threshold with a default 0 value(doesn't change the behavior)
one on the WindowOrientationListener: orientation.magnitude.threshold with a 200 (0.2G) default value
These allows to discard the sample if it is too close to STANDARD_GRAVITY (ie not accelerating much)
These can be set on a per device or use the default values.
On the TF101 200 works most of the time. But weirdly when docked the reported gravity seems to have an additionnal offsert of -0.2
maybe some magnetic interference from the dock...

For the moment the 0.2G threshold is positionned on the Orientation code.
Once the cpp sensor poll crazy loop is solved it could be better to use the sensor.magnitude.threshold instead.

That should take care of most of the lag generated by autorotation.

PatchSet2: position default SystemProperties values to do nothing.

Change-Id: I093227f539050a6bad8e6e8d9f533eff7bddd0d6
avoid crashing system serer process

Context#unregisterReceiver will throw IllegalArgumentException
if the receiver has already unregistered.

In GlobalAction class, when SilentModeAction is changed, it will
close the dialog with some delay. So there is a possibility
that it would unregistere again for the same receiver if a user
changes slient mode againand again. System must not crash in such
a case.

Change-Id: I33662feb48a770d39a8413901ec77ac1acd16bc7
Free resources in correct order in ResStringPool::uninit

mOwnedData contains the mHeader data structure

Change-Id: I0ae9ba3a0d18fc3f368c629501fadebce8807198
Re-read shortcut labels if the language has changed

The shortcut label isn't updated to the current language
if the phone's language has changed.

The problem was that the shortcut label is stored in a
static variable which is set once and kept throughout the
life time of the process.

Change-Id: I89c5875fbf28fb82e073166c472ca205d28674fb
Fixed typo and space.

Signed-off-by: Yoshihiko Ikenaga <yoshihiko.ikenaga@jp.sony.com>