Commit Graph

9150 Commits

Author SHA1 Message Date
Dmitri Plotnikov
8017f4ed5e Merge "Fix NullPointerException in BatteryUsageStats" into sc-dev 2021-04-14 19:10:36 +00:00
Dmitri Plotnikov
864454912a Merge "Remove POWER_COMPONENT_USAGE and TIME_COMPONENT_USAGE" into sc-dev 2021-04-14 17:50:25 +00:00
Tianjie Xu
9bf277f905 Merge "Improve the error handling for armRebootEscrow" am: 246c14d6da am: cd4836d197 am: f3bde71026
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1649651

Change-Id: Ie1a2e4e87e1dcda0b53044c0cb577b938455fdee
2021-04-14 07:17:25 +00:00
Tianjie Xu
f3bde71026 Merge "Improve the error handling for armRebootEscrow" am: 246c14d6da am: cd4836d197
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1649651

Change-Id: I6aabf1250d67f6a79711e89fb05c68bf84849656
2021-04-14 06:32:31 +00:00
Tianjie Xu
246c14d6da Merge "Improve the error handling for armRebootEscrow" 2021-04-14 05:23:07 +00:00
Dmitri Plotnikov
153f2acfee Fix NullPointerException in BatteryUsageStats
Bug: 185287730
Test: Build and launch Settings on a crosshatch
Change-Id: Iccdd8a0f3839b98dbb5c09599f35ac15985daa4c
2021-04-13 22:14:05 -07:00
Dmitri Plotnikov
9e19e96ad0 Remove POWER_COMPONENT_USAGE and TIME_COMPONENT_USAGE
... and use specific power components, such as POWER_COMPONENT_SCREEN

Bug: 184397335
Test: atest FrameworksCoreTests:com.android.internal.os.BatteryStatsTests
Test: mp :BatteryStatsViewer && adb shell am start -n com.android.frameworks.core.batterystatsviewer/.BatteryStatsViewerActivity
Change-Id: I551b2d37d2da77e21e622961f5290b55fb24da61
2021-04-13 21:59:26 -07:00
Dmitri Plotnikov
3885aa960b Add BatteryConsumer.getCustomPowerComponentName() and getCustomPowerComponentCount()
Bug: 184207674
Test: atest FrameworksCoreTests:com.android.internal.os.BatteryStatsTests
Change-Id: Ic41cf53e553a25caa8bb6c84c30e3ea2b7627281
2021-04-13 12:16:13 -07:00
Lais Andrade
f6febe9b65 Merge "Expose vibrator frequency bandwith to the service" into sc-dev 2021-04-13 17:31:18 +00:00
Lais Andrade
b4477092c4 Merge "Add Vibrator.cancel method with usage filters" into sc-dev 2021-04-13 17:30:51 +00:00
Lais Andrade
853dcb5a41 Expose vibrator frequency bandwith to the service
Add hidden APIs to expose the supported frequency range and maximum
amplitudes at each frequency for the device in Vibrator.java.

Also add a hidden method hasFrequencyControl().

Bug: 167947076
Test: VibratorTest
Change-Id: If2d5f8f0aa92223b4a342893f5fd3a1668dfcff1
2021-04-13 14:03:08 +00:00
Chiachang Wang
6a6a5e776c Merge "Make getUid a method on UserHandle itself instead of static" am: bd1cc4f2a2 am: 6b7167e807 am: 155b09614e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1669185

Change-Id: Ic0b7887630c00404ff354c193b82a96930940556
2021-04-13 13:06:43 +00:00
Lais Andrade
6e075783ee Add Vibrator.cancel method with usage filters
Add a new hidden API to Vibrator and VibratorManager that allows
vibrations to be cancelled based on their usage attribute.

The new API is used by the NotificationManagerService on volume button
press to only cancel ongoing attentional haptics, triggered for alarm,
notification or ringtone.

Fix: 182440404
Test: VibratorManagerTest & BuzzBeepBlinkTest
Change-Id: I4bf55928cf3b7dd79f66d53d570001a5205ce2d0
2021-04-13 13:04:05 +00:00
Chiachang Wang
155b09614e Merge "Make getUid a method on UserHandle itself instead of static" am: bd1cc4f2a2 am: 6b7167e807
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1669185

Change-Id: Icc006ab751a1a03aa3c09c1999a6141ff061081d
2021-04-13 11:54:57 +00:00
Chiachang Wang
bd1cc4f2a2 Merge "Make getUid a method on UserHandle itself instead of static" 2021-04-13 08:15:47 +00:00
Paul Hu
036d189a8d Merge "Rename FIRST_SDK_INT to DEVICE_INITIAL_SDK_INT" into sc-dev 2021-04-13 02:05:21 +00:00
Lais Andrade
d8dc940fc0 Rename CombinedVibrationEffect to CombinedVibration
The change makes the distinction between VibrationEffect and
CombinedVibratio clearer. The later is a combination of the former with
the extra information about the vibrator ids, allowing effects to be
played in one or more vibrators in parallel or in sequence.

The methods create/start synced where also renamed to parallel (together
with respective builder classes), to indicate they perform one or more
effects in parallel on multiple vibrators. This is also a better match
to the sequential combinations.

This change also deprecates the Context.VIBRATOR_SERVICE in favour of
the new VIBRATOR_MANAGER_SERVICE. The default vibrator can be retrieved
from the manager system service.

Same deprecation applied to InputDevice.getVibrator method.

Fix: 184123900
Test: CombinedVibrationTest
Change-Id: I44d8b225098d35fbf7783254acaf6a78f9fb4505
2021-04-12 16:34:54 +00:00
Zim
6502f59a98 Fix FileUtils#copy to fallback on userspace copy if sendfile fails
As per the manpage, sendfile(2) might fail for the following reasons:
1. input fd doesn't support mmap
2. output was opened with O_APPEND

If sendfile(2) fails with EINVAL or ENOSYS, we fallback to userspace
copy

Fixed failing FileUtilsTest#convertToModernFd test since
I7d6ecf4549e8ed5134d20977c2089240be804827 that stoped matching valid
files to convert to modernfd with regex

Test: atest FileUtilsTest
Bug: 184236915
Change-Id: I0955fe2a7dfb40ac1f78bde4a325eb624a34f28b
2021-04-12 12:52:47 +00:00
Chiachang Wang
49e4e7e167 Merge "Remove throws RuntimeException from APIs" am: ad274e531a am: d07131cb98 am: 3e04c95255
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1669005

Change-Id: I8c9661c382e757a458569810d519c3e0bbd2c0d2
2021-04-12 05:15:21 +00:00
Chiachang Wang
3e04c95255 Merge "Remove throws RuntimeException from APIs" am: ad274e531a am: d07131cb98
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1669005

Change-Id: I49359b27fb64573129cec3b1a5fe345257956521
2021-04-12 04:18:49 +00:00
Chiachang Wang
ad274e531a Merge "Remove throws RuntimeException from APIs" 2021-04-12 02:57:51 +00:00
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
Tianjie
6066898f42 Improve the error handling for armRebootEscrow
The change including the following items
1. Add error code for armRebootEscrow
2. Fail the armRebootEscrow for mismatching ror providers.
3. clear the escrow data for fatal armRebootEscrow
4. clear the RoR preparation state in recovery system for fatal
   armRebootEscrow

Bug: 183140900
Test: atest FrameworksServicesTests:RebootEscrowManagerTests;
      atest FrameworksServicesTests:RecoverySystemServiceTest;
      Change provider before reboot, reboot-and-apply failed;
Change-Id: I266ea6f2e1c77994d5cc8c2713106c527c4e0722
2021-04-09 13:18:18 -07:00
paulhu
016950a485 Rename FIRST_SDK_INT to DEVICE_INITIAL_SDK_INT
As API review feedback, rename Build#VERSION#FIRST_SDK_INT to
Build#VERSION#DEVICE_INITIAL_SDK_INT. As well as update all usage
in frameworks and tests.

Bug: 184735771
Test: m
Change-Id: I72660959cb4e638a8e80fcf2f4e96ea172969f44
2021-04-09 15:47:36 +08: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
Chiachang Wang
d171bcbd01 Make getUid a method on UserHandle itself instead of static
This commit addresses the API review feedback that getUid()
will be better to make it be a method on UserHandle itself
rather than a static method.

Update as it is and update the corresponding usages.

Fix: 184735865
Test: make update-api
Test: atest FrameworksNetTests
Test: atest CtsNetTestCasesLatestSdk
Change-Id: I33844309224d84764704255d251fadc8940202ca
2021-04-09 08:33:07 +08: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
Chiachang Wang
221e2c77ad Remove throws RuntimeException from APIs
As API review feedback, the information provides no value to a
user. Remove it from BatteryStatsManager#reportWifiRadioPowerState
and BatteryStatsManager#reportMobileRadioPowerState.

Fix: 184735838
Test: make update-api
Change-Id: I8cce6523695ba58654cbe5d1db79045eeb46d913
2021-04-08 09:44:12 +08: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