Commit Graph

9125 Commits

Author SHA1 Message Date
Jimmy Shiu
4c6e5036b7 ADPF: PerformanceHintManager API implementation
Test: Manual test, run bouncy ball
Test: atest FrameworksCoreTests:android.os.PerformanceHintManagerTest
Bug: 158791282
Change-Id: Ia0bf2b06675b8cf57cdf1668ee90e98026416439
Signed-off-by: Wei Wang <wvw@google.com>
2021-04-10 10:21:17 -07:00
Tianjie Xu
61647a6979 Merge "Expose error code for RoR reboot system API" am: d5547af728 am: 2cf5387b09 am: 133568e964
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1656644

Change-Id: I9cda23318ea0cab9c2e37e7a5967bed81a3188c7
2021-04-10 00:07:51 +00:00
Tianjie Xu
133568e964 Merge "Expose error code for RoR reboot system API" am: d5547af728 am: 2cf5387b09
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1656644

Change-Id: I96d48a205fb1f2d3a6b353e2b2ea36383c20eb2f
2021-04-09 23:26:15 +00:00
Tianjie Xu
d5547af728 Merge "Expose error code for RoR reboot system API" 2021-04-09 22:07:29 +00:00
Charles Chen
c22aff4e4d Merge "Allow config context to inflate views" into sc-dev 2021-04-09 06:56:16 +00:00
Remi NGUYEN VAN
6c9d7a5c75 Merge "Replace IS_DEBUGGABLE with isDebuggable module API" am: ba77876dbd am: 4290766ae7 am: 116bab20ab
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1667304

Change-Id: I3a64653b1a9cb283ba04d4c5a363d3b44fa7b987
2021-04-09 01:30:00 +00:00
Remi NGUYEN VAN
116bab20ab Merge "Replace IS_DEBUGGABLE with isDebuggable module API" am: ba77876dbd am: 4290766ae7
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1667304

Change-Id: Iaec8ac01bbb518af8e14c0936cf8d8f2f75d8dd4
2021-04-09 01:24:14 +00:00
Tianjie
559ed7f0f0 Expose error code for RoR reboot system API
The clients of resume on reboot want additional information for
reboot failures, so they can handle these failures better.
Therefore expose the reboot failure error code via SystemApi.

Bug: 183646725
Test: atest FrameworksServicesTests:RecoverySystemServiceTest;
      Do an RoR with gmscore
Change-Id: Ia02655218194a070ce02e9dae6fd62e19259c9f9
2021-04-08 17:54:29 -07:00
Alex Buynytskyy
c144cc453a Installation hardening: reducing read timeout during installation.
And then restoring post-install.

Bug: 160635296
Test: atest PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest IncrementalServiceTest PackageManagerServiceTest ChecksumsTest

Change-Id: I0821458bf92db162518a2cbcb7499cd7544e64f2
2021-04-08 09:57:54 +00:00
Remi NGUYEN VAN
b5f095ebf0 Replace IS_DEBUGGABLE with isDebuggable module API
Introduce a Build.isDebuggable() getter instead of the IS_DEBUGGABLE
static member.

Also make it module API as APK modules now have access to module APIs in
S, but also TestApi so it can be tested.

Test: m
Fixes: 182345786
Change-Id: I25d0848aee758792bbaba8ab73b5dd997a7250b3
2021-04-08 13:50:31 +09:00
Charles Chen
d12be75275 Allow config context to inflate views
Besides UI contexts, the context created via
Context#createConfigurationContext with a proper configuration
should be allowed to inflate views or obtain ViewConfiguration.
An example is that a wear device inflate views into bitmap and pass
the bitmap to the Wear OS Companion app on the phone.

Bug: 177847640
Test: atest StrictModeTest

Change-Id: Iab232a80a973f54bf0484262d45af3e4c2f0e5dc
2021-04-07 21:58:42 +08:00
Alex Buynytskyy
dc12570037 Always unbind/delete incremental instances when remove packages.
Bug: 160635296
Test: atest PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest IncrementalServiceTest PackageManagerServiceTest ChecksumsTest
Change-Id: Ie0aea11d906dccad892d6962b71afa62b44c6378
2021-04-01 21:21:22 -07:00
Dmitri Plotnikov
6a725247e5 Merge "Add BatteryConsumer.getPowerModel() method" into sc-dev 2021-04-01 23:25:55 +00:00
Dmitri Plotnikov
8b5679d534 Merge "Adjust total consumed power to avoid double-counting" into sc-dev 2021-04-01 17:00:30 +00:00
Dmitri Plotnikov
c13f44e0aa Add BatteryConsumer.getPowerModel() method
This method will be used for testing and visualization purposes.

Bug: 184207674
Test: atest FrameworksCoreTests:com.android.internal.os.BatteryStatsTests
Change-Id: Id28ba4cbb8f27774f36248678f93ec187bc022b3
2021-03-31 18:14:08 -07:00
Biswarup Pal
d80f760516 Refactor FileUtils#convertToModernFd
Replace implementation of FileUtils#convertToModernFd with
MediaStore#getOriginalMediaFormatFileDescriptor. Fix fd leak
by returning ParcelFileDescriptor instead of FileDescriptor.

Test: atest CtsProviderTestCases
Bug: 170488060
Change-Id: I7d6ecf4549e8ed5134d20977c2089240be804827
2021-03-31 21:25:21 +00:00
Treehugger Robot
e221106bf4 Merge "Address API feedback on SKU/ODM_SKU" am: 599f545969 am: 210b7a542b am: 5c9c0e7622
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1658040

Change-Id: If53f5ea849f8d00bd1984f4740ddbd4350931561
2021-03-31 15:29:29 +00:00
Treehugger Robot
5c9c0e7622 Merge "Address API feedback on SKU/ODM_SKU" am: 599f545969 am: 210b7a542b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1658040

Change-Id: I21ecac025395c23702ee59e93a72b50326798d8d
2021-03-31 14:46:12 +00:00
Michael Wright
ab7e61e87b Actually report resonant frequency and Q factor for vibrators.
This got plumbed all the way through except for the final step of
reporting this from the Vibrator object. Doh.

Bug: 182612056
Test: manual
Change-Id: I4282ff7914266589f0f61246fe42e8ef58e70460
2021-03-31 01:48:37 +01:00
Robin Lee
ddbe3e08ac Address API feedback on SKU/ODM_SKU
Change-Id: Iec5fe90dd172c9d45442731485da27c71039ac2f
Test: atest android.os.cts.BuildTest
Bug: 180419023
2021-03-30 17:07:02 +00:00
George Chang
03259bf7a4 Merge changes from topic "update_NFCC_Always_on" am: 7b7b809587 am: 6a6d92ff09 am: f5dcd90370
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1655107

Change-Id: I57b2db68bb05750718298d776ba2d365bea44a8b
2021-03-30 03:59:15 +00:00
George Chang
f5dcd90370 Merge changes from topic "update_NFCC_Always_on" am: 7b7b809587 am: 6a6d92ff09
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1655107

Change-Id: Ie96dfbcd9e37a1e76faa2efbea2fc146a42e82f9
2021-03-30 03:07:50 +00:00
Dmitri Plotnikov
ff6c7f864c Adjust total consumed power to avoid double-counting
The definition of SystemBatteryConsumer.getConsumedPower()
has been changed to include power attributed to apps.
That power is also included in UidBatteryConsumers, so we
ended up double-counting power attributed to apps.

Bug: 183235836
Test: atest FrameworksCoreTests:com.android.internal.os.BatteryStatsTests
Change-Id: Ib99b3ce910b62528241e271bdb3b925a9ac01830
2021-03-29 19:18:24 -07:00
Sean Stout
97effb798d Merge "Update Wakelocks to be per-DisplayGroup" into sc-dev 2021-03-29 08:18:28 +00:00
George Chang
ba34121efc Make NFC_UID TestApi
Bug: 182979907
Test: atest android.permission.cts.NfcPermissionTest
Test: atest android.net.wifi.cts.WifiManagerTest
Change-Id: Id007984bcd03b5892bd774673c8c0ab836032fc9
2021-03-28 22:28:06 +08:00
Dmitri Plotnikov
eb2a57b807 Merge "Add SystemBatteryConsumer.getPowerConsumedByApps()" into sc-dev 2021-03-26 14:31:35 +00:00
Steven Moreland
32f27edf97 Merge "Binder: allow stability downgrade" am: 7236cf6dca am: 0852de16cb am: e86ea5d7d4
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1651544

Change-Id: Icb13c0c97fb72d56c0212fe2ec4100653c454bd4
2021-03-26 03:58:18 +00:00
Steven Moreland
e86ea5d7d4 Merge "Binder: allow stability downgrade" am: 7236cf6dca am: 0852de16cb
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1651544

Change-Id: I5f0e1dcb3a06dcb35bf2c68f077afbe32a4e8088
2021-03-26 03:14:29 +00:00
Lais Andrade
1eba10e2a2 Merge "Implement PWLE support" into sc-dev 2021-03-26 02:01:14 +00:00
Dmitri Plotnikov
c733ef6692 Add SystemBatteryConsumer.getPowerConsumedByApps()
Also, standardize the implementations of getConsumedPower()
to consistently return the total power consumed, not the
power unattributed to apps.

Bug: 183235836
Test: atest FrameworksCoreTests:com.android.internal.os.BatteryStatsTests
Change-Id: Iaedb29b9d7afd9843b0ab871e9b8656963db11ea
2021-03-25 18:45:08 -07:00
Sean Stout
8a5baa96c9 Update Wakelocks to be per-DisplayGroup
Bug: 168210495
Test: atest PowerManagerServiceTest
Change-Id: Ic23301a8dcdfc97f3a83c74d61ad4108a187e52d
2021-03-25 13:22:20 -07:00
Zimuzo Ezeozue
3244637a97 Merge "Address onAnrDelayStarted API comments" into sc-dev 2021-03-25 19:35:47 +00:00
Zim
308a048787 Address onAnrDelayStarted API comments
Test: m
Bug: 183446229
Change-Id: I433096c9fdc003b777f8a280f13f675a2d7ea8bf
2021-03-25 16:15:36 +00:00
Lais Andrade
68a199f60d Implement PWLE support
Implement composePwle method and related frequency control getter
introduced to the IVibrator interface.

Bug: 167947076
Test: VibratorControllerTest and VibraionThreadTest
Change-Id: If15f47fae33bce0bcb916e84af0c6712068f3a00
2021-03-25 13:21:02 +00:00
Michael Wachenschwanz
522bb3d9cc Merge "Accumulate Mobile Radio and Gnss measured energy in BatteryStats" into sc-dev 2021-03-24 20:46:34 +00:00
Dmitri Plotnikov
0d1235b411 Merge "Remove references to BatterStatsHelper from BatteryUsageStatsProvider" into sc-dev 2021-03-24 18:35:48 +00:00
Abhijeet Kaur
7591e2d06a Make getExternalStorageMountMode as SystemApi
Secondary volumes are FUSE mounted, whereas Android/data and Android/obb
on primary volumes are not FUSE mounted. Access to these private app
directories on primary volumes is restricted using the mount modes, but
access for these on secondary volumes need to be regulated by
MediaProvider.

Make getExternalStorageMountMode as SystemApi so that MediaProvider
can leverage the same mount logic for Secondary volumes.
Expose relevant mount modes as SystemApi as well.

This change saves us the maintenance overhead for Secondary volumes for
Android S+. Otherwise we would have to check if an app is a signature
app through APIs which would basically be the duplication for the
logic in StorageManagerService.java.

Expose ExternalStorageProvider and downloads Authority for MediaProvider
to rely only on APIs. This is also required for CDD modifications that
these 2 providers are given exceptional access to private app dirs.

Bug: 175796984
Bug: 173505864
Bug: 173505864
Test: atest DownloadProviderTest
Test: atest CtsScopedStorageHostTest
Test: atest android.scopedstorage.cts.host.PublicVolumeHostTest#testCheckInstallerAppAccessToObbDirs
Test: atest android.scopedstorage.cts.host.PublicVolumeHostTest#testCantAccessOtherAppsExternalDirs
Change-Id: I51bc7bd3f355fadd9de56ac267469c2352eb0ffa
Merged-In: I51bc7bd3f355fadd9de56ac267469c2352eb0ffa
2021-03-24 09:28:27 +00:00
Dmitri Plotnikov
b8b58ebd2f Remove references to BatterStatsHelper from BatteryUsageStatsProvider
Also, add BatteryUsageStatsQuery.getMaxStatsAge() to allow throttling
of battery stats sync.

Bug: 174186345
Test: atest FrameworksCoreTests:com.android.internal.os.BatteryStatsTests
Change-Id: I097c6b9575422837a522cf313a320e83221cdfab
2021-03-23 19:29:11 -07:00
Michael Wachenschwanz
27959e75dc Accumulate Mobile Radio and Gnss measured energy in BatteryStats
Enabled querying and processing Mobile Radio and Gnss energy consumption
in BatteryStatsExternal.
Attribute and accumulate their power deltas in BatteryStatsImpl
Utilize measured power data in MobileRadioPowerCalculator and
GnssPowerCaluclulator.

Bug: 174818228
Test: atest GnssPowerCalculatorTest
Test: atest MobileRadioPowerCalculatorTest
Test: BatteryStatsExternalWorkerTest
Change-Id: If062033ff3c8cff20842be2cd92b04f6cb981366
2021-03-23 18:40:35 -07:00
Steven Moreland
bf6bbc60aa Binder: allow stability downgrade
For instance, use a VINTF interface inside the system image without
adding it to the VINTF manifest (e.g. for testing, in this case, the
interface can't be used between system and vendor).

Bug: 183154648
Test: N/A
Change-Id: I9ceb5d96e6a245b9509d9c60828aa3736056909d
2021-03-24 01:26:04 +00:00
TreeHugger Robot
478e03ed12 Merge "Add isAppIoBlocked TestApi" into sc-dev 2021-03-23 20:57:56 +00:00
TreeHugger Robot
14278aecfd Merge "Introduce vibrator frequency mapping." into sc-dev 2021-03-23 19:11:07 +00:00
Zim
ae30d154f6 Add isAppIoBlocked TestApi
This allows us test the notifyAppIoBlocked and notifyAppIoResumed APIs

Also fixed isAppIoBlocked bug where a uid with a blocked counter of
'0' would incorrectly result in returning true.

Test: m
Bug: 181222557
Change-Id: I3e8f040cd0e08cb0765fec0cfafab6428d6a3a00
Merged-In: I3e8f040cd0e08cb0765fec0cfafab6428d6a3a00
2021-03-23 18:14:58 +00:00
Dmitri Plotnikov
f2dca81569 Merge "Change getStatsStartRealtime to getStatsStartTimestamp" into sc-dev 2021-03-23 17:29:38 +00:00
Martijn Coenen
be76c4051b Merge "Make StorageVolume#getOwner a system API." into sc-dev 2021-03-23 17:22:39 +00:00
Lais Andrade
e574d3bbe8 Introduce vibrator frequency mapping.
Introduce frequency data to VibratorInfo and a transformation for
VibrationEffect that maps relative frequency and amplitude values to the
device absolute values.

The transformation also clips amplitude values to the device bandwidth
map provided.

Pending implementation of chaining composed waveforms and sending PWLE
primitives to the HAL.

Bug: 167947076
Test: DeviceVibrationEffectAdapterTest
Change-Id: Ie7505a1c0f50bb7d907b0752c02987f258316874
2021-03-23 15:28:10 +00:00
TreeHugger Robot
9db9a56c7e Merge "Introduce WaveformBuilder to VibrationEffect" into sc-dev 2021-03-23 14:32:56 +00:00
Martijn Coenen
b329228214 Make StorageVolume#getOwner a system API.
Since the MediaProvider mainline module will now manage volumes of
multiple users, it needs to know which user a volume belongs to. This
was implemented by an already existing API, so make that a @SystemApi.

Bug: 182396009
Test: N/A

Change-Id: I9ca24e500adfd51fbd52e863f549365dd9aaf39d
2021-03-23 14:16:12 +00:00
Saumya Pathak
cbe66b17b9 Merge "Add app clone profile and APIs." into sc-dev 2021-03-23 11:15:59 +00:00
Saumya Pathak
5a4fc52fc7 Add app clone profile and APIs.
This change adds a new hidden user type "android.os.usertype.profile.CLONE"
and two new system APIs "isCloneProfile" and "hasSharedMedia". To support App cloning, we need to support sharing media between the owner user and the clone user. Adding this as a property in UserTypeDetails.

Bug: 182396009
Test: atest android.multiuser.cts.UserManagerTest#testCloneUser, atest com.android.server.pm.UserManagerTest#testCloneUser and manually ran shell commands on the clone user.

Change-Id: I49ddcbd499944ca9ec05ef4dc10d2e2b231d8b88
(cherry picked from commit db930667a21dac9f0de7cb2fe99175b3b4545bf4)
2021-03-23 11:15:09 +00:00