diff options
Diffstat (limited to 'src/com/android/camera/BestpictureActivity.java')
-rw-r--r-- | src/com/android/camera/BestpictureActivity.java | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/src/com/android/camera/BestpictureActivity.java b/src/com/android/camera/BestpictureActivity.java index 45c45ed4b..cf285c2eb 100644 --- a/src/com/android/camera/BestpictureActivity.java +++ b/src/com/android/camera/BestpictureActivity.java @@ -48,6 +48,8 @@ import android.view.Gravity; import android.view.LayoutInflater; import android.view.Menu; import android.view.View; +import android.view.Window; +import android.view.WindowManager; import android.support.v4.app.FragmentActivity; import android.widget.CheckBox; import android.widget.PopupWindow; @@ -77,7 +79,12 @@ public class BestpictureActivity extends FragmentActivity { public static final String[] NAMES = { "00", "01", "02", "03", "04", "05", "06", "07", "08", "09" }; - + private static final String INTENT_ACTION_STILL_IMAGE_CAMERA_SECURE = + "android.media.action.STILL_IMAGE_CAMERA_SECURE"; + public static final String ACTION_IMAGE_CAPTURE_SECURE = + "android.media.action.IMAGE_CAPTURE_SECURE"; + public static final String SECURE_CAMERA_EXTRA = "secure_camera"; + private boolean mSecureCamera; public static final int NUM_IMAGES = 10; private ViewPager mImagePager; @@ -158,6 +165,22 @@ public class BestpictureActivity extends FragmentActivity { public void onCreate(Bundle state) { super.onCreate(state); mActivity = this; + Intent intent = getIntent(); + String action = intent.getAction(); + if (INTENT_ACTION_STILL_IMAGE_CAMERA_SECURE.equals(action) + || ACTION_IMAGE_CAPTURE_SECURE.equals(action)) { + mSecureCamera = true; + } else { + mSecureCamera = intent.getBooleanExtra(SECURE_CAMERA_EXTRA, false); + } + + if (mSecureCamera) { + // Change the window flags so that secure camera can show when locked + Window win = getWindow(); + WindowManager.LayoutParams params = win.getAttributes(); + params.flags |= WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED; + win.setAttributes(params); + } mFilesPath = getFilesDir()+"/Bestpicture"; setContentView(R.layout.bestpicture_editor); Display display = getWindowManager().getDefaultDisplay(); |