Commit Graph

9290 Commits

Author SHA1 Message Date
Tianjie Xu
50016559a3 Merge "Improve the error handling for armRebootEscrow" am: 246c14d6da am: cd4836d197 am: f3bde71026 am: 9bf277f905
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1649651

Change-Id: I77608efd2e11b359da3687048285c8e7bfbb9169
2021-04-14 08:16:43 +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
27ec6b50da Merge "Add BatteryConsumer.getCustomPowerComponentName() and getCustomPowerComponentCount()" into sc-dev am: 07bc3d6d95
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14145993

Change-Id: Ida3b1050ac168abaed05e7ff2859ec50ecb76fd8
2021-04-13 23:49:21 +00: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
a7a7063551 Merge "Expose vibrator frequency bandwith to the service" into sc-dev am: f6febe9b65
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14054486

Change-Id: Icd97497edce6ef4c99fda29fa21e31887674c406
2021-04-13 17:42:50 +00:00
Lais Andrade
ca2654289a Merge "Add Vibrator.cancel method with usage filters" into sc-dev am: b4477092c4
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14033675

Change-Id: I450a2b6bcbe904ef0036c9aea192dd5c1369051f
2021-04-13 17:42:26 +00: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
6dca0114c4 Merge "Make getUid a method on UserHandle itself instead of static" am: bd1cc4f2a2 am: 6b7167e807 am: 155b09614e am: 6a6a5e776c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1669185

Change-Id: I3121bd9c49162a20b3e3a7906affbce6a67279fc
2021-04-13 13:22:53 +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
65bc303fa8 Merge "Rename FIRST_SDK_INT to DEVICE_INITIAL_SDK_INT" into sc-dev am: 036d189a8d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14134967

Change-Id: Iaae05598a4d39e4706a5cbbaf2dbc7e6f85de35b
2021-04-13 02:17:42 +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
ef40d628b5 Merge "Rename CombinedVibrationEffect to CombinedVibration" into sc-dev am: 8b2586c6ea
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14104345

Change-Id: I5b4d66ee7d5f284dcd55f0044bc249d3c6d46b9a
2021-04-12 20:09:30 +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
Zimuzo Ezeozue
43cba5fee2 Merge "Fix FileUtils#copy to fallback on userspace copy if sendfile fails" into sc-dev am: 3f2a7540e4
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14141620

Change-Id: Ib834da966d06c6602b04cde95a7eef006b6f8588
2021-04-12 15:09:43 +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
64e80e925b Merge "Remove throws RuntimeException from APIs" am: ad274e531a am: d07131cb98 am: 3e04c95255 am: 49e4e7e167
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1669005

Change-Id: I2f716e1ec1b67b7009abee7a0ed7bcea535d8647
2021-04-12 05:29:44 +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
afe79043a8 ADPF: PerformanceHintManager API implementation am: 4c6e5036b7
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13699259

Change-Id: I4a1a0b654d38beba814ca968276675358c8d9331
2021-04-11 00:49:06 +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
d98c367acd Merge "Expose error code for RoR reboot system API" am: d5547af728 am: 2cf5387b09 am: 133568e964 am: 61647a6979
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1656644

Change-Id: Iefb4cdb1e7b6af3aca17b379dd513d056e9a9f7b
2021-04-10 00:21:27 +00: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
8926087107 Merge "Allow config context to inflate views" into sc-dev am: c22aff4e4d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13482649

Change-Id: Idc103720792c36b1a1e3331a5d2bea72e87e8efa
2021-04-09 07:17:18 +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
746aee1fd3 Merge "Replace IS_DEBUGGABLE with isDebuggable module API" am: ba77876dbd am: 4290766ae7 am: 116bab20ab am: 6c9d7a5c75
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1667304

Change-Id: I53ddc1fffdd2ca55017f8cbac62a9a6e2b33aa9a
2021-04-09 01:48:58 +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
TreeHugger Robot
0de6023f0c Merge "Installation hardening: reducing read timeout during installation." into sc-dev am: a8cfbe87c0
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14111951

Change-Id: Ia3be052f71f628558b1d70b56117f9394c05c210
2021-04-08 18:12:56 +00: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
TreeHugger Robot
3c0e301a25 Merge "Always unbind/delete incremental instances when remove packages." into sc-dev am: 1ab6db5cc6
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14071309

Change-Id: Ib571abfe6aa4e1381bfa63b2197df2abfb94f1bc
2021-04-02 09:06:30 +00: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
847754313b Merge "Add BatteryConsumer.getPowerModel() method" into sc-dev am: 6a725247e5
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14057262

Change-Id: I3f6f937a5ff55793bda7134a47d6bae214b8c3d0
2021-04-01 23:43:33 +00:00
Dmitri Plotnikov
6a725247e5 Merge "Add BatteryConsumer.getPowerModel() method" into sc-dev 2021-04-01 23:25:55 +00:00