Commit Graph

10213 Commits

Author SHA1 Message Date
Wesley Wang
c0401b62b8 BatteryManager support dock charging 2/2
Bug: 194012532
Test: manually, local test with kernel patch
Change-Id: I1ce467844bb7657c1412b8958fe4d4b0961576e8
2022-01-26 02:06:54 +00:00
Adam Bookatz
60dcd3a282 Merge "SystemService post-completed user event" 2022-01-25 21:16:55 +00:00
Michael Wright
764fae2661 Merge "Clean-up some warnings and docs bugs in PowerManager" 2022-01-25 19:01:20 +00:00
TreeHugger Robot
e21406e972 Merge "Renamed removeUserOrSetEphemeral completely" 2022-01-25 05:26:56 +00:00
Adam Bookatz
69444e10e8 SystemService post-completed user event
Introduces a new SystemService stage that indicates that user events
(user-switch, user-starting, user-unlocked) have completed. This can be
used by services for non-urgent tasks that must be completed after the
event in question, but can be delayed until later.

As long as they happen close enough in time, only a single event will be
sent (per user) which will contain information about all the
onUser-completion events it represents.

TODO: Also trigger the call when the user-switch UX has completed
(rather than waiting for the hard-coded delay). First we need to find an
appropriate signal for "switch UX is complete".

Test: atest UserControllerTest
Test: manual confirmation using VoiceInteractionManagerService
Bug: 197344658
Change-Id: Id8e6ce8e9c46f86d48d0a76085123c0c3dd1f2ea
2022-01-24 19:41:24 -08:00
Wenhao Wang
8707290b4b Merge "Add logcat service to track logd access" 2022-01-24 23:01:38 +00:00
Lais Andrade
b5ac864874 Merge "Use linear interpolator in VibratorInfo bandwidth curve" 2022-01-24 20:09:04 +00:00
Lais Andrade
0caffbfc38 Merge "Create VibratorFrequencyProfile in Vibrator API." 2022-01-24 20:08:18 +00:00
Roopa Sattiraju
c5399ffe76 Merge "Initialize FrameworkInitializer for Bluetooth" 2022-01-24 19:31:20 +00:00
Kholoud Mohamed
35216e0275 Merge "Allow updating enterprise strings in the framework" 2022-01-24 15:09:02 +00:00
Lais Andrade
136ca7e3fd Use linear interpolator in VibratorInfo bandwidth curve
Change VibratorInfo.FrequencyProfile to use a linear interpolation for
the max amplitude supported by frequency values between two measurement
entries in the HAL bandwidth returned.

Bug: 203785430
Test: VibratorInfoTest
Change-Id: I56e998df40698be87a713ca9013380c0e938e165
2022-01-24 12:15:45 +00:00
Lais Andrade
cb3718bfd4 Create VibratorFrequencyProfile in Vibrator API.
Create public class to represent the vibrator response for the
supported frequency range to the Vibrator public API, with basic
implementation that extracts these values from FrequencyMapping.

Integrate this data with the result of Vibrator.hasFrequencyControl
method, which also checks the HAL capabilities.

Also make public the methods to provide resonant frequency and Q-factor
of the device. Update the SystemVibrator to handle multi-vibrator
scenario and return values when all vibrators have the same
configurations. This includes returning the intersection of all vibrator
max amplitude measurements in the new profile object.

Add validation to HAL values and CTS to cover expected ranges based on
the device support for frequency control.

Bug: 203785430
Test: android.os.cts.VibratorTest & VibratorInfoTest
Change-Id: I0b7cf599ae6039355a0a198f4bdaafb85fb7422c
2022-01-24 12:15:11 +00:00
Sarup Dalwani
928116e4d0 Merge "Restricting creation of Clone Profile when the device owner is set" 2022-01-24 08:31:17 +00:00
Roopa Sattiraju
a070d18c3c Initialize FrameworkInitializer for Bluetooth
Bug: 195146428
Test: Compile and bring up
Change-Id: Ife478832ced506ff156c0a1f680952390e50d425
2022-01-23 18:17:34 -08:00
Felka Chang
ea8a9cb9fe Fix PackageInfoUserFieldsTest ClassNotFoundException
In order to make parsing package APIs visible for mainline, moving
parsing classes to system server. The related test cases should
change appropriately. Test Plan should also follow the change.

Because com.android.server.pm.parsing.PackageInfoUserFieldsTest has
been removed , frameworks/base/core/java/android/os/TEST_MAPPING
contains '"include-filter":
"com.android.server.pm.parsing.PackageInfoUserFieldsTest"'
that doesn't work.

Test: atest \
 com.android.server.pm.parsing.PackageInfoUserFieldsTest;
 # It gets Class Not Found
Test: http://ab/I11400010010682351

Fixed: 215305254
Change-Id: Ib435e5d08faa663dcfd03232378998b1db6f2a0e
2022-01-24 09:48:24 +08:00
Dmitri Plotnikov
50f887b058 Add BatteryStatsManager.getBluetoothBatteryStats() API
Bug: 202876405
Test: atest FrameworksCoreTests:BatteryStatsImplTest
Change-Id: I4a7f880ddad7dc98e9919356859603b17a894705
2022-01-21 13:04:54 -08:00
Neharika Jali
e9605c6905 Merge "Makes constants related to cache configurable via DeviceConfig API" 2022-01-21 19:06:21 +00:00
Hao Ke
4f71cd3513 Merge "Changing readParcelable and readSerializable's method signatures." am: d5b3a5c4a9 am: 6c1f3fbcd2 am: 1ff8962b79 am: 70398d2001
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1953436

Change-Id: Iaef6f3bd68561b879bf0d1600b7296b5c39b225a
2022-01-21 18:10:05 +00:00
Hao Ke
70398d2001 Merge "Changing readParcelable and readSerializable's method signatures." am: d5b3a5c4a9 am: 6c1f3fbcd2 am: 1ff8962b79
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1953436

Change-Id: Idc81838d965832f5d97af67e0006565fe93a3a76
2022-01-21 17:51:42 +00:00
Hao Ke
1ff8962b79 Merge "Changing readParcelable and readSerializable's method signatures." am: d5b3a5c4a9 am: 6c1f3fbcd2
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1953436

Change-Id: I24500f0428749baf7e1da43464982c1bd15c28f2
2022-01-21 17:33:28 +00:00
kholoud mohamed
9b24fdfb32 Allow updating enterprise strings in the framework
Bug: 188410712
Bug: 211422509
Test: manual
Change-Id: Ia27b22b6cad14c8b62f3415a4967e479c21eb30c
2022-01-21 17:10:33 +00:00
Hao Ke
d5b3a5c4a9 Merge "Changing readParcelable and readSerializable's method signatures." 2022-01-21 17:01:04 +00:00
Martijn Coenen
2283b7079c Merge changes I39c351f1,Ida90829a,I02aaaa1c
* changes:
  Make ProcessRecord.isolated more robust.
  Rename ServiceRecord.isolatedProc to isolationHostProc.
  Add a new UID range for supplemental processes.
2022-01-21 13:49:54 +00:00
Treehugger Robot
6eaf7224a3 Merge "[MS29] Remove Trace hidden API dependencies" am: be70a4353a am: 56da05be6c am: e987d6eb82 am: db6062fa8d
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1952201

Change-Id: I290a73b4a8c8bf2ca3e40c1f23224a67ebccf603
2022-01-21 09:24:44 +00:00
Treehugger Robot
db6062fa8d Merge "[MS29] Remove Trace hidden API dependencies" am: be70a4353a am: 56da05be6c am: e987d6eb82
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1952201

Change-Id: I34899dff6aa29ef5940afce89d459d2585d97044
2022-01-21 09:07:35 +00:00
Treehugger Robot
e987d6eb82 Merge "[MS29] Remove Trace hidden API dependencies" am: be70a4353a am: 56da05be6c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1952201

Change-Id: I735fbe031bef57ecb7a4e0428bcd56484a9af116
2022-01-21 08:44:24 +00:00
Treehugger Robot
be70a4353a Merge "[MS29] Remove Trace hidden API dependencies" 2022-01-21 08:29:29 +00:00
Junyu Lai
c048d53e60 [MS29] Remove Trace hidden API dependencies
Since data usage related code is going to move to mainline module,
hidden classes and methods can no longer be accessed. Thus,
expose the needed system apis since there is no alternative.

Test: TH
Fix: 215152167
Bug: 204830222
Change-Id: I41046f90b9ff8f1755304e5d289584d39599fd13
2022-01-21 06:34:55 +00:00
Mayank Garg
add9e6f184 Renamed removeUserOrSetEphemeral completely
Remaining Task: add more CTS tests for removeUserWhenPossible

Bug: 199446770
Test: m
Change-Id: I709ad0eeba3d01f11000b2f5647f385b17fa9c63
2022-01-20 18:10:01 -08:00
Martijn Coenen
9c9045241a Add a new UID range for supplemental processes.
These are processes that are spawned alongside regular app processes.
They have their own UID range, such that they can be properly isolated
from applications.

Add some APIs in Process that allows the system and mainline
modules to verify that a particular UID belongs to a supplemental
process, and to map between the supplemental process and the
corresponding app process.

Bug: 215012578
Test: N/A
Change-Id: I02aaaa1c2bcf9d141ddc97747eb6d7edd52d7b92
2022-01-21 01:05:46 +00:00
Etienne Ruffieux
7f494cc901 Merge "Making Process.NFC_UID SystemApi for modules" am: 06580338e6 am: d086e8ee72 am: 0fcd2ed905 am: 26f9b5d78b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1945288

Change-Id: Ia7695f25f9bec9cd61c1743888cb8c8dd3b8ee04
2022-01-21 00:19:54 +00:00
Etienne Ruffieux
26f9b5d78b Merge "Making Process.NFC_UID SystemApi for modules" am: 06580338e6 am: d086e8ee72 am: 0fcd2ed905
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1945288

Change-Id: I7f153f5c39de361e5b65848792ad35d67dcd00e0
2022-01-21 00:18:44 +00:00
Dmitri Plotnikov
802df78a0b Merge "Attribution of Bluetooth power per process state" 2022-01-21 00:01:02 +00:00
Etienne Ruffieux
0fcd2ed905 Merge "Making Process.NFC_UID SystemApi for modules" am: 06580338e6 am: d086e8ee72
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1945288

Change-Id: I8adadb76c51aa37665ac9847c51e852bd7d933b8
2022-01-21 00:00:34 +00:00
Etienne Ruffieux
fe195c9b7e Making Process.NFC_UID SystemApi for modules
In order for Bluetooth to be a mainline module, we need to
remove all hidden APIs calls from and to it. NFC_UID is
used inside BluetoothManagerService so we need to be able
to access it.

Tag: #feature
Test: make
Bug: 211851706
Change-Id: Ie778c4467f5db1efa1f759c405373cc3e34747ca
2022-01-20 19:09:50 +00:00
Sarup Dalwani
a47d72c3c2 Restricting creation of Clone Profile when the device owner is set
As part of Android S, the restriction was enforced by CDD but the user creation flow did not
block creation of clone profile. Creating changes that will add user restriction
of type  UserManager.DISALLOW_ADD_CLONE_PROFILE while setting up device
owner. This restriction is checked while user creation flow and throws
UserManager.CheckedUserOperationException. When the device owner is
removed, the user restriction UserManager.DISALLOW_ADD_CLONE_PROFILE is
removed and creation of clone profile is allowed.

Bug: 211862605
Test: 1. atest FrameworksServicesTests:com.android.server.devicepolicy.DevicePolicyManagerTest
2. atest FrameworksServicesTests:com.android.server.pm.UserManagerTest
3. Manually tried creation of clone profile before setting device
owner, able to create clone profile
4. Manually set device owner and tried to create clone profile, unable to
create clone profile
5. Manually removed device owner and tried to create clone profile, able
to create clone profile.

Change-Id: Id87756601a25323e06036a3193f6a7f8f53fa71d
2022-01-20 11:59:41 +00:00
TreeHugger Robot
ce65b04d56 Merge "Revert "Revert "Migrate unsafe parcel APIs in framework-minus-apex""" 2022-01-20 11:33:39 +00:00
Neharika Jali
f29cf7bbb5 Makes constants related to cache configurable via DeviceConfig API
Bug: 214343564
Test: atest installd_cache_test, atest StorageManagerBaseTest, atest
StorageManagerTest#testComputeStorageCacheBytes

Change-Id: Ie977b8798e7169471c407621535ca1ca8feb6fec
2022-01-20 10:42:36 +00:00
Allen Su
b0595af545 Merge "Export matchesLanguageAndScript() API in LocaleList" 2022-01-20 06:52:27 +00:00
Wenhao Wang
256519a529 Add logcat service to track logd access
The LogcatManagerService monitors all privileged (in AID_LOG group)
access to logd. Only Root and System Server can read the logd data
without tracking. Whenever the logd recieve privileged read data request,
the request is forwarded to the LogcatManagerService.

The LogcatManagerService can approve or decline the request via
binder RPC on logd service. The binder call is enforced by sepolicy.
That means only LogcatManagerService can use the logd binder service.
And only logd can use the logcat binder service.

The next step will add user consent requirement for the logd access.

Bug: 197901557
Test: Reboot the device, then run "adb logcat" multiple times
both during the booting and after the booting. The control flow goes
correctly as we expected.
Ignore-AOSP-First: pending fix for logcat privacy issue

Change-Id: I5e225b65357e7bfacd5c6c9cb4fab5f309803193
2022-01-19 16:49:49 -08:00
Dmitri Plotnikov
4cd04a2549 Attribution of Bluetooth power per process state
Bug: 191921016
Test: atest FrameworksCoreTests:BatteryStatsTests
Change-Id: Ibcda229824a2966bd6adf8db7b9168050d77fe96
2022-01-19 16:02:15 -08:00
allenwtsu
51dcd501ee Export matchesLanguageAndScript() API in LocaleList
Bug: 209729853
Test: atest LocaleListTest
Change-Id: I173fa6b525d3d265663e121c781b999ea573ea95
2022-01-20 03:56:13 +08:00
Hao Ke
9c4045f7c9 Changing readParcelable and readSerializable's method signatures.
Bug: 210800751
Test: atest -d android.os.cts.ParcelTest
Change-Id: Ie0a1deafc6e876ea01bfa5cee221ef81fecdfe59
2022-01-19 17:49:57 +00:00
Lais Andrade
41fd16dfb7 Merge "Deprecate boolean settings for haptic feedback and vibrate when ringing" 2022-01-19 17:24:40 +00:00
Bernardo Rufino
1a5cb387d6 Revert "Revert "Migrate unsafe parcel APIs in framework-minus-apex""
This reverts commit 331be9a643.

Reintroducing ag/16366278 since it seems unrelated to b/214053959 (more details on b/214053959#comment55).

Original commit message:

Migrate unsafe parcel APIs in framework-minus-apex

Migrate the following unsafe parcel APIs in framework-minus-apex:
* Parcel.readSerializable()
* Parcel.readArrayList()
* Parcel.readList()
* Parcel.readParcelable()
* Parcel.readParcelableList()
* Parcel.readSparseArray()

This CL was generated by applying lint fixes that infer the expected
type from the caller code and provide that as the type parameter
(ag/16365240).

A few observations:
* In some classes we couldn't migrate because the class also belonged to
another build module whose min SDK wasn't current (as is the case for
framework-minus-apex), hence I suppressed the lint check
(since I'll eventually submit the lint check to the tree).
* In some cases, I needed to do the cast in
https://stackoverflow.com/a/1080525/5765705 to make the compiler happy
since there isn't another way of providing a class of type
Class<MyClassWithGenerics<T>>.
* In the readSerializable() case, the new API also requires the class
loader, that was inferred to by InferredClass.class.getClassLoader().
* Note that automatic formatting and import rely on running hooked up
to the IDE, which wasn't the case here.

Bug: 195622897
Change-Id: I272432e6e082a973f7a50492ec35d79c2b577c93
Test: TH passes
2022-01-19 11:13:18 +00:00
Marcin Oczeretko
38a2814667 Merge "Fix NPE in Binder#getTransactionName" 2022-01-18 19:12:40 +00:00
Lais Andrade
a01a1f6993 Deprecate boolean settings for haptic feedback and vibrate when ringing
Deprecate HAPTIC_FEEDBACK_ENABLED in favor or HAPTIC_FEEDBACK_INTENSITY,
and VIBRATE_WHEN_RINGING in favor or RING_VIBRATION_INTENSITY.

Introduce hidden flag
VibrationAttributes.FLAG_BYPASS_USER_VIBRATION_INTENSITY_OFF
to represent HapticFeedbackConstants.FLAG_IGNORE_GLOBAL_SETTING in the
vibrator service. This is applied by:

- PhoneWindowManager, that converts HapticFeedbackConstants into
(VibrationEffect, VibrationAttributes).

- CellBroadcastAlertAudio, that triggers alerts using AudioAttributes
with flags FLAG_BYPASS_INTERRUPTION_POLICY (that translates to same flag
in VibratorManager, to bypass DnD) and FLAG_BYPASS_MUTE (that translates
to this new flag, to bypass the new alarm intensity settings).

The new flag is erased from request that are not from privileged apps,
similar to the other bypass flag. The public
HapticFeedbackConstants.FLAG_IGNORE_GLOBAL_SETTING has also been
deprecated in T with a documentation explaining the removal of platform
support.

Remove SysUI dependencies on the deprecated settings, it should use the
USAGE_TOUCH attribute and rely on the vibrator service to apply the user
settings.

Keep other SysUI dependencies that needs to run in older Android
versions (like Launcher3).

Bug: 185351540
Test: VibrationSettingsTest + manual
Change-Id: I0372e4db19e09523795d7e79b9f7a15ae48a8cd9
2022-01-18 18:57:10 +00:00
Marcin Oczeretko
28d940e33a Fix NPE in Binder#getTransactionName
Bug: 214053959
Test: manual

Change-Id: Ie77080d20f638e5e6e0a6ecb255d45bdb12f3c4d
2022-01-18 17:02:23 +00:00
Dmitri Plotnikov
538db821cd Merge "Attribution of WiFi power per process state" 2022-01-18 00:38:53 +00:00
Dmitri Plotnikov
d6cfe1ed83 Attribution of WiFi power per process state
Bug: 191921016
Bug: 182845426
Test: atest FrameworksCoreTests:BatteryStatsTests

Change-Id: I7dada3593dba59a8a0731e463bd18e67db7cd608
2022-01-14 16:00:05 -08:00