Loading core/java/android/app/Activity.java +1 −0 Original line number Diff line number Diff line Loading @@ -7033,6 +7033,7 @@ public class Activity extends ContextThemeWrapper } final void performRestart() { mCanEnterPictureInPicture = true; mFragments.noteStateNotSaved(); if (mToken != null && mParent == null) { Loading core/java/android/app/ActivityOptions.java +23 −0 Original line number Diff line number Diff line Loading @@ -194,6 +194,14 @@ public class ActivityOptions { */ private static final String KEY_DOCK_CREATE_MODE = "android:activity.dockCreateMode"; /** * Determines whether to disallow the outgoing activity from entering picture-in-picture as the * result of a new activity being launched. * @hide */ private static final String KEY_DISALLOW_ENTER_PICTURE_IN_PICTURE_WHILE_LAUNCHING = "android:activity.disallowEnterPictureInPictureWhileLaunching"; /** * For Activity transitions, the calling Activity's TransitionListener used to * notify the called Activity when the shared element and the exit transitions Loading Loading @@ -267,6 +275,7 @@ public class ActivityOptions { private int mLaunchStackId = INVALID_STACK_ID; private int mLaunchTaskId = -1; private int mDockCreateMode = DOCKED_STACK_CREATE_MODE_TOP_OR_LEFT; private boolean mDisallowEnterPictureInPictureWhileLaunching; private boolean mTaskOverlay; private boolean mTaskOverlayCanResume; private AppTransitionAnimationSpec mAnimSpecs[]; Loading Loading @@ -856,6 +865,8 @@ public class ActivityOptions { mTaskOverlay = opts.getBoolean(KEY_TASK_OVERLAY, false); mTaskOverlayCanResume = opts.getBoolean(KEY_TASK_OVERLAY_CAN_RESUME, false); mDockCreateMode = opts.getInt(KEY_DOCK_CREATE_MODE, DOCKED_STACK_CREATE_MODE_TOP_OR_LEFT); mDisallowEnterPictureInPictureWhileLaunching = opts.getBoolean( KEY_DISALLOW_ENTER_PICTURE_IN_PICTURE_WHILE_LAUNCHING, false); if (opts.containsKey(KEY_ANIM_SPECS)) { Parcelable[] specs = opts.getParcelableArray(KEY_ANIM_SPECS); mAnimSpecs = new AppTransitionAnimationSpec[specs.length]; Loading Loading @@ -1121,6 +1132,16 @@ public class ActivityOptions { mDockCreateMode = dockCreateMode; } /** @hide */ public void setDisallowEnterPictureInPictureWhileLaunching(boolean disallow) { mDisallowEnterPictureInPictureWhileLaunching = disallow; } /** @hide */ public boolean disallowEnterPictureInPictureWhileLaunching() { return mDisallowEnterPictureInPictureWhileLaunching; } /** * Update the current values in this ActivityOptions from those supplied * in <var>otherOptions</var>. Any values Loading Loading @@ -1275,6 +1296,8 @@ public class ActivityOptions { b.putBoolean(KEY_TASK_OVERLAY, mTaskOverlay); b.putBoolean(KEY_TASK_OVERLAY_CAN_RESUME, mTaskOverlayCanResume); b.putInt(KEY_DOCK_CREATE_MODE, mDockCreateMode); b.putBoolean(KEY_DISALLOW_ENTER_PICTURE_IN_PICTURE_WHILE_LAUNCHING, mDisallowEnterPictureInPictureWhileLaunching); if (mAnimSpecs != null) { b.putParcelableArray(KEY_ANIM_SPECS, mAnimSpecs); } Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java +1 −3 Original line number Diff line number Diff line Loading @@ -72,7 +72,6 @@ import com.android.systemui.plugins.IntentButtonProvider; import com.android.systemui.plugins.IntentButtonProvider.IntentButton; import com.android.systemui.plugins.IntentButtonProvider.IntentButton.IconState; import com.android.systemui.plugins.PluginListener; import com.android.systemui.plugins.PluginManager; import com.android.systemui.plugins.ActivityStarter; import com.android.systemui.statusbar.CommandQueue; import com.android.systemui.statusbar.KeyguardAffordanceView; Loading @@ -82,10 +81,8 @@ import com.android.systemui.statusbar.policy.ExtensionController; import com.android.systemui.statusbar.policy.ExtensionController.Extension; import com.android.systemui.statusbar.policy.FlashlightController; import com.android.systemui.statusbar.policy.PreviewInflater; import com.android.systemui.tuner.LockscreenFragment; import com.android.systemui.tuner.LockscreenFragment.LockButtonFactory; import com.android.systemui.tuner.TunerService; import com.android.systemui.tuner.TunerService.Tunable; /** * Implementation for the bottom area of the Keyguard, including camera/phone affordance and status Loading Loading @@ -510,6 +507,7 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL // force the crossfade animation if an orientation change // happens to occur during the launch. ActivityOptions o = ActivityOptions.makeBasic(); o.setDisallowEnterPictureInPictureWhileLaunching(true); o.setRotationAnimationHint( WindowManager.LayoutParams.ROTATION_ANIMATION_SEAMLESS); try { Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +11 −5 Original line number Diff line number Diff line Loading @@ -2679,7 +2679,8 @@ public class StatusBar extends SystemUI implements DemoMode, @Override public void startActivity(Intent intent, boolean dismissShade, Callback callback) { startActivityDismissingKeyguard(intent, false, dismissShade, callback); startActivityDismissingKeyguard(intent, false, dismissShade, false /* disallowEnterPictureInPictureWhileLaunching */, callback); } public void setQsExpanded(boolean expanded) { Loading Loading @@ -3672,11 +3673,13 @@ public class StatusBar extends SystemUI implements DemoMode, public void startActivityDismissingKeyguard(final Intent intent, boolean onlyProvisioned, boolean dismissShade) { startActivityDismissingKeyguard(intent, onlyProvisioned, dismissShade, null /* callback */); startActivityDismissingKeyguard(intent, onlyProvisioned, dismissShade, false /* disallowEnterPictureInPictureWhileLaunching */, null /* callback */); } public void startActivityDismissingKeyguard(final Intent intent, boolean onlyProvisioned, final boolean dismissShade, final Callback callback) { final boolean dismissShade, final boolean disallowEnterPictureInPictureWhileLaunching, final Callback callback) { if (onlyProvisioned && !isDeviceProvisioned()) return; final boolean afterKeyguardGone = PreviewInflater.wouldLaunchResolverActivity( Loading @@ -3689,6 +3692,8 @@ public class StatusBar extends SystemUI implements DemoMode, Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP); int result = ActivityManager.START_CANCELED; ActivityOptions options = new ActivityOptions(getActivityOptions()); options.setDisallowEnterPictureInPictureWhileLaunching( disallowEnterPictureInPictureWhileLaunching); if (intent == KeyguardBottomAreaView.INSECURE_CAMERA_INTENT) { // Normally an activity will set it's requested rotation // animation on its window. However when launching an activity Loading Loading @@ -5390,8 +5395,9 @@ public class StatusBar extends SystemUI implements DemoMode, } vibrateForCameraGesture(); if (!mStatusBarKeyguardViewManager.isShowing()) { startActivity(KeyguardBottomAreaView.INSECURE_CAMERA_INTENT, true /* dismissShade */); startActivityDismissingKeyguard(KeyguardBottomAreaView.INSECURE_CAMERA_INTENT, false /* onlyProvisioned */, true /* dismissShade */, true /* disallowEnterPictureInPictureWhileLaunching */, null /* callback */); } else { if (!mDeviceInteractive) { // Avoid flickering of the scrim when we instant launch the camera and the bouncer Loading services/core/java/com/android/server/am/ActivityManagerService.java +1 −1 Original line number Diff line number Diff line Loading @@ -8063,7 +8063,7 @@ public class ActivityManagerService extends IActivityManager.Stub stack.setPictureInPictureActions(actions); MetricsLogger.action(mContext, MetricsEvent.ACTION_PICTURE_IN_PICTURE_ENTERED, r.supportsPictureInPictureWhilePausing); r.supportsEnterPipOnTaskSwitch); logPictureInPictureArgs(params); }; Loading
core/java/android/app/Activity.java +1 −0 Original line number Diff line number Diff line Loading @@ -7033,6 +7033,7 @@ public class Activity extends ContextThemeWrapper } final void performRestart() { mCanEnterPictureInPicture = true; mFragments.noteStateNotSaved(); if (mToken != null && mParent == null) { Loading
core/java/android/app/ActivityOptions.java +23 −0 Original line number Diff line number Diff line Loading @@ -194,6 +194,14 @@ public class ActivityOptions { */ private static final String KEY_DOCK_CREATE_MODE = "android:activity.dockCreateMode"; /** * Determines whether to disallow the outgoing activity from entering picture-in-picture as the * result of a new activity being launched. * @hide */ private static final String KEY_DISALLOW_ENTER_PICTURE_IN_PICTURE_WHILE_LAUNCHING = "android:activity.disallowEnterPictureInPictureWhileLaunching"; /** * For Activity transitions, the calling Activity's TransitionListener used to * notify the called Activity when the shared element and the exit transitions Loading Loading @@ -267,6 +275,7 @@ public class ActivityOptions { private int mLaunchStackId = INVALID_STACK_ID; private int mLaunchTaskId = -1; private int mDockCreateMode = DOCKED_STACK_CREATE_MODE_TOP_OR_LEFT; private boolean mDisallowEnterPictureInPictureWhileLaunching; private boolean mTaskOverlay; private boolean mTaskOverlayCanResume; private AppTransitionAnimationSpec mAnimSpecs[]; Loading Loading @@ -856,6 +865,8 @@ public class ActivityOptions { mTaskOverlay = opts.getBoolean(KEY_TASK_OVERLAY, false); mTaskOverlayCanResume = opts.getBoolean(KEY_TASK_OVERLAY_CAN_RESUME, false); mDockCreateMode = opts.getInt(KEY_DOCK_CREATE_MODE, DOCKED_STACK_CREATE_MODE_TOP_OR_LEFT); mDisallowEnterPictureInPictureWhileLaunching = opts.getBoolean( KEY_DISALLOW_ENTER_PICTURE_IN_PICTURE_WHILE_LAUNCHING, false); if (opts.containsKey(KEY_ANIM_SPECS)) { Parcelable[] specs = opts.getParcelableArray(KEY_ANIM_SPECS); mAnimSpecs = new AppTransitionAnimationSpec[specs.length]; Loading Loading @@ -1121,6 +1132,16 @@ public class ActivityOptions { mDockCreateMode = dockCreateMode; } /** @hide */ public void setDisallowEnterPictureInPictureWhileLaunching(boolean disallow) { mDisallowEnterPictureInPictureWhileLaunching = disallow; } /** @hide */ public boolean disallowEnterPictureInPictureWhileLaunching() { return mDisallowEnterPictureInPictureWhileLaunching; } /** * Update the current values in this ActivityOptions from those supplied * in <var>otherOptions</var>. Any values Loading Loading @@ -1275,6 +1296,8 @@ public class ActivityOptions { b.putBoolean(KEY_TASK_OVERLAY, mTaskOverlay); b.putBoolean(KEY_TASK_OVERLAY_CAN_RESUME, mTaskOverlayCanResume); b.putInt(KEY_DOCK_CREATE_MODE, mDockCreateMode); b.putBoolean(KEY_DISALLOW_ENTER_PICTURE_IN_PICTURE_WHILE_LAUNCHING, mDisallowEnterPictureInPictureWhileLaunching); if (mAnimSpecs != null) { b.putParcelableArray(KEY_ANIM_SPECS, mAnimSpecs); } Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java +1 −3 Original line number Diff line number Diff line Loading @@ -72,7 +72,6 @@ import com.android.systemui.plugins.IntentButtonProvider; import com.android.systemui.plugins.IntentButtonProvider.IntentButton; import com.android.systemui.plugins.IntentButtonProvider.IntentButton.IconState; import com.android.systemui.plugins.PluginListener; import com.android.systemui.plugins.PluginManager; import com.android.systemui.plugins.ActivityStarter; import com.android.systemui.statusbar.CommandQueue; import com.android.systemui.statusbar.KeyguardAffordanceView; Loading @@ -82,10 +81,8 @@ import com.android.systemui.statusbar.policy.ExtensionController; import com.android.systemui.statusbar.policy.ExtensionController.Extension; import com.android.systemui.statusbar.policy.FlashlightController; import com.android.systemui.statusbar.policy.PreviewInflater; import com.android.systemui.tuner.LockscreenFragment; import com.android.systemui.tuner.LockscreenFragment.LockButtonFactory; import com.android.systemui.tuner.TunerService; import com.android.systemui.tuner.TunerService.Tunable; /** * Implementation for the bottom area of the Keyguard, including camera/phone affordance and status Loading Loading @@ -510,6 +507,7 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL // force the crossfade animation if an orientation change // happens to occur during the launch. ActivityOptions o = ActivityOptions.makeBasic(); o.setDisallowEnterPictureInPictureWhileLaunching(true); o.setRotationAnimationHint( WindowManager.LayoutParams.ROTATION_ANIMATION_SEAMLESS); try { Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +11 −5 Original line number Diff line number Diff line Loading @@ -2679,7 +2679,8 @@ public class StatusBar extends SystemUI implements DemoMode, @Override public void startActivity(Intent intent, boolean dismissShade, Callback callback) { startActivityDismissingKeyguard(intent, false, dismissShade, callback); startActivityDismissingKeyguard(intent, false, dismissShade, false /* disallowEnterPictureInPictureWhileLaunching */, callback); } public void setQsExpanded(boolean expanded) { Loading Loading @@ -3672,11 +3673,13 @@ public class StatusBar extends SystemUI implements DemoMode, public void startActivityDismissingKeyguard(final Intent intent, boolean onlyProvisioned, boolean dismissShade) { startActivityDismissingKeyguard(intent, onlyProvisioned, dismissShade, null /* callback */); startActivityDismissingKeyguard(intent, onlyProvisioned, dismissShade, false /* disallowEnterPictureInPictureWhileLaunching */, null /* callback */); } public void startActivityDismissingKeyguard(final Intent intent, boolean onlyProvisioned, final boolean dismissShade, final Callback callback) { final boolean dismissShade, final boolean disallowEnterPictureInPictureWhileLaunching, final Callback callback) { if (onlyProvisioned && !isDeviceProvisioned()) return; final boolean afterKeyguardGone = PreviewInflater.wouldLaunchResolverActivity( Loading @@ -3689,6 +3692,8 @@ public class StatusBar extends SystemUI implements DemoMode, Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP); int result = ActivityManager.START_CANCELED; ActivityOptions options = new ActivityOptions(getActivityOptions()); options.setDisallowEnterPictureInPictureWhileLaunching( disallowEnterPictureInPictureWhileLaunching); if (intent == KeyguardBottomAreaView.INSECURE_CAMERA_INTENT) { // Normally an activity will set it's requested rotation // animation on its window. However when launching an activity Loading Loading @@ -5390,8 +5395,9 @@ public class StatusBar extends SystemUI implements DemoMode, } vibrateForCameraGesture(); if (!mStatusBarKeyguardViewManager.isShowing()) { startActivity(KeyguardBottomAreaView.INSECURE_CAMERA_INTENT, true /* dismissShade */); startActivityDismissingKeyguard(KeyguardBottomAreaView.INSECURE_CAMERA_INTENT, false /* onlyProvisioned */, true /* dismissShade */, true /* disallowEnterPictureInPictureWhileLaunching */, null /* callback */); } else { if (!mDeviceInteractive) { // Avoid flickering of the scrim when we instant launch the camera and the bouncer Loading
services/core/java/com/android/server/am/ActivityManagerService.java +1 −1 Original line number Diff line number Diff line Loading @@ -8063,7 +8063,7 @@ public class ActivityManagerService extends IActivityManager.Stub stack.setPictureInPictureActions(actions); MetricsLogger.action(mContext, MetricsEvent.ACTION_PICTURE_IN_PICTURE_ENTERED, r.supportsPictureInPictureWhilePausing); r.supportsEnterPipOnTaskSwitch); logPictureInPictureArgs(params); };