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

Commit d887d93a authored by Massimo Carli's avatar Massimo Carli
Browse files

Fix RestartDialog Regression

In a previous implementation the restart Dialog wasn't displayed
when a LAUNCHER_TASKBAR_EDUCATION_SHOWING was displayed at the
same time.

This assumption is now wrong so the dependency has been removed.

Flag: EXEMPT Small fix
Fix: 428925093
Test: atest WMShellUnitTests:CompatUIControllerTest
Test: atest WMShellUnitTests:RestartDialogWindowManagerTest
Test: atest WMShellUnitTests:RestartDialogLayoutTest

Change-Id: I765597b8aa34e1432308b416ab88f49d2ec6b90e
parent 83b9464e
Loading
Loading
Loading
Loading
+1 −9
Original line number Diff line number Diff line
@@ -16,14 +16,12 @@

package com.android.wm.shell.compatui;

import static android.provider.Settings.Secure.LAUNCHER_TASKBAR_EDUCATION_SHOWING;
import static android.window.TaskConstants.TASK_CHILD_LAYER_COMPAT_UI;

import android.annotation.Nullable;
import android.app.TaskInfo;
import android.content.Context;
import android.graphics.Rect;
import android.provider.Settings;
import android.util.Pair;
import android.view.LayoutInflater;
import android.view.View;
@@ -120,7 +118,7 @@ class RestartDialogWindowManager extends CompatUIWindowManagerAbstract {
    @Override
    protected boolean eligibleToShowLayout() {
        // We don't show this dialog if the user has explicitly selected so clicking on a checkbox.
        return mRequestRestartDialog && !isTaskbarEduShowing() && (mLayout != null
        return mRequestRestartDialog && (mLayout != null
                || mCompatUIConfiguration.shouldShowRestartDialogAgain(getLastTaskInfo()));
    }

@@ -243,10 +241,4 @@ class RestartDialogWindowManager extends CompatUIWindowManagerAbstract {
        return getWindowLayoutParams(/* width= */ taskBounds.width(), /* height= */
                taskBounds.height());
    }

    @VisibleForTesting
    boolean isTaskbarEduShowing() {
        return Settings.Secure.getInt(mContext.getContentResolver(),
                LAUNCHER_TASKBAR_EDUCATION_SHOWING, /* def= */ 0) == 1;
    }
}