Merge "Move "mVold.onSecureKeyguardStateChanged" to handler thread"
This commit is contained in:
@@ -732,6 +732,7 @@ class StorageManagerService extends IStorageManager.Stub
|
|||||||
private static final int H_COMPLETE_UNLOCK_USER = 14;
|
private static final int H_COMPLETE_UNLOCK_USER = 14;
|
||||||
private static final int H_VOLUME_STATE_CHANGED = 15;
|
private static final int H_VOLUME_STATE_CHANGED = 15;
|
||||||
private static final int H_CLOUD_MEDIA_PROVIDER_CHANGED = 16;
|
private static final int H_CLOUD_MEDIA_PROVIDER_CHANGED = 16;
|
||||||
|
private static final int H_SECURE_KEYGUARD_STATE_CHANGED = 17;
|
||||||
|
|
||||||
class StorageManagerServiceHandler extends Handler {
|
class StorageManagerServiceHandler extends Handler {
|
||||||
public StorageManagerServiceHandler(Looper looper) {
|
public StorageManagerServiceHandler(Looper looper) {
|
||||||
@@ -871,6 +872,14 @@ class StorageManagerService extends IStorageManager.Stub
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case H_SECURE_KEYGUARD_STATE_CHANGED: {
|
||||||
|
try {
|
||||||
|
mVold.onSecureKeyguardStateChanged((boolean) msg.obj);
|
||||||
|
} catch (Exception e) {
|
||||||
|
Slog.wtf(TAG, e);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1330,12 +1339,12 @@ class StorageManagerService extends IStorageManager.Stub
|
|||||||
public void onKeyguardStateChanged(boolean isShowing) {
|
public void onKeyguardStateChanged(boolean isShowing) {
|
||||||
// Push down current secure keyguard status so that we ignore malicious
|
// Push down current secure keyguard status so that we ignore malicious
|
||||||
// USB devices while locked.
|
// USB devices while locked.
|
||||||
mSecureKeyguardShowing = isShowing
|
boolean isSecureKeyguardShowing = isShowing
|
||||||
&& mContext.getSystemService(KeyguardManager.class).isDeviceSecure(mCurrentUserId);
|
&& mContext.getSystemService(KeyguardManager.class).isDeviceSecure(mCurrentUserId);
|
||||||
try {
|
if (mSecureKeyguardShowing != isSecureKeyguardShowing) {
|
||||||
mVold.onSecureKeyguardStateChanged(mSecureKeyguardShowing);
|
mSecureKeyguardShowing = isSecureKeyguardShowing;
|
||||||
} catch (Exception e) {
|
mHandler.obtainMessage(H_SECURE_KEYGUARD_STATE_CHANGED, mSecureKeyguardShowing)
|
||||||
Slog.wtf(TAG, e);
|
.sendToTarget();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user