diff options
author | Camera Software Integration <camswint@localhost> | 2017-01-17 00:22:54 -0800 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2017-01-17 00:22:54 -0800 |
commit | aade11641bde65221479762de4afb36cbe69ee65 (patch) | |
tree | ce1737f119a274c0c1d489ab1d73fdf06f7c88e7 /src/com/android/camera/BestpictureActivity.java | |
parent | bc029c01d11d6ce3634ec3bc26b0e02b3092bed2 (diff) | |
parent | 64b18764c76e8211d3aac87b0836a791f445a0f7 (diff) | |
download | android_packages_apps_Snap-aade11641bde65221479762de4afb36cbe69ee65.tar.gz android_packages_apps_Snap-aade11641bde65221479762de4afb36cbe69ee65.tar.bz2 android_packages_apps_Snap-aade11641bde65221479762de4afb36cbe69ee65.zip |
Merge "SnapdragonCamera: Fix Can't choose BestPicture when the screen were locked" into camera.lnx.1.0-dev.1.0
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(); |