Commit Graph

8928 Commits

Author SHA1 Message Date
Adam Bookatz
47fe2c6ade Merge "TEST_MAPPING for BatteryStats" into sc-dev 2021-02-26 17:11:40 +00:00
Kholoud Mohamed
afb12625a9 Exposed some testAPIs in UserManager
The following changes in UserManager are required for ongoing
improvements to CTS/GTS infrastructure.
- Exposed the following as testAPIs:
	* isGuestUserEphemeral
	* createUser
	* preCreateUser
	* createProfileForUser
	* createRestrictedProfile
	* getUsers
	* getUserType
- Added permissions to the following APIs:
	* CREATE_USERS for getUserName
	* INTERACT_ACROSS_USERS for getProfileParent
- Added CREATE_USERS permission to the documentation of
getUsers and the APIs that call it.

Test: Confirmed that a CTS test can call these APIs
Bug: 178695365
Change-Id: Id9105db3bfefb926139715b728acedefd2a5ca3e
2021-02-26 10:08:18 +00:00
Dmitri Plotnikov
02073550c0 Merge "Add UID time-in-state to UidBatteryConsumer" into sc-dev 2021-02-26 04:51:40 +00:00
Dmitri Plotnikov
f441fbf774 Add UID time-in-state to UidBatteryConsumer
Bug: 158137862
Test: atest FrameworksCoreTests:com.android.internal.os.BatteryUsageStatsProviderTest
Test: atest FrameworksCoreTests:com.android.internal.os.BatteryUsageStatsTest
Change-Id: I8fde2f754deaa0d2c4ebb06b9a2c99d60086bc23
2021-02-25 15:47:20 -08:00
Adam Bookatz
b62859528e TEST_MAPPING for BatteryStats
Creates presubmit test mapping for BatteryStats-related
files.

These tests can be run manually via
atest FrameworksServicesTests:com.android.server.am.BatteryExternalStatsWorkerTest FrameworksServicesTests:com.android.server.am.MeasuredEnergySnapshotTest FrameworksServicesTests:com.android.server.am.BatteryStatsServiceTest FrameworksCoreTests:com.android.internal.os.BatteryStatsTests

Tests that currently fail are marked to be skipped;
they should be addressed by b/180015146.
This is accomplished by introducing a new annotation, @SkipPresubmit.

Test: treehugger presubmit
Bug: 180016384
Change-Id: If01beaa342468aeded660e5766a14391d3ee9bcc
2021-02-25 14:51:01 -08:00
TreeHugger Robot
2863f6a40d Merge "Convert WifiPowerCalculator to work with BatteryUsageStats" into sc-dev 2021-02-25 20:15:38 +00:00
Charles Chen
f225921153 Merge "Unhide isUiContext()" into sc-dev 2021-02-25 04:05:49 +00:00
Alex Buynytskyy
414d9ecc26 API feedback: getVersion instead of isV2.
Bug: 181015045
Fixes: 181015045
Test: atest PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest IncrementalServiceTest PackageManagerServiceTest ChecksumsTest
Change-Id: I623f73b834759d9a1c599d7c7f3ff585fa75c4aa
2021-02-25 02:06:08 +00:00
Treehugger Robot
feed10cb15 Merge "BugreportManager API review updates." am: e0db8b998f am: c8e42d59e7 am: 94a089b673
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1584520

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: If29af220ff4d636b5870a16b14ead953e562aa70
2021-02-24 00:20:46 +00:00
Tianjie Xu
fd08d9eac5 Merge "Throw an exception in RoR api on no-pin case" am: 7444774737 am: 4d208ac97e am: c26952bf52
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1584516

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I65d8cb00ee0c08763a53714f8825bc4d8a75557e
2021-02-24 00:19:46 +00:00
Treehugger Robot
94a089b673 Merge "BugreportManager API review updates." am: e0db8b998f am: c8e42d59e7
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1584520

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ibba20423d6d2d3a5394d871f5f4f2d33d0afdceb
2021-02-24 00:14:10 +00:00
Tianjie Xu
c26952bf52 Merge "Throw an exception in RoR api on no-pin case" am: 7444774737 am: 4d208ac97e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1584516

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ic6399b2d5de8fdca4973c8cf4a435c22ba0e68d8
2021-02-23 23:58:41 +00:00
Treehugger Robot
c8e42d59e7 Merge "BugreportManager API review updates." am: e0db8b998f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1584520

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I41e43baa35a660165075df1bc602cf197656df82
2021-02-23 23:58:26 +00:00
Tianjie Xu
4d208ac97e Merge "Throw an exception in RoR api on no-pin case" am: 7444774737
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1584516

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ic466002e50e6125c27f52eb2e989505720fc30c0
2021-02-23 23:52:30 +00:00
TreeHugger Robot
1d55488df5 Merge "Fix Vibrator and VibratorManager public API docs" into sc-dev 2021-02-23 19:00:43 +00:00
Lais Andrade
89d7a876fa Fix Vibrator and VibratorManager public API docs
Add information about value returned by Vibrator.getId, including a
description of what the default -1 value represents.

Fix description of CombinedVibrationEffect arguments to
VibratorManager methods.

Fix: 180962151
Fix: 180963421
Test: N/A
Change-Id: I3fab2d5fe299be5a951f32bd75eb2e5275ef6e56
2021-02-23 17:23:18 +00:00
Songchun Fan
a67a1a9841 [pm] smooth transition from install progress to incremental loading progress
Previously, regardless of the downloading progress reported by the client,
right before installation completion, we publish the install progress
as 0.9. For incremental installs, because we will publish the
incremnetal loading progress after the installation completion, we
might see the progress going backward, because the incremental loading
progress is likely less than 0.9.

For a smoother transition, we do not overwrite the client progress.
Instead, during committing, publish the incremental loading progress
while making sure the progress doesn't go backwards. After committing,
the launcher will keep showing the incremental loading progress.

+ Making sure the installer's incremental progress listener is
unregistered after session is committed.

See the demo video for an example. Notice that the progress is changed
during "Installing..." (around 00:35).

BUG: 180040329
Test: manual
Change-Id: I6c30b0dac6758fd103ed6a985ca39b6f8557ba8f
2021-02-22 22:25:51 +00:00
Treehugger Robot
e0db8b998f Merge "BugreportManager API review updates." 2021-02-22 21:46:41 +00:00
Tianjie Xu
7444774737 Merge "Throw an exception in RoR api on no-pin case" 2021-02-22 20:42:35 +00:00
Dmitri Plotnikov
80c0c66edc Convert WifiPowerCalculator to work with BatteryUsageStats
Also, combine WifePowerCalculator and WifiPowerEstimator: they
have a lot more in common than different.

Bug: 158137862
Test: atest WifiPowerCalculatorTest

Change-Id: Ib937102043a1fe04941ecfd09b5077b14058e6ef
2021-02-22 11:35:14 -08:00
TreeHugger Robot
28a92fd4f8 Merge "Adds caller check to getAllPackages()" into sc-dev 2021-02-22 18:23:55 +00:00
Kweku Adams
0c89d4b843 Merge "Remove unnecessary permission check." into sc-dev 2021-02-22 16:55:01 +00:00
Kholoud Mohamed
bfe45b77f8 Merge "Expose isUserKeyUnlocked as a TestAPI" into sc-dev 2021-02-22 15:46:21 +00:00
Charles Chen
aa6de2e6e8 Unhide isUiContext()
... because it is more tied to Context instance that developers
are working with.

Bug: 179308116
Test: atest ContextIsUiContextTest
Change-Id: I41d90c4b5b81b430fc8007a0bdf86c6fd1c54400
2021-02-22 08:38:52 +00:00
Lais Andrade
2356453306 Constrain scaled amplitude to valid values in [1,255]
Scaling down low amplitudes can lead to one-shot effects with amplitude
zero, which leads to an invalid VibrationEffect and causes
IllegalArgumentException to be thrown on an originally valid effect.

Bug: 179674498
Test: VibrationEffectTest
Change-Id: Ie653084d37f9bfed20aac25f8805ffdf40661e03
2021-02-22 01:08:18 +00:00
TreeHugger Robot
863e3fee2b Merge "Measured energy for Ambient Display in BatteryUsageStats" into sc-dev 2021-02-21 19:08:28 +00:00
Xin Li
be473bf819 Merge ab/7061308 into stage.
Bug: 180401296
Merged-In: I4bf82035631ccff6d5a6144d6d9b1d203b076851
Change-Id: I1b5f3a672a55eaabba0f5389bab110b395553559
2021-02-21 09:39:53 -08:00
Dmitri Plotnikov
66a11604f5 Copy custom measured power to BatteryUsageStats
Bug: 158137862
Test: atest FrameworksCoreTests:com.android.internal.os.CustomMeasuredPowerCalculatorTest
Change-Id: I53a974baf773f35eb212f234755c553be45336ce
2021-02-20 13:38:48 -08:00
TreeHugger Robot
9fb89c22ca Merge "Add discharge power estimates to BatteryUsageStats" into sc-dev 2021-02-20 20:34:33 +00:00
Chiachang Wang
6aca8c36e0 Merge changes I0a75c440,Ief9e8925,Ie03e8276,If0ac9a64,I716bd771 am: 63bc7bd3c2 am: 7fcc3efb9c am: 2540861d4f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1573943

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I52c41154ae3364774e63376fbdd5a9f42727b65f
2021-02-20 05:04:03 +00:00
Chiachang Wang
2540861d4f Merge changes I0a75c440,Ief9e8925,Ie03e8276,If0ac9a64,I716bd771 am: 63bc7bd3c2 am: 7fcc3efb9c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1573943

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I1e81aa264d988cc50f2d42f8b9592f050a01b69f
2021-02-20 04:22:17 +00:00
Chiachang Wang
63bc7bd3c2 Merge changes I0a75c440,Ief9e8925,Ie03e8276,If0ac9a64,I716bd771
* changes:
  [IT06]Move INetworkActivityListener into connectivity module
  [IT05] Remove the unused network activity logic out from NMS
  [IT4.7] Add network activity info into dumpsys for debugging
  [IT4.6] Unbundle NMS out from ConnectivityManager
  [IT4.5] Update radio power from CS directly
2021-02-20 02:02:46 +00:00
Robert Horvath
d34a5f6aab Merge "Document behaviour of "quiescent" reboot reason" into sc-dev 2021-02-19 16:14:14 +00:00
Dmitri Plotnikov
fc0ba64301 Add discharge power estimates to BatteryUsageStats
Bug: 158137862
Test: atest DischargedPowerCalculatorTest
Change-Id: I68e8ad491d92dca08bb7c49fadf663dd48ee2b90
2021-02-18 16:47:42 -08:00
Tianjie
9dbd5e7457 Throw an exception in RoR api on no-pin case
If the device doesn't have a pin, the current RoR preparation will
go through; but the lskf capture event won't happen. In order not
to confuse the caller, throw an exception instead in the no-pin
case.

Bug: 170664917
Test: remove pin, request RoR with adb shell
Change-Id: Ib04c629234b71e3f6cb36bdfe47759a715a69146
2021-02-18 15:26:33 -08:00
Dmitri Plotnikov
8c2e375c1f Measured energy for Ambient Display in BatteryUsageStats
Bug: 178140704
Test: atest FrameworksCoreTests:com.android.internal.os.AmbientDisplayPowerCalculatorTest

Change-Id: I1a573c3e380777637b7c0466aa78a4cab4c05887
2021-02-18 14:25:50 -08:00
Primiano Tucci
bf4a20e4c9 Merge "Do not check for debuggable / profilable for app tracing." am: 355753053c am: c8def00f9f am: 8bc9d1cd8e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1587412

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Iaa74e243082c0b66148d53e8123c34ee25010242
2021-02-18 20:54:38 +00:00
Primiano Tucci
8bc9d1cd8e Merge "Do not check for debuggable / profilable for app tracing." am: 355753053c am: c8def00f9f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1587412

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I11c3344dc0a6e735040822aa52f93d13961dd1e9
2021-02-18 20:12:19 +00:00
Hunter Knepshield
8c4887a7ce BugreportManager API review updates.
- Expand BugreportManager class javadoc
    - Explain what "privileged" means
    - Highlight only one-BR-at-a-time behavior
- Add more detail to BugreportCallback javadocs
    - Explain standard callback invocation flow
    - More detail on when BUGREPORT_ERROR_INVALID_INPUT is used
- Add @WorkerThread to {start{,Connectivity},cancel}Bugreport

Bug: 180015324
Test: make
Change-Id: Id3400b1cdd271f47bdeaf8cdc1a0dea61aafc933
2021-02-18 19:31:44 +00:00
Kweku Adams
e57d5ac376 Remove unnecessary permission check.
There's no reason for getPowerSaveModeTrigger to require the POWER_SAVER
permission. The API is only marked as a SystemApi because it was designed
for a specific use case and 3rd party apps don't need to know the
information, but there's no problem if they get the value. All the value
tells you is whether the device will turn on battery saver automatically
based on the percentage level or if it'll turn on automatically based on
a different dynamic signal.

Bug: 174241855
Test: atest android.os.cts.PowerManagerTest
Test: atest android.permission.cts.PowerManagerServicePermissionTest
Test: atest CtsPermission2TestCases
Test: atest SettingsProviderTest
Change-Id: I3146a681d9c5da9c68a7e6b38b50314b293dc924
2021-02-18 10:53:12 -08:00
Songchun Fan
1f535786c7 Merge "Revert "Revert "[pm/incremental] start monitoring progress on storage creation""" into sc-dev 2021-02-18 18:33:50 +00:00
yawanng
1ea4f56c3d Adds caller check to getAllPackages()
This change enforces that only system, root or shell may call
getAllPackages(), a hidden API that shares all package names regardless
of user, instant app or package visibility rules.

The only exception is the uid of iorapd. iorapd needs the package info
to prefetch the right data.

Bug: 179618216
Bug: 174661955
Test: run iorapd and check it works well.
Change-Id: I77460ae19a4d41151577646441f11e2eddbb741a
Merged-In: I77460ae19a4d41151577646441f11e2eddbb741a
(cherry picked from commit 8124efd57b)
2021-02-18 18:15:21 +00:00
Primiano Tucci
355753053c Merge "Do not check for debuggable / profilable for app tracing." 2021-02-18 17:52:31 +00:00
TreeHugger Robot
c1d7c4d6ab Merge "Remove unused method" into sc-dev 2021-02-18 04:25:02 +00:00
Chiachang Wang
6080999ebe [IT06]Move INetworkActivityListener into connectivity module
INetworkActivityListener is hidden and the only usage is inside
the connectivity module. Thus, move this into module scope.

Bug: 170598012
Test: atest FrameworksNetTests
Change-Id: I0a75c440c1daa773217bbd362b212fda4d07ec64
2021-02-18 12:03:21 +08:00
lucaslin
be5d09359c [IT05] Remove the unused network activity logic out from NMS
The network activity logic is moved to ConnectivityService.
CS is no longer setting the idle timer via NMS to netd. The
idle timer should only set from CS, so remove the network
activity logic out from NMS.

Bug: 170598012
Test: atest FrameworksNetTests
Change-Id: Ief9e892586aaee8e9542b9313088fa50d1d411e5
2021-02-18 12:02:02 +08:00
Jiashen Wang
61487dface Merge "Add the immutable flag to EuiccManager calls in RecoverySystem" am: 822856bcaf am: 24162e1679
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1562338

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ia24b0b2e7a1155670aa7b0e0fbe4c805f2f77eae
2021-02-18 02:18:23 +00:00
Jiashen Wang
6851cf0c51 Add the immutable flag to EuiccManager calls in RecoverySystem
Bug: 170432460
Test: refactoring CL. Existing unit tests still pass
Change-Id: Ibce939eec341cb9f572d13a33762cc5bc6e2ef42
Merged-In: Ibce939eec341cb9f572d13a33762cc5bc6e2ef42
2021-02-17 22:04:23 +00:00
TreeHugger Robot
0d831306f8 Merge "New API: UserManager.isUserForeground()." into sc-dev 2021-02-17 20:27:56 +00:00
Songchun Fan
3296a301a0 Revert "Revert "[pm/incremental] start monitoring progress on storage creation""
This reverts commit 5f47bc6ba1.

Reason for revert: We still need part of this CL that starts monitoring progress on storage creation. This helps detect the kernel selinux issue where the security context of a file was assigned wrongly.

BUG: 180514262
Test: builds
Change-Id: I33fca8f9be27f3f2dfab089feaf3c241ae7d5d49
2021-02-17 18:45:20 +00:00