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

Commit 521fcd9e authored by Ioana Alexandru's avatar Ioana Alexandru Committed by Android (Google) Code Review
Browse files

Merge "Remove flag undo_guts_on_config_changed" into main

parents 332a045f 528901f3
Loading
Loading
Loading
Loading
+0 −12
Original line number Diff line number Diff line
@@ -212,18 +212,6 @@ flag {
    }
}

flag {
    name: "notification_undo_guts_on_config_changed"
    namespace: "systemui"
    description: "Fixes a bug where a theme or font change while notification guts were open"
        " (e.g. the snooze options or notification info) would show an empty notification by"
        " closing the guts and undoing changes."
    bug: "379267630"
    metadata {
        purpose: PURPOSE_BUGFIX
    }
}

flag {
   name: "pss_app_selector_recents_split_screen"
   namespace: "systemui"
+0 −3
Original line number Diff line number Diff line
@@ -27,7 +27,6 @@ import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;

import android.platform.test.annotations.EnableFlags;
import android.provider.Settings;
import android.testing.TestableResources;
import android.view.View;
@@ -39,7 +38,6 @@ import androidx.test.annotation.UiThreadTest;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SmallTest;

import com.android.systemui.Flags;
import com.android.systemui.SysuiTestCase;
import com.android.systemui.animation.AnimatorTestRule;
import com.android.systemui.plugins.statusbar.NotificationSwipeActionHelper;
@@ -93,7 +91,6 @@ public class NotificationSnoozeTest extends SysuiTestCase {
    }

    @Test
    @EnableFlags(Flags.FLAG_NOTIFICATION_UNDO_GUTS_ON_CONFIG_CHANGED)
    public void closeControls_withoutSave_performsUndo() {
        ArrayList<SnoozeOption> options = mUnderTest.getDefaultSnoozeOptions();
        mUnderTest.mSelectedOption = options.getFirst();
+2 −14
Original line number Diff line number Diff line
@@ -22,7 +22,6 @@ import com.android.internal.widget.MessagingGroup
import com.android.internal.widget.MessagingMessage
import com.android.keyguard.KeyguardUpdateMonitor
import com.android.keyguard.KeyguardUpdateMonitorCallback
import com.android.systemui.Flags
import com.android.systemui.shade.ShadeDisplayAware
import com.android.systemui.statusbar.NotificationLockscreenUserManager
import com.android.systemui.statusbar.NotificationLockscreenUserManager.UserChangedListener
@@ -147,27 +146,16 @@ internal constructor(
        traceSection("updateNotifOnUiModeChanged") {
            mPipeline?.allNotifs?.forEach { entry ->
                entry.row?.onUiModeChanged()
                if (Flags.notificationUndoGutsOnConfigChanged()) {
                mGutsManager.closeAndUndoGuts()
            }
        }
    }
    }

    private fun updateNotificationsOnDensityOrFontScaleChanged() {
        colorUpdateLogger.logEvent("VCC.updateNotificationsOnDensityOrFontScaleChanged()")
        mPipeline?.allNotifs?.forEach { entry ->
            entry.onDensityOrFontScaleChanged()
            if (Flags.notificationUndoGutsOnConfigChanged()) {
            mGutsManager.closeAndUndoGuts()
            } else {
                // This property actually gets reset when the guts are re-inflated, so we're never
                // actually calling onDensityOrFontScaleChanged below.
                val exposedGuts = entry.areGutsExposed()
                if (exposedGuts) {
                    mGutsManager.onDensityOrFontScaleChanged(entry)
                }
            }
        }
    }

+1 −15
Original line number Diff line number Diff line
@@ -47,7 +47,6 @@ import com.android.internal.logging.nano.MetricsProto;
import com.android.internal.statusbar.IStatusBarService;
import com.android.settingslib.notification.ConversationIconFactory;
import com.android.systemui.CoreStartable;
import com.android.systemui.Flags;
import com.android.systemui.dagger.SysUISingleton;
import com.android.systemui.dagger.qualifiers.Background;
import com.android.systemui.dagger.qualifiers.Main;
@@ -235,15 +234,6 @@ public class NotificationGutsManager implements NotifGutsViewManager, CoreStarta
        }
    }

    public void onDensityOrFontScaleChanged(NotificationEntry entry) {
        if (!Flags.notificationUndoGutsOnConfigChanged()) {
            Log.wtf(TAG, "onDensityOrFontScaleChanged should not be called if"
                    + " notificationUndoGutsOnConfigChanged is off");
        }
        setExposedGuts(entry.getGuts());
        bindGuts(entry.getRow());
    }

    /**
     * Sends an intent to open the notification settings for a particular package and optional
     * channel.
@@ -295,11 +285,6 @@ public class NotificationGutsManager implements NotifGutsViewManager, CoreStarta
        mNotificationActivityStarter.startNotificationGutsIntent(intent, uid, row);
    }

    private boolean bindGuts(final ExpandableNotificationRow row) {
        row.ensureGutsInflated();
        return bindGuts(row, mGutsMenuItem);
    }

    @VisibleForTesting
    protected boolean bindGuts(final ExpandableNotificationRow row,
            NotificationMenuRowPlugin.MenuItem item) {
@@ -611,6 +596,7 @@ public class NotificationGutsManager implements NotifGutsViewManager, CoreStarta
        return mNotificationGutsExposed;
    }

    @VisibleForTesting
    public void setExposedGuts(NotificationGuts guts) {
        mNotificationGutsExposed = guts;
    }
+1 −2
Original line number Diff line number Diff line
@@ -51,7 +51,6 @@ import com.android.app.animation.Interpolators;
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.logging.MetricsLogger;
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.systemui.Flags;
import com.android.systemui.plugins.statusbar.NotificationSwipeActionHelper;
import com.android.systemui.plugins.statusbar.NotificationSwipeActionHelper.SnoozeOption;
import com.android.systemui.res.R;
@@ -477,7 +476,7 @@ public class NotificationSnooze extends LinearLayout

    @Override
    public boolean handleCloseControls(boolean save, boolean force) {
        if (Flags.notificationUndoGutsOnConfigChanged() && !save) {
        if (!save) {
            // Undo changes and let the guts handle closing the view
            mSelectedOption = null;
            showSnoozeOptions(false);
Loading