diff options
author | Brian Colonna <bcolonna@google.com> | 2012-05-09 11:16:04 -0400 |
---|---|---|
committer | Brian Colonna <bcolonna@google.com> | 2012-05-09 11:16:04 -0400 |
commit | 22001c1f96984655f7205ecbc93dd982c47b4e97 (patch) | |
tree | b65f4d50267f3f0dfc01ba2d94b26e7a544eeb56 /policy | |
parent | feecf9d7869c87dfe11d594640d0c7ad2045d1fb (diff) | |
download | frameworks_base-22001c1f96984655f7205ecbc93dd982c47b4e97.zip frameworks_base-22001c1f96984655f7205ecbc93dd982c47b4e97.tar.gz frameworks_base-22001c1f96984655f7205ecbc93dd982c47b4e97.tar.bz2 |
Added checks to make sure FUL functions are on UI thread
There are three functions in FaceUnlock.java that have the requirement
that they are to be called on the UI thread. I added checks to log
an error if they are ever called off of the UI thread.
Change-Id: I581968e8138b7561b7ad75a1ac6945bf218e2bcf
Diffstat (limited to 'policy')
-rw-r--r-- | policy/src/com/android/internal/policy/impl/FaceUnlock.java | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/policy/src/com/android/internal/policy/impl/FaceUnlock.java b/policy/src/com/android/internal/policy/impl/FaceUnlock.java index 6e09b7f..6590fb3 100644 --- a/policy/src/com/android/internal/policy/impl/FaceUnlock.java +++ b/policy/src/com/android/internal/policy/impl/FaceUnlock.java @@ -28,6 +28,7 @@ import android.content.Intent; import android.content.ServiceConnection; import android.os.Handler; import android.os.IBinder; +import android.os.Looper; import android.os.Message; import android.os.RemoteException; import android.telephony.TelephonyManager; @@ -112,10 +113,14 @@ public class FaceUnlock implements BiometricSensorUnlock, Handler.Callback { /** * Sets the Face Unlock view to visible, hiding it after the specified amount of time. If - * timeoutMillis is 0, no hide is performed. + * timeoutMillis is 0, no hide is performed. Called on the UI thread. */ public void show(long timeoutMillis) { if (DEBUG) Log.d(TAG, "show()"); + if (mHandler.getLooper() != Looper.myLooper()) { + Log.e(TAG, "show() called off of the UI thread"); + } + removeDisplayMessages(); if (mFaceUnlockView != null) { mFaceUnlockView.setVisibility(View.VISIBLE); @@ -138,9 +143,14 @@ public class FaceUnlock implements BiometricSensorUnlock, Handler.Callback { /** * Binds to the Face Unlock service. Face Unlock will be started when the bind completes. The * Face Unlock view is displayed to hide the backup lock while the service is starting up. + * Called on the UI thread. */ public boolean start() { if (DEBUG) Log.d(TAG, "start()"); + if (mHandler.getLooper() != Looper.myLooper()) { + Log.e(TAG, "start() called off of the UI thread"); + } + if (mIsRunning) { Log.w(TAG, "start() called when already running"); } @@ -170,10 +180,14 @@ public class FaceUnlock implements BiometricSensorUnlock, Handler.Callback { } /** - * Stops Face Unlock and unbinds from the service. + * Stops Face Unlock and unbinds from the service. Called on the UI thread. */ public boolean stop() { if (DEBUG) Log.d(TAG, "stop()"); + if (mHandler.getLooper() != Looper.myLooper()) { + Log.e(TAG, "stop() called off of the UI thread"); + } + boolean mWasRunning = mIsRunning; stopUi(); |