Commit Graph

7621 Commits

Author SHA1 Message Date
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
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
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
Dmitri Plotnikov
2a594c9e64 Merge "Introduce thread-local allowBlocking flag" into rvc-dev 2020-03-09 17:16:18 +00:00
Jeff Sharkey
16c9fb8c0f Merge "Updates based on API council feedback." into rvc-dev 2020-03-08 20:59:38 +00:00
Jia-yi Chen
73e2b381f0 Merge "Support PowerHAL AIDL service" into rvc-dev 2020-03-07 06:27:22 +00:00
Jeff Sharkey
f5eebf9fe6 Updates based on API council feedback.
-- Promote generally-useful PFD API to public.
-- Add @WorkerThread annotations.
-- Add docs to explain how AUTHORITY_LEGACY works, and add explicit
START/FINISH_LEGACY_MIGRATION_CALL verbs to communicate progress.
-- Expand docs for createWriteRequest() to explain broader access
that it grants.  Expand all request methods to indicate the action
is fully completed before the result is delivered.
-- Expand docs for new generation fields to explain that version
also needs to be inspected.
-- Explicitly call out why getKindSize() is deprecated, and guide
towards better alternative.

Bug: 148867182, 148403418, 148011561, 147760276
Test: none
Change-Id: I54ff072a752497b6aba153bd4013567c269e5b19
2020-03-06 14:42:00 -07:00
Dmitri Plotnikov
1258084de2 Introduce thread-local allowBlocking flag
Test: see instructions in http://ag/7911739
Fixes: 146675384

Change-Id: I478f2a8c4e4d8d563e5e78f6e103a62fe120191f
2020-03-06 10:23:02 -08:00
Jia-yi Chen
bfd8f1f74d Support PowerHAL AIDL service
Bug: 147840082
Test: Boot & check logs
Change-Id: Iccdaf84053e0974ffb43857aaa2e382d2f1b4a6b
2020-03-06 10:08:30 -08:00
Yifan Hong
47af8f93b8 Merge "UpdateEngine: fix cleanupAppliedPayload impl" into rvc-dev 2020-03-05 22:57:08 +00:00
TreeHugger Robot
03a65f1a5e Merge "BatteryStatsManager: Address API council feedback" into rvc-dev 2020-03-05 21:42:12 +00:00
Roshan Pius
cdf5744a77 BatteryStatsManager: Address API council feedback
Bug: 144925883
Test: Compiles
Change-Id: Ibdc61769965a97222fdd968084eca71b997e8feb
2020-03-05 10:34:24 -08:00
Songchun Fan
7f051b5251 remove proxy binder service IIncrementalManager
This is no longer needed because native Incremental Service directly
uses IDataLoaderManager.

BUG: 150406132
Test: atest service.incremental_test
Test: atest PackageManagerShellCommandIncrementalTest
Change-Id: Idbde2988883becbf3eb707d42c0558774a6073e8
2020-03-04 19:50:44 -08:00
Songchun Fan
ecd96c2be4 Merge "make IDataLoaderManager and IDataLoader stable interfaces" into rvc-dev 2020-03-04 22:53:12 +00:00
Yifan Hong
8b0eedf99c UpdateEngine: fix cleanupAppliedPayload impl
IUpdateEngine.cleanupSuccessfulUpdate is now asynchronous with a callback.
Update UpdateEngine.cleanupAppliedPayload accordingly to use the new impl.

Bug: 147696014
Test: apply OTA
Change-Id: I9b308316dcb8e6a507063d3060fed7693da82a19
2020-03-04 11:38:59 -08:00
Songchun Fan
6381d6193e make IDataLoaderManager and IDataLoader stable interfaces
Instead of using Bundle, explicitly specify params when initializing a data loader.

BUG: 150406132
Test: atest PackageManagerShellCommandIncrementalTest
Change-Id: I2f89d3c3ea1058fdbd689da0d5cb801bf4d9a0b4
2020-03-03 21:18:30 -08:00
Kweku Adams
ede42f99ed Add PowerWhitelistManager.isWhitelisted.
The "XXXExceptIdle" lists and methods are expected to be a superset of
the XXX methods. That's not immediately obvious from the method names.
This effort is to clean up the naming and better document actual
behavior. As part of this, we're moving the isApplicationWhitelisted
methods to PowerWhitelistManager to also help clean up the interface
between the apex and the rest of the system.

Bug: 142420609
Bug: 144864180
Bug: 145014493
Test: atest CtsBatterySavingTestCases:DeviceIdleTest
Test: atest CtsSecurityTestCases:DeviceIdleControllerTest
Test: atest FrameworksServicesTests:AppStandbyControllerTests
Change-Id: I1d248a075992e2dc279a7bfec44f38c7e51780b4
2020-03-03 17:03:04 -08:00
Songchun Fan
b8ab0034c6 dataloader/incfs openWrite returns int
Plus minor refactors

BUG: 150470163
Test: atest PackageManagerShellCommandIncrementalTest
Change-Id: Ib3a1c7c45a4abaab793be73213545ce91c98510b
Merged-In: Ib3a1c7c45a4abaab793be73213545ce91c98510b
2020-03-03 10:18:56 -08:00
Songchun Fan
38dfe9a0d4 use shell to open v4 signature file
BUG: 133435829
Test: atest PackageManagerShellCommandIncrementalTest
Change-Id: I8e57b00f042f8b6c85d5f905460dd2da6199accc
(cherry picked from commit cdbcb34c2b)
2020-03-03 09:48:02 -08:00
SongFerngWang
53515a0ea6 CellularBatteryStats: Address API council feedback
Bug: 144925883
Test: Build pass, device boots up
atest TelephonyMetricsTest

Change-Id: Iac5904a3397a42aa5f015cb53bb63318f5c377a4
Merged-In: Iac5904a3397a42aa5f015cb53bb63318f5c377a4
(cherry picked from commit 84dc30fede)
2020-03-02 05:15:08 +00:00
Paul Chang
af730a12bd Merge "Improvements to Bugreporting API." into rvc-dev 2020-02-29 00:20:04 +00:00
Ytai Ben-Tsvi
d5065ba8a5 Pass models to soundtrigger middleware with shared memory
This both avoids the need to make extra copied for the models and
allows exceeding the parcel size limits.

Bug: 150100907
Test: Manual testing of basic sound trigger functionality
Change-Id: Ic4c5c1a9de3e29b1b6fa82442254e1afe7daec19
2020-02-28 13:01:24 -08:00
Paul Chang
1a44ed3a18 Improvements to Bugreporting API.
- Show a toast to indicate screenshot is taken.

BUG:149525300
Test: Flash and press bug report shortcut and check the toast
Change-Id: Ib210c8855d2b588b51f883e32070c8b748ea4e3f
Merged-In: Ib210c8855d2b588b51f883e32070c8b748ea4e3f
2020-02-28 17:14:48 +00:00
Chris Wailes
ee398f9664 Adds Zygote policy flags to control how applications are launched
This patch adds a zygote policy parameter to functions in the
ActivityManagerService (and associated classes) to allow for different
launch behavior based on the triggering event.  This will allow for
latency sensitive applications to utilize the Unspecialized App Process
Pool, without other processes draining the pool and causing excessive
refill events.

Test: Booted and launched several apps
Bug: 147613193
Change-Id: Ib0a51c8720f95a7eafcab4ad2b5bb08f27a58d8c
(cherry picked from commit 4d05188588)
2020-02-27 20:33:12 +00:00
Makoto Onuki
9577cd78ff Merge "Squash same ApplicationInfo's in Parcel" into rvc-dev 2020-02-25 15:17:14 +00:00
Makoto Onuki
2d80ca09fc Squash same ApplicationInfo's in Parcel
ApplicationInfo now automatically tries to "squash" the same instances in a
Parcel.

NOTE: This CL still does *not* optimize the package manager APIs that return a
list. e.g. PM.queryContentProviders() still return duplicate AppInfo's.
We can optimize them by making ParcelableListSlice call "allowSquashing",
but that *could* have negative side effects, so I'm not doing it in this CL.
I think we can do that for S.

Bug: 148588589
Test: atest CtsContentTestCases # except for two preexsiting failures:
- android.content.pm.cts.PackageManagerTest#testGetIcon
- android.content.pm.cts.PackageManagerTest#testGetPreferredActivities

Test: Use the debugger and make sure bindApplication() is not receiving
duplicate AppInfo's in the provider list.

Change-Id: I3ba2c047a469169340c0f75c36bdfd394bc5d627
(cherry picked from commit 7d09275d70)
2020-02-24 22:22:13 +00:00
Yo Chiang
9834448ca1 Add DSU default userdata partition size
Use DEFAULT_USERDATA_SIZE as userdata partition size if the calling
Intent desn't specify the userdata size or the specified size is zero.

Bug: 145891687
Test: adb shell am start-activity \
  -n com.android.dynsystem/com.android.dynsystem.VerificationActivity \
  -a android.os.image.action.START_INSTALL \
  -d file:///storage/emulated/0/Download/aosp_arm64-dsu_test.zip

Merged-In: I52767dfefef394403c5e16fcfd40792b14ff9a71
Change-Id: I52767dfefef394403c5e16fcfd40792b14ff9a71
(cherry picked from commit f41e145480)
2020-02-24 17:13:20 +08:00
Sudheer Shanka
77f2a2c3dd Merge "Update BlobStoreMS to augment storage stats with blobs data." 2020-02-21 19:28:09 +00:00
Chris Ye
e078ee507e Merge "Add native Thermal Throttling API to libandroid." 2020-02-21 03:21:18 +00:00
Iavor-Valentin Iftime
4eb7c72945 Merge "Address API council suggestions for UserManager APIs" 2020-02-20 20:35:44 +00:00