Commit Graph

8760 Commits

Author SHA1 Message Date
Corina Grigoras
1744f3021f Merge "Add all storage team to owners." am: d17c69bccb am: 552bdafa3a am: 2baff21819
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1558549

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I5f2185e68fde92fa65708765faa1e5be4be9b73f
2021-01-22 17:53:46 +00:00
Corina Grigoras
2baff21819 Merge "Add all storage team to owners." am: d17c69bccb am: 552bdafa3a
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1558549

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I7f9bdaf72fc875a0949d897558f0e1dd07a853d0
2021-01-22 17:39:39 +00:00
Corina Grigoras
d17c69bccb Merge "Add all storage team to owners." 2021-01-22 16:57:22 +00:00
Felipe Leme
7dc7910d9a Merge "Added evenWhenDisallowed param to removeUserOrSetEphemeral()." 2021-01-22 16:31:03 +00:00
Corina
6915543849 Add all storage team to owners.
Bug: no
Test: no
Change-Id: Ib4fba7af30cec8efd5fb9115fec9bd354e07a2fc
2021-01-22 14:10:07 +00:00
Paul Hu
6d5681b753 Merge "Expose Build.VERSION.FIRST_SDK_INT as module-lib API" am: 64625e9706 am: 7126f9404b am: f369634aae
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1540865

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ie9adc3def53e7708c715af665718669ff8e4c954
2021-01-22 13:10:21 +00:00
Paul Hu
f369634aae Merge "Expose Build.VERSION.FIRST_SDK_INT as module-lib API" am: 64625e9706 am: 7126f9404b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1540865

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ia8cb0ca497e0cbaea24d9e7c376f8f3f0ded69a2
2021-01-22 12:39:19 +00:00
paulhu
69f79b0aca Expose Build.VERSION.FIRST_SDK_INT as module-lib API
Connectivity service is going to become a mainline module which
will not be able to access hidden APIs. But PermissionMonitor
needs know Build.VERSION.FIRST_SDK_INT for granting network
restricted permission to system packages. Thus, expose the value
as module-lib API to support the usage.

Bug: 170598012
Test: make update-api
Change-Id: Id0ae42120f69faee43eeb7ebd35cae9e26cb7561
2021-01-22 15:30:07 +08:00
Felipe Leme
6ad393d896 Added evenWhenDisallowed param to removeUserOrSetEphemeral().
UserManager.removeUserOrSetEphemeral() was added primarily to
be used by CarDevicePolicyManager, in which case it should ignore
the no_remove_user restriction. But as it's also used in other
places, it needs a new parameter to define this behavior.

Test: atest FrameworksServicesTests:com.android.server.pm.UserManagerTest#testRemoveUserOrSetEphemeral_evenWhenRestricted
Test: atest FrameworksServicesTests:com.android.server.pm.UserManagerTest # to make sure it didn't break anything
Test: atest android.car.apitest.CarDevicePolicyManagerTest#testRemoveUser_whenDisallowed # on automotive

Bug: 170887769

Change-Id: If797ace64c0fa0262116f649212bbcb1d61e2046
2021-01-22 04:43:22 +00:00
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
Marco Ballesio
64459e591b ActivityManager: don't freeze processes holding file locks am: 80a05232a0
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13376527

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I393a094a76fe2ffff831a1f34f0c5b39725cd137
2021-01-21 03:07:26 +00: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
Marco Ballesio
80a05232a0 ActivityManager: don't freeze processes holding file locks
As a temporary measure waiting for the more robust b/176927978 to be
implemented, query the file lock status of processes prior freezing
them, and skip freeze if any locks are held.

Test: verified form the logs that processes holding file locks are not
frozen
Bug: 176928302

Change-Id: Ib7e1715effb63c1b304ce22a9451294fd9f7b10d
Merged-In: Ib7e1715effb63c1b304ce22a9451294fd9f7b10d
2021-01-20 22:33: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
37f4ebb9e1 Merge "Make BugreportManager a public API that respects carrier privileges." am: 0dcf4de7df am: 6d6c5ec5cd
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1552883

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ib26fe91f828ca6d39f19f7893f2f3c76da6e9738
2021-01-19 01:34:32 +00:00
Treehugger Robot
0dcf4de7df Merge "Make BugreportManager a public API that respects carrier privileges." 2021-01-19 00:21:25 +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
30e7b64d9c 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
Merged-In: I5a38e7a040fa23146fa6c1e785db102b066ad167
(cherry picked from commit 57fd3440be)
2021-01-15 17:35:45 -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