Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cdc47690 authored by Yunfan Chen's avatar Yunfan Chen
Browse files

Clean up the server side immersive confirmation dialog

The system UI immersive confirmation dialog has launched. The feature
flag as well as the old path is removed.

Bug: 359713629
Test: build
Flag: EXEMPT removing com.android.window.flags.system_ui_immersive_confirmation_dialog
Change-Id: Ia442370a517907a4353ccf0b9f44ab6733f8dc33
parent 1d41d55c
Loading
Loading
Loading
Loading
+0 −11
Original line number Diff line number Diff line
@@ -133,7 +133,6 @@ import static com.android.text.flags.Flags.disableHandwritingInitiatorForIme;
import static com.android.window.flags.Flags.enableBufferTransformHintFromDisplay;
import static com.android.window.flags.Flags.predictiveBackSwipeEdgeNoneApi;
import static com.android.window.flags.Flags.setScPropertiesInClient;
import static com.android.window.flags.Flags.systemUiImmersiveConfirmationDialog;
import android.Manifest;
import android.accessibilityservice.AccessibilityService;
@@ -375,16 +374,6 @@ public final class ViewRootImpl implements ViewParent,
    public static final boolean CLIENT_TRANSIENT =
            SystemProperties.getBoolean("persist.wm.debug.client_transient", false);
    /**
     * Whether the client (system UI) is handling the immersive confirmation window. If
     * {@link CLIENT_TRANSIENT} is set to true, the immersive confirmation window will always be the
     * client instance and this flag will be ignored. Otherwise, the immersive confirmation window
     * can be switched freely by this flag.
     * @hide
     */
    public static final boolean CLIENT_IMMERSIVE_CONFIRMATION =
            systemUiImmersiveConfirmationDialog();
    /**
     * Set this system property to true to force the view hierarchy to render
     * at 60 Hz. This can be used to measure the potential framerate.
+0 −8
Original line number Diff line number Diff line
@@ -293,14 +293,6 @@ flag {
  }
}

flag {
  name: "system_ui_immersive_confirmation_dialog"
  namespace: "windowing_frontend"
  description: "Enable the implementation of the immersive confirmation dialog on system UI side by default"
  bug: "359713629"
  is_fixed_read_only: true
}

flag {
  name: "ensure_wallpaper_in_transitions"
  namespace: "windowing_frontend"
+42 −49
Original line number Diff line number Diff line
@@ -22,8 +22,6 @@ import static android.app.StatusBarManager.DISABLE_BACK;
import static android.app.StatusBarManager.DISABLE_HOME;
import static android.app.StatusBarManager.DISABLE_RECENT;
import static android.view.Display.DEFAULT_DISPLAY;
import static android.view.ViewRootImpl.CLIENT_IMMERSIVE_CONFIRMATION;
import static android.view.ViewRootImpl.CLIENT_TRANSIENT;
import static android.view.WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS;
import static android.window.DisplayAreaOrganizer.FEATURE_UNDEFINED;
import static android.window.DisplayAreaOrganizer.KEY_ROOT_DISPLAY_AREA_ID;
@@ -313,7 +311,6 @@ public class ImmersiveModeConfirmation implements CoreStartable, CommandQueue.Ca

    @Override
    public void start() {
        if (CLIENT_TRANSIENT || CLIENT_IMMERSIVE_CONFIRMATION) {
        mCommandQueue.addCallback(this);

        final Resources r = mSysUiContext.getResources();
@@ -351,7 +348,6 @@ public class ImmersiveModeConfirmation implements CoreStartable, CommandQueue.Ca
            loadSetting(UserHandle.USER_CURRENT);
        });
    }
    }

    private final IVrStateCallbacks mVrStateCallbacks = new IVrStateCallbacks.Stub() {
        @Override
@@ -599,9 +595,6 @@ public class ImmersiveModeConfirmation implements CoreStartable, CommandQueue.Ca

        @Override
        public void handleMessage(Message msg) {
            if (!CLIENT_TRANSIENT && !CLIENT_IMMERSIVE_CONFIRMATION) {
                return;
            }
            switch (msg.what) {
                case SHOW:
                    handleShow(msg.arg1);
+4 −62
Original line number Diff line number Diff line
@@ -22,7 +22,6 @@ import static android.view.InsetsFrameProvider.SOURCE_ARBITRARY_RECTANGLE;
import static android.view.InsetsFrameProvider.SOURCE_CONTAINER_BOUNDS;
import static android.view.InsetsFrameProvider.SOURCE_DISPLAY;
import static android.view.InsetsFrameProvider.SOURCE_FRAME;
import static android.view.ViewRootImpl.CLIENT_IMMERSIVE_CONFIRMATION;
import static android.view.ViewRootImpl.CLIENT_TRANSIENT;
import static android.view.WindowInsetsController.APPEARANCE_FORCE_LIGHT_NAVIGATION_BARS;
import static android.view.WindowInsetsController.APPEARANCE_LIGHT_NAVIGATION_BARS;
@@ -193,7 +192,6 @@ public class DisplayPolicy {
    private final boolean mCarDockEnablesAccelerometer;
    private final boolean mDeskDockEnablesAccelerometer;
    private final AccessibilityManager mAccessibilityManager;
    private final ImmersiveModeConfirmation mImmersiveModeConfirmation;
    private final ScreenshotHelper mScreenshotHelper;

    private final Object mServiceAcquireLock = new Object();
@@ -634,12 +632,6 @@ public class DisplayPolicy {
        };
        displayContent.mAppTransition.registerListenerLocked(mAppTransitionListener);
        displayContent.mTransitionController.registerLegacyListener(mAppTransitionListener);
        if (CLIENT_TRANSIENT || CLIENT_IMMERSIVE_CONFIRMATION) {
            mImmersiveModeConfirmation = null;
        } else {
            mImmersiveModeConfirmation = new ImmersiveModeConfirmation(mContext, looper,
                    mService.mVrModeEnabled, mCanSystemBarsBeShownByUser);
        }

        // TODO: Make it can take screenshot on external display
        mScreenshotHelper = displayContent.isDefaultDisplay
@@ -2294,11 +2286,7 @@ public class DisplayPolicy {
                }
            }
        }
        if (CLIENT_IMMERSIVE_CONFIRMATION || CLIENT_TRANSIENT) {
        mStatusBarManagerInternal.confirmImmersivePrompt();
        } else {
            mImmersiveModeConfirmation.confirmCurrentPrompt();
        }
    }

    boolean isKeyguardShowing() {
@@ -2523,17 +2511,10 @@ public class DisplayPolicy {
            // The immersive confirmation window should be attached to the immersive window root.
            final RootDisplayArea root = win.getRootDisplayArea();
            final int rootDisplayAreaId = root == null ? FEATURE_UNDEFINED : root.mFeatureId;
            if (!CLIENT_TRANSIENT && !CLIENT_IMMERSIVE_CONFIRMATION) {
                mImmersiveModeConfirmation.immersiveModeChangedLw(rootDisplayAreaId,
                        isImmersiveMode,
                        mService.mPolicy.isUserSetupComplete(),
                        isNavBarEmpty(disableFlags));
            } else {
            // TODO(b/277290737): Move this to the client side, instead of using a proxy.
            callStatusBarSafely(statusBar -> statusBar.immersiveModeChanged(getDisplayId(),
                        rootDisplayAreaId, isImmersiveMode));
        }
        }

        // Show transient bars for panic if needed.
        final boolean requestHideNavBar = !win.isRequestedVisible(Type.navigationBars());
@@ -2745,15 +2726,8 @@ public class DisplayPolicy {
    void onPowerKeyDown(boolean isScreenOn) {
        // Detect user pressing the power button in panic when an application has
        // taken over the whole screen.
        boolean panic = false;
        if (!CLIENT_TRANSIENT && !CLIENT_IMMERSIVE_CONFIRMATION) {
            panic = mImmersiveModeConfirmation.onPowerKeyDown(isScreenOn,
                    SystemClock.elapsedRealtime(), isImmersiveMode(mSystemUiControllingWindow),
                    isNavBarEmpty(mLastDisableFlags));
        } else {
            panic = isPowerKeyDownPanic(isScreenOn, SystemClock.elapsedRealtime(),
        boolean panic = isPowerKeyDownPanic(isScreenOn, SystemClock.elapsedRealtime(),
                    isImmersiveMode(mSystemUiControllingWindow), isNavBarEmpty(mLastDisableFlags));
        }
        if (panic) {
            mHandler.post(mHiddenNavPanic);
        }
@@ -2774,27 +2748,6 @@ public class DisplayPolicy {
        return false;
    }

    void onVrStateChangedLw(boolean enabled) {
        if (!CLIENT_TRANSIENT && !CLIENT_IMMERSIVE_CONFIRMATION) {
            mImmersiveModeConfirmation.onVrStateChangedLw(enabled);
        }
    }

    /**
     * Called when the state of lock task mode changes. This should be used to disable immersive
     * mode confirmation.
     *
     * @param lockTaskState the new lock task mode state. One of
     *                      {@link ActivityManager#LOCK_TASK_MODE_NONE},
     *                      {@link ActivityManager#LOCK_TASK_MODE_LOCKED},
     *                      {@link ActivityManager#LOCK_TASK_MODE_PINNED}.
     */
    public void onLockTaskStateChangedLw(int lockTaskState) {
        if (!CLIENT_TRANSIENT && !CLIENT_IMMERSIVE_CONFIRMATION) {
            mImmersiveModeConfirmation.onLockTaskModeChangedLw(lockTaskState);
        }
    }

    /** Called when a {@link android.os.PowerManager#USER_ACTIVITY_EVENT_TOUCH} is sent. */
    public void onUserActivityEventTouch() {
        // If there is keyguard, it may use INPUT_FEATURE_DISABLE_USER_ACTIVITY (InputDispatcher
@@ -2808,14 +2761,6 @@ public class DisplayPolicy {
        mService.mAtmService.setProcessAnimatingWhileDozing(w != null ? w.getProcess() : null);
    }

    boolean onSystemUiSettingsChanged() {
        if (CLIENT_TRANSIENT || CLIENT_IMMERSIVE_CONFIRMATION) {
            return false;
        } else {
            return mImmersiveModeConfirmation.onSettingChanged(mService.mCurrentUserId);
        }
    }

    /**
     * Request a screenshot be taken.
     *
@@ -3025,9 +2970,6 @@ public class DisplayPolicy {
        mDisplayContent.mTransitionController.unregisterLegacyListener(mAppTransitionListener);
        mHandler.post(mGestureNavigationSettingsObserver::unregister);
        mHandler.post(mForceShowNavBarSettingsObserver::unregister);
        if (!CLIENT_TRANSIENT && !CLIENT_IMMERSIVE_CONFIRMATION) {
            mImmersiveModeConfirmation.release();
        }
        if (mService.mPointerLocationEnabled) {
            setPointerLocationEnabled(false);
        }
+0 −533

File deleted.

Preview size limit exceeded, changes collapsed.

Loading