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

Commit 7e0de42c authored by Ale Nijamkin's avatar Ale Nijamkin Committed by Android (Google) Code Review
Browse files

Merge "[flexiglass] Removes refactor_keyguard_dismiss_intent flag dependency." into main

parents 137bb377 63f3c7b5
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -62,7 +62,7 @@ the instructions below to turn it on.

NOTE: in case these instructions become stale and don't actually enable the
framework, please make sure `SceneContainerFlag.isEnabled` in the
[`SceneContainerFlags.kt`](https://cs.android.com/android/platform/superproject/main/+/main:frameworks/base/packages/SystemUI/src/com/android/systemui/scene/shared/flag/SceneContainerFlags.kt)
[`SceneContainerFlag.kt`](https://cs.android.com/android/platform/superproject/main/+/main:frameworks/base/packages/SystemUI/src/com/android/systemui/scene/shared/flag/SceneContainerFlag.kt)
file evalutes to `true`.

1.  Set a collection of **aconfig flags** to `true` by running the following
@@ -74,10 +74,9 @@ file evalutes to `true`.
    $ adb shell device_config override systemui com.android.systemui.keyguard_wm_state_refactor true
    $ adb shell device_config override systemui com.android.systemui.media_in_scene_container true
    $ adb shell device_config override systemui com.android.systemui.migrate_clocks_to_blueprint true
    $ adb shell device_config override systemui com.android.systemui.notification_heads_up_refactor true
    $ adb shell device_config override systemui com.android.systemui.notifications_heads_up_refactor true
    $ adb shell device_config override systemui com.android.systemui.predictive_back_sysui true
    $ adb shell device_config override systemui com.android.systemui.device_entry_udfps_refactor true
    $ adb shell device_config override systemui com.android.systemui.refactor_keyguard_dismiss_intent true
    ```
2.  **Restart** System UI by issuing the following command:
    ```console
+3 −4
Original line number Diff line number Diff line
@@ -81,7 +81,6 @@ import com.android.systemui.deviceentry.domain.interactor.DeviceEntryInteractor;
import com.android.systemui.flags.FeatureFlags;
import com.android.systemui.keyguard.KeyguardWmStateRefactor;
import com.android.systemui.keyguard.domain.interactor.KeyguardTransitionInteractor;
import com.android.systemui.keyguard.shared.RefactorKeyguardDismissIntent;
import com.android.systemui.log.SessionTracker;
import com.android.systemui.plugins.ActivityStarter;
import com.android.systemui.plugins.FalsingManager;
@@ -304,7 +303,7 @@ public class KeyguardSecurityContainerController extends ViewController<Keyguard
         */
        @Override
        public void finish(int targetUserId) {
            if (!RefactorKeyguardDismissIntent.isEnabled()) {
            if (!SceneContainerFlag.isEnabled()) {
                // If there's a pending runnable because the user interacted with a widget
                // and we're leaving keyguard, then run it.
                boolean deferKeyguardDone = false;
@@ -614,7 +613,7 @@ public class KeyguardSecurityContainerController extends ViewController<Keyguard
     * @param action callback to be invoked when keyguard disappear animation completes.
     */
    public void setOnDismissAction(ActivityStarter.OnDismissAction action, Runnable cancelAction) {
        if (RefactorKeyguardDismissIntent.isEnabled()) {
        if (SceneContainerFlag.isEnabled()) {
            return;
        }
        if (mCancelAction != null) {
@@ -908,7 +907,7 @@ public class KeyguardSecurityContainerController extends ViewController<Keyguard
            mUiEventLogger.log(uiEvent, getSessionId());
        }

        if (RefactorKeyguardDismissIntent.isEnabled()) {
        if (SceneContainerFlag.isEnabled()) {
            if (authenticatedWithPrimaryAuth) {
                mPrimaryBouncerInteractor.get()
                        .notifyKeyguardAuthenticatedPrimaryAuth(targetUserId);
+0 −53
Original line number Diff line number Diff line
/*
 * Copyright (C) 2024 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.android.systemui.keyguard.shared

import com.android.systemui.Flags
import com.android.systemui.flags.FlagToken
import com.android.systemui.flags.RefactorFlagUtils

/** Helper for reading or using the refactor_keyguard_dismiss_intent flag. */
@Suppress("NOTHING_TO_INLINE")
object RefactorKeyguardDismissIntent {
    /** The aconfig flag name */
    const val FLAG_NAME = Flags.FLAG_REFACTOR_KEYGUARD_DISMISS_INTENT

    /** A token used for dependency declaration */
    val token: FlagToken
        get() = FlagToken(FLAG_NAME, isEnabled)

    /** Is the refactor enabled */
    @JvmStatic
    inline val isEnabled
        get() = Flags.refactorKeyguardDismissIntent()

    /**
     * Called to ensure code is only run when the flag is enabled. This protects users from the
     * unintended behaviors caused by accidentally running new logic, while also crashing on an eng
     * build to ensure that the refactor author catches issues in testing.
     */
    @JvmStatic
    inline fun isUnexpectedlyInLegacyMode() =
        RefactorFlagUtils.isUnexpectedlyInLegacyMode(isEnabled, FLAG_NAME)

    /**
     * Called to ensure code is only run when the flag is disabled. This will throw an exception if
     * the flag is enabled to ensure that the refactor author catches issues in testing.
     */
    @JvmStatic
    inline fun assertInLegacyMode() = RefactorFlagUtils.assertInLegacyMode(isEnabled, FLAG_NAME)
}
+2 −2
Original line number Diff line number Diff line
@@ -20,8 +20,8 @@ import com.android.systemui.CoreStartable
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.dagger.qualifiers.Application
import com.android.systemui.keyguard.domain.interactor.KeyguardDismissActionInteractor
import com.android.systemui.keyguard.shared.RefactorKeyguardDismissIntent
import com.android.systemui.log.core.LogLevel
import com.android.systemui.scene.shared.flag.SceneContainerFlag
import com.android.systemui.util.kotlin.sample
import javax.inject.Inject
import kotlinx.coroutines.CoroutineScope
@@ -40,7 +40,7 @@ constructor(
) : CoreStartable {

    override fun start() {
        if (!RefactorKeyguardDismissIntent.isEnabled) {
        if (!SceneContainerFlag.isEnabled) {
            return
        }

+2 −2
Original line number Diff line number Diff line
@@ -22,9 +22,9 @@ import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.dagger.qualifiers.Application
import com.android.systemui.flags.FeatureFlagsClassic
import com.android.systemui.keyguard.domain.interactor.KeyguardDismissInteractor
import com.android.systemui.keyguard.shared.RefactorKeyguardDismissIntent
import com.android.systemui.keyguard.shared.model.KeyguardDone
import com.android.systemui.log.core.LogLevel
import com.android.systemui.scene.shared.flag.SceneContainerFlag
import com.android.systemui.user.domain.interactor.SelectedUserInteractor
import javax.inject.Inject
import kotlinx.coroutines.CoroutineScope
@@ -44,7 +44,7 @@ constructor(
) : CoreStartable {

    override fun start() {
        if (!RefactorKeyguardDismissIntent.isEnabled) {
        if (!SceneContainerFlag.isEnabled) {
            return
        }

Loading