Symptom:
If a snoozed notification is cancelled and new notification that has
same key is registered, the system continue to snooze the
notification. But the notification won't be notified when the snoozing
period expires.
Root cause:
SnoozeHelper doesn't update NotificationRecord if the existing record
has already been cancelled. SnoozeHelper continue to use existing
cancelled record. So SnoozeHelper doesn't repost notification when the
snoozing period expires.
Solution:
SnoozeHelper updates NotificationRecord even if the existing record
has been cancelled.
Fixes: 140462813
Change-Id: I4b58aed20eec08819e36dac9dda250ac046205b8
This allows doing more work except killing the app upon change override.
Up to one listener per change id is allowed. Currently intended for
SeLinux usecase only (for data relabeling, see http://ag/9635653).
Test: atest FrameworksServicesTests
Bug: 143539591
Change-Id: Ib2110a31d4f521fc8054620a9edf902fa5bba501
* changes:
Add multi-user test for the general non-staged case
Increase timeout in testNativeWatchdogTriggersRollback
Fix flaky testEnableRollbackTimeoutFailsRollback test
Wait for available rollbacks in RollbackTest.
Include NewRollbacks in result of getAvailableRollbacks.
Rename RollbackData to Rollback.
Remove INSTALLED_USERS extra from ACTION_PACKAGE_ENABLE_ROLLBACK.
Update to new RollbackUtils.sendCrashBroadcast API.
Extend ROLLBACK_COMMITTED broadcast for the multi-user case
Fix NullPointerException.
Cleanup some obsolete TODOs and unused code.
Test Native Watchdog triggers RollbackManager rollback
Uninstall testapps before running SecondaryUserRollbackTest
delete ENABLING rollback if we can't get session info for it.
Add test for rollback of userdata with multiple rollbacks
Load rollback data in RollbackManagerServiceImpl constructor.
Use "commit" for rollbacks instead of "execute".
Add TestApi to block the RollbackManagerHandlerThread.
Use Slog in RollbackManager, not Log
Make setRequestDowngrade @TestApi
Migrate RollbackTest and StagedRollbackTest to cts utils
Add .apex suffix to apex files during validation
Add host side test for secondary user rollback
Reduce ENABLE_ROLLBACK timeout to 0 for timeout test.
This allows the RecoverySystemService to be instantiated outside of its
lifecycle events and mocked connections to be injected during the tests.
Test: atest FrameworksServicesTests:RecoverySystemServiceTest
Merged-In: If75632b8dc16c916f3fa90853d6c1863b75d2c64
Change-Id: If75632b8dc16c916f3fa90853d6c1863b75d2c64
Because "Data" doesn't add anything useful to the name.
Also prefer the variable name "rollback" over "data" and "rd" for
instances of Rollback.
Test: builds.
Change-Id: Ibaa3326660345a763c67c573368ba1da11c0a830
Merged-In: I5ae3866753d6badcdf019525b40522937568dee5
This changes RollbackManagerServiceImpl to use the list of installed users
that is passed in to snapshotAndRestoreUserData for the purpose of snapshotting.
With this change, it is no longer necessary for the list of installed users to be
added as an extra to the ENABLE_ROLLBACK intent, so that extra
(EXTRA_ENABLE_ROLLBACK_INSTALLED_USERS) is removed.
Bug: 139181444
Test: atest RollbackTest
Test: atest AppDataRollbackHelperTest
Exempt-From-Owner-Approval: Already approved in
https://googleplex-android-review.git.corp.google.com/c/platform/frameworks/base/+/9168506
Change-Id: Iff42f4e5b2d02d1124d64a5fedc659a41cddd5fc
Merged-In: Iffd63977a7498e3cba20d2039af623c921d38f57
Allow for empty time suggestions in the TimeDetectorService. The empty
suggestions are currently ignored but are likely to be used in future
time detector strategy implementations.
Bug: 140712361
Test: atest android.app.timedetector.PhoneTimeSuggestionTest
Test: atest com.android.server.timedetector
Change-Id: Ifb219702fa8bc53665a0d74752e06d851d86f8bb
This change adds much needed unit tests to the scanPackageOnlyLI method
in PackageManagerService. As part of the change, the abi-deriving /
parsing code that is heavily device state dependant has been extracted
into an interface that can be mocked.
Test: atest ScanTests
Bug: 137881067
Bug: 137961986
Exempt-From-Owner-Approval: Already approved in
https://googleplex-android-review.git.corp.google.com/c/platform/frameworks/base/+/7844466
Change-Id: If99330c63658ff21c799712f99c9bb5eba35b960
Merged-In: Ib0b17bffa02570451bd2ad6a649791832c9edd65
Naming rule for aidl module is changed to make using unstable AIDL module more explicit
So, to use unstable version AIDL module, use "-unstable" suffix version
And also, module name without any suffix means latest frozen version.
But wrt modules for C++ and NDK, module name with latest frozen version
is not available for now.
In b/139280289, more background is explained
Test: m
Bug: 139280289
Change-Id: Ib38e2cb114cc373ef50652f421ddaff9b4fbe5b9
Merged-In: Ib38e2cb114cc373ef50652f421ddaff9b4fbe5b9
Make TimeDetectorService more aware of a time signal's origin by making
the time signal from telephony less generic.
When TimeDetectorService was written it was assumed that the TimeSignal
could be generic and there would just be a String source identifier to
indicate origin.
With multiple SIMs / phones on a device it makes sense to keep track of
the originating phone of the signal so that the time detector service
could implement stickiness if it wanted. This would avoid a device
alternating back and forth between two signals and help with debugging.
As new signals are added, new "suggestXxxxTime()" methods will be added
to TimeDetectorService. That is the point at which the strategy for
ranking different sources can be decided. e.g. should NTP always rank
higher than NITZ?
The main change here is that TimeSignal is renamed to
PhoneTimeSuggestion to indicate it's only for use by signals from
telephony, sourceId has been removed and it has been given a phoneId
instead. Extra free-form metadata (mDebugInfo) has been added to assist
with logging / debugging.
Bug:140712361
Test: atest android.app.timedetector
Test: atest com.android.server.timedetector
Change-Id: I5305c34516e5f4e254309193183f00e054801a46
It's possible for a service to do a start/stop foreground and cause a
couple of things to happen:
NotificationManagerService will enqueue a EnqueueNotificationRunnable,
post a PostNotificationRunnable (for the startForeground), and then also
enqueue a CancelNotificationRunnable. There is some racy behavior here
in that the cancel runnable can get triggered in between enqueue and
post runnables. If the cancel happens first, then
NotificationListenerServices will never get the message.
This behavior is technically allowed, however for foreground services we
want to ensure that there is a minmum amount of time that notification
listeners are aware of the foreground service so that (for instance) the
FGS notification can be shown.
This CL does two things to mitigate this problem:
1. Introduce checking in the CancelNotificationRunnable such that it
will not cancel until after PostNotificationRunnable has finished
executing.
2. Introduce a NotificationLifetimeExtender method that will allow a
lifetime extender to manage the lifetime of a notification that has been
enqueued but not inflated yet.
Bug: 119041698
Test: atest NotificationManagerServiceTest
Test: atest ForegroundServiceNotificationListenerTest
Change-Id: I0680034ed9315aa2c05282524d48faaed066ebd0
Merged-In: I0680034ed9315aa2c05282524d48faaed066ebd0
(cherry picked from commit 5136eefeb3e343ad2a487296063d19e01ea554e0)
When package suspend occurs, API calls are made as many as the number of changed packages,
resulting in unnecessary binder transactions.
This can rapidly consume the async space on the NotificationListener side, such as the SystemUI.
JavaBinder: !!! FAILED BINDER TRANSACTION !!! (parcel size = 8844)
NotificationListeners: unable to notify listener (posted): android.service.notification.INotificationListener$Stub$Proxy@8ed47e2
NotificationListeners: android.os.DeadObjectException: Transaction failed on small parcel; remote process probably died
Test: Occurs ACTION_PACKAGES_UNSUSPENDED/SUSPENDED with a pkgList size of 50 or more
Test: Async space of SystemUI(NotificationListener) decreases and binder transaction fails.
Change-Id: I58d42ecf39e13b3adce7652ae72147de0be00e89