summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/util
diff options
context:
space:
mode:
authorAndy Huibers <andyhuibers@google.com>2015-02-05 02:43:42 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-02-05 02:43:43 +0000
commita6bddcf608dc387f64ab196163e5e313a82ef752 (patch)
treed3094e4b9225c426e44c98a9d307d84c5c9f29f4 /src/com/android/camera/util
parent054ccbf10949437349140f3285d33250e2e28136 (diff)
parent60d252d03fcd4a9dc22ea2ff292db563a83c5f6f (diff)
downloadandroid_packages_apps_Camera2-a6bddcf608dc387f64ab196163e5e313a82ef752.tar.gz
android_packages_apps_Camera2-a6bddcf608dc387f64ab196163e5e313a82ef752.tar.bz2
android_packages_apps_Camera2-a6bddcf608dc387f64ab196163e5e313a82ef752.zip
Merge "Use KeyguardManager.isKeyguardLocked() to fire double-onResume lock screen launch workaround. Previously we were only doing workaround for INTENT_ACTION_STILL_IMAGE_CAMERA_SECURE." into ub-camera-haleakala
Diffstat (limited to 'src/com/android/camera/util')
-rw-r--r--src/com/android/camera/util/QuickActivity.java22
1 files changed, 15 insertions, 7 deletions
diff --git a/src/com/android/camera/util/QuickActivity.java b/src/com/android/camera/util/QuickActivity.java
index 039d8fc9b..98a6bd8d9 100644
--- a/src/com/android/camera/util/QuickActivity.java
+++ b/src/com/android/camera/util/QuickActivity.java
@@ -17,12 +17,13 @@
package com.android.camera.util;
import android.app.Activity;
+import android.app.KeyguardManager;
+import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
-import android.provider.MediaStore;
-
import com.android.camera.debug.Log;
+import javax.annotation.Nullable;
/**
* Workaround for secure-lockscreen double-onResume() bug:
@@ -62,7 +63,9 @@ public abstract class QuickActivity extends Activity {
* call to onResume() should execute onResumeTasks() immediately.
*/
private boolean mCanceledResumeTasks = false;
-
+ /** Handle to Keyguard service. */
+ @Nullable
+ private KeyguardManager mKeyguardManager = null;
/**
* A runnable for deferring tasks to be performed in onResume() if starting
* from the lockscreen.
@@ -116,6 +119,8 @@ public abstract class QuickActivity extends Activity {
@Override
protected final void onResume() {
logLifecycle("onResume", true);
+ Log.v(TAG, "Intent Action = " + getIntent().getAction());
+
mMainHandler.removeCallbacks(mOnResumeTasks);
if (delayOnResumeOnStart() && !mCanceledResumeTasks) {
mMainHandler.postDelayed(mOnResumeTasks, ON_RESUME_DELAY_MILLIS);
@@ -177,10 +182,13 @@ public abstract class QuickActivity extends Activity {
}
private boolean delayOnResumeOnStart() {
- String action = getIntent().getAction();
- boolean isSecureLockscreenCamera =
- MediaStore.INTENT_ACTION_STILL_IMAGE_CAMERA_SECURE.equals(action);
- return isSecureLockscreenCamera;
+ if (mKeyguardManager == null) {
+ mKeyguardManager = (KeyguardManager) this.getSystemService(Context.KEYGUARD_SERVICE);
+ }
+ if (mKeyguardManager != null) {
+ return mKeyguardManager.isKeyguardLocked();
+ }
+ return false;
}
/**