Commit Graph

8746 Commits

Author SHA1 Message Date
Dmitri Plotnikov
dfce528997 Convert MobileRadioPowerCalculator to work with BatteryUsageStats
Test: atest FrameworksCoreTests:com.android.internal.os.MobileRadioPowerCalculatorTest
Bug: 175644968
Change-Id: Iea088a14adde4255767ca76d8ec4c40b404cb33c
2021-01-21 13:19:21 -08:00
Sean Stout
99170bffd3 Merge "PM#goToSleep and PM#wakeUp only affects default display group" 2021-01-21 21:04:58 +00:00
Josh Tsuji
fd577558f6 Merge "Adds the power button unlock animation and plumbs detailed wake/sleep reason to System UI." 2021-01-21 18:55:52 +00:00
Sean Stout
e2f209d260 PM#goToSleep and PM#wakeUp only affects default display group
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
2021-01-21 10:17:02 -08:00
Josh Tsuji
cb27bd1a83 Adds the power button unlock animation and plumbs detailed wake/sleep reason to System UI.
Test: unlock the phone using either the power button or lifting it
Bug: 169693662
Change-Id: I567555e6ee04f369ce7f4b32744639be70583112
2021-01-20 20:08:37 -05:00
Michael Groover
af1fafe936 Merge "Add StrictMode check for unsafe intent launching" 2021-01-21 01:06:20 +00:00
Jeff Sharkey
6728d4f92c Add StrictMode check for unsafe intent launching
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
2021-01-20 13:05:09 -08:00
TreeHugger Robot
dbc2f45b54 Merge "Cache result from VibratorService.hasVibrator in SystemVibrator" 2021-01-20 14:11:15 +00:00
Lais Andrade
e69b5f4177 Cache result from VibratorService.hasVibrator in SystemVibrator
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
2021-01-20 11:35:13 +00:00
TreeHugger Robot
eecc5b5020 Merge "[pm/incremental] start monitoring progress on storage creation" 2021-01-19 19:21:36 +00:00
Lais Andrade
fc0659bb76 Merge "Create single thread to play any Vibration" 2021-01-19 14:25:17 +00:00
Iavor-Valentin Iftime
1b4a41b7c7 Merge "Start HOME intent when waking up TV device" 2021-01-19 12:33:35 +00:00
Lais Andrade
d6fae9a1e8 Create single thread to play any Vibration
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
2021-01-19 11:48:34 +00:00
Zimuzo Ezeozue
c042f1bfcb Merge "Fix convertToModernFd to support /mnt/user paths" 2021-01-19 09:15:35 +00:00
Zim
94a7b819fe Fix convertToModernFd to support /mnt/user paths
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
2021-01-19 08:48:09 +00:00
Treehugger Robot
67187f7575 Merge "New sm command to unmount app data and obb app visibility mount" am: 3299d00b87 am: 40c7e3d17d am: 05af40c490
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1552534

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ie35b99efa56faaf4339a7c344743092a5b5d540b
2021-01-18 18:04:13 +00:00
Treehugger Robot
05af40c490 Merge "New sm command to unmount app data and obb app visibility mount" am: 3299d00b87 am: 40c7e3d17d
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1552534

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Id5a591310ed72bf625e04ff16c08825b6fa94af6
2021-01-18 17:05:40 +00:00
Treehugger Robot
4fa18d6995 Merge "Add MOUNT_FLAG_VISIBLE to visible stub volumes" am: d8e3e07264 am: eba787f7a5 am: 8187197857
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1536320

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I31f8f93fa974f9ee7aa785fd89c45ec5c43dc0bb
2021-01-18 16:47:06 +00:00
Treehugger Robot
8187197857 Merge "Add MOUNT_FLAG_VISIBLE to visible stub volumes" am: d8e3e07264 am: eba787f7a5
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1536320

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I21d5560f0d061cae9c8959cb658a75fd14e7ed76
2021-01-18 16:25:48 +00:00
Treehugger Robot
3299d00b87 Merge "New sm command to unmount app data and obb app visibility mount" 2021-01-18 16:20:41 +00:00
Treehugger Robot
d8e3e07264 Merge "Add MOUNT_FLAG_VISIBLE to visible stub volumes" 2021-01-18 14:54:27 +00:00
Youkichi Hosoi
d2905dd086 Add MOUNT_FLAG_VISIBLE to visible stub volumes
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
2021-01-18 12:09:52 +00:00
Treehugger Robot
444e91786a Merge "Pass caller information in cancelBugreport." am: 21d36ec4f5 am: 61b2a3c228
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1552882

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I53469e3b7f38270b95bdb2f926470216676f87b7
2021-01-18 11:25:17 +00:00
TreeHugger Robot
77e33e1a9e Merge "Limit UI context verification to UI related APIs" 2021-01-18 07:21:14 +00:00
Charles Chen
9ca5f902ca Limit UI context verification to UI related APIs
This CL relaxed the UI context checks to only apply on UI related
APIs in WallpaperManager.

Test: build & run
Bug: 176958992

Change-Id: I390e865e31fde48bad6bbddb4203e4c997a1400a
2021-01-18 12:37:06 +08:00
Hunter Knepshield
fffec02113 Pass caller information in cancelBugreport.
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)
2021-01-15 17:29:03 -08:00
Hunter Knepshield
59e4240e93 Merge "Make BugreportManager a public API that respects carrier privileges." 2021-01-16 00:35:27 +00:00
Songchun Fan
31fa0fc9c1 [pm/incremental] start monitoring progress on storage creation
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
2021-01-15 22:46:52 +00:00
Hunter Knepshield
57fd3440be Make BugreportManager a public API that respects carrier privileges.
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
2021-01-15 10:58:14 -08:00
Ricky Wai
e81ebc69c3 New sm command to unmount app data and obb app visibility mount
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
2021-01-15 14:06:29 +00:00
Patrick Baumann
6a6b8d43bb Merge "Add support for pathSuffix" 2021-01-14 16:28:15 +00:00
TreeHugger Robot
0eb9c29224 Merge "Pass caller information in cancelBugreport." 2021-01-14 14:28:11 +00:00
Lorenzo Colitti
869987f60a Merge changes I28e39400,Ibada8b42 am: c5f2057d02 am: 98802d08bf
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1548870

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I8a086ef5602d1823ca582894f8fddd138ce6080c
2021-01-14 11:34:15 +00:00
Lorenzo Colitti
c5f2057d02 Merge changes I28e39400,Ibada8b42
* changes:
  UserManager restricted profile SystemApis
  Improve testing of CONNECTIVITY_ACTION broadcasts.
2021-01-14 10:39:48 +00:00
Adam Bookatz
81762facae UserManager restricted profile SystemApis
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
2021-01-14 17:39:13 +09:00
Hunter Knepshield
4a1b9e949d Pass caller information in cancelBugreport.
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
2021-01-13 16:57:58 -08:00
Adam Bookatz
2dd6b2b344 Merge "UserManager restricted profile SystemApis" 2021-01-13 22:47:26 +00:00
Adam Bookatz
20ba13f5bc UserManager restricted profile SystemApis
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
2021-01-13 11:53:33 -08:00
Valentin Iftime
06689aad01 Start HOME intent when waking up TV device
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
2021-01-13 16:30:12 +01:00
Yo Chiang
d09c22c4e8 Merge "Fix DynamicSystemClient.start() exceptions" am: f2bf58fb9b am: 318dd035a6 am: 3755738a7d
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1541268

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I2afbce697848641fe7fda09f63601829107bac58
2021-01-13 04:01:31 +00:00
Yo Chiang
3755738a7d Merge "Fix DynamicSystemClient.start() exceptions" am: f2bf58fb9b am: 318dd035a6
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1541268

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I29f91caa3f49d5961f736cee9a809c687e00d47b
2021-01-13 03:58:27 +00:00
Yo Chiang
f2bf58fb9b Merge "Fix DynamicSystemClient.start() exceptions" 2021-01-13 02:35:28 +00:00
Jeff Sharkey
e069ac2c91 Merge "Interface to dynamically generate DropBox data." 2021-01-13 01:28:33 +00:00
Patrick Baumann
8cbf2e5a8f Add support for pathSuffix
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
2021-01-12 16:15:52 -08:00
Marco Ballesio
9b2cce77ed Merge "ActivityManager: don't freeze processes holding file locks" 2021-01-12 23:34:20 +00:00
Adam Bookatz
185089663b Merge "Add User* OWNERS file (part 2)" am: da79da08f0 am: b9b73d26db am: 9ac98ffa59
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1543926

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I3fc005c69350f13002ceea055c7b97b8486eb484
2021-01-12 21:04:55 +00:00
Adam Bookatz
9ac98ffa59 Merge "Add User* OWNERS file (part 2)" am: da79da08f0 am: b9b73d26db
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1543926

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I87bc14c52e4aa4ed42f73496e104f0f3182c613b
2021-01-12 20:55:13 +00:00
Jeff Sharkey
8eebdbe4b5 Interface to dynamically generate DropBox data.
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
2021-01-12 13:51:28 -07:00
Alex Buynytskyy
daea39f8a2 Merge "Per package read timeouts." 2021-01-12 16:53:11 +00:00
Zimuzo Ezeozue
e2cdacf427 Merge "Fix StorageVolume Parcel parsing" 2021-01-12 09:31:16 +00:00