am cbc52b7b: Merge change Iee638412 into eclair
Merge commit 'cbc52b7bcbea7dc6ae3b7cfc84fd44ae86711910' into eclair-mr2 * commit 'cbc52b7bcbea7dc6ae3b7cfc84fd44ae86711910': Fix issue #2161726: Car dock app bypasses setup wizard
This commit is contained in:
@@ -26,6 +26,7 @@ import android.os.Handler;
|
|||||||
import android.os.Message;
|
import android.os.Message;
|
||||||
import android.os.SystemClock;
|
import android.os.SystemClock;
|
||||||
import android.os.UEventObserver;
|
import android.os.UEventObserver;
|
||||||
|
import android.provider.Settings;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
import com.android.internal.widget.LockPatternUtils;
|
import com.android.internal.widget.LockPatternUtils;
|
||||||
@@ -154,26 +155,16 @@ class DockObserver extends UEventObserver {
|
|||||||
mHandler.sendEmptyMessage(0);
|
mHandler.sendEmptyMessage(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
private final void updateKeyguardLocked() {
|
|
||||||
if (!mLockPatternUtils.isLockPatternEnabled()) {
|
|
||||||
if (!mKeyguardDisabled && mDockState != Intent.EXTRA_DOCK_STATE_UNDOCKED) {
|
|
||||||
Log.d(TAG, "calling mKeyguardLock.disableKeyguard");
|
|
||||||
mKeyguardLock.disableKeyguard();
|
|
||||||
mKeyguardDisabled = true;
|
|
||||||
} else if (mKeyguardDisabled && mDockState == Intent.EXTRA_DOCK_STATE_UNDOCKED) {
|
|
||||||
Log.d(TAG, "calling mKeyguardLock.reenableKeyguard");
|
|
||||||
mKeyguardLock.reenableKeyguard();
|
|
||||||
mKeyguardDisabled = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private final Handler mHandler = new Handler() {
|
private final Handler mHandler = new Handler() {
|
||||||
@Override
|
@Override
|
||||||
public void handleMessage(Message msg) {
|
public void handleMessage(Message msg) {
|
||||||
synchronized (this) {
|
synchronized (this) {
|
||||||
updateKeyguardLocked();
|
Log.i(TAG, "Dock state changed: " + mDockState);
|
||||||
Log.d(TAG, "Broadcasting dock state " + mDockState);
|
if (Settings.Secure.getInt(mContext.getContentResolver(),
|
||||||
|
Settings.Secure.DEVICE_PROVISIONED, 0) == 0) {
|
||||||
|
Log.i(TAG, "Device not provisioned, skipping dock broadcast");
|
||||||
|
return;
|
||||||
|
}
|
||||||
// Pack up the values and broadcast them to everyone
|
// Pack up the values and broadcast them to everyone
|
||||||
mPowerManager.userActivityWithForce(SystemClock.uptimeMillis(), false, true);
|
mPowerManager.userActivityWithForce(SystemClock.uptimeMillis(), false, true);
|
||||||
Intent intent = new Intent(Intent.ACTION_DOCK_EVENT);
|
Intent intent = new Intent(Intent.ACTION_DOCK_EVENT);
|
||||||
|
|||||||
Reference in New Issue
Block a user