diff options
author | I-Jong Lin <ijonglin@google.com> | 2014-10-16 16:13:24 -0700 |
---|---|---|
committer | I-Jong Lin <ijonglin@google.com> | 2014-10-20 12:07:58 -0700 |
commit | 718c43d79bd080ccacc8eb962637c51811616fda (patch) | |
tree | d6b4c9bf03ee352c61db35795779581532621921 /src | |
parent | e9dedb39b240e87e854918d544de66820b41700c (diff) | |
download | android_packages_apps_Camera2-718c43d79bd080ccacc8eb962637c51811616fda.tar.gz android_packages_apps_Camera2-718c43d79bd080ccacc8eb962637c51811616fda.tar.bz2 android_packages_apps_Camera2-718c43d79bd080ccacc8eb962637c51811616fda.zip |
Secure Camera App survives phone unlock screen
Bug: 17883828
There is UI path to start the secure camera app from the lock
screen, and then unlock the phone and find the secure camera
app on the task manager.
This live instance of secure camera app is confusing to the
user who is expecting to interact with a full camera app.
This fix kills the secure camera app when the phone is unlocked
and ensures that the user cannot easily restart the secure
camera app from the currently running tasks in task manager.
Change-Id: Ia6a6d077c460e66807d4be9836fe192184aa8eaf
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/camera/CameraActivity.java | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/src/com/android/camera/CameraActivity.java b/src/com/android/camera/CameraActivity.java index d05248a56..d9e1df29f 100644 --- a/src/com/android/camera/CameraActivity.java +++ b/src/com/android/camera/CameraActivity.java @@ -280,8 +280,8 @@ public class CameraActivity extends QuickActivity return mModuleManager; } - // close activity when screen turns off - private final BroadcastReceiver mScreenOffReceiver = new BroadcastReceiver() { + // close activity when secure app passes lock screen or screen turns off + private final BroadcastReceiver mShutdownReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { finish(); @@ -1440,10 +1440,17 @@ public class CameraActivity extends QuickActivity win.setAttributes(params); // Filter for screen off so that we can finish secure camera - // activity - // when screen is off. - IntentFilter filter = new IntentFilter(Intent.ACTION_SCREEN_OFF); - registerReceiver(mScreenOffReceiver, filter); + // activity when screen is off. + IntentFilter filter_screen_off = new IntentFilter(Intent.ACTION_SCREEN_OFF); + registerReceiver(mShutdownReceiver, filter_screen_off); + + // Filter for phone unlock so that we can finish secure camera + // via this UI path: + // 1. from secure lock screen, user starts secure camera + // 2. user presses home button + // 3. user unlocks phone + IntentFilter filter_user_unlock = new IntentFilter(Intent.ACTION_USER_PRESENT); + registerReceiver(mShutdownReceiver, filter_user_unlock); } mCameraAppUI = new CameraAppUI(this, (MainActivityLayout) findViewById(R.id.activity_root_view), isCaptureIntent()); @@ -1894,7 +1901,7 @@ public class CameraActivity extends QuickActivity @Override public void onDestroyTasks() { if (mSecureCamera) { - unregisterReceiver(mScreenOffReceiver); + unregisterReceiver(mShutdownReceiver); } mActionBar.removeOnMenuVisibilityListener(mOnMenuVisibilityListener); mSettingsManager.removeAllListeners(); |