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

Commit db0f76e1 authored by Adrian Roos's avatar Adrian Roos
Browse files

Directly dispatch USER_REMOVED to LockSettingsService

Bug: 18931518
Change-Id: Ibaf875a06868ae3196115d77eed6874daf2fec16
parent 230635ef
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -31,5 +31,4 @@ interface ILockSettings {
    boolean checkVoldPassword(int userId);
    boolean havePattern(int userId);
    boolean havePassword(int userId);
    void removeUser(int userId);
}
+0 −8
Original line number Diff line number Diff line
@@ -267,14 +267,6 @@ public class LockPatternUtils {
        }
    }

    public void removeUser(int userId) {
        try {
            getLockSettings().removeUser(userId);
        } catch (RemoteException re) {
            Log.e(TAG, "Couldn't remove lock settings for user " + userId);
        }
    }

    private int getCurrentOrCallingUserId() {
        if (mMultiUserMode) {
            // TODO: This is a little inefficient. See if all users of this are able to
+0 −22
Original line number Diff line number Diff line
@@ -103,12 +103,9 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
    private static final int MSG_DEVICE_PROVISIONED = 308;
    private static final int MSG_DPM_STATE_CHANGED = 309;
    private static final int MSG_USER_SWITCHING = 310;
    private static final int MSG_USER_REMOVED = 311;
    private static final int MSG_KEYGUARD_VISIBILITY_CHANGED = 312;
    private static final int MSG_BOOT_COMPLETED = 313;
    private static final int MSG_USER_SWITCH_COMPLETE = 314;
    private static final int MSG_SET_CURRENT_CLIENT_ID = 315;
    private static final int MSG_SET_PLAYBACK_STATE = 316;
    private static final int MSG_USER_INFO_CHANGED = 317;
    private static final int MSG_REPORT_EMERGENCY_CALL_ACTION = 318;
    private static final int MSG_SCREEN_TURNED_ON = 319;
@@ -185,9 +182,6 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
                case MSG_USER_SWITCH_COMPLETE:
                    handleUserSwitchComplete(msg.arg1);
                    break;
                case MSG_USER_REMOVED:
                    handleUserRemoved(msg.arg1);
                    break;
                case MSG_KEYGUARD_VISIBILITY_CHANGED:
                    handleKeyguardVisibilityChanged(msg.arg1);
                    break;
@@ -449,9 +443,6 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
            } else if (TelephonyManager.ACTION_PHONE_STATE_CHANGED.equals(action)) {
                String state = intent.getStringExtra(TelephonyManager.EXTRA_STATE);
                mHandler.sendMessage(mHandler.obtainMessage(MSG_PHONE_STATE_CHANGED, state));
            } else if (Intent.ACTION_USER_REMOVED.equals(action)) {
                mHandler.sendMessage(mHandler.obtainMessage(MSG_USER_REMOVED,
                       intent.getIntExtra(Intent.EXTRA_USER_HANDLE, 0), 0));
            } else if (Intent.ACTION_BOOT_COMPLETED.equals(action)) {
                dispatchBootCompleted();
            }
@@ -679,7 +670,6 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
        filter.addAction(TelephonyIntents.ACTION_SIM_STATE_CHANGED);
        filter.addAction(TelephonyManager.ACTION_PHONE_STATE_CHANGED);
        filter.addAction(AudioManager.RINGER_MODE_CHANGED_ACTION);
        filter.addAction(Intent.ACTION_USER_REMOVED);
        context.registerReceiver(mBroadcastReceiver, filter);

        final IntentFilter bootCompleteFilter = new IntentFilter();
@@ -831,18 +821,6 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
        return mBootCompleted;
    }

    /**
     * Handle {@link #MSG_USER_REMOVED}
     */
    protected void handleUserRemoved(int userId) {
        for (int i = 0; i < mCallbacks.size(); i++) {
            KeyguardUpdateMonitorCallback cb = mCallbacks.get(i).get();
            if (cb != null) {
                cb.onUserRemoved(userId);
            }
        }
    }

    /**
     * Handle {@link #MSG_DEVICE_PROVISIONED}
     */
+0 −5
Original line number Diff line number Diff line
@@ -122,11 +122,6 @@ public class KeyguardUpdateMonitorCallback {
     */
    public void onSimStateChanged(int subId, int slotId, IccCardConstants.State simState) { }

    /**
     * Called when a user is removed.
     */
    public void onUserRemoved(int userId) { }

    /**
     * Called when the user's info changed.
     */
+0 −5
Original line number Diff line number Diff line
@@ -328,11 +328,6 @@ public class KeyguardViewMediator extends SystemUI {
            }
        }

        @Override
        public void onUserRemoved(int userId) {
            mLockPatternUtils.removeUser(userId);
        }

        @Override
        public void onUserInfoChanged(int userId) {
        }
Loading