Commit Graph

7492 Commits

Author SHA1 Message Date
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
TreeHugger Robot
2c13539844 Merge "Revert "Minimum viable TimeZoneDetectorService"" 2019-02-01 12:57:32 +00:00
Narayan Kamath
bd01149b62 Merge "ModuleInfo: Address API council feedback." 2019-02-01 12:00:44 +00:00
Ricky Wai
6229250736 Make AppDetailsActivity to be transparent
Test: It's transparent and no flash/action bar when it starts
Bug: 119484208
Change-Id: Iddbe80d017d652884f5bfb7bb7420739e00b855d
2019-02-01 11:22:47 +00:00
Po-Chien Hsueh
5380a5adf9 Merge "Add DynamicAndroidClient" 2019-02-01 10:56:42 +00:00
TreeHugger Robot
8a72d5a9d5 Merge "Add a new "appPredictor" protection flag." 2019-02-01 03:48:32 +00:00
TreeHugger Robot
f973460248 Merge "Implement getting displayId from ActivityManager" 2019-02-01 01:41:31 +00:00
Aurimas Liutikas
949b05dbdc Update TypedArray and TypedValue to store source layouts.
In ag/5859897 we started tracking source styles for each TypedValue.
It is also useful to keep track of source layouts if the attribute
was resolved against a layout (attribute set in XML layout inside
of <View> tag).

Test: atest CtsContentTestCases:android.content.res.cts.TypedArrayTest
Bug: 111439551
Change-Id: Ie6bc6ecd9a22b536a2f3288263b896f9cec67d38
2019-01-31 15:44:51 -08:00
Adam He
bb82c6a9f0 Implement getting displayId from ActivityManager
Change-Id: Ib8659062e5dd58b49c1e1fdee03f5f6a65e00971
Fixes: 121260224
Test: atest CtsContentCaptureServiceTestCases
2019-01-31 15:33:36 -08:00
TreeHugger Robot
7d3adab5e9 Merge "Change foregroundServiceType from enum to flags" 2019-01-31 22:11:41 +00:00
TreeHugger Robot
9853d60bd9 Merge "Rename preferCodeIntegrity to useEmbeddedDex" 2019-01-31 20:35:54 +00:00
Hui Yu
2d4207f8c1 Change foregroundServiceType from enum to flags
1. Now the value of manifest attribute foregroundServiceType can
be multiple flags ORed together.
2. Add a overloaded version of Service.startForeground() with an
additional parameter foregroundServiceType. The flags in parameter
foregroundServiceType must be a subset of flags specified in manifest
attribute foregroundServiceType, otherwise a IllegalArgumentException is
thrown.
3. Add a field foregroundServiceType in ServiceRecord, it is the types
that have been started on this foreground sevice.

Bug: 111453223
Test: atest frameworks/base/tests/FrameworkPerf

Change-Id: I7eb68f696e6bf75720fe9c9388a6c23a529677f7
2019-01-31 11:50:18 -08:00
Aurimas Liutikas
83cbd348c3 Merge "Add View#getSourceLayoutResId()." 2019-01-31 18:23:02 +00:00
George Hodulik
cd7695dda0 Add a new "appPredictor" protection flag.
Permissions that have the new apppredictor protection flag will
be granted to the app predictor app, which is AiAi for Pixels.

The MANAGE_APP_PREDICTIONS permission is updated to use the
app predictor flag.

App Predictor for Pixels already set in ag/6019430.
Some one-off handling for app predictor already added in
ag/6025266 and ag/6025267. This cl adds the appPredictor flag.

Test: Tested manually that it worked.
Test: atest CtsPermission2TestCases:PermissionPolicyTest
Bug:123599542

Change-Id: I0550930f78fdb57eea8680762c9b313a330968b6
2019-01-31 10:17:09 -08:00
TreeHugger Robot
c9a6395ba2 Merge "Support for multi-package APK+APEX sessions." 2019-01-31 18:15:29 +00:00
Gavin Corkery
ed521ab2a9 Renaming plsCertsNoVerifyOnlyCerts to unsafeGetCertsWithoutVerification.
Bug: 118866213
Test: m -j
Change-Id: Iba5e933b7db8dd36d5c720dba128cdce7d76e6d5
2019-01-31 17:58:18 +00:00
TreeHugger Robot
d243eccc6e Merge "Remove TODO from API Javadoc." 2019-01-31 17:06:31 +00:00
Dario Freni
4b572c0740 Support for multi-package APK+APEX sessions.
Adding support for single-package staged session containing one APK
only, or multiple-package staged sessions containing an arbitrary number
of APK or APEX packages.

Bug: 118865310
Test: tried the following scenarios:
  - atest apex_e2e_tests
  - adb install --staged file.apk
  - adb install-multi-package --staged file.apk file.apk
  - adb install-multi-package --staged file.apk file2.apk file.apex
    file2.apex
Change-Id: I0c018f89705128ecc7e3939cff18eafa19e47a0e
2019-01-31 15:58:43 +00:00
Victor Hsieh
fa9df0b5db Rename preferCodeIntegrity to useEmbeddedDex
Also remove the restriction of extractNativeLibs.

Test: build, (new) CTS in progress
Bug: 112037137
Change-Id: If0ad13b0d63b288c2da3a82b911d8dad0db8c07a
2019-01-31 07:49:45 -08:00
Dario Freni
566350a93a Remove TODO from API Javadoc.
Test: N/A
Change-Id: If14a5fea300192390e8f4f04ec5ccbf39a0d8a53
Fix: 123661629
2019-01-31 14:56:06 +00:00
Narayan Kamath
79eed4bf12 Merge "PackageManager: Call RollbackManager API with the right set of installed users." 2019-01-31 14:07:04 +00:00
Martijn Coenen
81973983b0 Merge "Allow app to specify class name for app zygote preloading." 2019-01-31 12:35:13 +00:00
Howard Chen
0a94764738 Add the DynamicAndroid Service
Define the DynamicAndroid with AIDL.
  Add a java implementation.
  Start a service instance in the system server.
  Add a permission test.

Bug: 122015653
Test: Build & Test on a pixel phone with following command \
  ./frameworks/base/services/tests/runtests.py -e class com.android.server.DynamicAndroidTest

Change-Id: I2e54b6b71fac4a4c5a9c9c25ce6bdac74cddcfb7
2019-01-31 14:19:34 +08:00
Howard Chen
c570b0c5a9 Add DynamicAndroidClient
DynamicAndroidClient is the SystemApi to invoke DynamicAndroid
installation service. It also provides a listener for status update.

Bug: 122440941
Test: Compile and run on internal target
Change-Id: I1ea5e861ecaca1647b445eac57ed15a144be68e8
2019-01-31 10:47:03 +08:00
TreeHugger Robot
71f12a3093 Merge "Allow cross user SessionCallback support" 2019-01-30 23:05:37 +00:00
Aurimas Liutikas
aae06631e1 Add View#getSourceLayoutResId().
Add ability for developers to check which layout file did a given
View was inflated from.

Bug: 111439551
Test: atest CtsViewTestCases:android.view.cts.ViewSourceLayoutTest
Change-Id: I0f2981648629d74fd576687a54a31b00cd636976
2019-01-30 13:36:04 -08:00
Narayan Kamath
acdccf0a4e ModuleInfo: Address API council feedback.
Use CharSequence instead of String for package labels

Bug:123587616
Test: atest ModuleInfoProviderTest
Change-Id: I2ed9712aabad57c7e6325e452aa0caee19476213
2019-01-30 19:43:03 +00:00
Matt Pietal
ffcf6e5460 Merge "Sharesheet content preview - adding text support only" 2019-01-30 11:58:51 +00:00
Richard Uhler
8ffae36fa9 Merge "Rename RollbackInfo.getSessionId to getCommittedSessionId." 2019-01-30 10:29:04 +00:00
Narayan Kamath
a3bf162ae4 Merge "Multi-user support for app data snapshot / rollback." 2019-01-30 10:15:33 +00:00
Narayan Kamath
67af327d2b PackageManager: Call RollbackManager API with the right set of installed users.
We know we're operating on an update to an installed app, which is
applied to all previously installed users. Therefore, we must restore
data for those users and not just the user specified in the
InstallParams.

Test: atest RollbackTest
Bug: 112431924

Change-Id: Id95ee5c8e02da71fa3a64b4bf10966f3fb2e5e9c
2019-01-30 09:16:30 +00:00
Martijn Coenen
fb7caa96f9 Allow app to specify class name for app zygote preloading.
Instead of using a fixed class name, define an interface for
preloading application code that must be implemented by applications
that use the application zygote.

Also, add an ApplicationInfo parameter to said function, so the app
knows where to look for its data and code.

Bug: 111434506
Test: atest CtsApptestCases:ServiceTest
      atest CtsSeccompHostTestCases

Change-Id: I1f8472da89dc90562dcb4e479e3d87ebf49b926c
2019-01-30 09:57:19 +01:00
TreeHugger Robot
78ae2b5bb6 Merge "Skeleton API for IncidentManager to retrieve incident reports." 2019-01-30 03:30:40 +00:00