Commit Graph

24440 Commits

Author SHA1 Message Date
Varun Shah
9e283d5e37 Merge "Introduce a new permission for LRJ." 2022-10-28 07:54:40 +00:00
Ruslan Tkhakokhov
8264c8dbce Add implementation for BackupRestoreEventLogger
Bug: 252762060
Test: atest BackupRestoreEventLoggerTest
Change-Id: If5516b873b5a0562c819d45270c27187280da3e6
2022-10-27 09:02:40 +00:00
Thiébaud Weksteen
ea6b13120e Merge "Add PermissionEnforcer class" 2022-10-26 22:20:23 +00:00
Sudheer Shanka
755b166f80 Merge "Allow senders to specify "merged" delivery group policy." 2022-10-26 15:56:07 +00:00
Sudheer Shanka
152b879153 Merge "Promote delivery group policy related APIs to @SystemApi." 2022-10-26 13:21:01 +00:00
Sudheer Shanka
c2a195074b Allow senders to specify "merged" delivery group policy.
Bug: 249160234
Test: atest FrameworksMockingServicesTests:BroadcastQueueTest
Test: atest FrameworksMockingServicesTests:BroadcastQueueModernImplTest
Change-Id: Ic998c98e85b17e8d6958178904d901d4c6fd553b
2022-10-26 10:41:34 +00:00
Sudheer Shanka
cade72637d Promote delivery group policy related APIs to @SystemApi.
Bug: 249160234
Test: atest FrameworksMockingServicesTests:BroadcastQueueTest
Test: atest FrameworksMockingServicesTests:BroadcastQueueModernImplTest
Change-Id: I2126254028e783004b74e0b39c2c62024c6e9a55
2022-10-26 00:54:01 -07:00
Varun Shah
414f5c6c25 Introduce a new permission for LRJ.
Add a new permission "RUN_LONG_JOBS" for apps which lets them schedule
long running jobs.

Since this will be a "normal|appop" permission, add the AppOps logic as
well.

Bug: 255038128
Test: build/manual
Change-Id: I27637f2a502bbd615df2d6fb0e558bece60ddaf0
2022-10-25 22:43:28 +00:00
Hai Zhang
0dd6333b08 Clarify that OPSTR constants don't have to be system APIs.
System APIs should only be created when needed.

Test: presubmit
Change-Id: I9e00b7a3008e71ce2a7ebaeac31c545137606477
2022-10-25 20:25:47 +00:00
Lee Shombert
baa2230821 Merge "Add PropertyInvalidatedCacheTests to presubmit" 2022-10-25 16:00:55 +00:00
Riddle Hsu
1178705e53 Merge "Only set locale in config for updating locale" into tm-qpr-dev am: b553c74619 am: ada9d7accb
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20235235

Change-Id: I88c62a628a57f8f39bd5d9b849372e0f74e0e430
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-10-25 14:18:11 +00:00
Riddle Hsu
ada9d7accb Merge "Only set locale in config for updating locale" into tm-qpr-dev am: b553c74619
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20235235

Change-Id: I1cb0b923aa4673e4d04abbf65f143d142cdb0ac5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-10-25 13:40:11 +00:00
Riddle Hsu
b553c74619 Merge "Only set locale in config for updating locale" into tm-qpr-dev 2022-10-25 13:07:32 +00:00
Jeff Sharkey
e7eb1719ce Merge changes from topic "oct21"
* changes:
  Apply negative delay to "urgent" broadcasts.
  Deliver handful of system broadcasts as unordered.
  BroadcastQueue: more misc fixes before dogfooding.
2022-10-25 11:49:52 +00:00
Hai Zhang
5611f58784 Merge "Move TypedXml{Parser,Serializer} to modules utils package." 2022-10-25 02:44:29 +00:00
Jeff Sharkey
2d4f558d57 Deliver handful of system broadcasts as unordered.
Several existing broadcasts are being sent as ordered simply to
receive a "resultTo" signal when dispatch is finished.  This was
reasonable in the legacy stack, since only one receiver was
dispatched at a time, but the modern stack can dispatch to multiple
receivers in parallel.

This change updates BOOT, SCREEN, and PACKAGE broadcasts to pivot
to this new approach when the modern queue is enabled; we retain
the previous ordered behavior when the legacy queue is being used.

Bug: 253226131
Test: atest FrameworksMockingServicesTests:BroadcastRecordTest
Test: atest FrameworksMockingServicesTests:BroadcastQueueTest
Test: atest FrameworksMockingServicesTests:BroadcastQueueModernImplTest
Change-Id: I81299b9ec6f509f5b73dfe9484aca12794eb3868
2022-10-24 14:53:19 -06:00
Iavor-Valentin Iftime
83fbf2407d Merge "Add RECEIVE_EXPLICIT_USER_INTERACTION_AUDIO AppOp" 2022-10-24 17:57:06 +00:00
Valentin Iftime
8f7ee077c8 Add RECEIVE_EXPLICIT_USER_INTERACTION_AUDIO AppOp
New AppOp to be used for near-field file-based audio transfer
  (ie. TV Remote Service) to allow audio recording
  regardless of sensor privacy state, because it is considered
 an intentional user interaction: hold-to-talk

 And new Global Settings and SensorPrivacyManager APIs for the
 opt-out toggle - as agreed with PWG.

Bug: 235618473
Test: manual

Change-Id: I95cdf8fa362b937609bdf834a82b05ec8375ac26
2022-10-24 17:52:49 +00:00
Jing Ji
2253c02b80 Highlight the javadoc about the changes in killBackgroundProcesses
Bug: 239423414
Test: m offline-sdk-docs
Change-Id: Ieed6af77da1bc31cfecc5272b9f97971db7ae7b2
2022-10-22 14:09:49 -07:00
Jing Ji
38cde61727 Merge "ActivityManager#killBackgroundProcesses can kill caller's own app only" 2022-10-22 19:35:18 +00:00
Amos Bianchi
d0ff205bcf Merge "Add Device Lock service to system server." 2022-10-21 17:47:30 +00:00
Neil Fuller
a2e4669df1 Merge "API changes for device initialization / SUW" 2022-10-21 16:44:33 +00:00
Julia Reynolds
33f3cd67e7 Merge "Fix notification tests" into tm-qpr-dev am: 79cf8d64b7
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20239847

Change-Id: Iacaf775a80e36d067a3ef6190c8bfeca8d9d52d1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-10-21 14:10:33 +00:00
Hai Zhang
e55b8eeb28 Move TypedXml{Parser,Serializer} to modules utils package.
A subsequent change will actually move the files to the other git
project.

Bug: 243194720
Test: presubmit
Change-Id: If126bb68f74852528c4da8df79831b49b5129983
2022-10-21 04:28:13 -07:00
Amos Bianchi
62e8cf3a70 Add Device Lock service to system server.
Bug: b/241442337
Bug: b/228907574
Test: service successfully starts
Test: atest DeviceLockUnitTests
Test: cts-tradefed run cts -m CtsDeviceLockTestCases

Change-Id: I928d697c4040168955090712547c973a9e7ff61c
2022-10-20 22:50:42 -07:00
Jeff Sharkey
1c5c28968a Merge "Prioritize some broadcasts ahead of strict FIFO" 2022-10-20 16:08:20 +00:00
Riddle Hsu
03f0f57e6b Only set locale in config for updating locale
To update locale, it doesn't need a full configuration because
system only applied the diff of config from non-undefined fields.

IActivityManager#getConfiguration actually gets the configuration
according to the pid, which is process configuration. And process
configuration can be overridden by the activity running in its
process. So the returned value shouldn't be used to update the
system persistent configuration.

Therefore it is enough to use a new Configuration instance with
setting the necessary fields. This is also more efficient that
saves a binder call to system.

Bug: 253386061
Test: atest LocaleManagerTests
Change-Id: Icdce437fcf1a3bef0562cfc4dd5ad3ba52ea08ef
2022-10-20 14:41:47 +00:00
Julia Reynolds
1c897114d8 Fix notification tests
- Fix method incorrectly marked test
- Fix access to non-@hide methods
- Fix a logic error in Notification.java
- Move the 'core' notification test that were in the services suite to
the 'core' suite

Test: atest NotificationTest
Fixes: 254459150
Change-Id: Ib2793badb6b0616097bb837d7fd2c7504a43e186
(cherry picked from commit a4d04b1534)
2022-10-20 13:55:09 +00:00
Julia Reynolds
3bf839938c Merge "Fix notification tests" 2022-10-20 11:12:38 +00:00
Sarp Misoglu
ae5ef2ef3a Merge "Add BackupTransport#getBackupManagerMonitor" 2022-10-20 08:58:23 +00:00
Julia Reynolds
a4d04b1534 Fix notification tests
- Fix method incorrectly marked test
- Fix access to non-@hide methods
- Fix a logic error in Notification.java
- Move the 'core' notification test that were in the services suite to
the 'core' suite

Test: atest NotificationTest
Fixes: 254459150
Change-Id: Ib2793badb6b0616097bb837d7fd2c7504a43e186
2022-10-19 19:53:05 +00:00
Ruslan Tkhakokhov
5a7e4de2f0 Merge "Add skeleton for BackupRestoreEventLogger" 2022-10-19 18:49:04 +00:00
Sudheer Shanka
56cec3db5f Merge "Allow senders to specify delivery group policies." 2022-10-19 18:22:20 +00:00
Zimuzo Ezeozue
13067850e6 Merge changes from topic "aidl_trace" am: e75a6f8696 am: 7a54741e61
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2254718

Change-Id: I876702d1964ac6e065e4f829a5c06a4ea32a4b84
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-10-19 18:12:51 +00:00
Zimuzo Ezeozue
7a54741e61 Merge changes from topic "aidl_trace" am: e75a6f8696
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2254718

Change-Id: Iaa231773191a436e176730d0fb5ae1a9965d71ff
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-10-19 17:45:02 +00:00
Felipe Leme
0b05542d67 Merge "Fixed permission on AM.startUserInBackgroundOnSecondaryDisplay()" 2022-10-19 17:17:47 +00:00
Zimuzo Ezeozue
e75a6f8696 Merge changes from topic "aidl_trace"
* changes:
  Clean up binder txn tracking special case
  Enable binder txn tracing more broadly
2022-10-19 17:08:05 +00:00
Ruslan Tkhakokhov
9d02709874 Add skeleton for BackupRestoreEventLogger
Add class definition for BackupRestoreEventLogger which will be used to
allow BackupAgent implementations to report B&R-related events.
Implementation will follow.

Bug: 252762060
Test: m-j
Change-Id: Ib988e99863e46b03a48a0d35f4960870952b8613
2022-10-19 16:31:36 +01:00
Sarp Misoglu
f7fbe355ed Add BackupTransport#getBackupManagerMonitor
This allows the framework to ask for a monitor to use for backups that
are initiated by the framework (i.e. scheduled backups). Previously
the only way to pass a monitor in was through the
BackupManager#requestBackup API.

I also moved BackupManagerMonitorWrapper to a separate class now that
it's shared by three different classes.

Bug: 252763821
Test: atest CtsBackupHostTestCases
  Also manually by implementing a simple monitor inside LocalTransport
  and calling the new getBackupManagerMonitor.
Change-Id: I84d56a3e80d6c94f9a327f7d71876d1bc27fe5ac
2022-10-19 13:26:03 +00:00
Sudheer Shanka
d1712e4597 Allow senders to specify delivery group policies.
While sending the broadcast, sender can specify
what delivery group the broadcast belongs to and
how it should be treated if there are already
broadcasts in the same delivery group waiting to
be delivered.

Bug: 249160234
Test: atest FrameworksMockingServicesTests:BroadcastQueueTest
Test: atest FrameworksMockingServicesTests:BroadcastQueueModernImplTest
Change-Id: Ie6e8164ff37ec5501482adc9419959cc7e149d90
2022-10-19 12:33:39 +00:00
Josh Hou
6cb6091dc6 Merge "[Panlingual] Expose the API for the current IME" 2022-10-19 07:38:25 +00:00
Joanne Chung
a94f5bbcbc Merge "Dump App exit reason if the remote service died." 2022-10-19 04:40:19 +00:00
Louis Chang
a3e880d91b Merge "Always report Activity configuration changes unless relaunch" 2022-10-19 03:32:41 +00:00
Jeff Sharkey
f7b7e8bcab Merge changes from topic "oct11"
* changes:
  BroadcastQueue: Handle successor ProcessRecords.
  More robust ProcessRecord routing for resultTo.
2022-10-18 21:37:39 +00:00
Christopher Tate
0b35f9df78 Prioritize some broadcasts ahead of strict FIFO
User-interactive event flow and broadcast priority classes both suffer
from priority inversion issues with strict FIFO dispatch policy:
existing queued deliveries might require significant time to complete
dispatch, with the resulting delivery latency of the interactive or
foreground-priority messages leading to poor user experience.  To
address this issue, we introduce urgency-base queueing policy, with
"urgent" broadcasts placed ahead of ordinary ones in the recipients'
pending queues.  A broadcast is currently considered urgent when:

* the sender has marked it FLAG_RECEIVER_FOREGROUND, or
* the sender has marked it as "interactive", or
* the broadcast was issued by an alarm triggering

AND

* the broadcast is only going to a single receiver

That final restriction prevents certain kinds of interference with
ordered broadcast delivery and completion semantics.

"interactive" is a new BroadcastOption applied when the broadcast
issuance is in response to a direct user interaction, i.e. when
timeliness of delivery is directly perceived as a responsiveness issue
by the user.  The canonical example of this is notification
interactions, though perhaps the concept might usefully be applied to
scenarios such as high-priority push message delivery.  For now its use
is restricted to system-internal callers.

Finite capacity for dispatch parallelism can currently cause priority
inversions even with the new queueing policy if all available running
slots are occupied with background-priority deliveries.  Addressing
this will happen in a follow-on CL.

Bug: 251902289
Test: atest FrameworksMockingServicesTests:BroadcastQueueModernImplTest
Test: atest FrameworksMockingServicesTests:BroadcastQueueTest
Change-Id: I47813c2c6ca43559f39d701f104fa62527c7bc21
2022-10-18 14:30:58 -07:00
Automerger Merge Worker
dcae7d9f7c Merge changes from topic "am-acaafc0086a64d01a48d5fafba82c641"
* changes:
  Merge "Add a flag to enable independent lock screen live wallpaper" into tm-qpr-dev am: cb69035ca9 am: 80c0576162
  Merge "Lock screen live wallpaper: adds home/lock screen flag as argument." into tm-qpr-dev am: 0f8f2d726b am: e5e1aa95a5
2022-10-18 16:17:39 +00:00
Lee Shombert
48d4eac43d Merge "Fix concurrency issue in PropertyInvalidatedCache" 2022-10-18 16:17:19 +00:00
Chris Poultney
c22d2ce264 Merge "Lock screen live wallpaper: adds home/lock screen flag as argument." into tm-qpr-dev am: 0f8f2d726b am: e5e1aa95a5
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20122170

Change-Id: Iedfe67b28f3a950a989b229bb2da14320b991fd9
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-10-18 16:16:04 +00:00
Chris Poultney
e5e1aa95a5 Merge "Lock screen live wallpaper: adds home/lock screen flag as argument." into tm-qpr-dev am: 0f8f2d726b
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20122170

Change-Id: Ib4e2321373420b1c7fdfd47cca372bbf3baa122a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-10-18 15:45:18 +00:00
Chris Poultney
0f8f2d726b Merge "Lock screen live wallpaper: adds home/lock screen flag as argument." into tm-qpr-dev 2022-10-18 15:06:21 +00:00