diff options
author | Angus Kong <shkong@google.com> | 2013-09-21 14:48:51 -0700 |
---|---|---|
committer | Angus Kong <shkong@google.com> | 2013-09-23 20:58:54 -0700 |
commit | 690dc4722d068a1838b16dc0eabe9c7d518d524c (patch) | |
tree | d28117062fc917811697de8d4cf4b6404671985a /src/com/android | |
parent | 283beaf677d0c3235fbb22bfd5cd8338459bed1b (diff) | |
download | android_packages_apps_Snap-690dc4722d068a1838b16dc0eabe9c7d518d524c.tar.gz android_packages_apps_Snap-690dc4722d068a1838b16dc0eabe9c7d518d524c.tar.bz2 android_packages_apps_Snap-690dc4722d068a1838b16dc0eabe9c7d518d524c.zip |
Allow user to tap on lock icon from secure camera.
bug:10857973
Change-Id: Id3c03f4d83c676986748ed083e85e85cea8eb507
Diffstat (limited to 'src/com/android')
-rw-r--r-- | src/com/android/camera/CameraActivity.java | 12 | ||||
-rw-r--r-- | src/com/android/camera/util/CameraUtil.java | 17 |
2 files changed, 25 insertions, 4 deletions
diff --git a/src/com/android/camera/CameraActivity.java b/src/com/android/camera/CameraActivity.java index 702de876d..b18f4e993 100644 --- a/src/com/android/camera/CameraActivity.java +++ b/src/com/android/camera/CameraActivity.java @@ -795,10 +795,7 @@ public class CameraActivity extends Activity switch (item.getItemId()) { case android.R.id.home: // ActionBar's Up/Home button was clicked - if (ApiHelper.HAS_APP_GALLERY) { - startActivity(Intent.makeMainSelectorActivity( - Intent.ACTION_MAIN, Intent.CATEGORY_APP_GALLERY)); - } else { + if (!CameraUtil.launchGallery(CameraActivity.this)) { mFilmStripView.getController().goToFirstItem(); } return true; @@ -986,6 +983,13 @@ public class CameraActivity extends Activity // 0. ImageView v = (ImageView) getLayoutInflater().inflate( R.layout.secure_album_placeholder, null); + v.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + CameraUtil.launchGallery(CameraActivity.this); + finish(); + } + }); mDataAdapter = new FixedLastDataAdapter( mWrappedDataAdapter, new SimpleViewData( diff --git a/src/com/android/camera/util/CameraUtil.java b/src/com/android/camera/util/CameraUtil.java index fc80c5c3e..d90110f9f 100644 --- a/src/com/android/camera/util/CameraUtil.java +++ b/src/com/android/camera/util/CameraUtil.java @@ -847,4 +847,21 @@ public class CameraUtil { } return ret; } + + /** + * Launches apps supporting action {@link Intent.ACTION_MAIN} of category + * {@link Intent.CATEGORY_APP_GALLERY}. Note that + * {@link Intent.CATEGORY_APP_GALLERY} is only available on API level 15+. + * + * @param ctx The {@link android.content.Context} to launch the app. + * @return {@code true} on success. + */ + public static boolean launchGallery(Context ctx) { + if (ApiHelper.HAS_APP_GALLERY) { + ctx.startActivity(Intent.makeMainSelectorActivity( + Intent.ACTION_MAIN, Intent.CATEGORY_APP_GALLERY)); + return true; + } + return false; + } } |