These changes cause some noted app ops to be swallowed due to one-way
app ops.
Fixes: 187721493
Test: atest AppOpsLoggingTest
Change-Id: I3b761b65b2e06138fc1d130bf80587f8885bb1d5
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
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
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)
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
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
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
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
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.
Undeprecate getExternalStorageDirectory() and
getExternalStoragePublicDirectory() to reflect the current level of
support.
BUG: 153562415
Test: m
Change-Id: Ibd93ca07a0c08b11a82b70dca8c2cd7d49600354
(cherry picked from commit 74bf4e682d)
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
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
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
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
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
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