Commit Graph

9305 Commits

Author SHA1 Message Date
Nate Myren
50ff5ac8b8 Merge "Revert sync app op chain changes" into sc-dev 2021-08-03 15:16:35 +00:00
Nate Myren
86c337659a Revert sync app op chain changes
These changes cause some noted app ops to be swallowed due to one-way
app ops.

Fixes: 187721493
Test: atest AppOpsLoggingTest
Change-Id: I3b761b65b2e06138fc1d130bf80587f8885bb1d5
2021-08-02 12:50:44 -07:00
Li Li
ef12967b75 Merge "Freezer: fix exception when parsing /proc/locks" into sc-dev 2021-07-30 16:35:16 +00:00
Zim
366493edd2 Fix fd leak while bypassing transcoding in media APIs
To call the media service while bypassing transcoding there are 4 file
descriptors involved:

A: The original file descriptor the app owns and is responsible for
closing
B: Dupe of A, to pass into the MediaStore API as an input to receive a
non-transoding fd
C: The output from the MediaStore API
D: Final fd owned by the media service, after C gets duped over binder
as part of setDataSource

We were leaking (B) and (C). Now we close them appropriately.

See I0124ec8fbd0471237e99bab321f903544f8fe1f8 for another 2 fd leak
fix in MediaProvider

Test: atest TranscodeTest
Test: Manual with 'adb shell lsof | grep <filename>'
Bug: 194828489
Bug: 179804072
Change-Id: I978257bbc4a8f6813b6e6a5ce22124257204f432
Merged-In: I978257bbc4a8f6813b6e6a5ce22124257204f432
2021-07-29 22:05:17 +01:00
Li Li
bbe06e7b59 Freezer: fix exception when parsing /proc/locks
The original code is based on /proc/locks manpage. Unfortunately, that
manpage is never correctly updated to include the new field for blocked
locks. The new code detects the extra field. As StringTokenizer is too
heavy, ProcFileReader is used for better performance.

Bug: 194756340
Test: FrameworksUtilTests com.android.internal.util.ProcFileReaderTest
Test: FrameworksCoreTests com.android.internal.os.ProcLocksReaderTest
Test: No /proc/locks parsing exception with blocked locks
Change-Id: I4c9763f9d3091f7d84d2e4b672d7e5cb78b33f59
2021-07-29 09:18:53 -07:00
TreeHugger Robot
95e50fed20 Merge "Revert "Add systrace tag for system property"" into sc-dev 2021-07-23 17:04:39 +00:00
Bo Liu
0b2ad9f70d Implement java PerformanceHintManager on top of native
Note some exceptions became silence errors in this conversion.

Test: None
Bug: 194204196
Change-Id: Ia3cc7f2396f2e307a23b40b3f104a2fa90352196
2021-07-22 11:33:13 -04:00
Bowgo Tsai
e169c22053 Revert "Add systrace tag for system property"
Revert "Add systrace tag for system property"

Revert "Adding system property tracing"

Revert submission 1403568-sysprop_trace

Reason for revert: makes property get/set non-reentrant
Reverted Changes:
I6f85f3f52:Add systrace tag for system property
Id2b93acb2:Adding system property tracing
Id78992d23:Add systrace tag for system property
I1ba9fc7bd:Add systrace tag for system property

Bug: 193050299
Change-Id: Iaf522b403e51abcf1d49804f35a184b4aa0d3209
Merged-In: Iaf522b403e51abcf1d49804f35a184b4aa0d3209
Test: build and boot a device
(cherry picked from commit 137d78bb67)
2021-07-22 04:41:03 +00:00
Shuzhen Wang
a00ce4e75f DropBoxManager: Fix doc build error
Test: make doc-comment-check-docs
Bug: 194230402
Change-Id: I38da2bbfbe7ed0a660274ec4d07e2b176a2a7542
2021-07-20 16:14:15 -07:00
Kalesh Singh
4b939ccd2f Merge "Add API to get GPU private memory" into sc-dev 2021-07-15 17:21:49 +00:00
Kalesh Singh
c6deb0fd9d Add API to get GPU private memory
Remove getGpuDmabufUsageKb since the kernel no longer
supports the sysfs nodes that this depends on.

Add getGpuPrivateMemoryKb which uses the memtrack hal
to report the system-wide GPU private memory.

Bug: 193226716
Bug: 193465681
Bug: 192621117
Test: dumpsys meminfo
Change-Id: Ib90505ec184339d5acbcd42c67dad3ad65dbd933
2021-07-14 21:16:18 +00:00
Jeff Sharkey
866af3b915 Consistent version documentation.
Aligns description of all VERSION_CODES based on details at:
https://en.wikipedia.org/wiki/Android_version_history

Bug: 193421818
Change-Id: I0ccb2480b5255b0e3a61a82d6be75f746166e536
2021-07-13 13:17:18 -06:00
Dmitri Plotnikov
dc3a78354e Address race condition in procstate time tracking
The issue occurs when the application proc state changes
rapidly, e.g. from FOREGROUND to BACKGROUND to CACHED.
The original code would sometimes attribute the time slice
to the wrong proc state.

Bug: 192550308
Test: (on cuttlefish) atest --rerun-until-failure 300 FrameworksCoreTests:com.android.internal.os.BstatsCpuTimesValidationTest -- --abi x86_64

Change-Id: Ic22bbfa3aae701014fc016ec9e2d32b1c528d462
2021-07-01 22:04:28 -07:00
TreeHugger Robot
64dcdac602 Merge "FileBridge: use a ByteBuffer for the temp buffer" into sc-dev 2021-06-25 21:25:40 +00:00
Tim Murray
8c37737cbc FileBridge: use a ByteBuffer for the temp buffer
Using a direct ByteBuffer allows the buffer to be passed to/from JNI
without intermediate copies.

Test: FileBridgeTests, apps get installed without allocation churn
Bug: 192020559
Change-Id: Ic5965c94ba14de6599af67d2e3bba33cd9996046
2021-06-25 11:14:53 -07:00
Lais Andrade
efc9cc93be Fix SystemVibrator constant support checks on device without vibrator
Fix the implementation of SystemVibrator to return always no support to
all effect and primitive constants on devices with no vibrator.

Fix: 191414125
Test: FrameworksCoreTests:VibratorTest
Change-Id: I0fd9e27d6e2890df9ee206029488ea70ff50712d
2021-06-24 12:33:40 +01:00
TreeHugger Robot
55a8db6450 Merge "Split long vibration composition using HAL limits" into sc-dev 2021-06-22 16:08:22 +00:00
TreeHugger Robot
8affbdac22 Merge "Create config for audio haptic channels max value" into sc-dev 2021-06-22 14:59:21 +00:00
Lais Andrade
a1167c2a06 Split long vibration composition using HAL limits
Load composition and pwle limits from the HAL and apply them on
VibrationThread to split long vibrations in multiple calls.

This ensures that long vibration will be performed by the HAL.

Bug: 188431691
Fix: 183517124
Test: VibrationThreadTest & VibrationInfoTest
Change-Id: I09a04c7b1de331320d453899f59b01e4bbb42ac3
2021-06-22 15:36:23 +01:00
Lais Andrade
a2c4eda89c Create config for audio haptic channels max value
Leave the configuration empty by default, which should be ignored by the
audio framework and impose no limit to haptic signals.

Bug: 188025353
Test: N/A
Change-Id: I7553fc00d59d6b0dd52c679320880fc86c4c4aa7
2021-06-22 12:43:35 +01:00
Dmitri Plotnikov
8b22190dfd Merge "Reduce size of BatteryUsageStats Parcel" into sc-dev 2021-06-21 19:57:08 +00:00
Adam Bookatz
b82d3b0b76 Merge "TestApi for UserSystemPackageInstaller" into sc-dev 2021-06-18 19:05:49 +00:00
Dmitri Plotnikov
b59cb7202e Reduce size of BatteryUsageStats Parcel
Bug: 191237968
Test: atest FrameworksCoreTests:BatteryUsageStatsTest

Change-Id: I89ec1b7f31935d65b170f180ff6cab4352e7ccbf
2021-06-17 17:27:00 -07:00
TreeHugger Robot
c100aeabbc Merge "Fix usage filter over UNKNOWN vibration" into sc-dev 2021-06-17 20:12:14 +00:00
Lais Andrade
ba57b002d3 Fix usage filter over UNKNOWN vibration
The usageFilter parameter added to Vibrator.cancel is always cancelling
UNKNOWN vibrations (usage = 0). The filter should only cancel them if
the value is the same usage, or if all usages are being cancelled.

Fix: 182440404
Test: VibratorManagerServiceTest
Change-Id: Ibf33fe24e5253501e751b027cbf4b68564d82929
2021-06-17 15:30:11 +01:00
Dmitri Plotnikov
c24fb81627 Add BatteryUsageStatsQuery parameters: time range
Bug: 187223764
Test: atest FrameworksCoreTests:BatteryUsageStatsProviderTest
Change-Id: If370360695a3f0327f07457abac1fd02164864e1
Merged-In: If370360695a3f0327f07457abac1fd02164864e1
(cherry picked from commit 6ea400b27c)
2021-06-17 05:24:37 +00:00
Dmitri Plotnikov
d82aa7e5c4 Convert BatteryUsageStats to and from XML
Bug: 187223764
Test: atest FrameworksCoreTests:BatteryUsageStatsTest#testXml
Change-Id: I6aec09bfb87c1003ede1b24cce8cf474675d2448
Merged-In: I6aec09bfb87c1003ede1b24cce8cf474675d2448
(cherry picked from commit 4b8a26bcaa)
2021-06-16 22:21:05 -07:00
Dmitri Plotnikov
36e0ae27a9 Add BatteryUsageStats.add(BatteryUsageStats)
Bug: 187223764
Test: atest FrameworksCoreTests:com.android.internal.os.BatteryUsageStatsTest
Change-Id: I1e5060d726fd0f4634fd658483e80a9ab02e24fb
Merged-In: I1e5060d726fd0f4634fd658483e80a9ab02e24fb
(cherry picked from commit 63d9aecdbb)
2021-06-16 22:18:09 -07:00
Kevin Chyn
c3e64b14c5 Merge "Add BiometricActionDisabledByAdminController" into sc-dev 2021-06-17 01:27:03 +00:00
Kevin Chyn
4e84b8849a Add BiometricActionDisabledByAdminController
1) Adds UserManager#DISALLOW_BIOMETRIC. We actually need to
   pass a restriction from settings to ActionDisabledByAdmin area,
   otherwise the biometric-specific dialog would be shown outside of
   biometric flows.
2) Adds an interface to ActionDisabledByAdminController to return a
   optional OnClickListener for the positive dialog button
3) Returns an instance of the biometric controller when conditions
   are met
4) Adds string interfaces to DeviceAdminStringProvider to retrieve
   biometric-specific strings

Bug: 188847063
Bug: 191306258
Test: manual

Change-Id: Iaeffdeb1336d5db56d464104cdc7677b9021f609
2021-06-16 16:41:14 -07:00
Soonil Nagarkar
a244ceeb2e Merge "Fix bugs in LocationManagerService and AppOpsPolicy" into sc-dev 2021-06-16 15:37:32 +00:00
TreeHugger Robot
0a9650dcde Merge "Add BatteryUsageStatsProtoTests to presubmit" into sc-dev 2021-06-15 18:02:16 +00:00
Soonil Nagarkar
4aa42bdb17 Fix bugs in LocationManagerService and AppOpsPolicy
LocationManagerService was overwriting location source appops tag
information whenever a location provider changed state. Since multiple
location providers can correspond to the same uid/app id, this could
lead to loss of tags. This is fixed by recalculating the set of tag for
an entire app id any time a uid changes.

AppOpsPolicy had a bug where tag lists coming from different uids under
the same appid would inappropriately overwrite each other. This is fixed
by modifying the internal/external APIs to work in terms of appid rather
than uid, so that it is someone else's responsibility to ensure the
result is valid for the app id as a whole.

Also fixes a bug where LMS assumes tag listeners are added prior to any
providers. If listeners are added after some providers they will miss
updates. Fixed by always updating the listener on registration.

Bug: 190073375
Test: manual
Change-Id: Ib52d752d857b6ac3b6683186a8d1bbcb814fb798
2021-06-15 08:45:44 -07:00
Dmitri Plotnikov
b2baae41c2 Add BatteryUsageStatsProtoTests to presubmit
Bug: 189221904
Test: atest --test-mapping frameworks/base/core/java/android/os
Test: atest --test-mapping frameworks/base/core/java/com/android/internal/os
Change-Id: Id279e899a19c81726cabb5e134a199bb3c367475
2021-06-14 18:56:55 -07:00
Dmitri Plotnikov
969e4064ac Limit the number of UidBatteryConsumers included in the BatteryUsageStats atom
Bug: 189225426
Test: atest BatteryUsageStatsProtoTests:BatteryUsageStatsPulledTest
Change-Id: Ic9866962330f0b51727e5202560d97ffac0b8980
Merged-In: Ic9866962330f0b51727e5202560d97ffac0b8980
2021-06-14 11:53:48 -07:00
Pavel Grafov
c0115519f6 Merge "Don't reset user VPN without reason" into sc-dev 2021-06-10 15:31:04 +00:00
Pavel Grafov
d406212ac2 Don't reset user VPN without reason
When DPM.setAlwaysOnVpn is called with package=null, it resets
any VPN configured by the user. With this change it won't happen
anymore: it will only reset VPN configuration if it was previously
configured by the admin.

If an admin actually wants to remove any user configured VPN, they
can enforce DISALLOW_CONFIG_VPN restriction which will remove any
user VPNs and will prevent the user from configuring a new one.

+ Also make sure that when the DPC removes an always-on VPN
configuration, the package loses ability to start VPN until the
user authorizes it again.

Bug: 139823667
Test: atest com.android.server.devicepolicy.DevicePolicyManagerTest
Change-Id: Ia703015b4e8d7eaf156358d7eb000d6f58d32238
2021-06-09 14:22:01 +01:00
Alex Buynytskyy
4bafd4ddd8 Proper retrying DL installation sessions.
Plus more robust handling of broken DLs.

Bug: 190012477
Test: atest PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest IncrementalServiceTest com.google.android.packageinstallerv2proxy.host.gts.IncrementalInstallerHostTest
Change-Id: I5cb037d49cd2b140bed1045c99f072112495acfc
2021-06-08 17:41:47 -07:00
Adam Bookatz
55fdb3106a TestApi for UserSystemPackageInstaller
Introduces a TestApi that lists which system packages
will be pre-installed for the given user type, for
use with CTS tests that need to predict which packages
are installed on a new user.

Test: atest com.android.cts.devicepolicy.DeviceOwnerTest#testCreateAndManageUser_LeaveAllSystemApps
Bug: 189873486
Change-Id: I471c5da55f8cf500a07de5773050a997ea391892
2021-06-07 14:33:35 -07:00
Songchun Fan
e8b6bcf6cc [metrics] log TotalDelayedReadsDurationMillis during ANR and Crash
BUG: 187354818
Test: atest android.cts.statsdatom.incremental.AppErrorAtomTests
Change-Id: I54de2d558248a65775452474464ea3f786bf5c55
2021-06-07 12:12:58 -07:00
Jeff Sharkey
e6fb6087aa Merge changes from topic "may27-sdk" into sc-dev
* changes:
  Finalize resource IDs; script to help in future.
  platform/frameworks/base/ - S is now 31
2021-06-02 20:11:14 +00:00
Lais Andrade
c0c482736b Remove non-zero amplitude validation for waveforms
The validation does not exist in Android R and is causing apps to start
crashing in S.

The validation for the static API createOneShot was maintained, as it
already existed in previous releases.

Fix: 184890231
Test: VibrationEffectTest
Change-Id: I606c943a35ddd68ccacab76f0047b9a276b5cf28
2021-06-02 12:26:35 +01:00
TreeHugger Robot
1b3424aa94 Merge "Clarify what ignoring battery optimizations means." into sc-dev 2021-06-01 14:39:55 +00:00
Jeff Sharkey
7c5f4337fd platform/frameworks/base/ - S is now 31
Bug: 171506470
Test: Build
Change-Id: I46d4df5f27783a96a58c966b113391ea3bc112cb
2021-06-01 06:48:51 -06:00
TreeHugger Robot
787c2a6d2a Merge "Fix storage directory API docs" into sc-dev 2021-05-27 20:34:54 +00:00
Kweku Adams
b4582d98c5 Clarify what ignoring battery optimizations means.
Add some more definition to what it means to be on the power allowlist.

Bug: 173547576
Test: N/A
Change-Id: I6c6bd3248dc39877e560656e787ef02adf7d279f
2021-05-27 09:22:05 -07:00
Nandana Dutt
3863979df8 Fix storage directory API docs
Android 10 did not support file path operations for apps in
scoped storage. But Android 11 and above do support file path
operations for such apps.

Fix docs for getExternalStorageDirectory() and
getExternalStoragePublicDirectory() to reflect the current level of support.

BUG: 153562415
Test: m docs

Change-Id: I8bc2a4aa266dbbcc391b415e6209ed6e5d56fe97
2021-05-27 15:57:02 +00:00
Jeff Sharkey
14016d39a6 Merge "Revert "Add user privacy sensitivity APIs."" into sc-dev 2021-05-27 11:59:21 +00:00
TreeHugger Robot
03b86cd11f Merge "Add documentation to VibratorManager on foreground/background behavior" into sc-dev 2021-05-26 17:28:52 +00:00
Adam Bookatz
fdf919fbd5 Merge "BatteryUsageStats - use bus end time" into sc-dev 2021-05-26 17:19:47 +00:00