Allow user to tap on lock icon from secure camera.

  bug:10857973

Change-Id: Id3c03f4d83c676986748ed083e85e85cea8eb507
diff --git a/src/com/android/camera/CameraActivity.java b/src/com/android/camera/CameraActivity.java
index 702de87..b18f4e9 100644
--- a/src/com/android/camera/CameraActivity.java
+++ b/src/com/android/camera/CameraActivity.java
@@ -795,10 +795,7 @@
         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 @@
             // 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 fc80c5c..d90110f 100644
--- a/src/com/android/camera/util/CameraUtil.java
+++ b/src/com/android/camera/util/CameraUtil.java
@@ -847,4 +847,21 @@
         }
         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;
+    }
 }