public static final String MODULE_SCOPE_PREFIX = "_preferences_module_";
public static final String CAMERA_SCOPE_PREFIX = "_preferences_camera_";
- /**
- * Request code from an activity we started that indicated that we do not
- * want to reset the view to the preview in onResume.
- */
- public static final int REQ_CODE_DONT_SWITCH_TO_PREVIEW = 142;
-
- public static final int REQ_CODE_GCAM_DEBUG_POSTCAPTURE = 999;
-
private static final int MSG_CLEAR_SCREEN_ON_FLAG = 2;
private static final long SCREEN_DELAY_MS = 2 * 60 * 1000; // 2 mins.
private static final int MAX_PEEK_BITMAP_PIXELS = 1600000; // 1.6 * 4 MBs.
@Override
public void launchActivityByIntent(Intent intent) {
- startActivityForResult(intent, REQ_CODE_DONT_SWITCH_TO_PREVIEW);
+ // Starting from L, we prefer not to start edit activity within camera's task.
+ mResetToPreviewOnResume = false;
+ intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+
+ startActivity(intent);
}
@Override
}
@Override
- protected void onActivityResult(int requestCode, int resultCode, Intent data) {
- if (requestCode == REQ_CODE_DONT_SWITCH_TO_PREVIEW) {
- mResetToPreviewOnResume = false;
- } else {
- super.onActivityResult(requestCode, resultCode, data);
- }
- }
-
- @Override
public void onResume() {
CameraPerformanceTracker.onEvent(CameraPerformanceTracker.ACTIVITY_RESUME);
Log.v(TAG, "Build info: " + Build.DISPLAY);
private void startPlayVideoActivity() {
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(mCurrentVideoUri, convertOutputFormatToMimeType(mProfile.fileFormat));
+ intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
try {
- mActivity
- .startActivityForResult(intent, CameraActivity.REQ_CODE_DONT_SWITCH_TO_PREVIEW);
+ mActivity.startActivity(intent);
} catch (ActivityNotFoundException ex) {
Log.e(TAG, "Couldn't view video " + mCurrentVideoUri, ex);
}
Intent intent = IntentHelper.getVideoPlayerIntent(uri)
.putExtra(Intent.EXTRA_TITLE, title)
.putExtra(KEY_TREAT_UP_AS_BACK, true);
- activity.startActivityForResult(intent, CameraActivity.REQ_CODE_DONT_SWITCH_TO_PREVIEW);
+ intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+ activity.startActivity(intent);
} else {
// In order not to send out any intent to be intercepted and
// show the lock screen immediately, we just let the secure
MAPS_CLASS_NAME);
Intent mapsIntent = new Intent(Intent.ACTION_VIEW,
Uri.parse(uri)).setComponent(compName);
- activity.startActivityForResult(mapsIntent,
- CameraActivity.REQ_CODE_DONT_SWITCH_TO_PREVIEW);
+ mapsIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+ activity.startActivity(mapsIntent);
} catch (ActivityNotFoundException e) {
// Use the "geo intent" if no GMM is installed
Log.e(TAG, "GMM activity not found!", e);