Commit Graph

24600 Commits

Author SHA1 Message Date
Chris Poultney
b7134cd71d Merge "Lock screen live wallpaper: adds home/lock screen flag as argument." 2022-11-22 14:48:47 +00:00
Sudheer Shanka
6fe293bbae Merge "Allow senders to specify the delivery group via matching filters." 2022-11-22 12:01:06 +00:00
Xiang Wang
f0a11f4563 Merge changes from topics "game-mode-custom", "no-game-mode-supported"
* changes:
  Add IGameModeListener and methods to add/remove in GameManagerService
  Disallow setting UNSUPPORTED mode to avoid ambiguity
  Always return STANDARD & CUSTOM game modes as available modes
2022-11-22 04:13:35 +00:00
Xiang Wang
8fe347b0ac Merge changes I0317cf08,Ie1db1889,I0909bc7c
* changes:
  Add updateCustomGameModeConfiguration system API
  Add GameModeConfiguration
  Add opt-in game modes and intervention flags to GameModeInfo
2022-11-22 02:11:13 +00:00
Sudheer Shanka
7645452cd1 Allow senders to specify the delivery group via matching filters.
Senders can specify an IntentFilter object that should match
against another broadcast intent to be considered in the same
delivery group.

Bug: 249160234
Test: atest services/tests/mockingservicestests/src/com/android/server/am/BroadcastRecordTest.java
Test: atest services/tests/mockingservicestests/src/com/android/server/am/BroadcastQueueModernImplTest.java
Test: atest tests/app/src/android/app/cts/BroadcastOptionsTest.java
Test: atest tests/tests/content/src/android/content/cts/IntentFilterTest.java

Change-Id: I36f1e3ffab8e30371a9968cb23c7b345c3301682
2022-11-22 01:04:29 +00:00
Makoto Onuki
0d5fe72137 Merge "Set proper procstate and oom-adj for SHORT_SERVICE FGS." 2022-11-21 23:09:32 +00:00
Xiang Wang
8b9be354e1 Add IGameModeListener and methods to add/remove in GameManagerService
Bug: b/243448953
Test: atest GameManagerServiceTests
Change-Id: I5e286ee46d118fe2e88782bc7751f4ec650323b3
2022-11-21 14:52:53 -08:00
Xiang Wang
db78635eef Disallow setting UNSUPPORTED mode to avoid ambiguity
Replace the UNSUPPORTED mode read from settings file with STANDARD.

Bug: b/243448953
Test: atest GameManagerServiceTests GameManagerTest
Change-Id: I503e98447b8f522e9df4fec87f179578d7a21f3e
2022-11-21 14:52:06 -08:00
Xiang Wang
4ab05d0668 Add updateCustomGameModeConfiguration system API
Bug: b/243448953
Test: atest GameManagerTests GameManagerServiceTests
Change-Id: I0317cf08e146fa7da623ada670223dc63106b266
2022-11-21 14:45:11 -08:00
Xiang Wang
1418f411e5 Add GameModeConfiguration
Bug: b/243448953
Test: atest GameModeConfigurationTest GameModeInfoTest
Change-Id: Ie1db1889c82ca01ede6de9c68076f67a423ae484
2022-11-21 14:45:11 -08:00
Xiang Wang
8954f782ad Add opt-in game modes and intervention flags to GameModeInfo
Bug: b/243448953
Test: atest GameManagerServiceTests
Change-Id: I0909bc7cb9193418effd9231f747fe0b838ba366
2022-11-21 14:44:34 -08:00
Xiang Wang
b6f89235d6 Merge "Include public GameManager unit tests in presubmit" 2022-11-21 22:41:43 +00:00
TreeHugger Robot
a42c092cb1 Merge "Add killing subreason for undelivered broadcast" 2022-11-21 21:56:31 +00:00
Xiang Wang
62fbe39ad6 Include public GameManager unit tests in presubmit
Bug: b/243448953
Test: (frameworks/base/services/core/java/com/android/server/app) atest
Change-Id: Iea84369dda83d754ed72b1a3a75221f627c4a0ea
2022-11-21 21:27:15 +00:00
Kholoud Mohamed
3250c65594 Merge changes Ifbaf0f19,Ia7eb2e35,I6e2a7a3f
* changes:
  Add lockTask policy definition
  Persist policies set through the device policy engine
  Add boiler plate for the policy engine
2022-11-21 20:46:05 +00:00
Makoto Onuki
ee5863e4f5 Set proper procstate and oom-adj for SHORT_SERVICE FGS.
We use:
- PROCESS_STATE_IMPORTANT_FOREGROUND
- ProcessList.PERCEPTIBLE_MEDIUM_APP_ADJ + 1

- Oom-adj will be PERCEPTIBLE_RECENT_FOREGROUND_APP_ADJ + 1
  for the first N seconds when started from TOP.

The "+1" is so we can tell apart short-FGS from regular FGS and EJ.

Also, we slightly the oom-adj for EJ -- +2 to the original values -- so
we can tell them apart from FGS / short-FGS.

- Other restrictions of short-FGS aren't implemented yet.

Test: atest FrameworksServicesTests:OomAdjusterTests MockingOomAdjusterTests
Test: Manual test using the test app, monitoring `dumpsys activity processes| grep PACKAGE`

... First N seconds after started from TOP:
```
Proc # 1: fg +51 F/S/IMPF ---N  t: 0 8851:com.google.omakoto.testapp/u0a252 (fg-service-short-act)
```
After that:
```
Proc # 1: prcm  + 1 R/S/IMPF ---N  t: 0 8851:com.google.omakoto.testapp/u0a252 (fg-service-short)
```

Bug: 257270313
Change-Id: I75e9295fd34871a70f6a5db23d701601c1b12622
2022-11-21 11:25:58 -08:00
Xiang Wang
3ed2898d28 Merge "Add custom game mode" 2022-11-21 18:15:16 +00:00
Makoto Onuki
ad227d66aa Merge "Preparation for adding a SHORT_SERVICE timeout" 2022-11-21 17:12:53 +00:00
Sarp Misoglu
c6215c0cf4 Unhide BackupTransport#getBackupManagerMonitor()
This needs to be a public API so that BackupTransports can implement it.

Bug: 241760569
Test: N/A
Change-Id: Ic3ac1d3f77bcc1bf5f5babdda7361d949023aa16
2022-11-20 20:45:27 +00:00
Sarp Misoglu
104604674f Pass agent logs to monitor after package B&R
In this change B&R tasks ask for logs from each BackupAgent after it is
backed up or restored. These logs are then immediately passed on to the
BackupManagerMonitor.

Bug: 252760247
Change-Id: Iaf43ce61e98bb4b42c05c18a46031a06d41abb12
Test: $ atest BackupFrameworksServicesRoboTests:KeyValueBackupTaskTest
  $ atest BackupManagerMonitorUtilsTest
  Unfortunately, the other classes are not unit testable.
  For manual testing, I implemented some fake loggers for various
  BackupAgents, passed in a fake BackupManagerMonitor, ran B&R with the
  following commands, and observed that the monitor received the logs.
  1. $ adb shell bmgr backupnow --all
  2. $ adb shell bmgr restore ... (for one KV and one FullBackup package)
2022-11-20 20:44:29 +00:00
Li Li
b81fa07b64 Add killing subreason for undelivered broadcast
Bug: 239419108
Test: atest ApplicationExitInfoTest
Test: atest BroadcastQueueTest
Test: use up async buffer, broadcast & dumpsys activity exit-info
Change-Id: I6a1b8c5a96963af624b8254753c8d8c364d0bc78
2022-11-19 03:21:16 +00:00
Makoto Onuki
3764d10f89 Preparation for adding a SHORT_SERVICE timeout
Step 1:
- Adding one more device_config constant
- Added IApplicationThread callback for Service.onTimeout.

Bug: 257270313
Test: Build & Boot
Test: `dumpsys activity settings | grep -i short` and check short_fgs_proc_state_extra_wait_duration
Test: `device_config put activity_manager short_fgs_proc_state_extra_wait_duration 4` and check the above dumpsys
Change-Id: I1910b900232ed57fc6b68f1197770a1e646ba52b
2022-11-18 16:14:35 -08:00
Chris Poultney
cc560f439e Lock screen live wallpaper: adds home/lock screen flag as argument.
Bug: 253481667
Test: TreeHugger
Test: CTS tests for API changes in same topic
Change-Id: Icfe1096026569baf29bc3ffe062327c4d52b17fa
2022-11-18 23:08:09 +00:00
Xiang Wang
f2579028ed Add custom game mode
Bug: b/243448953
Test: atest GameManagerTests
Change-Id: Ifda3e97c737b7bfdc4ffcf3cdd9fc7f24fe5ed5b
2022-11-18 11:44:53 -08:00
Chris Poultney
f762e7a2d4 Merge "Clean up naming of getWallpaperInfo functions." into tm-qpr-dev am: 7fcaee5366 am: 76111f60d7
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20501449

Change-Id: I0c3cecaaca373a54bab381115b3167e6f0dac50e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-18 18:22:09 +00:00
Chris Poultney
76111f60d7 Merge "Clean up naming of getWallpaperInfo functions." into tm-qpr-dev am: 7fcaee5366
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20501449

Change-Id: Iaff340929b0b3ac957d0fa93e4169bcdb213aab2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-18 17:49:32 +00:00
Makoto Onuki
d01181151b Merge "Remove service related dead code" 2022-11-18 16:45:07 +00:00
Li Li
d6a1e5cb0c Merge "Stop using CannotDeliverBroadcastException" 2022-11-18 06:27:07 +00:00
Felipe Leme
808daf5eb6 Merge "UserVisibilityMediator refactoring, step 3." 2022-11-17 22:51:36 +00:00
Chris Poultney
57001212ee Clean up naming of getWallpaperInfo functions.
Cleaning up per comments on ag/20208351.

Bug: 253481667
Test: CTS testing after merge into master
Change-Id: I3d40bfa69f82013257966780e2f702a5a06c3f4c
2022-11-17 22:06:46 +00:00
Jay Sullivan
8658e677e3 Merge "Make process capability constants systemapi" 2022-11-17 21:34:29 +00:00
TreeHugger Robot
e27a387a63 Merge "Add constants "short service" foreground service" 2022-11-17 18:24:41 +00:00
Manjeet Rulhania
07feded318 Merge "Adding null check" 2022-11-17 17:51:36 +00:00
Pavel Grafov
f00136e4ac Merge "Add app exemptions APIs for managing platform restriction exemptions" 2022-11-17 17:48:39 +00:00
Chris Tate
ae4acf79ba Merge "Move "interactive" from BroadcastOptions to ComponentOptions" 2022-11-17 17:47:56 +00:00
Makoto Onuki
0bd9e5f897 Remove service related dead code
The following features are no longer used.
- Stop FGS associated with a given notification channel.
- "Dungeon" notification, which is a system notification showing
  "hidden" FGSs.

Test: build
Change-Id: Ic33ee2813bb09b769f7c2b6b432cc761982f2dad
2022-11-17 09:03:12 -08:00
Andrey Epin
c2ee27ef2f Merge "Make AppPredictor thread-safe" into tm-qpr-dev am: 2a4339d073 am: ce2368e599
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20269815

Change-Id: If1c0ff4471ecd34ccb6cdadcc69e0b4f3521a52f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-17 17:00:18 +00:00
Andrey Epin
ce2368e599 Merge "Make AppPredictor thread-safe" into tm-qpr-dev am: 2a4339d073
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20269815

Change-Id: I7e0440785e6ea2858fc3d5b276c7aec58e2246a6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-17 16:55:40 +00:00
Andrey Epin
2a4339d073 Merge "Make AppPredictor thread-safe" into tm-qpr-dev 2022-11-17 16:31:11 +00:00
Sarp Misoglu
a5ca8d2495 Merge "Integrate BackupAgent with B&REventLogger" 2022-11-17 16:29:00 +00:00
Pavel Grafov
44f8a5a60a Merge "Add foreground service related exemption app-ops" 2022-11-17 14:15:26 +00:00
Sarp Misoglu
c7076a7148 Integrate BackupAgent with B&REventLogger
In this CL we:

1) Create the logger when the agent is created.
2) Add getBackupRestoreEventLogger for agent implementations to retrieve
   it to log their metrics.
3) Add a method to IBackupAgent for the framework to query the results
   of the agent's logging once the agent is done with a B&R session.
   This also requires for the results to be Parcelable.

Bug:252760247
Test: atest BackupRestoreEventLoggerTest.java
	atest BackupAgentTest.java

Change-Id: I4b4483574f604aff8350e9ddef685f27458e9091
2022-11-17 12:29:21 +00:00
Neil Fuller
6a5be3e17e Merge "Add status to TimeZoneCapabilitiesAndConfig" 2022-11-17 09:28:35 +00:00
Jing Ji
ae64ee70a1 Merge "Log foreground service start/stop in system trace" 2022-11-17 07:23:50 +00:00
Louis Chang
24920c208d Merge "Move the task to back while pressing back on the last activity" into tm-qpr-dev am: b73cda834c am: e20ffee9dd
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20278150

Change-Id: Ia1193d7790c8dda3ab693027b905b60915de326e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-17 01:12:19 +00:00
Louis Chang
e20ffee9dd Merge "Move the task to back while pressing back on the last activity" into tm-qpr-dev am: b73cda834c
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20278150

Change-Id: I2b133d0cd5ea3dcb8ce038f1972f778c30048006
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-17 00:45:22 +00:00
Louis Chang
b73cda834c Merge "Move the task to back while pressing back on the last activity" into tm-qpr-dev 2022-11-17 00:21:08 +00:00
Christopher Tate
89ea9b587c Move "interactive" from BroadcastOptions to ComponentOptions
Some parts of the system interact with PendingIntent options via
ActivityOptions even when the underlying PendingIntent might be a
broadcast, so we need accommodate that pattern.

Bug: 254290593
Test: atest FrameworksMockingServicesTests:BroadcastQueueModernImplTest
Test: atest FrameworksMockingServicesTests:BroadcastQueueTest
Test: atest android.app.activity.BroadcastTest#testBroadcastOption_interactive
Change-Id: Ia1e5e2c337d9a4fe557202e794cae23dfa64911b
2022-11-16 16:05:34 -08:00
Andrey Epin
d669bfe836 Make AppPredictor thread-safe
Make callback registration, unregistration and session deletion mutually
exclusive.

Test: manual testing

Change-Id: I2ebc8ac37f2b34e0c6a10b563e9c4f36697101b1
2022-11-16 15:44:27 -08:00
Makoto Onuki
f36f22de3e Add constants "short service" foreground service
Aslo add the timeout callback.

All APIs are still hidden.

Bug: 257270313
Test: Build
Change-Id: I9868de22a343e97c83cc2524cf81aec159aa62ab
2022-11-16 14:51:40 -08:00