Work challenge did not show when a work activity is not on top, but
still visible after screen turns on.
Also show work challenge even if the work activity is behind a top
fullscreen activity of another profile because the user can still
navigate back to the work activity when top activity finishes.
Bug: 177457096
Test: RootActivityContainerTests
Change-Id: I5e09b09be547d04fdfd709cb9cd4bcd4a94bbf21
Merged-In: I5e09b09be547d04fdfd709cb9cd4bcd4a94bbf21
USER_CURRENT is not an acceptable input to isSecure(). The test has also
been updated as the use of any() for the mock hid this bug.
Test: atest LockTaskControllerTest
Bug: 176801033
Change-Id: Ib8a11ed4fc895bcd6eda8cf777a8dd2ce253e11e
CancelNotificationRunnables just spin on the work handler of
NotificationManagerService, hoping that they get executed at the correct
moment after a PostNotificationRunnable and before the next
EnqueueNotificationRunnable completes. Otherwise, you end up in a bad
state where the cancel either is canceling notifications before they get
a chance to post, or missing its only chance to cancel the notification
(for instance, ActivityManagerService is the only caller that can cancel
FGS notifications).
This change attempts to execute a CancelNotificationRunnable at the
moment its run() method is called, otherwise it associates the runnable
with the latest enqueued notificaiton record which has yet to post.
It then associates PostNotificationRunnable with the delayed cancel
list, executing any missed cancel operations immediately upon finishing
the PostNotificationRunnable.
Test: atest SystemUITests NotificationManagerServiceTest; manual
Bug: 162652224
Bug: 119041698
Change-Id: I88d3c5f4fd910a83974c2f84ae3e8a9498d18133
Originally, if the caller of navigateUpTo is alive, even the calling
uid is set to the caller who launched the existing destination activity,
the uid from caller process has higher priority to replace the given
calling uid. So this change doesn't modify the existing behavior if
the caller process is valid. Besides, the case of delivering new intent
uses the source record as calling identity too, so the case of starting
new activity should be consistent.
Also forbid attaching null application thread to avoid unexpected state
in process record.
Bug: 144285917
Test: atest ActivityStackTests#testNavigateUpTo
Test: atest CtsSecurityTestCases:ActivityManagerTest# \
testActivityManager_attachNullApplication
Change-Id: I60732f430256d37cb926d08d093581f051c4afed
Originally, if the caller of navigateUpTo is alive, even the calling
uid is set to the caller who launched the existing destination activity,
the uid from caller process has higher priority to replace the given
calling uid. So this change doesn't modify the existing behavior if
the caller process is valid. Besides, the case of delivering new intent
uses the source record as calling identity too, so the case of starting
new activity should be consistent.
Also forbid attaching null application thread to avoid unexpected state
in process record.
Bug: 144285917
Test: atest ActivityStackTests#testNavigateUpTo
Change-Id: I60732f430256d37cb926d08d093581f051c4afed
Applying theme on start
update system properties on startup to apply the updates
Fixes: 149441632
Fixes: 149385662
Test: UiModeManager tests
Change-Id: I7f71e27a43eb24be833b3003340653fefc75d0cc
Merged-In: I0bee6517b39216146681097262cf55c7192b0131
Force displaying system bars can cause app screen compatibility issues
in non-Automotive Android.
Bug: 148407132
Test: CTS Test + Unit Tests
Change-Id: Ia433572650760e3b85954724c63084dca769eaa0
Merged-In: Ia433572650760e3b85954724c63084dca769eaa0
The detector class to be used by the CountryDetectorService can be set
by overlaying config_customCountryDetector in the device config.
Test: atest CountryDetectorServiceTest
Bug: 141626568
Merged-In: I158abd6397e3102d13e431ba043e8ce45061b64a
Change-Id: I158abd6397e3102d13e431ba043e8ce45061b64a
(cherry picked from commit 34147601d8)
Currently backup service is re-activated unconditionally when clearing
a device owner but not profile owner. With this CL it should be
re-activate in both cases.
NB: there are two bits of state related to backup service:
1. activated or deactivated: This is out of user control, but can be
changed by the admin via DPM.setBackupServiceEnabled (this name is
a bit misleading here).
2. enabled or disabled: this is controlled by the user via Settings
and only available when backup service is activated (see 1.)
Bug: 143274029
Bug: 147997438
Test: atest CtsAdminTestCases && adb shell bmgr enabled
Test: atest com.android.server.devicepolicy.DevicePolicyManagerTest
Merged-In: I6f11642abe544c7df265ed7e2ad466d47796e7f9
Change-Id: I6f11642abe544c7df265ed7e2ad466d47796e7f9
(cherry picked from commit 775b26d884)
If adb is not enabled on a device then the adb key store is not
instantiated when the AdbDebuggingManager's handler is started as
in most cases it will not be needed. However if the user attempts
to revoke any previous adb grants when a device is booted with adb
disabled it will result in a NPE. This commit ensures the key store
is instantiated before attempting to revoke authorizations.
Test: atest AdbDebuggingManagerTest
Test: Manually invoked 'Revoke USB debugging authorizations' after
a boot with adb disabled.
Fixes: 145790817
Change-Id: Id00e531c18412be009a211eec80a72867659608f
Merged-In: Id00e531c18412be009a211eec80a72867659608f
The UID allocator stores complete UIDs, not app IDs. When removing a UID
from the range, we should therefore also use the UID, not the app ID.
Also added a test to cover this scenario, which passes with this change.
Bug: 146313311
Test: atest ActivityManagerTest
Change-Id: I1118ec73dcee5987e12f35aabce5cfa8cbe407a1
(cherry picked from commit c9a0df2d88)
Clean-up the test to use Mockito instead of the deprecated
AndroidTestCase, also getting rid of 1.5s of Thread.sleep.
No logic change.
Bug: 141626568
Test: atest CountryDetectorServiceTest
Merged-in: Ic0782b1ffcd1dcb30b9f1d91b37521d1f9887f03
Change-Id: Ic0782b1ffcd1dcb30b9f1d91b37521d1f9887f03
(cherry picked from commit 50361687ba)
One shot sensors need to be re-registered after they've been triggered.
Since DeviceIdleController wasn't doing that, we weren't properly
tracking motion to inform stationary listeners. This change makes sure
to re-register the motion sensor after some time to make sure motion is
properly tracked.
Bug: 140162457
Test: atest com.android.server.DeviceIdleControllerTest
Change-Id: Ic712e46bdc9d107d56cea3bce72c2e7b2187530a
Merged-In: I8600a8382b7c773be9e200afba96a7f1a74f6e10
See CL with change id (I0680034ed9315aa2c05282524d48faaed066ebd0) for
the meaningful changes/description. This change was reverted in qt-qpr1-dev
in order to fix a bug but never got unreverted due to the qt-dev CL
having the same change-id as the reverted one.
Bug: 119041698
Test: atest NotificationManagerServiceTest
Test: atest ForegroundServiceNotificationListenerTest
Change-Id: I50f16072b0e56ab69aabf8010ffffd172ca7c05a
Set allow app switches so the accessibility service can start activity
without delay.
Bug: 141873810
TEST: atest AccessibilityServiceConnectionTest
Change-Id: I4204c4cf0baa1f66d6d2d73d56a342ae803d24dd
(cherry picked from commit 24ef87d5f1)
Turn off color sampling for qpr2
A separate CL has been submitted to add an API
to enabled / disabled color sampling in master.
Bug: 143556482
Test: atest BrightnessTrackerTest
Change-Id: I4401cd35a2aa0ec35afaba928c95c971f92b0557
AppIdleHistory will fail to persist to disk if a null package name makes
it into the map. This change avoids the failure and adds more detail to
the log in the event of a failure.
Test: atest AppIdleHistoryTests
Fixes: 122609407
Change-Id: I30115265a1b963a0d66bad4fe15c69907ee8e53c
Merged-In: Ifec5a14f488fdb425bdcfee6ffe1f48f9fa9d1e8
When the user has Dark theme scheduling turned on (b/141567787), the quick settings tile subtext should reflect the following:
If Dark theme is on: "Until sunrise"
If Dark theme is off: "On at sunset"
If the user does not have Dark theme scheduled, the text should not appear.
This matches the appearance of the Night Light QS tile.
All starting windows snapshots will be deleted and splash screens
will be used instead.
Test: atest UiModeManagerServiceTest
Fix: 143874807
Merged-In: Ie2ce64b5c5544fffe76be7ec3f971eb7461f8c4d
Change-Id: Ie2ce64b5c5544fffe76be7ec3f971eb7461f8c4d
(cherry picked from commit 8b2671b029)
Create a constant in ContentSuggestionsManager, which will
be used to pass a hardware bitmap to ContentSuggestionsService.
In the presence of this key in the request extras, we skip taking a
snapshot in ContentSuggestionsPerUserService.
Bitmap is extracted from reading this value from extras in
ContentSuggestionsService.
Create ScreenshotNotificationSmartActionsProvider, which is overridden
in GoogleSystemUI.
Calling AiAi is guarded by a device config flag created in cl/277143225.
(cherry picked from commit d2010f2628 and c45d86fc15)
Test: Manually tested the code in this CL and corresponding change in SystemUIGoogle.
Took a screenshot and verified that AiAi gets invoked and the screenshot notification
shows smart actions.
Ran new tests added in this CL
'atest ScreenshotNotificationSmartActionsTest'
'atest ContentSuggestionsPerUserServiceTest'
Bug: 141634285
Change-Id: I439a4be9aac53fb02b566ae4d438afe3edf2b37a
Merged-In: I439a4be9aac53fb02b566ae4d438afe3edf2b37a
The cancel listeners are created per PendingIntent instance and were
spamming the callback list stored inside PendingIntentRecord. In cases
where there is even a single live PendingIntent backed by this
PendingIntentRecord, all PendingIntent instances backed by this
PendingIntentRecord for which a callback was ever registered will leak.
Test: atest FrameworksMockingServicesTests:\
com.android.server.am.PendingIntentControllerTest
atest FrameworksMockingServicesTests:\
com.android.server.AlarmManagerServiceTest
Bug: 143091024
Change-Id: I65df12da0c437064e6e3719911926738c677c4eb
Merged-In: I65df12da0c437064e6e3719911926738c677c4eb
(cherry picked from commit 0d51a8bcc0)