Commit Graph

7524 Commits

Author SHA1 Message Date
TreeHugger Robot
f9723ba1e7 Merge changes from topic "accessibility-usage-dialog"
* changes:
  Make the accessibility op string a SystemApi.
  Add a new intent for reviewing running accessibility services.
2019-02-14 21:04:32 +00:00
TreeHugger Robot
b225c56f06 Merge "Use role for default home." 2019-02-14 19:59:59 +00:00
TreeHugger Robot
2934daf1ba Merge "Add an intent to launch the permission toggle screen." 2019-02-14 18:40:02 +00:00
Tiger Huang
3d11ee4837 Merge "Fix rotation if the shape of display is close to square" 2019-02-14 09:55:31 +00:00
Tiger Huang
3d2b89840f Fix rotation if the shape of display is close to square
For a close-to-square device, the user won't get reasonable benefits
when the content on display is rotated. Worse, the rotation forces the
user to turn their device into an unnatural orientation.

In this CL, if the non-decor aspect ratio of a display is less than
config_closeToSquareDisplayMaxAspectRatio, and the device is configured
to force default orientation, we will ignore all the orientation
requests on the display, and keep the orientation as the user rotation.

For the activity which has a minAspectRatio, the logic will take account
into its preferred orientation while computing its bounds. So the shape
of bounds given to the app can meet its expectation.

Bug: 123507947
Test: atest AspectRatioTests DisplayRotationTests
Test: Manual test with wm size command and simulated display cutout

Change-Id: If99a89d59c805cfc0d305a66067643ce35b3f2bd
2019-02-14 14:14:04 +08:00
TreeHugger Robot
6c3b856efd Merge "Hiding annotation @DistractionRestriction" 2019-02-13 23:13:43 +00:00
Ivan Chiang
5922ce2433 Make getCache and putCache in ContentResolver @SystemApi
The two methods are not usable by public Apps.
Make them are @SystemApi

Change-Id: Id8ba06facd6909d225a241343f3f72daaeafc423
Fix: 123661724
Test: make
2019-02-13 11:42:42 +08:00
Suprabh Shukla
8b924438d7 Hiding annotation @DistractionRestriction
Test: Builds, boots, existing tests pass
make -j update-api
make -j docs
make -j
atest GtsSuspendAppsTestCases

Fixes: 124302271
Change-Id: Ifa7a46636ddc1196c48154fe51cc76a483d59f29
2019-02-12 19:10:37 -08:00
Hai Zhang
8be463fe95 Use role for default home.
This change makes package manager update the home role holder when
preferred activity for the home intent changes, in order to be
backward-compatible.

Bug: 124260975
Test: manual
Change-Id: I2f29e86f0db88d7e1edee74d0e911d33fef889c9
2019-02-12 14:33:28 -08:00
Mehdi Alizadeh
7009b3e1b2 Merge "Persist the Persons field in ShortcutInfo" 2019-02-12 20:12:09 +00:00
TreeHugger Robot
2ab332d584 Merge "Make SessionParams.setStaged SystemApi." 2019-02-12 18:15:16 +00:00
TreeHugger Robot
adf522b211 Merge "Compatible behavior for non-resizable activity (1/N)" 2019-02-12 12:24:48 +00:00
Dario Freni
77786d9ec7 Make SessionParams.setStaged SystemApi.
Bug: 123977800
Test: N/A
Change-Id: If5afd9d559261959b07a4618e7807c82f7643e11
2019-02-12 09:51:14 +00:00
Mehdi Alizadeh
ebb4b60740 Persist the Persons field in ShortcutInfo
Test: atest com.android.server.pm.ShortcutManagerTest1
Test: atest com.android.server.pm.ShortcutManagerTest2
Test: atest com.android.server.pm.ShortcutManagerTest3
Test: atest com.android.server.pm.ShortcutManagerTest4
Test: atest com.android.server.pm.ShortcutManagerTest5
Test: atest com.android.server.pm.ShortcutManagerTest6
Test: atest com.android.server.pm.ShortcutManagerTest7
Test: atest com.android.server.pm.ShortcutManagerTest8
Test: atest com.android.server.pm.ShortcutManagerTest9
Test: atest com.android.server.pm.ShortcutManagerTest10
Test: atest CtsShortcutHostTestCases
Test: atest CtsShortcutManagerTestCases

Bug: 122664307
Change-Id: Icbf999b89efe668f161bbab8d484f7887056f9c8
2019-02-11 17:00:48 -08:00
Joel Galenson
035dfd90e4 Add an intent to launch the permission toggle screen.
Fixes: 124123015
Test: Launched the intent.
Change-Id: Iba5312ea6be595d293358cd183c077d4405eb9d3
2019-02-11 08:12:55 -08:00
Ruslan Tkhakokhov
7567485875 Add manifest flag to clear user data at restore
Currently there are 2 functionalities guarded by the same flag
(FLAG_ALLOW_CLEAR_USER_DATA):

1. Allowing users to clear the app's data from settings
2. Allowing the system to clear the app's data if a restore operation
fails.

The purpose of this CL is to introduce a new flag
(FLAG_ALLOW_CLEAR_USER_DATA_ON_FAILED_RESTORE) for (2)

Bug: 120267643
Test: N/A
Change-Id: I4ee315e311049c55ed26e7cf121f7e0c59eabd55
2019-02-11 15:26:28 +00:00
TreeHugger Robot
44b8309ea2 Merge "Surface <overlayable> info in Java AssetManager" 2019-02-11 03:55:13 +00:00
Riddle Hsu
0a343c34db Compatible behavior for non-resizable activity (1/N)
Introduce a fixed screen mode for non-resizable activity. If the
activity has fixed of orientation or aspect ratio, it can keep the
original configuration when the size of container is changed.

The original bounds and screen related attributes are set to the
override configuration. So when the activity meet:
 - Move to another display
 - Display size changed
The activity won't be relaunch or receive unexpected config changes.

The next CL will utilize this information to scale and offset the
windows of the non-resizable activity into the corresponding place
according to different use cases.

Bug: 112288258
Test: atest ActivityRecordTests
Change-Id: I5050f180e5d6c6c05514f0dc79102c0668c75c23
2019-02-10 17:39:12 +08:00
TreeHugger Robot
631587faed Merge "Allow update from pre-release to release targetSDK" 2019-02-09 02:17:48 +00:00
Mårten Kongstad
c92c4dd6c6 Surface <overlayable> info in Java AssetManager
Add a new, hidden method to AssetManager to extract a mapping
overlayable name -> overlayable actor for all <overlayable> blocks in a
package. [This will eventually be used to check if the caller of the OMS
AIDL API is the registered actor for a given overlay.]

Also, teach AssetManager2 to not accept packages that re-use the same
overlayable name. [Such packages have always been ill-formed.]

Bug: 123894537
Test: make libandroidfw_tests
Change-Id: I1117fd3503f04fe4c73eb7114901e022508f4d9e
2019-02-07 14:32:16 -08:00
Aurimas Liutikas
86ef44bcc7 Merge "Add helper methods for View attribute debugging" 2019-02-07 19:05:20 +00:00
Chad Brubaker
1189c0f9e8 Merge "Remove usage info" 2019-02-07 18:08:04 +00:00
Nicholas Lativy
eb23e4d944 Allow update from pre-release to release targetSDK
Renders the '--force-sdk' flag a noop.

Bug: 122886665
Change-Id: I7b93d336179c4f00dca90fedb4acd6a9b4326e15
Test: Manually on a Q device by updating to a release targetSdkVersion app
2019-02-07 16:10:21 +00:00
Joel Galenson
9562824743 Add a new intent for reviewing running accessibility services.
Bug: 123595964
Test: Compile
Change-Id: I5854ec61292242e53b01280462cd8b3ca3e89c19
2019-02-07 07:26:13 -08:00
Aurimas Liutikas
8f004c85a0 Add helper methods for View attribute debugging
Adding abilities to debug:
- Attribute resolution stack (which resources are looked
  at when resolving an attribute)
- Attribute value source (where did each attribute value
  get defined)
- Get explicit style id (if a view had it set via style="...")

This feature will be behind Settings.Global flag that Android
Studio will set to the debugged application package ID.

Bug: 111439551
Test: atest CtsViewTestCases:android.view.cts.ViewStyleTest
Change-Id: Ib6f9fc81000bb867b5b94a68953c99b0bc802d6c
2019-02-06 14:46:17 -08:00
Nikita Ioffe
c9e0cf90c4 Merge "RMS: Delete user data snapshots when deleting a rollback" 2019-02-06 18:08:38 +00:00
Dianne Hackborn
8ed0204749 Merge "Fix issue #123704875: Editing the screenshot force closed the activity" 2019-02-06 17:25:33 +00:00
Nikita Ioffe
952aa7b4b0 RMS: Delete user data snapshots when deleting a rollback
- PackageRollbackInfo now also stores list of users the package is
  installed for and the inodes of backup CE data snapshot.
- Changed snapshotAppData to return a pair of
  <pendingBackups, ceSnapshotInodes>.
- RollbackData is updated with CE user data snapshot inode after user
  unlocks the phone and snapshotAppData call is made.
- Added javadoc to some methods in Installer.java to make lint happy.

Not sure how to automatically test:
- multi-user flow.
- the fact that user data snapshots were deleted. I can't access folder
  with snapshot data in RollbackTest, because it is owned by installd.

Bug: 112431924
Test: AppDataRollbackHelperTest, RollbackTest
Change-Id: Ife15f1aed9cf1d2b15be238bdaf766c51b85cab6
2019-02-06 16:13:58 +00:00
Ruslan Tkhakokhov
19513033cf [Multi-user] Make AccountSettingsBackupHelper multi-user aware
Bug: 123349308
Test: 1) atest RunBackupFrameworksServicesRoboTests
         2) atest CtsBackupTestCases
         3) atest CtsBackupHostTestCases
         4) atest GtsBackupTestCases
         5) atest GtsBackupHostTestCases

Manual testing (secondary user):
  1. Go to Settings -> Accounts -> [google-account] -> Account Sync,
     choose items to be synced
  2. adb shell bmgr --user [user-id] backupnow android
  3. Disable all itmes in sync settings
  4. adb shell bmgr --user [user-id] restore 1 android
  5. Verify the sync settings state was restored

Change-Id: I41b92cea54542b5311e1c6425521ab647bc9a787
2019-02-06 15:07:01 +00:00
Dianne Hackborn
52e42a4012 Fix issue #123704875: Editing the screenshot force closed the activity
We need a way for a content provider to say it always wants
permission grants, even though it is telling the system it doesn't
need permissions.

Change-Id: I50238ecd6a84e8b37f28145c36abe8a21de5c5eb
Fixes: 123704875
Test: manual (create screenshot, click edit in the notification)
2019-02-05 16:10:50 -08:00
Chad Brubaker
e210731480 Remove usage info
Test: checkbuild
Bug: 123699931
Change-Id: I1adf60c3667ea88c296fc06807ac22b2ddf0e226
2019-02-05 13:40:24 -08:00
Richard Uhler
6fa7d13ebe Notify RollbackManager of the apk session for a staged install.
The rollback manager needs to know the apk session to avoid doing an
extra backup of the apks when the apk session is applied post-reboot.

Bug: 112431924
Test: atest RollbackTest

Change-Id: Ie84969760b9b1fd3949a7241f23e52cfb403e294
2019-02-05 16:43:47 +00:00
Narayan Kamath
e9ea9cc748 Merge "Staged Rollbacks Part 1: Pre reboot data copy." 2019-02-05 15:20:55 +00:00
Narayan Kamath
fcd4a04cc8 Staged Rollbacks Part 1: Pre reboot data copy.
For staged sessions, the staging manager calls through to the
Rollback manager during its pre-reboot flow if package rollback
is enabled for the session. It passes through a list of sessionIds
representing a single package session or siblings in a multi package
session that rollback must be enabled for. The rollback manager then
performs the following actions :

- Makes a copy of APKs and APEXes corresponding to the sessionIds
  provided by the staging manager.

- Creates and persists RollbackData objects for the staged session.
  and marks that they're part of a staged install and not a regular
  install. This change augments RollbackData with sessionIds of
  the staged session and PackageRollbackInfo with a flag indicating
  whether or not it represents an APEX.

In a follow up change, the StagingManager will call through to the
RollbackManager post reboot and provide a mapping between the staged
session ID for the APK section of the staged install. This will allow
the RollbackManager to make userdata backups and finally mark the Rollback
as available.

Test: atest RollbackTest AppDataRollbackHelperTest
Test: adb install-multi-package --staged --enable-rollback \
        ./apex.test.apex ./RollbackTestAppAv2.apk

Change-Id: I4a7b154844684ddb26b7c95d39be36f542fb5d4b
2019-02-05 11:46:27 +00:00
Dario Freni
80ced71afd Merge "Disable package verifier for staged installs." 2019-02-05 10:16:23 +00:00
TreeHugger Robot
98665da93b Merge "Make RoleManager inject DefaultBrowserProvider into PackageManager." 2019-02-04 22:09:28 +00:00
TreeHugger Robot
a3cce241f1 Merge "Migrate default browser to use role." 2019-02-04 18:50:34 +00:00
Hai Zhang
85fd062239 Make RoleManager inject DefaultBrowserProvider into PackageManager.
This way PackageManager does not depend on RoleManager any more. Also
did some refactoring on RoleManagerService.

Bug: 123775970
Test: manual
Change-Id: I56c50d410ef212c960ffaa6212655b2f42870878
2019-02-04 10:37:07 -08:00
Nataniel Borges
5bfb2b7b00 Merge "Allow for different log levels on WM traces" 2019-02-04 17:45:15 +00:00
Dario Freni
49c3fa7488 Disable package verifier for staged installs.
This is a temporary measure to allow staged installs for APKs to work on
dev-signed devices.

Test: adb install --staged file.apk on taimen-eng target; adb
install-multi-package file1.apex file2.apex file3.apk file4.apk
Bug: 123753157
Change-Id: I537afbb08cb0a5db37bb823f4b084691dcd2f5d1
2019-02-04 14:49:18 +00:00
Richard Uhler
ccf035d6cb Add mIsStaged and mCommittedSessionId to RollbackInfo.
These will be needed for the rollback manager to support rollback of
staged sessions.

Bug: 112431924
Test: atest RollbackTest

Change-Id: I22c02ba2de023af6cf6908207bf69ab36ca9291c
2019-02-04 14:06:29 +00:00
Dario Freni
1108886bd2 Merge "Add STAGED_SESSION_ prefix to error codes." 2019-02-04 10:34:09 +00:00
Gavin Corkery
6db967fe33 Merge "Renaming plsCertsNoVerifyOnlyCerts to unsafeGetCertsWithoutVerification." 2019-02-04 10:08:00 +00:00
Nataniel Borges
023ecb5f6d Allow for different log levels on WM traces
Currently only a boolean value (trim) is supported. If trim is true then the configuration (Configuration.java) is written only once, otherwise it is written 3 times. With this implementation too much information is written in the log and it is not possible to activate a continuous tracing mode without affecting system performance. Trace logging currently consumes ~1ms for each log write  on a Pixel 2 device, divided into ~0.6ms to write the data to the ProtoBuf and ~0.4ms to it to the circular buffer.

This implementation converts this boolean into an enum and defines 3 different log levels (WindowTraceLogLevel enum): "Critical", "Trim" and "All".

"Trim" and "All" behave as the previously existing boolean. "Critical" is a new log level which logs only the elements which are visible with the minimum amount of information required for analysis. With this mode the average overhead of continuous logging drops to ~0.26ms on the same Pixel 2 device (0.2ms to write to ProtoBuf and 0.06 to add ot circular buffer).

The system automatically configures the log level between "Trim" and "Critical" according to the trace strategy used. When using continuous tracing mode it automatically uses the "Critical" level, otherwise it uses "Trim".

To activate the continuous mode use:
- adb shell cmd window tracing continuous true

Test: Flash a device. Set continuous mode to true and enable Winscope tracing. Start a systrace test for wm category and use the device. Check the "writeToProto" item to inspect the overhead.
Change-Id: I7abd74969b94abe44af4f7c65be5fefdd0860155
2019-02-01 14:37:04 -08:00
Hai Zhang
a22cd83c06 Migrate default browser to use role.
This change migrates the default browser to use role, while preserving
the old APIs.

Bug: 110557011
Test: manual
Change-Id: If0037e5d2a0d5dc24805bd66215a27e72927a0ef
2019-02-01 13:58:58 -08:00
Eugene Susla
b8543da969 Merge "Revert "Log a warning if non-role holder attempts to read sms"" 2019-02-01 21:50:45 +00:00
Aurimas Liutikas
ce37d9027d Merge "Update TypedArray and TypedValue to store source layouts." 2019-02-01 20:35:23 +00:00
Eugene Susla
c0826a6434 Revert "Log a warning if non-role holder attempts to read sms"
This reverts commit e865b9d9bf.

Reason for revert: caused b/123709320, also non needed any more

Fixes: 123709320
Change-Id: I2afa0a60133a490ab433cd04dd03a5e26fb3fc14
2019-02-01 18:26:30 +00:00
Dario Freni
b6d2896a4b Add STAGED_SESSION_ prefix to error codes.
Fix: 123661418
Test: m
Change-Id: I013af7699f0d0225cdcdde232e54e2ee3f615257
2019-02-01 16:26:14 +00:00
Ricky Wai
922698a90b Merge "Make AppDetailsActivity to be transparent" 2019-02-01 15:15:13 +00:00