diff options
| author | Adrian Roos <roosa@google.com> | 2015-06-02 21:05:21 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-06-02 21:05:22 +0000 |
| commit | 579e7b7b9ac9f9fed052c63a462b49b16baffc16 (patch) | |
| tree | 8e4d207d19e0e64a2df3103884faeb39905080a0 | |
| parent | b36ad5dc6bb6218aeabca17197001ac0a942219a (diff) | |
| parent | 328472ebd8f9c139fef1ad859ed4f7b43b3f86c6 (diff) | |
| download | frameworks_base-579e7b7b9ac9f9fed052c63a462b49b16baffc16.zip frameworks_base-579e7b7b9ac9f9fed052c63a462b49b16baffc16.tar.gz frameworks_base-579e7b7b9ac9f9fed052c63a462b49b16baffc16.tar.bz2 | |
Merge "Patches for IKeyguardStateCallback" into mnc-dev
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java | 45 |
1 files changed, 28 insertions, 17 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java index bc42105..0dcc0b9 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java +++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java @@ -33,6 +33,7 @@ import android.content.pm.UserInfo; import android.media.AudioManager; import android.media.SoundPool; import android.os.Bundle; +import android.os.DeadObjectException; import android.os.Handler; import android.os.Looper; import android.os.Message; @@ -381,14 +382,17 @@ public class KeyguardViewMediator extends SystemUI { + ",state=" + simState + ")"); } - try { - int size = mKeyguardStateCallbacks.size(); - boolean simPinSecure = mUpdateMonitor.isSimPinSecure(); - for (int i = 0; i < size; i++) { + int size = mKeyguardStateCallbacks.size(); + boolean simPinSecure = mUpdateMonitor.isSimPinSecure(); + for (int i = size - 1; i >= 0; i--) { + try { mKeyguardStateCallbacks.get(i).onSimSecureStateChanged(simPinSecure); + } catch (RemoteException e) { + Slog.w(TAG, "Failed to call onSimSecureStateChanged", e); + if (e instanceof DeadObjectException) { + mKeyguardStateCallbacks.remove(i); + } } - } catch (RemoteException e) { - Slog.w(TAG, "Failed to call onSimSecureStateChanged", e); } switch (simState) { @@ -551,6 +555,7 @@ public class KeyguardViewMediator extends SystemUI { // Assume keyguard is showing (unless it's disabled) until we know for sure... setShowingLocked(!shouldWaitForProvisioning() && !mLockPatternUtils.isLockScreenDisabled( KeyguardUpdateMonitor.getCurrentUser())); + updateInputRestrictedLocked(); mTrustManager.reportKeyguardShowingChanged(); mStatusBarKeyguardViewManager = new StatusBarKeyguardViewManager(mContext, @@ -954,13 +959,16 @@ public class KeyguardViewMediator extends SystemUI { boolean inputRestricted = isInputRestricted(); if (mInputRestricted != inputRestricted) { mInputRestricted = inputRestricted; - try { - int size = mKeyguardStateCallbacks.size(); - for (int i = 0; i < size; i++) { + int size = mKeyguardStateCallbacks.size(); + for (int i = size - 1; i >= 0; i--) { + try { mKeyguardStateCallbacks.get(i).onInputRestrictedStateChanged(inputRestricted); + } catch (RemoteException e) { + Slog.w(TAG, "Failed to call onDeviceProvisioned", e); + if (e instanceof DeadObjectException) { + mKeyguardStateCallbacks.remove(i); + } } - } catch (RemoteException e) { - Slog.w(TAG, "Failed to call onDeviceProvisioned", e); } } } @@ -1544,13 +1552,16 @@ public class KeyguardViewMediator extends SystemUI { private void setShowingLocked(boolean showing) { if (showing != mShowing) { mShowing = showing; - try { - int size = mKeyguardStateCallbacks.size(); - for (int i = 0; i < size; i++) { + int size = mKeyguardStateCallbacks.size(); + for (int i = size - 1; i >= 0; i--) { + try { mKeyguardStateCallbacks.get(i).onShowingStateChanged(showing); + } catch (RemoteException e) { + Slog.w(TAG, "Failed to call onShowingStateChanged", e); + if (e instanceof DeadObjectException) { + mKeyguardStateCallbacks.remove(i); + } } - } catch (RemoteException e) { - Slog.w(TAG, "Failed to call onShowingStateChanged", e); } updateInputRestrictedLocked(); mTrustManager.reportKeyguardShowingChanged(); @@ -1565,7 +1576,7 @@ public class KeyguardViewMediator extends SystemUI { callback.onShowingStateChanged(mShowing); callback.onInputRestrictedStateChanged(mInputRestricted); } catch (RemoteException e) { - Slog.w(TAG, "Failed to call onShowingStateChanged or onSimSecureStateChanged", e); + Slog.w(TAG, "Failed to call onShowingStateChanged or onSimSecureStateChanged or onInputRestrictedStateChanged", e); } } } |
