diff options
| author | Matías Hernández <matiashe@google.com> | 2025-01-03 13:38:10 +0100 |
|---|---|---|
| committer | Julian Veit <Claymore1298@gmail.com> | 2025-04-18 14:06:43 +0200 |
| commit | 59cfd6fa6ff811b4fd8080abdf34bb4bd9e7f599 (patch) | |
| tree | b015b264942bbdce8c67f48465f13313cc5ddab8 /tests/robotests/src/com/android/settings/notification/NotificationAccessConfirmationActivityTest.java | |
| parent | 88b3833355b7d19ad3bfb040e38d7695e2230764 (diff) | |
Remove incorrect call to Window.addFlags with a system flagu14.0
The same flag is being (correctly) added in onCreate, so on top of being wrong this was also completely unnecessary.
Bug: 368579654
Test: atest NotificationAccessConfirmationActivityTest
Flag: EXEMPT bugfix
(cherry picked from commit e0510a62eba04140e459cdd8232f35087aa3073b)
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:824d46f313eb83c1d4a8ad48585dabf6763f5645)
Merged-In: I539fca77a1d136bdd0e4892993020884430b8a4e
Change-Id: I539fca77a1d136bdd0e4892993020884430b8a4e
Diffstat (limited to 'tests/robotests/src/com/android/settings/notification/NotificationAccessConfirmationActivityTest.java')
| -rw-r--r-- | tests/robotests/src/com/android/settings/notification/NotificationAccessConfirmationActivityTest.java | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/robotests/src/com/android/settings/notification/NotificationAccessConfirmationActivityTest.java b/tests/robotests/src/com/android/settings/notification/NotificationAccessConfirmationActivityTest.java index 0a953615abf..8ae242f0869 100644 --- a/tests/robotests/src/com/android/settings/notification/NotificationAccessConfirmationActivityTest.java +++ b/tests/robotests/src/com/android/settings/notification/NotificationAccessConfirmationActivityTest.java @@ -16,6 +16,8 @@ package com.android.settings.notification; +import static android.view.WindowManager.LayoutParams.SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS; + import static com.android.internal.notification.NotificationAccessConfirmationActivityContract.EXTRA_COMPONENT_NAME; import static com.google.common.truth.Truth.assertThat; @@ -43,6 +45,19 @@ import org.robolectric.RuntimeEnvironment; public class NotificationAccessConfirmationActivityTest { @Test + public void onCreate_setsWindowFlags() { + ComponentName cn = new ComponentName("com.example", "com.example.SomeService"); + installPackage(cn.getPackageName(), "Example"); + + NotificationAccessConfirmationActivity activity = startActivityWithIntent(cn); + + assertThat(activity.getWindow().getAttributes().privateFlags + & SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS).isNotEqualTo(0); + assertThat(activity.getWindow().getAttributes().flags + & SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS).isEqualTo(0); + } + + @Test public void start_withMissingIntentFilter_finishes() { ComponentName cn = new ComponentName("com.example", "com.example.SomeService"); installPackage(cn.getPackageName(), "X"); |
