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

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

Merge "Unexport ControlsActivity" into udc-dev

parents 3776c40b 7f833f2e
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -949,7 +949,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.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.AndroidTestingRunner
import android.testing.TestableLooper
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)
    }