Commit Graph

3277 Commits

Author SHA1 Message Date
Calvin Pan
2801e6de4f Merge changes Ib484fc0c,I2b9ff69c,I0a31b117,I888c65c8,I03723cfe, ...
* changes:
  Clean <plurals> in DateTimeView
  Clean <plurals> in CertificateMonitor
  Clean <plurals> in FillUi
  Clean <plurals> in BugreportProgressService
  Clean <plurals> in keyguard
  Clean <plurals> in ChooserActivity
  Clear <plurals> in TextUtils
  Clean <plurals> in FindActionModeCallback
  Clean <plurals> in ZenModeConfig
  Add util class for plurals
2022-01-27 06:31:58 +00:00
shannonchen
614ba13847 Add a GameSession API for restarting the associated game.
Since restarting a process must be done from the system server side,
we accomplish this by passing a IBinder through to the GameSession
allowing the GameSession to make IPCs to its hosting
GameServiceProviderInstanceImpl. As an additional layer of security,
the implementation takes a taskId and only restarts the given
game if the taskId matches an active game session.

Test: atest FrameworksMockingServicesTests and manual e2e testing
Bug: 210127167
Bug: 202414447
Bug: 202417255
CTS-Coverage-Bug: 206128693
Change-Id: I944da060323ac1779cd2c61d1e411e9868caed91
2022-01-25 17:54:03 +00:00
Joanne Chung
bd4e4f6cf1 Merge "Clone LocalFloatingToolbarPopup to RemoteSelectionToolbar" 2022-01-25 14:41:16 +00:00
Tiger Huang
dc94a72272 Merge "Remove the frame number from WindowManagerService" 2022-01-25 14:11:20 +00:00
Tiger Huang
3932df1165 Merge "Let the client compute the surface size on its own" 2022-01-25 14:09:25 +00:00
Joanne Chung
4559c7a8b6 Merge "Change path for DefaultSelectionToolbarRenderService" 2022-01-25 12:07:12 +00:00
Darrell Shi
a67a0dd0de Merge "Clean up DreamService." 2022-01-24 19:29:04 +00:00
Tiger Huang
96c3e87e9e Remove the frame number from WindowManagerService
The frame number at the server side is not used anymore since BLAST.

Bug: 161810301
Test: presubmit
Change-Id: I01c6fb0750799aa94766f2582ce6ac031c9426cf
2022-01-24 21:43:28 +08:00
Tiger Huang
0456e9d5cb Let the client compute the surface size on its own
This is a step to move the layout logic to the client side. We won't
obtain the surface size from the server then.

This CL also moves the logic about adjusting the LayoutParams of
wallpaper to the client side.

Bug: 161810301
Test: presubmit
Change-Id: I3a81e174035c67a285cab449c0701ee2fe6f6a24
2022-01-24 21:40:45 +08:00
Calvin Pan
9e38ebf366 Clean <plurals> in ZenModeConfig
Bug: 199230228
Test: make
Change-Id: I712f984b440043360b8f5fc6c6613c752bb2a2dd
2022-01-24 14:46:19 +08:00
Tyler Lacey
d320bc3adb Merge "Add GameSession game task focus lifecycle methods." 2022-01-23 18:49:48 +00:00
Tiger Huang
697660ac69 Merge "Let the client set transform hint on its own" 2022-01-23 18:02:11 +00:00
Kathy Chen
50460ddd32 Merge "AmbientContext (aka Ambient PCC) Framework API, with a client API for apps to subscribe for AmbientContextEvents, and a provider API for AiAi to implement and provide the detected events." 2022-01-23 01:54:29 +00:00
Kathy Xiaoming Chen
5d568eda62 AmbientContext (aka Ambient PCC) Framework API, with a client API for apps to subscribe for AmbientContextEvents, and a provider API for AiAi to implement and provide the detected events.
Client apps need the ACCESS_AMBIENT_CONTEXT_EVENT permission to use the service. The permission protection level is internal|role.

API overview: http://go/ambient-framework-api
PRD: http://go/ambient-attribution-prd
Design doc: http://go/ambient-service-api

Test: CTS test
Bug: 192476579
Change-Id: I9daede83af34f215c278cb0530238faba1be5c70
Ignore-AOSP-First: to prevent new feature leak.
2022-01-22 22:07:22 +00:00
Tiger Huang
5242af609e Let the client set transform hint on its own
This is a step to move the layout logic to the client side. We won't
invoke IWindowSession#relayout then.

Bug: 161810301
Test: atest WmTests
Change-Id: Ib5ac048a573907af0a81f3e228575d9458862cfd
2022-01-22 19:22:23 +08:00
Sharon Su
55485dd15b Merge "Create directories for wallpaper effects generation api and and owners files. Bug: 213238425 Test: meta file change" am: 3166def10f am: 58e37e59d1 am: 9075544cd1 am: 2fff06e2cf
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1955206

Change-Id: I1dc6aa909d1179c52b26750ba9dccd0f781eb6f1
2022-01-22 01:13:38 +00:00
Sharon Su
2fff06e2cf Merge "Create directories for wallpaper effects generation api and and owners files. Bug: 213238425 Test: meta file change" am: 3166def10f am: 58e37e59d1 am: 9075544cd1
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1955206

Change-Id: Ie939bcf302fc7f6939e2ac84352490ba9a324fc4
2022-01-22 00:48:06 +00:00
Sharon Su
3166def10f Merge "Create directories for wallpaper effects generation api and and owners files. Bug: 213238425 Test: meta file change" 2022-01-22 00:05:24 +00:00
Jay Aliomer
290ec62f3b Merge "check surface valid before screenshotting wallapper" 2022-01-21 23:48:07 +00:00
Tyler Lacey
bf590fe7c9 Add GameSession game task focus lifecycle methods.
Introduce GameSession#onGameTaskFocusChanged method that is called to
inform GameSession implementations abouts when their game task goes into
our out of focus.

Also introduce a new LifecycleState to the abstract GameSession class
to ensure that transitions follow the following rules:

- All GameSessions start in the INITIALIZED state
- All GameSessions will then transition to the CREATED state [onCreate()
  is called]. If a GameSession transitions from INITIALIZED directly to
  DESTOYED, onCreate() and onDestroy() will both be called.
- A GameSession in the CREATED state may transition to either the
  TASK_FOCUSED state [onGameTaskFocusChanged(true) is called] or the
  DESTROYED state [onDestroy() is called]. If a game task starts in a
  non-focused state and never comes into focus, the GameSession will
  never transition to the TASK_FOCUSED or TASK_UNFOCUSED states.
- A GameSession in the TASK_FOCUSED state may only transition
  to the TASK_UNFOCUSED state [onGameTaskFocusChanged(false) is called].
  If a GameSession transitions from TASK_FOCUSED to DESTROYED, it will
  call onGameTaskFocusChanged(false) to complete that part of the
  lifecycle before transitioning to the DESTROYED state.
- A GameSession in the TASK_UNFOCUSED state may transition back to the
  TASK_FOCUSED state [onGameTaskFocusChanged(false) is called again] or
  the DESTROYED state [onDestroy() is called].

In this way, all GameSessions are guaranteed to have
onGameTaskFocusChanged(true) be called if they are ever in focus before
being destroyed (generally as soon as the GameSession is created) and to
have onGameTaskFocusChanged(false) be called before they are destroyed.
GameSessions are also guarnateed to have onCreate() be called before
onDestroy().

Test: Manual e2e testing
Bug: 214104366
Bug: 202414447
Bug: 202417255
CTS-Coverage-Bug: 206128693
Change-Id: Id4e1eec50eb891ffb6df74650c27ea3a27a8b9c3
2022-01-21 22:02:49 +00:00
Jay Aliomer
ad09fa8bab check surface valid before screenshotting wallapper
Fixes: 214410335
Test: manual`
Change-Id: Ief56edec17a3540d8747694bc77764e2ab55c24f
2022-01-21 20:54:06 +00:00
Tyler Lacey
1dd597d89c Merge "Add GameSession#takeScreenshot API" 2022-01-21 20:35:14 +00:00
Darrell Shi
b344d76fc7 Clean up DreamService.
- Rename TAG to mTag, for it is a private non-static variable
- A few variables can be final
- Unnecessary "final" for private method
- Unnecessary return at the end of method
- Double white spaces
- Misspellings

Test: manual
Change-Id: Id8523a0857e2a8333a2756cdc778b7d468463f40
2022-01-21 10:02:42 -08:00
Tyler Lacey
197ecb2557 Add GameSession#takeScreenshot API
The screenshot is taken using a new method added to the
WindowManagerService: captureTaskSnapshot. The existing
WindowManagerService methods for getting a TaskSnapshot
are not suitable because they rely on previously cached
snapshots (e.g., taken when the task is put into the background).

To access the WindowManagerService functionality from
the GameSessionService, an IBinder is passed from the
GameServiceProviderInstanceImpl, which is running on the system server
side (and thus can call the new method) to the GameSessionService when
it is created. The GameSessionService then makes this reference
available to each GameSession when the GameSession is created via the
new GameSession#attach method. The GameSession can then use the IBinder
reference to make an IPC back to the GameServiceProviderInstanceImpl
instance which hosts the GameSessionService. This reference is then used
by the GameSession to request a screenshot.

By using the IBinder in this way, only GameSessions which are created
via the system GameService can access the sensitive screenshot
functionality implemented by GameServiceProviderInstanceImpl via the
new captureTaskSnapshot method.

Test: Manual e2e testing
Bug: 210119689
Bug: 202414447
Bug: 202417255
CTS-Coverage-Bug: 206128693
Change-Id: If42dc9a5a5b6068db8670666a371117cf5865f20
2022-01-21 16:54:39 +00:00
Jared Duke
7bfc101b05 Remove additional logspam from SmartspaceService
Test: CTS tests
Bug: 189885848
Change-Id: I2fe1994e986e55f9a7ae063abf78ebfe8aaeb47d
2022-01-21 16:51:04 +00:00
Antoan Angelov
034f3b9f43 Merge "Add system API to PersistentDataBlockManager to return config_persistentDataPackageName" 2022-01-21 16:42:07 +00:00
Justin McClain
9a7c1ab439 Merge "Add OWNERS files for AttestationVerification in frameworks/base/core/java/android/service/." am: 4939f35ba3 am: aca729636f am: 47b398bccf am: 3411e81261
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1954517

Change-Id: Ia15c4bcdf2c5dac99efbbcc5208fe6ecb81a5c6d
2022-01-21 15:45:29 +00:00
Justin McClain
3411e81261 Merge "Add OWNERS files for AttestationVerification in frameworks/base/core/java/android/service/." am: 4939f35ba3 am: aca729636f am: 47b398bccf
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1954517

Change-Id: I487ac5a79ddef6cc925e0141e29dbcfca64fab29
2022-01-21 15:27:54 +00:00
Dave McCloskey
5e0e3a3da8 Merge "Add call to TrustManager for SystemUI to propagate unlock requests to a trust agent." 2022-01-21 00:56:37 +00:00
David Samuelson
33abaa26fe Merge "Add support for rendering a View ontop of the GameSession's task." 2022-01-20 23:16:07 +00:00
David Samuelson
19519e58a3 Add support for rendering a View ontop of the GameSession's task.
Test: Manual e2e testing
Bug: 202414447
Bug: 202417255
Bug: 204504596
CTS-Coverage-Bug: 206128693
Change-Id: Ie3d0d74511bede4cffc18fdbfe558491797bc2d2
2022-01-20 19:24:42 +00:00
arangelov
b7542a3b9d Add system API to PersistentDataBlockManager to return config_persistentDataPackageName
Fixes: 215369101
Test: none
Change-Id: Ic10dc8ce41c872d77c8a454f63a783984aab71d8
2022-01-20 12:48:37 +00:00
TreeHugger Robot
ce65b04d56 Merge "Revert "Revert "Migrate unsafe parcel APIs in framework-minus-apex""" 2022-01-20 11:33:39 +00:00
Vania Desmonda
2ad9fe6296 Merge "Add wallpaper dimming SystemAPI and implementation for handling dimming set by multiple applications." 2022-01-20 08:55:45 +00:00
Sharon Su
fd184683cb Create directories for wallpaper effects generation api and and owners
files.
Bug: 213238425
Test: meta file change

Change-Id: Ibdd21969f4cbd30c68f933ea4515358173307919
2022-01-20 01:07:27 +00:00
Justin McClain
abd3ae5d80 Add OWNERS files for AttestationVerification in
frameworks/base/core/java/android/service/.

Test: m
Change-Id: I7e90bfe7dee6937b398304b1269ae399d008ad21
2022-01-19 17:59:22 +00:00
Tyler Lacey
607e78a56f Merge "Allow Game Service to trigger the Game Session creation" 2022-01-19 14:45:33 +00:00
Joanne Chung
25af083ef9 Clone LocalFloatingToolbarPopup to RemoteSelectionToolbar
This change doesn't change the content of LocalFloatingToolbarPopup,
we just rename the file. This helps to review the follow up selction
toolbar service implementation change easier.

Bug: 190030331
Bug: 205823018
Test: build pass
Change-Id: I0a98fe7f2057fd3a04a408ab1acf1b4090515cb9
2022-01-19 20:43:38 +08:00
Bernardo Rufino
1a5cb387d6 Revert "Revert "Migrate unsafe parcel APIs in framework-minus-apex""
This reverts commit 331be9a643.

Reintroducing ag/16366278 since it seems unrelated to b/214053959 (more details on b/214053959#comment55).

Original commit message:

Migrate unsafe parcel APIs in framework-minus-apex

Migrate the following unsafe parcel APIs in framework-minus-apex:
* Parcel.readSerializable()
* Parcel.readArrayList()
* Parcel.readList()
* Parcel.readParcelable()
* Parcel.readParcelableList()
* Parcel.readSparseArray()

This CL was generated by applying lint fixes that infer the expected
type from the caller code and provide that as the type parameter
(ag/16365240).

A few observations:
* In some classes we couldn't migrate because the class also belonged to
another build module whose min SDK wasn't current (as is the case for
framework-minus-apex), hence I suppressed the lint check
(since I'll eventually submit the lint check to the tree).
* In some cases, I needed to do the cast in
https://stackoverflow.com/a/1080525/5765705 to make the compiler happy
since there isn't another way of providing a class of type
Class<MyClassWithGenerics<T>>.
* In the readSerializable() case, the new API also requires the class
loader, that was inferred to by InferredClass.class.getClassLoader().
* Note that automatic formatting and import rely on running hooked up
to the IDE, which wasn't the case here.

Bug: 195622897
Change-Id: I272432e6e082a973f7a50492ec35d79c2b577c93
Test: TH passes
2022-01-19 11:13:18 +00:00
Vania Desmonda
dde365777a Add wallpaper dimming SystemAPI and implementation for handling dimming
set by multiple applications.

Handle lock screen dimming regardless if it shares the same wallpaper
with the system to apply composite keyguard + additional dimming.

Test: manual testing and unit tests
Bug: 202841384
Change-Id: Iabd665e9a8e377185b123494eac2198a4436b0c6
CTS-Coverage-Bug: 213426781
2022-01-19 10:08:21 +00:00
Peiyong Lin
b31166f5bc Merge "Update OWNERS file for related game modules." 2022-01-19 01:35:21 +00:00
Peiyong Lin
0c8efa76f4 Update OWNERS file for related game modules.
Ignore-AOSP-First: New files haven't been released
Bug: b/202414447, b/196880806
Test: N/A
Change-Id: Ic22097704ea2e4d6a3eabad046e6612a40cf6568
2022-01-18 23:10:23 +00:00
Tyler Lacey
3d7dc6d0a0 Allow Game Service to trigger the Game Session creation
With this change, the GameServiceProviderInstanceImpl no longer
automatically creates a game session every time a new game task is
started. Instead, the GameServiceProviderInstanceImpl calls the new
GameService#onGameStarted method with details about the game task that
just started.

The GameService can implement onGameStarted with appropriate logic to
determine whether a game session should be created. If the service
determines that a session should be created, then the GameService can
call GameService#createGameSession.

After calling onGameStarted, the GameServiceProviderInstanceImpl will
maintain a GameSessionRecord in the NO_GAME_SESSION_REQUESTED state.
Only games with a record in this state will have a session created in
response to createGameSession being called. When createGameSession
is called for a record in this state, the record will transition to the
GAME_SESSION_REQUESTED state. Once the game session is finally created
and attached to the record, it will switch to the GAME_SESSION_ATTACHED
state.

Test: Manual e2e testing and unit tests
Bug: 207035150
Bug: 202414447
Bug: 202417255
CTS-Coverage-Bug: 206128693
Change-Id: I799f8410da6936ab242fa925d77b0276875cc20f

Change-Id: Id6da59fd3a5951ba5f032c825d1f1f28d3320965
2022-01-18 15:07:11 +00:00
Dave McCloskey
997c684ac2 Add call to TrustManager for SystemUI to propagate unlock requests to a
trust agent.

Still TODO: Add CTS test once SystemUI code is in to call this.

Test: manual testing with temporary call from SystemUI & logcat
Bug: 213631672
Change-Id: If76c033a73580e16a25ad0a6775e4e145644d926
2022-01-14 13:54:10 -08:00
Dave McCloskey
8cfa5678d2 Modifies the Trust Agent API to support Active Unlock.
Details for the design are in go/android-active-unlock-t and
go/android-active-unlock-t-api. This change
defines the API without implementing its use.

Test: non-functional API change. Existing regression tests check for regressions.
Test: manually verified smart lock still revokes trust when bluetooth
device disconnected
Bug: 213631675
Bug: 213631677
Bug: 213631672
Bug: 213911325
CTS-Coverage-Bug: 213944235

Change-Id: I206f3e5c5c456a7433be325ea0186b79319d3a66
2022-01-13 13:21:43 -08:00
Ashwini Oruganti
776b439703 Merge "Revert "Migrate unsafe parcel APIs in framework-minus-apex"" 2022-01-12 23:07:08 +00:00
Shannon Chen
b628834dc3 Merge "Make onBind methods final for GameService and GameSessionService." 2022-01-12 19:46:09 +00:00
Bernardo Rufino
331be9a643 Revert "Migrate unsafe parcel APIs in framework-minus-apex"
This reverts commit 90bb3709dc.

Reason for revert: b/214053959

Change-Id: Ic271bab1d3eaf677a5989dda9deb944ee2ad6850
2022-01-12 17:44:44 +00:00
Shannon Chen
dae36267c4 Merge "Add sample XML to GameService javadoc to show how to request BIND_GAME_SERVICE permission." 2022-01-12 15:19:13 +00:00
Joanne Chung
895098daeb Change path for DefaultSelectionToolbarRenderService
We met the ClassNotFoundException when putting the service under
system service folder. Cannot find the root cause to fix it now. We
need to more time to find the reason so the workaround is to move the
class to the framework/base/core/service/selectiontoolbar to fix the
problem now. We will go back to fix the problem later.

Bug: 214122495
Test: manual. Can bind to DefaultSelectionToolbarRenderService and
the methods can be called successfully.

Change-Id: I9218c9ceee25a105fe592c0c63905ba2e2f8a305
2022-01-12 16:20:42 +08:00