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

Commit ac7fd0c0 authored by Behnam Heydarshahi's avatar Behnam Heydarshahi Committed by Android (Google) Code Review
Browse files

Merge "Unexport ControlsActivity" into main

parents d3d9ba02 b1911637
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)
    }