Fix fingerprint for multiuser

Change-Id: Iab18c4de9764da1a65490b186b33535f8e79e1e5
diff --git a/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java b/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java
index d13d71c..0795f65 100644
--- a/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java
+++ b/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java
@@ -102,7 +102,6 @@
     private static final int MSG_SIM_STATE_CHANGE = 304;
     private static final int MSG_RINGER_MODE_CHANGED = 305;
     private static final int MSG_PHONE_STATE_CHANGED = 306;
-    private static final int MSG_CLOCK_VISIBILITY_CHANGED = 307;
     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;
@@ -174,9 +173,6 @@
                 case MSG_PHONE_STATE_CHANGED:
                     handlePhoneStateChanged((String) msg.obj);
                     break;
-                case MSG_CLOCK_VISIBILITY_CHANGED:
-                    handleClockVisibilityChanged();
-                    break;
                 case MSG_DEVICE_PROVISIONED:
                     handleDeviceProvisioned();
                     break;
@@ -764,15 +760,11 @@
                         public void onUserSwitching(int newUserId, IRemoteCallback reply) {
                             mHandler.sendMessage(mHandler.obtainMessage(MSG_USER_SWITCHING,
                                     newUserId, 0, reply));
-                            mSwitchingUser = true;
-                            updateFingerprintListeningState();
                         }
                         @Override
                         public void onUserSwitchComplete(int newUserId) throws RemoteException {
                             mHandler.sendMessage(mHandler.obtainMessage(MSG_USER_SWITCH_COMPLETE,
                                     newUserId, 0));
-                            mSwitchingUser = false;
-                            updateFingerprintListeningState();
                         }
                         @Override
                         public void onForegroundProfileSwitch(int newProfileId) {
@@ -877,6 +869,9 @@
      * Handle {@link #MSG_USER_SWITCHING}
      */
     protected void handleUserSwitching(int userId, IRemoteCallback reply) {
+        mSwitchingUser = true;
+        updateFingerprintListeningState();
+
         for (int i = 0; i < mCallbacks.size(); i++) {
             KeyguardUpdateMonitorCallback cb = mCallbacks.get(i).get();
             if (cb != null) {
@@ -893,6 +888,9 @@
      * Handle {@link #MSG_USER_SWITCH_COMPLETE}
      */
     protected void handleUserSwitchComplete(int userId) {
+        mSwitchingUser = false;
+        updateFingerprintListeningState();
+
         for (int i = 0; i < mCallbacks.size(); i++) {
             KeyguardUpdateMonitorCallback cb = mCallbacks.get(i).get();
             if (cb != null) {
@@ -1052,19 +1050,6 @@
     }
 
     /**
-     * Handle {@link #MSG_CLOCK_VISIBILITY_CHANGED}
-     */
-    private void handleClockVisibilityChanged() {
-        if (DEBUG) Log.d(TAG, "handleClockVisibilityChanged()");
-        for (int i = 0; i < mCallbacks.size(); i++) {
-            KeyguardUpdateMonitorCallback cb = mCallbacks.get(i).get();
-            if (cb != null) {
-                cb.onClockVisibilityChanged();
-            }
-        }
-    }
-
-    /**
      * Handle {@link #MSG_KEYGUARD_VISIBILITY_CHANGED}
      */
     private void handleKeyguardVisibilityChanged(int showing) {
@@ -1108,21 +1093,6 @@
         }
     }
 
-    public boolean isKeyguardVisible() {
-        return mKeyguardIsVisible;
-    }
-
-    /**
-     * @return if the keyguard is currently in bouncer mode.
-     */
-    public boolean isKeyguardBouncer() {
-        return mBouncer;
-    }
-
-    public boolean isSwitchingUser() {
-        return mSwitchingUser;
-    }
-
     private static boolean isBatteryUpdateInteresting(BatteryStatus old, BatteryStatus current) {
         final boolean nowPluggedIn = current.isPluggedIn();
         final boolean wasPluggedIn = old.isPluggedIn();
@@ -1148,13 +1118,6 @@
     }
 
     /**
-     * @return The default plmn (no service)
-     */
-    private CharSequence getDefaultPlmn() {
-        return mContext.getResources().getText(R.string.keyguard_carrier_default);
-    }
-
-    /**
      * Remove the given observer's callback.
      *
      * @param callback The callback to remove
@@ -1219,11 +1182,6 @@
         message.sendToTarget();
     }
 
-    public void reportClockVisible(boolean visible) {
-        mClockVisible = visible;
-        mHandler.obtainMessage(MSG_CLOCK_VISIBILITY_CHANGED).sendToTarget();
-    }
-
     /**
      * Report that the user successfully entered the SIM PIN or PUK/SIM PIN so we
      * have the information earlier than waiting for the intent