Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8b1496df authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Move "mVold.onSecureKeyguardStateChanged" to handler thread" am: f552cf82 am: 6975b68d

parents 4db1d7ea 6975b68d
Loading
Loading
Loading
Loading
+14 −5
Original line number Diff line number Diff line
@@ -732,6 +732,7 @@ class StorageManagerService extends IStorageManager.Stub
    private static final int H_COMPLETE_UNLOCK_USER = 14;
    private static final int H_VOLUME_STATE_CHANGED = 15;
    private static final int H_CLOUD_MEDIA_PROVIDER_CHANGED = 16;
    private static final int H_SECURE_KEYGUARD_STATE_CHANGED = 17;

    class StorageManagerServiceHandler extends Handler {
        public StorageManagerServiceHandler(Looper looper) {
@@ -871,6 +872,14 @@ class StorageManagerService extends IStorageManager.Stub
                    }
                    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) {
        // Push down current secure keyguard status so that we ignore malicious
        // USB devices while locked.
        mSecureKeyguardShowing = isShowing
        boolean isSecureKeyguardShowing = isShowing
                && mContext.getSystemService(KeyguardManager.class).isDeviceSecure(mCurrentUserId);
        try {
            mVold.onSecureKeyguardStateChanged(mSecureKeyguardShowing);
        } catch (Exception e) {
            Slog.wtf(TAG, e);
        if (mSecureKeyguardShowing != isSecureKeyguardShowing) {
            mSecureKeyguardShowing = isSecureKeyguardShowing;
            mHandler.obtainMessage(H_SECURE_KEYGUARD_STATE_CHANGED, mSecureKeyguardShowing)
                    .sendToTarget();
        }
    }