This CL changes the behavior of PM#goToSleep to instead turn off the
power for the default display group. PM#wakeUp turns on the default
display group.
If all display groups are turned off, the device will go to sleep. If
any display group is on, the device will remain interactive.
This results in no behavior change if there is a single display group.
However if there are multiple display groups then it will be possible to
interact with ones that are on while others are off.
Bug: 138328918
Bug: 170935083
Bug: 175919649
Test: atest PowerManagerServiceTest
Change-Id: I8b475c38886eda3e43d6e8da7e68102a25da1584
Exported components that are not guarded by a signature permission
can receive Intents from any other app on a device. If an app unparcels
and launches an Intent from the Intent delivered to this unprotected
component then a malicious actor can potentially craft an Intent that
could launch hidden components, grant URI permissions, etc. This
commit adds a StrictMode check to report if a component launches an
Intent unparceled from the delivered Intent.
Bug: 160796858
Test: atest StrictModeTest
Change-Id: I763b8a965f91f5b433ce2f4b619e10ef12f5c296
The existing implementation of performHapticFeedback in
PhoneWindowManager uses both hasVibrator and vibrate methods from
Vibrator class. The implementation of VibratorService.hasVibrator is
already constant, returning true if the device has a built in vibrator.
This adds a cache for this value to SystemVibrator, to avoid binder
calls to system_server after the first one.
Bug: 170127981
Test: manual
Change-Id: I68934a41068f4388449321d08a42d8bf890ea91e
This thread takes in a CombinedVibrationEffect and plays all vibrations.
The Prebaked effect now also holds a fallback VibrationEffect, which is
resolved and scaled together with the original effect and is passed on
to the VibrateThread. All class attributes are not final, making this
effect immutable as all the others.
The Vibration now takes in a CombinedVibrationEffect, in preparation to
be used by the VibratorManagerService in multiple vibrators.
The new thread is replacing all vibration from VibratorService, which
means they are all triggering the HAL asynchronously.
Bug: 167946816
Bug: 131311651
Test: VibrationThreadTest, VibratorServiceTest, VibrationEffectTest, VibrationScalerTest
Change-Id: Ic27b35e63ca35ad47083f94da9ca7bd75b683d43
Since I72f39d3e35b975f0a386c055cbb10b4d21c21c86, the MediaProvider
now always opens FUSE paths when transcoding is required. Those paths
start with /mnt/user/ but apps can't access those paths directly so we
make the following changes:
1. Call readlink(2) directly (without stat as
ParcelFileDescriptor#getFile currently does).
2. Replace /mnt/user/<userid> with /storage paths and use the new
/storage path for scanning
This also fixes some failing CTS
Test: Apps don't ANR when calling MediaMetadataRetriever#setDataSource
Test: atest android.appsecurity.cts.ExternalStorageHostTest#testMediaNone29
Bug: 174655855
Fixes: 177860000
Change-Id: Iec48dcb714a47b147e16eae39df783de748960f4
The visibility setting of a removable device shared with Chrome OS is
passed via Disk flags. When a device (stub volume) is marked as visible,
we should set the MOUNT_FLAG_VISIBLE flag to it.
Bug: 123377807
Bug: 142684891
Bug: 132796154
Test: Toggle the visibility setting of a removable device in the Chrome
Test: OS Settings app > Confirm that the device is visible to Android
Test: apps only when it is marked as visible.
Test: Tested in R
Change-Id: I19289596345690b1802738122fe274eeb41f9361
This CL relaxed the UI context checks to only apply on UI related
APIs in WallpaperManager.
Test: build & run
Bug: 176958992
Change-Id: I390e865e31fde48bad6bbddb4203e4c997a1400a
In preparation for a broader set of apps using BugreportManager, we
enforce that only the app which started a bugreport is allowed to cancel
it.
Bug: 161393541
Test: atest BugreportManagerTestCases
Test: manual with two apps triggering/cancelling BRs
Change-Id: I430d856014a226ef345bd2349f0601062dcaa8c7
Merged-In: I430d856014a226ef345bd2349f0601062dcaa8c7
(cherry picked from commit 4a1b9e949d)
For Incremental installs, the installation progress will be equal to the
loading progress, which is the percentage of filled blocks divided by
the total number of blocks. The installation progress reported from the
client will be ignored. This is for a smoother visual transition between
installed state and loading state, as reflected in the launcher UI.
See timestamp 00:26 in video:
https://drive.google.com/file/d/11Z4IwUvaoMx0QZVboq7idxu4PUZZcGw-/view?usp=sharing&resourcekey=0-EQDzWobRTJxTQCCGUfbXQA
It reflects the <25% of loading progress instead of the 100% installation
progress, though not very visible.
BUG: 172082017
Test: manual
Change-Id: I30bac011fc4fe431960570640e6ced55b01c0234
This permission model is only allowed for BUGREPORT_MODE_TELEPHONY to
let carrier apps (even from the Play Store / not pre-loaded) access
BugreportManager to trigger connectivity bugreports.
This also requires SELinux policy changes to allow non-system apps to
get an instance through Context#getSystemService, and then dumpstate
also needs permissions to write public apps' files.
Minor documentation and formatting fixes as well.
BYPASS_INCLUSIVE_LANGUAGE_REASON=leaving variable name derived from
"bugreport-whitelisted" sysconfig alone for now
Bug: 161393541
Test: atest CtsCarrierApiTestCases:BugreportManagerTest
Change-Id: I5a38e7a040fa23146fa6c1e785db102b066ad167
This command will be used in tests so tests won't mount data and obb
dirs anymore so won't be killed by system when volume is unmounted.
Bug: 148049767
Test: Enable storage app visibility flag, then run "sm unmount-app-data-dirs PKG PID USER_ID", data and obb are not mounted in /proc/$PID anymore.
Change-Id: Ie5ddf55471f59c61e1906664b87a9bf889702536
Makes two new SystemApis:
getRestrictedProfileParent()
canHaveRestrictedProfile()
Temporarily disables VPN Tests that rely on the old APIs until those
tests are updated (b/175883995).
Bug: 171529940
Test: atest FrameworksNetTests:com.android.server.connectivity.VpnTest
Test: Tests for UserManager SystemApis are TODO awaiting completion of new user test infrastructure (b/163890431)
(cherry picked from commit 20ba13f5bc)
Change-Id: I28e39400039631e7d391dc7b0d003e8a38d1f06a
In preparation for a broader set of apps using BugreportManager, we
enforce that only the app which started a bugreport is allowed to cancel
it.
Bug: 161393541
Test: atest BugreportManagerTestCases
Test: manual with two apps triggering/cancelling BRs
Change-Id: I430d856014a226ef345bd2349f0601062dcaa8c7
Makes two new SystemApis:
getRestrictedProfileParent()
canHaveRestrictedProfile()
Temporarily disables VPN Tests that rely on the old APIs until those
tests are updated (b/175883995).
Bug: 171529940
Test: atest FrameworksNetTests:com.android.server.connectivity.VpnTest
Test: Tests for UserManager SystemApis are TODO awaiting completion of new user test infrastructure (b/163890431)
Change-Id: I28e39400039631e7d391dc7b0d003e8a38d1f06a
Add wakeup reason to HOME intent as extra.
Test: Put device to sleep (remote power button). Press remote POWER or HOME button.
adb logcat | grep startReason
=> startDockOrHome startReason= WAKE_REASON_POWER_BUTTON or startDockOrHome startReason= WAKE_REASON_WAKE_KEY
Bug: 168223486
Change-Id: Ic7f98b802faeacebb9416fcb20ca183a553c105d
This change adds support for a simple pathSuffix attribute in an app's
intent filter that can be applied to the path or ssp to match the end of
either. This enables filters that match based on file extensions as a
common use case.
This change additionally finally exposes the pathAdvancedPattern
attribute to enable more complex matching logic. This feature was added
back in API 26, but never exposed as a supported attribute in app
manifests, essentially making it useless to the average developer.
Test: atest IntentFilterTest
Bug: 139934742
Bug: 35193418
Change-Id: Ib58d5fb5419e621497e402b16a3a31c0c73f77cd
The existing DropBoxManager APIs require that data be entirely
pre-cooked before it can be added. This adds significant overhead
to Log.wtf() style messages which collect logcat data, since we
need to copy that log data through a pipe to an in-memory buffer.
To avoid that overhead, this change introduces an EntrySource
interface which can either be pre-cooked data or dynamically
generated data written directly to an open FD on disk. Future
changes will adjust the Log.wtf() logic to use this new interface
to have logcat write directly into an FD.
In addition, this interface paves the way for leveraging a newer
F2FS feature which transparently compresses and decompresses data in
the kernel, instead of forcing us to use DEFLATE in userspace.
This change drops periodic quota checking while recording new
entries, and instead adjusts to pre-flight the quota checks before
writing starts. It also drops the expensive fsync(), since these
logs are collected on a best-effort basis.
Bug: 176843501
Test: atest CtsDropBoxManagerTestCases
Test: atest FrameworksServicesTests:com.android.server.DropBoxTest
Change-Id: Ic78e99a32cfaf4edac066a73a6864c9c9e9fdeef