7123 Commits

Author SHA1 Message Date
Jay Aliomer
d175be5ebe Merge "Update NotificationRecord of snooze even after it is cancelled"
am: 10f4d427cd

Change-Id: Ibd4367f14ee326acfba3bb54ee701e8b0265aebf
2019-11-27 10:16:51 -08:00
Koji Fukui
7bb4802a03 Update NotificationRecord of snooze even after it is cancelled
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
2019-11-27 17:38:22 +00:00
Anna Trostanetski
aa7b68930a Merge "Add Listeners to PlatformCompat"
am: e14d7099a9

Change-Id: Id187394dc3f52f560faac6b9c73dea40119a5eff
2019-11-27 06:20:13 -08:00
Anna Trostanetski
e14d7099a9 Merge "Add Listeners to PlatformCompat" 2019-11-27 14:09:59 +00:00
Neil Fuller
e02dcaa9d1 Merge "Allow for empty time suggestions"
am: a241a15ccc

Change-Id: Ib6e1ddbba9c474f06475a666d025ab8e0f98189b
2019-11-27 02:04:56 -08:00
Neil Fuller
a241a15ccc Merge "Allow for empty time suggestions" 2019-11-27 09:45:53 +00:00
Sudheer Shanka
1381de466a Merge "Fix NetworkPolicyManager unit tests."
am: da3518bc6b

Change-Id: I4caf3995143b5dc63925e64a05dd9dd94deec636
2019-11-26 19:05:41 -08:00
Sudheer Shanka
2d1ab90aa2 Fix NetworkPolicyManager unit tests.
Bug: 137859686
Test: atest core/tests/coretests/src/android/net/NetworkPolicyManagerTest.java
Test: atest services/tests/servicestests/src/com/android/server/net/NetworkPolicyManagerServiceTest.java
Change-Id: I38a935c71bfb1f78739d508b400e43dc1b52bef5
Merged-In: I38a935c71bfb1f78739d508b400e43dc1b52bef5
(cherry picked from commit 6ec3caf21811ce40e188b7a43c744c0057cd54af)
2019-11-27 02:50:03 +00:00
atrost
0be238b455 Add Listeners to PlatformCompat
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
2019-11-25 18:19:08 +00:00
Richard Uhler
b646e555e8 Rename RollbackData to Rollback.
am: 91fc4db14e

Change-Id: I01d1329b3c49deee6b54ae77100cdaf71c3bbf55
2019-11-25 05:34:58 -08:00
Oli Lan
682e501c2a Remove INSTALLED_USERS extra from ACTION_PACKAGE_ENABLE_ROLLBACK.
am: 87a504d1fc

Change-Id: I8636d29038d10d3f4182e130de08ad8efa294a8e
2019-11-25 05:34:25 -08:00
Bill Lin
63e6d6af01 Merge changes from topic "migrate_CtsStagedInstallTest_RollbackTest"
* 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.
2019-11-25 02:56:10 +00:00
Xin Li
9ae3822f83 DO NOT MERGE - Merge QQ1A.191205.011 into stage-aosp-master
Bug: 144955631
Merged-In: I86c741f7ede242568aab436f673000c9f0da5813
Change-Id: Ia6a3a55023e4e66811c4ef7c6ccd05c5db3e5944
2019-11-24 05:17:08 +00:00
Kenny Root
1b506101de Merge "Make RecoverySystemService more testable"
am: 49af39e751

Change-Id: I79d712e2c8739212c4a62e9db6deddf28091fafc
2019-11-22 08:27:49 -08:00
Kenny Root
d508e1e61f Make RecoverySystemService more testable
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
2019-11-21 23:54:05 +00:00
David Su
c4df6668bb Merge "NetworkKey: migrate from ScanResult.wifiSsid to SSID"
am: 1124e240c0

Change-Id: Ia0c92f1db33b0a884da7388cd31b33d51df29288
2019-11-21 11:50:57 -08:00
David Su
1124e240c0 Merge "NetworkKey: migrate from ScanResult.wifiSsid to SSID" 2019-11-21 18:44:46 +00:00
Richard Uhler
91fc4db14e Rename RollbackData to Rollback.
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
2019-11-21 17:49:25 +08:00
Oli Lan
87a504d1fc Remove INSTALLED_USERS extra from ACTION_PACKAGE_ENABLE_ROLLBACK.
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
2019-11-21 17:41:10 +08:00
David Su
e51ae1566b NetworkKey: migrate from ScanResult.wifiSsid to SSID
wifiSsid is an @hide field, migrate to getter method.

Bug: 144311098
Test: atest NetworkKeyTest
Change-Id: Ic689e12b8de4af52fae26c25bc90c8eb093ad3fe
Merged-In: Ic689e12b8de4af52fae26c25bc90c8eb093ad3fe
2019-11-20 10:41:59 -08:00
Dario Freni
62637979e4 Merge changes from topic "apks_in_apex"
am: a8ce56e23f

Change-Id: I0373f86833f35ed61c3138d8f26d63667db03d7f
2019-11-20 08:07:42 -08:00
Neil Fuller
568fd897eb Allow for empty time suggestions
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
2019-11-20 16:04:37 +00:00
Dario Freni
a8ce56e23f Merge changes from topic "apks_in_apex"
* changes:
  PackageAbiHepler no longer modifies Package
  Adds scan unit tests
2019-11-20 15:43:57 +00:00
Beverly
e9e1e8290a Merge "Update equals and hashCode methods of NoMan.Policy"
am: e3d6061a67

Change-Id: I723e70a5e6c856ecd693d9b6eb8c592303fe9f11
2019-11-18 13:53:33 -08:00
Beverly
3fe3e8195a Update equals and hashCode methods of NoMan.Policy
Test: atest AudioManagerTest#testPriorityOnlyChannelsCanBypassDnd
Fixes: 142643922
Change-Id: I15835f784ba73b40eccf92a0a430905d28647669
Merged-In: I15835f784ba73b40eccf92a0a430905d28647669
(cherry picked from commit 4f8b0224e12037f5c41200722d689e1c8e0d8e1e)
2019-11-18 13:55:43 -05:00
Patrick Baumann
235e52eace PackageAbiHepler no longer modifies Package
Bug: 137881067
Test: atest ScanTests
Exempt-From-Owner-Approval: Already approved in
https://googleplex-android-review.git.corp.google.com/c/platform/frameworks/base/+/8884794

Change-Id: I50f7c200bc97f08e49f33158bf1df7881b9b231a
Merged-In: I060f2d1395886a9eebce703bd80149559f9c39bb
2019-11-16 22:38:49 +08:00
Patrick Baumann
f62817e86e Adds scan unit tests
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
2019-11-16 22:38:26 +08:00
Howard Chen
a0dc5e8e10 Merge "Use the new gsid interface"
am: c68c069db7

Change-Id: I7d8d96c8de5089360302deef783cf617a94a7abc
2019-11-15 04:04:57 -08:00
Howard Chen
c68c069db7 Merge "Use the new gsid interface" 2019-11-15 11:05:16 +00:00
Howard Chen
6ea5beddd9 Use the new gsid interface
This CL supports gsid refactoring aosp/1148898.

Test: adb shell am start-activity \
                -n com.android.dynsystem/com.android.dynsystem.VerificationActivity \
                -a android.os.image.action.START_INSTALL \
                -d file:///storage/emulated/0/Download/system.raw.gz \
                --el KEY_SYSTEM_SIZE $(du -b system.raw|cut -f1) \
                --el KEY_USERDATA_SIZE 8589934592
Change-Id: I0209a1b0750e96623f90f134bb18d37254249fbd
2019-11-12 18:29:18 +08:00
Bill Lin
f17cec022f Merge changes from topic "apex_migration"
am: c29a5cf115

Change-Id: Ifc8a986f9daf4ed0bffc901b7ab09afef0355f99
2019-11-07 11:11:53 -08:00
Bill Lin
423379c9d6 Implement ApexManager UnitTest
Create ApexManagerTest.java for ApexManager

Fixes: 136247730
Fixes: 142384111
Test: atest ApexManagerTest
Test: atest CtsStagedInstallHostTestCases
Change-Id: Ie4ef02cbd993d97a6e407a508ef33ee219c3fbb9
2019-11-07 11:55:06 +00:00
TreeHugger Robot
abc015499a Merge "DO NOT MERGE - qt-qpr1-dev-plus-aosp-without-vendor@5915889 into stage-aosp-master" into stage-aosp-master 2019-10-31 18:38:40 +00:00
Xin Li
6f48900f50 DO NOT MERGE - qt-qpr1-dev-plus-aosp-without-vendor@5915889 into stage-aosp-master
Bug: 142003500
Change-Id: If5056a73ede668b0048ca107b686413695e5b3b6
2019-10-30 14:33:01 -07:00
Jeongik Cha
cc0b57ca06 Change AIDL module name
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
2019-10-29 16:01:18 +09:00
Xin Li
d3498e3053 Merge Coral/Flame into AOSP master
Bug: 141248619
Change-Id: Ic0486c8c79d94c9a30efa37676b2f6a94fb7b5fa
Merged-In: Ibe8ff7bdba7a886bd8b91155ae56f087a836981f
2019-10-25 10:27:58 -07:00
Howard Chen
6b1e8cc0ab Merge "Use new GsiInstallParams struct"
am: 7898d33e3a

Change-Id: I3f05bf9db6e5db4c675791295cc6bffe4098db32
2019-10-25 00:37:53 -07:00
Howard Chen
e176c56f6e Use new GsiInstallParams struct
Bug: 139402092
Test: adb shell am start-activity \
            -n com.android.dynsystem/com.android.dynsystem.VerificationActivity \
            -a android.os.image.action.START_INSTALL \
            -d file:///storage/emulated/0/Download/system.raw.gz \
            --el KEY_SYSTEM_SIZE $(du -b system.raw|cut -f1) \
            --el KEY_USERDATA_SIZE 8589934592

Change-Id: I62330ccbe3c863850b545db5e911196d22f518d7
2019-10-24 21:34:43 +00:00
Neil Fuller
3150e58082 Merge "Make TimeDetectorService more aware of origin"
am: 4ef2551dfa

Change-Id: I27866cf74b779bb0040f4ace384207047ca6838f
2019-10-21 11:53:20 -07:00
Neil Fuller
af3eeaf431 Make TimeDetectorService more aware of origin
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
2019-10-21 08:42:50 +01:00
Xin Li
5c4d37fc17 DO NOT MERGE - Merge QD1A.190821.011 into stage-aosp-master
Bug: 141248619
Change-Id: I078f35ceef06ae7d08c5de385fd023c71c1ecbac
2019-10-14 22:54:53 +00:00
Evan Laird
055976434b Force FGS notifications to show for a minimum time
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)
2019-10-11 02:34:54 +00:00
Julia Reynolds
c3918379eb Merge "Reduce unnecessary NotificationListener binder transaction."
am: d3ec7950e3

Change-Id: Ic0d876ee823ec1527229bfff2b117256e3e768b4
2019-10-04 07:05:03 -07:00
Julia Reynolds
d3ec7950e3 Merge "Reduce unnecessary NotificationListener binder transaction." 2019-10-04 13:41:58 +00:00
woongki min
bbc972806b Reduce unnecessary NotificationListener binder transaction.
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
2019-10-03 13:38:51 +09:00
Suprabh Shukla
1ea52041e2 DO NOT MERGE revoke certain app-ops on suspend am: 873e19f63f am: 53ca466732
am: 15c374d84b

Change-Id: Icd0fc56768f47f6152cd022edb1752aa3bb3a4ad
2019-09-27 19:52:40 -07:00
Suprabh Shukla
15c374d84b DO NOT MERGE revoke certain app-ops on suspend am: 873e19f63f
am: 53ca466732

Change-Id: I9487bfaf93255ca485ce8eacf940cc9748b39859
2019-09-27 19:44:46 -07:00
Suprabh Shukla
16acbaac55 DO NOT MERGE revoke certain app-ops on suspend am: 873e19f63f
am: 53ca466732

Change-Id: I5f7456bc746affacbb949a9883484dfb8aaf7234
2019-09-27 19:44:44 -07:00
Suprabh Shukla
53ca466732 DO NOT MERGE revoke certain app-ops on suspend
am: 873e19f63f

Change-Id: I2447a90e4935e53fc0d55510bb50938fdaea23fa
2019-09-27 19:31:51 -07:00
Jeongik Cha
cac5791954 Merge changes from topic "system_ext" am: a828ee6442 am: dee02a0fae
am: 6a46c5315a

Change-Id: Ic31f9d12fffda486d36ce427848e04c7755cc531
2019-09-26 16:00:00 -07:00