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

Commit b1911637 authored by Behnam Heydarshahi's avatar Behnam Heydarshahi
Browse files

Unexport ControlsActivity

Also do not draw non-system windows on top of ControlsSettingsDialog

Fix: 404256832
Flag: EXEMPT bugfix
Test: atest ControlsSettingsDialogManagerImplTest
Change-Id: Iaf71532a498c03592ba1d97495eb984b6973ce05
parent ea8406bd
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -948,7 +948,6 @@
                  android:launchMode="singleInstance"
                  android:configChanges="screenSize|smallestScreenSize|screenLayout|keyboard|keyboardHidden|orientation"
                  android:visibleToInstantApps="true"
                  android:exported="true"
                  />

        <activity android:name=".wallet.ui.WalletActivity"
+3 −0
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ import android.content.Context.MODE_PRIVATE
import android.content.DialogInterface
import android.content.SharedPreferences
import android.provider.Settings
import android.view.WindowManager.LayoutParams.SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS
import androidx.annotation.VisibleForTesting
import com.android.systemui.res.R
import com.android.systemui.controls.settings.ControlsSettingsDialogManager.Companion.MAX_NUMBER_ATTEMPTS_CONTROLS_DIALOG
@@ -148,6 +149,8 @@ internal constructor(
                }
            }

        d.window?.addSystemFlags(SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS)

        SystemUIDialog.registerDismissListener(d) { dialog = null }
        SystemUIDialog.setDialogSize(d)
        SystemUIDialog.setShowForAllUsers(d, true)
+14 −0
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ import android.provider.Settings.Secure.LOCKSCREEN_ALLOW_TRIVIAL_CONTROLS
import android.provider.Settings.Secure.LOCKSCREEN_SHOW_CONTROLS
import android.testing.TestableLooper
import androidx.test.ext.junit.runners.AndroidJUnit4
import android.view.WindowManager.LayoutParams.SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
import com.android.systemui.controls.settings.ControlsSettingsDialogManager.Companion.PREFS_SETTINGS_DIALOG_ATTEMPTS
@@ -327,6 +328,19 @@ class ControlsSettingsDialogManagerImplTest : SysuiTestCase() {
        assertThat(secureSettings.getBool(SETTING_ACTION)).isTrue()
    }

    @Test
    fun dialogHidesNonSystemOverlayWindows() {
        sharedPreferences.putAttempts(0)
        secureSettings.putBool(SETTING_SHOW, false)
        secureSettings.putBool(SETTING_ACTION, false)

        underTest.maybeShowDialog(context, completedRunnable)

        val flags = dialog!!.window!!.attributes.privateFlags
        assertThat(flags and SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS)
            .isEqualTo(SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS)
    }

    private fun clickButton(which: Int) {
        dialog?.clickButton(which)
    }