Commit Graph

8270 Commits

Author SHA1 Message Date
Charles Chen
6e08c39554 Merge "Remove addWindowTokenWithOptions" into sc-dev 2021-02-07 03:14:57 +00:00
TreeHugger Robot
3ae84f530b Merge "Rename InputConnecton#setImeTemporarilyConsumesInput" into sc-dev 2021-02-07 03:13:55 +00:00
Charles Chen
b80fdde45f Remove addWindowTokenWithOptions
Since WindowContext won't add WindowToken from the client side,
addWindowTokenWithOption is no more needed. Also remove the logic
to invoke removeWindowToken from the client side.

Bug: 159767464
Bug: 153369119
Test: atest WindowManagerServiceTests WindowManagerPermissionTests
Change-Id: Ib0c948dca223cf8d056865ce3a0d4adaef07d247
2021-02-06 15:47:08 +08:00
TreeHugger Robot
ef8d3b00e0 Merge "Add device state request APIs to DeviceStateManager." into sc-dev 2021-02-06 04:37:38 +00:00
Winson Chung
92e9fb341d Merge "Revert "Sandbox letterbox and size compat apps"" into sc-dev 2021-02-05 17:52:07 +00:00
Charles Chen
582247eef0 Merge changes from topic "window_context_2.0" into sc-dev
* changes:
  Apply WindowContext 2.0 for InputMethodMenuController
  Migrate WindowContext to WindowContextListener mechanism
2021-02-05 04:53:09 +00:00
Lan Wei
66b21086e3 Rename InputConnecton#setImeTemporarilyConsumesInput
Rename InputConnecton#setImeTemporarilyConsumesInput as InputConnecton#setImeConsumesInput

Bug: 175362887
Bug: 179143513
Test: atest FrameworksCoreTests:TextViewTest
Test: atest CtsWidgetTestCases:TextViewTest

Change-Id: I8ac1ea4d53f747b0086ed415ff90793dfc6155bc
2021-02-05 12:16:22 +08:00
Darryl L Johnson
c26defea8f Add device state request APIs to DeviceStateManager.
This change promotes DeviceStateManager to a TestApi and exposes three
additional methods:
- getSupportedStates: returns a list of state ids that can be used with
requestState().
- submitRequest: requests that the device enter the supplied state.
- cancelRequest: clears the current requested device state.
to be used initially in CTS tests.

Bug: 177235528
Bug: 177236115
Test: atest DeviceStateManagerServiceTest
Test: atest DeviceStateManagerGlobalTest

Change-Id: Ieae9208420ddecea641a5c44f1610d3cb7071b07
2021-02-04 17:47:14 -08:00
Chris Tate
191b3b9db5 Merge "Revert "Put broadcast timekeeping on its own thread"" into sc-dev 2021-02-05 00:57:55 +00:00
Dmitri Plotnikov
1ffcf97a14 Merge "Change the API for getting PowerProfile-only BatteryUsageStats" into sc-dev 2021-02-04 22:55:11 +00:00
Chris Tate
c39b8b1185 Revert "Put broadcast timekeeping on its own thread"
This reverts commit 9c2775572e.

Reason for revert: Unanticipated performance degradation observed in user-switching scenarios; investigation will follow.

Change-Id: Ie06e909a92be45a24cc46b458a372eadf302e6c4
2021-02-04 22:50:43 +00:00
Winson Chung
0ba6185639 Revert "Sandbox letterbox and size compat apps"
This reverts commit 4d3f1c5681.

Reason for revert: b/179308296

Change-Id: Idccf97038d5aa92268a13bacc512215878e8aefa
2021-02-04 21:57:57 +00:00
Seigo Nonaka
7fc019ca7b Merge "Update OWNERS file for font files in FrameworksCoreTests" am: eff415e780 am: a4e2684bb5 am: 1bba2cdafa
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1548869

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I271582e3e246a35da9274d8ecee669fd307e76c9
2021-02-04 21:50:29 +00:00
Seigo Nonaka
eff415e780 Merge "Update OWNERS file for font files in FrameworksCoreTests" 2021-02-04 19:57:14 +00:00
TreeHugger Robot
4c7e9d1a90 Merge "Reduce LocationManager memory usage" into sc-dev 2021-02-04 19:13:26 +00:00
Charles Chen
9854a1e315 Migrate WindowContext to WindowContextListener mechanism
1. Use registerWindowContextListener instead of
   addWindowTokenWithOptions
2. Clean up the logic of sending the config to the client in WindowToken
3. Add a mechanism in WMS#addWindow, when a WindowContext adds a view,
   the server side will switch to register the WindowToken for the
   WindowContext.

In this way, we won't add a WindowToken until adding the fist view.
Also, we could apply an existing window token by overriding
WindowManager.LayoutParams.token.

Bug: 159767464
Bug: 153369119
Test: atest WindowContextTests WindowContextPolicyTests
Test: atest WindowContextTest
Test: atest WindowContextListenerControllerTests

Change-Id: I2396187c445306d18101706c4521edd9cf92facf
2021-02-04 23:27:03 +08:00
Adam Bookatz
696dd2af2d MeasuredEnergyStats supports custom energy buckets
MeasuredEnergyStats now supports a variable number of
'buckets', including both the standard buckets (fixed number)
and additional custom buckets (variable number) whose meaning
is unknown to BatteryStats (but is enumerated as an 'ordinal').
This will be used to store per-uid energy data from custom
power components.

Test: atest MeasuredEnergyStatsTest
Test: atest com.android.internal.os.BatteryStatsTests
Bug: 179107328
Bug: 174186358
Change-Id: I0022ac6940daca5f1e7d0e502eed01effa71f796
2021-02-04 02:26:31 +00:00
Treehugger Robot
a7592f99b0 Merge "Adding SimPhonebookContract" am: 110420fcae am: 0e6db34869 am: 60be88bbd4
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1521063

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I36eeb81bffb9791076c872411c682bd2986ed02c
2021-02-04 01:12:40 +00:00
Dmitri Plotnikov
42b6bb0575 Change the API for getting PowerProfile-only BatteryUsageStats
Bug: 175644968
Test: mp :BatteryStatsViewer && adb shell am start -n com.android.frameworks.core.batterystatsviewer/.BatteryStatsViewerActivity
Change-Id: I66ce64321805423d2545df4691a4df8508f40440
2021-02-03 20:27:47 +00:00
Seigo Nonaka
bd4d43b1b7 Update OWNERS file for font files in FrameworksCoreTests
Bug: N/A
Test: N/A
Change-Id: Iaf764a2fcff1348f2e9a4c51dab9c7e6c5a8c4d0
2021-02-03 11:59:02 -08:00
Dmitri Plotnikov
df5ebd7eab Merge "Calculate total power for a BatteryConsumer by adding up PowerComponents" into sc-dev 2021-02-03 19:06:15 +00:00
Soonil Nagarkar
204b133883 Reduce LocationManager memory usage
Move GNSS listener overhead into statics so it's shared per process, and
do not instantiate by default.

Previously GNSS requests were multiplexed by LocationManager instance,
this is now removed. This could mean additional binder overhead, but
it's pretty unlikely that this feature was in active use anywhere, as in
any large application that has multiple gnss requests, they are usually
coming from different contexts (and thus LocationManager instances) and
would not have seen the benefit of multiplexing anyways.

Bug: 179261871
Test: atest CtsLocationFineTestCases
Change-Id: I8b7a41c13dfe219c326b1e519483d89d2b721ce5
2021-02-03 17:08:16 +00:00
Mariia Sandrikova
546983419c Merge "Configurable letterbox background." into sc-dev 2021-02-03 11:50:38 +00:00
Shawn Lin
7de88bceb9 Merge "Provides apps the rounded corners info" into sc-dev 2021-02-03 11:20:17 +00:00
Naomi Musgrave
4d3f1c5681 Sandbox letterbox and size compat apps
Sandbox Display#getRealSize and WindowManager
bounds when letterbox or size compat mode are
applied to the configuration. Display uses
this field to provide the sandboxed display
size.

Test: atest WindowConfigurationTests
Test: atest FrameworksMockingCoreTests:android.view.DisplayTests
Test: atest WmTests:SizeCompatTests
Bug: 171386167
Change-Id: I6f78edcd9214b52ab0708e3892bc86ee05bb5b9a
2021-02-03 10:03:20 +00:00
Alexander Dorokhine
bad7328c54 Merge "Update framework from Jetpack." into sc-dev 2021-02-03 04:46:48 +00:00
Mariia Sandrikova
c0f663fd35 Configurable letterbox background.
Allow three types of the letterbox wallpaper:
- Solid background using color specified in R.color.config_letterboxBackgroundColorSolid color
- Color specified in R.attr.colorBackground for the letterboxed application
- Color specified in R.attr.colorBackgroundFloating for the letterboxed application

Also, adding ADB commands for each config value:
- adb shell cmd window set-letterbox-background-color [reset|color]
- adb shell cmd window get-letterbox-background-color
- adb shell cmd window set-letterbox-background-type [reset|solid_color|app_color_background|app_color_background_floating]
- adb shell cmd window get-letterbox-background-type

Test: manual with ADB commands, atest LetterboxTest
Fix: 179088234
Change-Id: I23cf0b52c9f95d1f92255731bc7be165a575c7cd
2021-02-02 23:54:25 +00:00
Hai Zhang
f61f4fb849 Pass in split permissions to ParsingPackageUtils.
Similar to passing in display metrics. We can use
ActivityThread.currentApplication() as the context for getting
PermissionManager in system server process because it will be created
early in ActivityThread.attach() before any custom logic can run, but
it becomes a problem for apps because they can run their own logic by
overriding Application.attachBaseContext() and do things there before
ActivityThread.currentApplication() becomes non-null.

So pass in the split permissions explicitly as an external dependency
for ParsingPackageUtils, and move the getPackageArchiveInfo()
implementation from PackageManager to ApplicationPackageManager to
utilize the context there. PackageParser2 can get the split
permissions internally because it's only used in system server.

Fixes: 178155985
Test: manual
Change-Id: I8213cf752e16b08328ad1150b2639da18c5d0e83
(cherry picked from commit 7b8974d375)
2021-02-02 11:42:40 -08:00
TreeHugger Robot
b23f6d71ee Merge "Move GameManager to android.app package." into sc-dev 2021-02-02 19:36:13 +00:00
Lais Andrade
502e1ae7b7 Implement vibrate and cancelVibrate on VibratorManagerService
Use the same VibrationThread to control combined vibrations on all
vibrators.

Bug: 167946816
Test: VibratorManagerTest
Change-Id: I40c9f235f05baf85e5ed15bf3bce41451283c7f2
2021-02-02 14:14:13 +00:00
shawnlin
5ab588a48b Provides apps the rounded corners info
- Created a new @hide class RoundedCorners
  - The class is used to create and manager all the rounded corners.
- Created a new public class RoundedCorner
  - Represent each rounded corner.
- Created a new public API in Display to get the original rounded
  corners.
- Created a new public API in WindowInsets to get the rounded corners
  relative to the window bounds.

Bug: 161808676
Test: atest RoundedCornerTest RoundedCornersTest
      DisplayPolicyLayoutTests DisplayPolicyTests
      WallpaperControllerTests
Change-Id: I58c671b0e9a077cdf26764c6302537c72db0f667
2021-02-02 16:33:34 +08:00
Dmitri Plotnikov
afe6fe643d Calculate total power for a BatteryConsumer by adding up PowerComponents
Bug: 158137862
Test: atest BatteryUsageStatsTest
Change-Id: I785799efcc895494be6e338475c6b4f276bdf9d5
2021-02-01 17:44:36 -08:00
Kim Low
922ed181fe New API methods to access external battery info
Created new API methods that allow apps to access external battery info
of devices such as bluetooth connected gamepads.

Bug: 161633432
Test: atest android.hardware.input.cts.tests.SonyDualshock4BluetoothTest
      atest android.hardware.input.cts.tests.SonyDualshock3UsbTest

Change-Id: Iba59fc9a259818b03c24ee8c2c49601952ed65a3
Merged-In: Iba59fc9a259818b03c24ee8c2c49601952ed65a3
2021-02-01 22:16:44 +00:00
Michael Groover
969c49681c Merge "Document Signature equals/hash should not include flags" into sc-dev 2021-02-01 20:55:14 +00:00
Marcus Hagerott
1edf43e23d Adding SimPhonebookContract
This is a contract class for a provider that reads contacts from the SIM
card.

Bug: 154363919
Test: atest CtsSimPhonebookProviderTestCases CtsSimPhonebookProviderNoSimTestCases
Change-Id: I584150dd8352dbb49d70ea28c6d064a6336d018d
2021-02-01 09:18:16 -08:00
TreeHugger Robot
3bdaabfc66 Merge "Put broadcast timekeeping on its own thread" into sc-dev 2021-02-01 17:12:02 +00:00
Ryan Mitchell
b9c60d9ac1 Merge "Fix OverlayDeviceTests for un-rooted devices" into sc-dev 2021-02-01 16:23:48 +00:00
Peiyong Lin
235cb5086c Move GameManager to android.app package.
Bug: b/177611751
Bug: b/178112303
Test: atest GameManagerTests
Test: atest GameManagerServiceTests
Test: atest GameManagerServiceSettingsTests
Change-Id: Icf01f723f1323f6f91030e6005958b7da05e8177
2021-01-29 20:58:52 -08:00
Peiyong Lin
72036e758c Merge "Add GameManager service." into sc-dev 2021-01-29 23:47:19 +00:00
Naomi Musgrave
ec5c4c568a Merge "Introduce OWNERS file for Display unit tests" am: a1721e71ca am: a0fcc520c6 am: 2486ee1320
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1563732

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Icab5d4f92178b51bee5ff5866818bbd5701e5721
2021-01-29 23:37:31 +00:00
Ryan Mitchell
7c8e650c2b Fix OverlayDeviceTests for un-rooted devices
The AndroidText.xml needs the root preparer to run on non-rooted
devices.

Bug: 177115481
Test: adb unroot && atest OverlayDeviceTests
Change-Id: I4377207428182fbb76c09abef248b69eeae6acf5
2021-01-29 14:08:37 -08:00
TreeHugger Robot
05921e00c8 Merge "System font check for downloadable font" into sc-dev 2021-01-29 20:33:39 +00:00
Alexander Dorokhine
dcbf7708d5 Update framework from Jetpack.
Changes included:
* 081c412: Remove spam logs from GenericDocumentToPlatformConverter.
* 69df01d: Fix an issue with nested documents after serialization.
* 0197939: Update Jetpack API usages to build against the latest SDK.
* 843f415: Rename @AppSearchDocument to @Document.
* 37adb0f: Update docs around database name.
* 19383f8: Apply naming changes to AppSearchSession and GlobalSearchSession.
* 8359c2b: Update SetSchemaRequest to comply with API council requirements.
* 4b04aba: Update PutDocumentsRequest APIs to align with API council guidance.
* 3c8ebfb: Update SearchSpec APIs to match API council recommendations.

Bug: 174614009
Bug: 178540467
Bug: 175763859
Bug: 171340471
Test: Presubmit
Change-Id: I4649ffe1d1c94b0c6125943772d33c6fb38d0006
2021-01-29 10:32:32 -08:00
Peiyong Lin
32f6ff7e15 Add GameManager service.
GameManager service is a service to manage game related features. This
patch creates the initial service to manage the game mode and persist
the data across reboot.

Bug: b/174956354
Test: atest GameManagerTests
Test: atest GameManagerServiceTests
Test: atest GameManagerServiceSettingsTests
Change-Id: Iee2ab47c79d29f48847bc6d4b3eb781a5af18ff4
2021-01-29 09:18:34 -08:00
Michael Groover
47c04289f8 Merge "Grant signature permission to requesting app with common signer" into sc-dev 2021-01-29 15:34:52 +00:00
Shawn Lin
7ee87037f5 Merge "Create an API to get a cutout path" into sc-dev 2021-01-29 12:42:48 +00:00
Naomi Musgrave
a1721e71ca Merge "Introduce OWNERS file for Display unit tests" 2021-01-29 11:33:30 +00:00
Jeff Sharkey
7ca8108311 Merge "Add owners" am: 033aefcb06 am: 8098a5fa5d am: 8121f93bac
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1562605

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ie654042f25cf29395f0891d701f574bde8ecddc2
2021-01-28 20:42:22 +00:00
TreeHugger Robot
8f15e41d76 Merge "ScreenPowerCalculator is responsible for smearing" into sc-dev 2021-01-28 20:39:30 +00:00
Siyamed Sinir
30900cac3f System font check for downloadable font
Adds a new attribute to downloadable font xml
that checks if downloaded font is on the system
already and uses that instead.

Test: added new tests
Test: atest ResourcesTest
Test: atest FontResourcesParserTest

Bug: 178589784
Change-Id: Ib7c32ba3037c534e9ab8c144716d68e46c908a39
2021-01-28 20:05:11 +00:00