Commit Graph

9183 Commits

Author SHA1 Message Date
Dmitri Plotnikov
840f73e773 Merge "Use POWER_COMPONENT_ constants instead of TIME_COMPONENT_... constants" into sc-dev 2021-04-26 22:44:26 +00:00
Lais Andrade
fc0207696b Merge "Update javadoc for Vibrator.getPrimitiveDurations" into sc-dev 2021-04-26 14:56:15 +00:00
Dmitri Plotnikov
70b37cbf6a Use POWER_COMPONENT_ constants instead of TIME_COMPONENT_... constants
Bug: 186006876
Test: atest FrameworksCoreTests:com.android.internal.os.BatteryStatsTests
Change-Id: Ie52616e8d7b0d5c848802af94aeb3d3780af117a
2021-04-23 14:39:28 -07:00
Kweku Adams
2e2e94cc2c Merge changes I61392c55,I97e40d35 into sc-dev
* changes:
  Expand internal stop reasons.
  Rename "legacy" stop reasons.
2021-04-22 22:54:12 +00:00
Lais Andrade
0228bf8ae0 Update javadoc for Vibrator.getPrimitiveDurations
Link the method to the existing one arePrimitivesSupported.

Fix: 186120527
Test: N/A
Change-Id: Ibf128f851da977feef5f6822794c61cb31488cab
2021-04-22 17:01:26 +00:00
Saumya Pathak
8bc88258ab Merge "Renaming sharesMediaWithParent on API feedback" into sc-dev 2021-04-22 16:15:55 +00:00
TreeHugger Robot
557f9e056e Merge "Expose vibration primitives durations in Vibrator" into sc-dev 2021-04-22 15:44:10 +00:00
Kweku Adams
805535cc55 Rename "legacy" stop reasons.
There are some uses for the "legacy" stop reasons that the public API
stop reasons can't cover well. Since we'll be keeping the "legacy"
reasons around, renaming them to "internal" to help explain the
differentiation.

Bug: 141645789
Test: atest frameworks/base/services/tests/servicestests/src/com/android/server/job
Test: atest frameworks/base/services/tests/mockingservicestests/src/com/android/server/job
Test: atest ContentResolverTest (all)
Test: atest CtsJobSchedulerTestCases
Test: atest CtsSyncManagerTest
Test: atest SyncManagerTest
Test: atest SyncOperationTest
Test: atest SyncRequestTest
Change-Id: I97e40d35b79dbd012216bc22e90d649639614854
2021-04-22 07:56:48 -07:00
Steven Moreland
3b44e58145 Merge "ServiceManagerNative: update for updatableViaApex" am: 0da4dcceea am: b763d9fbb6 am: 50dda4bb15
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1682064

Change-Id: I7f25599c5ebe6759f7001194d401e0bbc191ffd9
2021-04-21 21:36:38 +00:00
Steven Moreland
50dda4bb15 Merge "ServiceManagerNative: update for updatableViaApex" am: 0da4dcceea am: b763d9fbb6
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1682064

Change-Id: Ib717ea616df7947cb1b14fc583e60ea3c8407529
2021-04-21 21:14:24 +00:00
TreeHugger Robot
fc2b8f7e57 Merge "Expose SPIN and THUD vibration effects to public" into sc-dev 2021-04-21 20:28:25 +00:00
Steven Moreland
0da4dcceea Merge "ServiceManagerNative: update for updatableViaApex" 2021-04-21 20:17:44 +00:00
Lais Andrade
dd6027e5f1 Expose SPIN and THUD vibration effects to public
Fix: 167947207
Test: N/A
Change-Id: I0785ba8efbd8edea5813715e0891bda9341b5cea
2021-04-21 10:26:23 +00:00
Lais Andrade
8231960159 Expose vibration primitives durations in Vibrator
Fix: 182477149
Test: VibratorTest
Change-Id: I4dd500fe6551645454ac9af24499098a74fd866e
2021-04-21 10:26:13 +00:00
Tianjie Xu
ff38f2041d Merge "Catch security exceptions in RoR APIs" am: 27dcfb808c am: ffbcac67ab am: f14cfe0fc3
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1651270

Change-Id: I966f41db7056be4452050f4a5a8f512f9974f790
2021-04-21 04:35:48 +00:00
Tianjie Xu
f14cfe0fc3 Merge "Catch security exceptions in RoR APIs" am: 27dcfb808c am: ffbcac67ab
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1651270

Change-Id: I034655978c746b2e824ab27d68d4fb5316aa1b3b
2021-04-21 04:06:56 +00:00
Tianjie Xu
27dcfb808c Merge "Catch security exceptions in RoR APIs" 2021-04-21 03:22:56 +00:00
Steven Moreland
021f3e3d3f ServiceManagerNative: update for updatableViaApex
See if a VINTF instance is updatable via APEX.

Bug: 185832616
Test: N/A
Change-Id: I3413707eb18beae1ac417a92e9082655f6d07f11
2021-04-21 00:28:53 +00:00
TreeHugger Robot
18ecd98109 Merge "[pm] remove incremental startable/unstartable code" into sc-dev 2021-04-20 22:03:22 +00:00
Jing Ji
a063e0f24a Merge "Update Kotlin sample code for CountDownTimer and Parcelable" am: 598675abef am: a61b23b89e am: 3d7210ee88
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1673235

Change-Id: I33967535b9da48028d895d51078c545329eda681
2021-04-20 00:33:32 +00:00
TreeHugger Robot
23292d7dee Merge "Check if idsig size is within IncFs limits." into sc-dev 2021-04-19 22:28:09 +00:00
Tony Mak
b004404a72 Merge "Add some TestAPIs for replacing some @hide API usages in ExtServices's test" into sc-dev 2021-04-19 21:07:41 +00:00
Jing Ji
3d7210ee88 Merge "Update Kotlin sample code for CountDownTimer and Parcelable" am: 598675abef am: a61b23b89e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1673235

Change-Id: Ia82738a244e73ea431280afa3bd5896b68ad6f28
2021-04-19 19:34:11 +00:00
Jing Ji
598675abef Merge "Update Kotlin sample code for CountDownTimer and Parcelable" 2021-04-19 19:23:06 +00:00
Dmitri Plotnikov
d215e29f75 Merge "Use BatteryStats instead of BatteryStatsImpl in BatteryUsageStatsProvider" into sc-dev 2021-04-19 18:09:31 +00:00
Saumya Pathak
b46e5f57f0 Renaming sharesMediaWithParent on API feedback
Test: atest android.multiuser.cts.UserManagerTest#testCloneUser, atest com.android.server.pm.UserManagerTest#testCloneUser
Bug: 185365969

Change-Id: I44a28bc6ed3e73674d77db497a15ec33b8244b05
2021-04-19 14:11:51 +00:00
Dmitri Plotnikov
a5163de7af Use BatteryStats instead of BatteryStatsImpl in BatteryUsageStatsProvider
This is being done in preparation for a switch of BatteryStats.dumpLocked
from BatteryStatsHelper to BatteryUsageStats

Bug: 162380414
Test: atest FrameworksCoreTests:com.android.internal.os.BatteryStatsTests

Change-Id: Ia8bf02116517c77f008b85c2012f68353b39c044
2021-04-16 17:47:04 -07:00
Alex Buynytskyy
c863792d62 Check if idsig size is within IncFs limits.
Bug: 152148243
Fixes: 152148243
Test: pm install-incremental <apk in the bug>
Test: atest PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest IncrementalServiceTest PackageManagerServiceTest ChecksumsTest
Change-Id: I33623a9240482ea36a8e1eeb97ec01294e7249ff
2021-04-16 12:28:41 -07:00
Songchun Fan
5ada1508c2 [pm] remove incremental startable/unstartable code
Also remove streaming health status reporting which could cause
startable state change because it is also not needed any more.

BUG: 171920377
Test: builds
Change-Id: I7284e7a63df79da7dbf3d16ff64302b3d1ce1348
2021-04-16 02:29:24 +00:00
Martijn Coenen
0110dc4836 Dump binder proxies interface descriptors on a separate thread.
There are apparently some processes that block getInterfaceDescriptor()
from completing, thus locking up the thread doing the binder proxy dump.
This can cause the watchdog to restart system_server. Move the calls to
a separate thread and give it some time to complete!

Bug: 174722615
Bug: 183676249
Test: adb shell am dump binder-proxies
Change-Id: Ifa79e53524197bf1d785210b7504e7f6c6ddc9b7
Merged-In: Ifa79e53524197bf1d785210b7504e7f6c6ddc9b7
(cherry picked from commit f1a22a35e8)
2021-04-15 06:56:32 +00:00
Tony Mak
ccb5678569 Add some TestAPIs for replacing some @hide API usages in ExtServices's test
Added a builder class for UsageStats and StorageVolume. This allows
us to create these data classes for testing.

Currently, a test in ExtServices creates these objects by using some
hidden APIs. Those tests are part of the mainline test suite, we should
not use hiden APIs there. Otherwise, the test APK cannot be installed on
older platforms.

Test: atest ExtservicesUnitTest

Bug: 182546925
Change-Id: I32939dedfa55233dfb27337cee8818a9dc25d786
2021-04-14 20:41:56 +01:00
Dmitri Plotnikov
8017f4ed5e Merge "Fix NullPointerException in BatteryUsageStats" into sc-dev 2021-04-14 19:10:36 +00:00
Jing Ji
18de9f0156 Update Kotlin sample code for CountDownTimer and Parcelable
Also fixed a typo in the javadoc of android.os.Debug

Bug: 155869891
Bug: 152033307
Bug: 177360175
Test: m -j ds-docs
Change-Id: I52da37d24ab224344f931fed558df86f250bf86f
2021-04-14 12:00:56 -07: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