summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorWu-cheng Li <wuchengli@google.com>2012-11-02 13:36:07 +0800
committerWu-cheng Li <wuchengli@google.com>2012-11-02 14:12:08 +0800
commitd270653e91ff15d552d6c94b143e32a70f9610f1 (patch)
tree541576e9bb2d3f0ce1654515f960d1ee989a5fef /src
parent2e13c999e8f63296e643e9a921950f3b964b3eff (diff)
downloadandroid_packages_apps_Snap-d270653e91ff15d552d6c94b143e32a70f9610f1.tar.gz
android_packages_apps_Snap-d270653e91ff15d552d6c94b143e32a70f9610f1.tar.bz2
android_packages_apps_Snap-d270653e91ff15d552d6c94b143e32a70f9610f1.zip
Lock icon in secure album should redirect to gallery after unlock.
Use FLAG_DISMISS_KEYGUARD so lock screen will be brought up when launching gallery. bug:7462572 Change-Id: I345398cc6cfc09901e1ce8309ebdb65cf15088e0
Diffstat (limited to 'src')
-rw-r--r--src/com/android/gallery3d/app/Gallery.java7
-rw-r--r--src/com/android/gallery3d/app/PhotoPage.java4
2 files changed, 10 insertions, 1 deletions
diff --git a/src/com/android/gallery3d/app/Gallery.java b/src/com/android/gallery3d/app/Gallery.java
index 78fedd838..e28404fac 100644
--- a/src/com/android/gallery3d/app/Gallery.java
+++ b/src/com/android/gallery3d/app/Gallery.java
@@ -27,6 +27,7 @@ import android.net.Uri;
import android.os.Bundle;
import android.provider.OpenableColumns;
import android.view.Window;
+import android.view.WindowManager;
import android.widget.Toast;
import com.android.gallery3d.R;
@@ -48,6 +49,7 @@ public final class Gallery extends AbstractGalleryActivity implements OnCancelLi
public static final String KEY_GET_ALBUM = "get-album";
public static final String KEY_TYPE_BITS = "type-bits";
public static final String KEY_MEDIA_TYPES = "mediaTypes";
+ public static final String KEY_DISMISS_KEYGUARD = "dismiss-keyguard";
private static final String TAG = "Gallery";
private Dialog mVersionCheckDialog;
@@ -58,6 +60,11 @@ public final class Gallery extends AbstractGalleryActivity implements OnCancelLi
requestWindowFeature(Window.FEATURE_ACTION_BAR);
requestWindowFeature(Window.FEATURE_ACTION_BAR_OVERLAY);
+ if (getIntent().getBooleanExtra(KEY_DISMISS_KEYGUARD, false)) {
+ getWindow().addFlags(
+ WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD);
+ }
+
setContentView(R.layout.main);
if (savedInstanceState != null) {
diff --git a/src/com/android/gallery3d/app/PhotoPage.java b/src/com/android/gallery3d/app/PhotoPage.java
index a48db37d8..41c86afc8 100644
--- a/src/com/android/gallery3d/app/PhotoPage.java
+++ b/src/com/android/gallery3d/app/PhotoPage.java
@@ -1159,7 +1159,9 @@ public class PhotoPage extends ActivityState implements
} else if (goBack) {
onBackPressed();
} else if (unlock) {
- mActivity.getStateManager().finishState(this);
+ Intent intent = new Intent(mActivity, Gallery.class);
+ intent.putExtra(Gallery.KEY_DISMISS_KEYGUARD, true);
+ mActivity.startActivity(intent);
} else if (launchCamera) {
launchCamera();
} else {