Commit Graph

7648 Commits

Author SHA1 Message Date
Michael Wright
f51b6aa53a Merge "Make vibrator effect queries an @IntDef." into rvc-dev 2020-03-27 13:29:18 +00:00
Michael Wright
6d2c6f0255 Merge "Address API Council feedback." into rvc-dev 2020-03-27 12:22:39 +00:00
Michael Wright
8d761db1e4 Make vibrator effect queries an @IntDef.
Rather than tri-state enums, which aren't as clear and easy to
mis-interpret, switch the return values to an explicit tri-state
@IntDef.

Bug: 150958120
Test: atest VibratorTest
Change-Id: I3a5daa4078a21008664ea14d45a5c5284c1224ed
2020-03-26 21:39:17 +00:00
Michael Wright
f7eb2d82a7 Address API Council feedback.
- Make VibrationEffect.Composition final
- Hide the VibrationEffect.Composition default constructor
- Fix doc and nullability annotation bugs on
  VibrationEffect.Composition#addPrimiritive
- Make Vibrator#areAllEffectsSupported and
  Vibrator#areAllPrimitivesSupported

Fixes: 150958120
Test: build
Change-Id: I0d9a782fd4130639ad99179d7770dcde1a2afba5
2020-03-26 19:29:54 +00:00
Kenny Root
625bcd2eeb Resume-on-Reboot: change SystemApi calls slightly
In response to feedback, remove boolean returns and rely on exceptions
to provide detail descriptions.

Test: make # using a test app that calls the API using old signature
Test: atest FrameworksServicesTests:RecoverySystemServiceTest
Bug: 150205125
Change-Id: I95930078df9c88194f21b38ff7d96b425db47d56
2020-03-26 12:23:11 -07:00
TreeHugger Robot
e5d60ed552 Merge "Do not mount whitelisted package in storage data and obb dirs" into rvc-dev 2020-03-26 11:01:12 +00:00
TreeHugger Robot
d60a2bd945 Merge "Make OP_LEGACY_STORAGE stickiness configurable" into rvc-dev 2020-03-25 21:16:01 +00:00
Ricky Wai
2cd955e79d Do not mount whitelisted package in storage data and obb dirs
We now pass 2 booleans from AM to zygote about:
- If CE and DE data dirs need to be mounted
- If storage data and obb dirs need to be mounted

And also, separate whitelisted package from same uid packages, as same
uid packages do not need to be mounted in storage data and obb dir case,
it's needed to be mounted for CE and DE data dirs only. Otherwise
whtelisted packages will also be mounted in storage data and obb dirs,
which apps should not have access to it.

Bug: 151218156
Test: atest AdoptableHostTest
Change-Id: If7c20a7ed3b845d8657c937469161cb7ed3da07f
2020-03-25 16:40:46 +00:00
shafik
76735f666a Make OP_LEGACY_STORAGE stickiness configurable
OP_LEGACY_STORAGE is sticky for apps targeting <= Q.
This change makes this behaviour configurable via DeviceConfig, by
introducing a new property "legacy_storage_op_sticky" to existing
namespace "storage_native_boot". If the property is set to true, then
we get the default behaviour (app-op sticky for SDK<=Q). If it's set to
true, then the app-op is not sticky for SDK<=Q.

Apps targeting > Q remain unaffected: always not sticky.

Test: manual:
    * adb shell dumpsys appops --package com.android.vending
    * Observe LEGACY_STORAGE mode=allowed
    * adb shell device_config put storage_native_boot legacy_storage_op_sticky false
    * adb reboot
    * adb shell dumpsys appops --package com.android.vending
    * Observe LEGACY_STORAGE mode=ignored
Bug: 151735608
Change-Id: I06d115a0c85c44b5a6d1054f74a00d8fa674dfa7
2020-03-25 15:49:10 +00:00
Martijn Coenen
1152370510 Merge "Add (hidden) fixupAppDir() API." into rvc-dev 2020-03-25 12:56:47 +00:00
TreeHugger Robot
c6f4f74723 Merge "V4 uses V2 digest if V3 is not available." into rvc-dev 2020-03-25 01:36:01 +00:00
Alex Buynytskyy
6b7efbc4b9 V4 uses V2 digest if V3 is not available.
Test: atest PackageManagerShellCommandIncrementalTest
Bug: b/151240006
Change-Id: I242b599e434880ce218537574e879e9436e5d3da
2020-03-24 14:34:52 -07:00
TreeHugger Robot
da8101d270 Merge "Deprecate POWER_SAVE_MODE_CHANGING broadcast." into rvc-dev 2020-03-24 20:56:25 +00:00
TreeHugger Robot
393c9121ce Merge "Hide CellularBatteryStats#getTxTimeMillis." into rvc-dev 2020-03-24 00:09:05 +00:00
Amit Mahajan
9bfde0e1fd Hide CellularBatteryStats#getTxTimeMillis.
Will be re-exposed as SystemApi in S.

Test: TH
Bug: 152247297
Change-Id: Ifb87676fa5afd2720dd09f36f3ff67c1b215b676
2020-03-23 15:15:17 -07:00
Dan Stoza
571a08feec Merge "Add <p> tags for PowerManager#getThermalHeadroom" into rvc-dev 2020-03-23 20:04:41 +00:00
Kweku Adams
62cef43ac2 Deprecate POWER_SAVE_MODE_CHANGING broadcast.
The internal POWER_SAVE_MODE_CHANGING broadcast is sent at the same
time as the POWER_SAVE_MODE_CHANGED broadcast. Since broadcasts are
asynchronous,there's no reason to have both, especially since it can
potentially lead to inconsistency, so we should simplify down to just
one. Mark the POWER_SAVE_MODE_CHANGING broadcast as deprecated in R and
unavailable to apps targeting R. We'll remove it in a future version.

Bug: 79580230
Test: Android builds
Test: atest BatterySaverReceiverTest
Change-Id: I70e20ce53b496a3dc88a1083c230334f53032d81
2020-03-23 11:51:46 -07:00
Dan Stoza
2ee536290e Add <p> tags for PowerManager#getThermalHeadroom
Adds <p> tags to the Javadoc for PowerManager#getThermalHeadroom

Bug: 150855511
Test: m docs
Change-Id: Icf7b4eef8539ace14f466745e5bc6b6b79cc23c5
2020-03-23 10:40:30 -07:00
Martijn Coenen
0f522bfebf Add (hidden) fixupAppDir() API.
On devices without sdcardfs, filesystem permissions aren't magically
fixed up. This is problematic mostly in application-private directories,
which are owned by the application itself; if another process with
elevated permissions creates a file in these directories, the UID will
be wrong, and the owning package won't be able to access the files.

Allow processes that modify application-private directories (eg
DownloadManager) to ask the framework to fix up permissions on their
behalf.

Bug: 151986170
Test: WIP
Change-Id: Ic30f708d25d7702ec3a4569ee6ddf100732d89d1
2020-03-23 16:27:24 +01:00
Sudheer Shanka
add060f917 Merge "Add BlobStoreManager.getRemainingLeaseQuotaBytes." into rvc-dev 2020-03-22 07:21:17 +00:00
Peter Wang
23cf98eaa8 [Telephony Mainline] Hide TelephonyServiceManager and TelephonyFrameworkInitializer
Bug: 151455139
Fix: 151455139
Test: Build
Change-Id: I067c821239585d3d4e8dcf39798b1d0014ba077b
2020-03-20 17:34:49 -07:00
TreeHugger Robot
afb5aa530b Merge "Fixed doc" into rvc-dev 2020-03-21 00:28:15 +00:00
Jack Yu
ad00ab2959 Fixed doc
Fixed the doc per API council feedback.

Test: Build
Bug: 148218347
Change-Id: If7e180787267ba422fd1833b641c17d6f1051e88
2020-03-20 15:13:37 -07:00
Sudheer Shanka
a80a997a3b Add BlobStoreManager.getRemainingLeaseQuotaBytes.
+ Add LimitExceededException which can be used to indicate
that an app is doing something that will cause it to violate
any limits enforced by the System.

Bug: 150239703
Test: atest --test-mapping apex/blobstore
Change-Id: I7584d1b8618be546080b0eddb2fe35de2611f9e7
2020-03-20 12:06:53 -07:00
TreeHugger Robot
60e19c7656 Merge "Skip unnecessary IPC when getting VibrationEffect." into rvc-dev 2020-03-20 18:07:26 +00:00
Michael Wright
324650d5fc Skip unnecessary IPC when getting VibrationEffect.
If we know there's no configured ringtone-specific effects, we can skip
uncanonicalizing the URI, which normally incurs an IPC.

Bug: 151696203
Test: atest android.os.VibrationEffectTest
Change-Id: I0e3c8f5cd50761a90875d326cc57dcfd4597dd97
2020-03-19 19:20:47 +00:00
Shuo Qian
cf5dc204f6 Merge "API Council Feedbacks" into rvc-dev 2020-03-18 17:15:36 +00:00
Ricky Wai
3909ffc964 Merge "Do not mount storage obb&data dirs in fuse daemon process" into rvc-dev 2020-03-18 15:36:13 +00:00
Shuo Qian
43c2f470ed API Council Feedbacks
1) Add Annotation for getCarrirPrivilegeStatus
2) Remove NullProinterException throwing in isDataConnectionAllowed
3) Add SdkConstant for ACTION_UPDATE_EMRGENCY_NUMBER_DB

Test: Treehugger
Bug: 148218347
Bug: 151455822
Change-Id: I4943491abf70641f9379862a67941295a4cf67f9
2020-03-18 02:12:30 +00:00
Marco Ballesio
e12741e825 Merge "freezer: thaw on dumpsys data collection" into rvc-dev 2020-03-17 16:07:27 +00:00
Abhijeet Kaur
14c5d83597 Move Scoped Storage compat flags definition to frameworks/base
Currently the flags definition is in MediaProvider, which is an
apex module (updatable), and the flags values are now used in
frameworks/base as well (non-updatable).

Good to have flags definition in the constant component.

Bug: 150593967
Test: atest ExternalStorageHostTest
Test: atest com.android.providers.media
Test: manual
Merged-In: I0b06c068cb3957a7db8af5e14598724f72122736
Change-Id: I0b06c068cb3957a7db8af5e14598724f72122736
(cherry picked from commit 4a989379e8)
2020-03-17 12:54:17 +00:00
Marco Ballesio
71750b2229 freezer: thaw on dumpsys data collection
Introduce a new java API wrapping libprocessgroup to thaw and freeze again
the freezer. Use such API in ActivityManager upon collection of sensitive
dumpsys fields.

Bug: 151225245
Test: manually verified that the freezer is thawed and then frozen again
for meminfo, dbinfo and gfxinfo. Verified that data collection does not
timeout when this API is called

Change-Id: I487f328cb05ceac2fa2f23ad94ca8d4f82b82a5a
2020-03-16 18:29:21 -07:00
TreeHugger Robot
6bd4a7edb8 Merge "Remove haptic primitives that aren't ready yet." into rvc-dev 2020-03-16 19:16:48 +00:00
Ricky Wai
e25c92d13a Do not mount storage obb&data dirs in fuse daemon process
Otherwise, fuse daemon will be killed during storage dir remount.
Also, fix wrong uid in prepareObbDirs() for multi-user case.

Bug: 151452792
Bug: 151436460
Test: atest AdoptableHostTest
Change-Id: Ib0d4cba36bc1bc91f31583c6a97d37203ac8b88d
2020-03-16 18:35:08 +00:00
TreeHugger Robot
6838c0ef56 Merge "Use compat flags to reflect the current status of legacy storage." into rvc-dev 2020-03-16 17:47:33 +00:00
Michael Wright
8fc2be555d Remove haptic primitives that aren't ready yet.
We have some concerns about a couple of the primitives we're exposing,
so rather than risk committing to an API surface that we may regret and
aren't 100% confident in the implementation of, lets hide it and keep
them for private usage for now.

Also, rename LIGHT_TICK to TICK; we shouldn't expose the internal
differences to users since it just makes the whole surface more
complicated to explain.

Fixes: 151085071
Fixes: 151261619
Test: N/A
Change-Id: I2872e8f52202d6192de6aa7e3081778486174f4e
2020-03-16 17:06:10 +00:00
Ricky Wai
bac0268f63 Merge "Pass bind mount storage data decision from java to zygote" into rvc-dev 2020-03-16 15:39:52 +00:00
Paul Chang
eaca5898d0 Merge "Pass value to indicate screenshot is requested or not in Bugreporting API" into rvc-dev 2020-03-14 18:04:46 +00:00
Alex Buynytskyy
f5e605a00c Updated v4 signature processing.
Passing to libincfs.so.
Obtaining and verifying, including v3 digest check.

go/apk-v4-signature-format

Test: atest PackageManagerShellCommandTest
Bug: b/151241461
Change-Id: Id61f5716b9f9b55d6ab1ebca5a7ecb1c6e54570a
2020-03-13 15:13:25 -07:00
Abhijeet Kaur
3a6027c012 Use compat flags to reflect the current status of legacy storage.
Scoped Storage status of an app can be changed by using compat flags,
as apps can chose to opt-in/opt out of Scoped Storage using these flags.
See ag/10406320 for more details.

Update documentation of isExternalStorageLegacy() method.

Remove checks around INSTALL_PACKAGES and OP_REQUEST_INSTALL_PACKAGES as
that does not allow legacy external storage.

Remove check for WRITE_MEDIA_STORAGE as its value is now
reflected by OP_LEGACY_STORAGE (ag/10162772)

Bug: 132649864
Test: atest ExternalStorageHostTest
Test: atest com.android.providers.media
Test: manually using StorageTest app
Merged-In: Id53da8f8783455038bad101e6ac50ba66b595012
Change-Id: Id53da8f8783455038bad101e6ac50ba66b595012
(cherry picked from commit f8af82046a)
2020-03-13 10:10:36 +00:00
Louis Chang
8fa645a2db Merge "Add warning message when entering loop twice" into rvc-dev 2020-03-13 09:35:20 +00:00
Louis Chang
59e85c25a6 Add warning message when entering loop twice
The messages in queue could be executed before current
message completed.

Bug: 140599188
Test: calling Looper.loop() twice
Change-Id: I1a4628606ed974e7a6a76b2832044959a9261bb9
2020-03-13 14:51:29 +08:00
Philip P. Moltmann
767ef39c1a Add docs for users, permissions, appops.
Test: Only docs changes
Change-Id: I2115b32c41a500d3a9847a5ea3c1d8b82dd5112c
Fixes: 151379035
2020-03-13 00:52:22 +00:00
Ricky Wai
486d760e6b Pass bind mount storage data decision from java to zygote
Before we used store dirty data in system property to record
if FUSE for a user is mounted, and zygote uses it to determine
if storage mount is needed. It introduces performance issues and
not reliable.

This CL does the following changes:

- System server determines if storage dirs mount are needed, and store
the record inside system server.

- It passes the verdict to zygote so zygote just need to follow the
input.

- When emulated storage is mounted / unmounted, it will record if
FUSE for that user is ready to use, and will be used for determining
if storage dirs mount are needed when a new process starts.

- After emulated storage is mounted, it will create an async thread
to remount all storage dirs for existing app processes. As we have a
record of pids that storage dirs are not mounted yet, we can use it
directly without scanning the whole /proc in vold.

Bug: 149548518
Test: After flag is enabled, AdoptableHostTest still pass.
Change-Id: Ic99d027d42b2b9a1c7fd03070b36c44882c6e7c5
2020-03-12 19:36:26 +00:00
Shuo Qian
e3efafddda API Council Feedbacks
1) Update doc of ACTION_UPDATE_EMERGENCY_NUMBER_DB
2) Add new APIs EXTRA_VERSION and EXTRA_REQUIRED_HASH
3) Rename isDataConnectionEnabled to IsDataConnectionAllowed
4) Format the API documentations with html format
5) Throw errors for shutdownAllRadios, isAnyRadioPoweredOn
6) Modify the doc of TelephonyManager.getEmergencyNumberDbVersion
7) Add UPDATE_CONFIG permission for ACTION_UPDATE_EMERGENCY_NUMBER_DB

Test: Treehugger; Manual made a call; make -j offline-sdk-docs
Bug: 147696692
Bug: 147805285
Bug: 148217670
Bug: 148218347
Change-Id: Idf3dee3de5ebf75ca8b8fbaaf879e69f7ae4b754
Merged-In: Idf3dee3de5ebf75ca8b8fbaaf879e69f7ae4b754
(cherry picked from commit dc86120fca)
2020-03-12 03:49:15 +00:00
Paul Chang
925c8dec27 Pass value to indicate screenshot is requested or not in Bugreporting API
BUG: 149525300
Test: Build pass
Change-Id: Ic307879bd80fe125cade37d8a53aaf718aebea2c
2020-03-11 10:38:10 +00:00
Philip P. Moltmann
b73aa1e008 Merge "Rename AppOpsCollector -> OnOpNotedCallback" into rvc-dev 2020-03-10 21:03:21 +00:00
Philip P. Moltmann
5892a8f7b0 Rename AppOpsCollector -> OnOpNotedCallback
and annotate time values used by this area of code correctly.

Fixes: 150699068
Test: Only renames
Change-Id: Ibd5b08900d6855603e7ce59048587d391a5c5410
2020-03-10 11:50:00 -07:00
Zimuzo Ezeozue
f46b9c9656 Merge "Add API for apps to query whether they have All Files Access" into rvc-dev 2020-03-10 17:03:16 +00:00
shafik
8187065889 Add API for apps to query whether they have All Files Access
This is a fix in response to developers' feedback on DP1.
Add Environment API that enables apps to check whether they have All
Files Access special app access. The API encapsulates the actual
mechanics of the check, which are as follows:
    * First check MANAGE_EXTERNAL_STORAGE app-op,
      if it's allowed, return true. If it's denied (ignored or errored),
      return false.
    * If the mode is default, then check for MANAGE_EXTERNAL_STORAGE
      permission, if it's GRANTED (not just declared), then return true,
      else return false.

Also add test.

Test: atest EnvironmentTest # not CTS
Fix: 150115615
Merged-In: I0574827c22960bf8f074313d983f289be7142149
Change-Id: I0574827c22960bf8f074313d983f289be7142149
2020-03-10 11:47:56 +00:00