Commit Graph

6192 Commits

Author SHA1 Message Date
Geoffrey Pitsch
7c95a682ba Merge "New supported QuickViewConstant feature to delete a file." 2017-12-07 21:32:29 +00:00
TreeHugger Robot
081be42c27 Merge "Introduce getProfileSwitchingIcon/Label In CrossProfileApps" 2017-12-06 22:56:17 +00:00
Chris Tate
f10f83d507 Merge "Introduce ServiceConnection#onNullBinding()" 2017-12-06 18:47:17 +00:00
TreeHugger Robot
9e33289902 Merge "Adds metadata to InstantAppResolveInfo" 2017-12-06 18:05:32 +00:00
Geoffrey Pitsch
bc02b77463 New supported QuickViewConstant feature to delete a file.
Bug: 65368139
Test: compiles
Change-Id: I45e31f9ee063a9bd1330b3031bc770f7f0bf312e
2017-12-06 12:48:29 -05:00
TreeHugger Robot
2e24967956 Merge "Add system service for slices" 2017-12-06 15:58:46 +00:00
Patrick Baumann
709ee1551d Adds metadata to InstantAppResolveInfo
This change introduces a metadata Bundle to the InstantAppResolveInfo
type to be passed along to the Instant App installer in the case of
resolution. This can be used by the resolver and installer to improve
launch by avoiding IPC to fetch needed data that lives in the resolver.

Change-Id: I0b9c168dd8803f5398d222384ebd436c787e1a48
Fixes: 68223794
Test: manual - modified resolver to populate data, verified in installer
2017-12-06 15:38:59 +00:00
Dianne Hackborn
d5b9266f01 Merge "Add major version code to platform." 2017-12-05 20:12:17 +00:00
Calin Juravle
d3392daa3b Merge "Add SystemApis to expose runtime profile information" 2017-12-05 19:10:34 +00:00
Jason Monk
8f5f7ff5fa Add system service for slices
Will be used to manage permissions and possibly pinned state for slices.

Test: manual
Change-Id: Ie53f4988f817ac5b920087567dbac751e2857dbf
2017-12-05 13:37:37 -05:00
Christopher Tate
5d73b6d7a9 Introduce ServiceConnection#onNullBinding()
Historically, if a service returns null from onBind(), the binding app
gets no information about the outcome:  the ServiceConnection is never
invoked.  We now introduce a new connection callback, onNullBinding(),
for apps that need to detect this situation.  When the service rejects
the binding by returning null, the onNullBinding() callback in the
associated ServiceConnection is invoked instead of onServiceConnected().

onNullBinding() has an empty default implementation, so there is no
binary-compatibility impact of this new interface method.

Bug: 67377345
Test: atest android.app.cts.ServiceTest

Change-Id: I224512c118f7d6e5c1c2bb69eca1902882e73594
2017-12-04 17:11:31 -08:00
Patrick Baumann
b4165d7267 Sends resolving action to Instant App installer
This change adds the action being resolved to an installing Instant
App to the installer so it may increase friction for untrusted or
potentially dangerous sources (NFC, nearby, etc.)

Change-Id: If6c47a219e4ddf453fb406e2b212b024aa24ade6
Fixes: 63102749
Test: manual - debugged the ephemeral installer to ensure extra
2017-12-04 23:23:45 +00:00
Calin Juravle
45f8b29ce0 Add SystemApis to expose runtime profile information
The API allows a system apps which acquired
{@code android.permission.READ_RUNTIME_PROFILE} to snapshot the runtime
profiles of installed packages.

The API is implemented in a new service class (AndroidRuntimeManager)
accessible from the context using
context().getPackageManager().getAndroidRuntimeManager().

The main functionality is exposed as a one way call into the
AndroidRuntimeManager with the result being posted on a callback. The
profile is available to the caller as a read-only ParcelFileDescriptor.

This CL only adds the API interfaces and validation. It does not fully
implement the functionality.

oneway void snapshotRuntimeProfile(in String packageName,
  in String codePath, in ISnapshotRuntimeProfileCallback callback)

Bug: 30934496
Test: gts-tradefed -m GtsAndroidRuntimeManagerHostTestCases

Change-Id: Iaa6be4715840f24508acba3162ea9c1ab725bd38
2017-12-04 14:26:46 -08:00
Dianne Hackborn
3accca05dd Add major version code to platform.
It turns the version code into almost a 64-bit integer, with the
new major part being the upper 32 bits.

The only tricky part about this is the backup manager, since it
stored 32-bit version codes in its backup data sets.  This is dealt
with by, when the major version code is not 0, writing MIN_INT as
the version code and following that by the full long version code,
which we can detect when reading.  Note that this makes backup sets
containing apps with major version codes incompatible with older
versions of the platform.

Bug: 64459786
Test: Added in Change-Id: Iab8a682b62103babd6c16a56b8dc1e97d7078658
Change-Id: Ibfffe235bbfcf358b3741abd3f7197fdb063d3f3
2017-12-04 13:02:10 -08:00
TreeHugger Robot
70de9728d2 Merge changes from topic "priv_vendor_app"
* changes:
  BIND_IMS_SERVICE is exposed to vendors
  Support privileged vendor apps
2017-12-04 03:20:34 +00:00
Tony Mak
8246513dfc Introduce getProfileSwitchingIcon/Label In CrossProfileApps
Leave the resource retrieval part in client side to avoid passing
drawable across process boundary which should be bad for performance.

The verification part is done in client side, so in theory, apps can work
around the verification. That said, the strings and drawables
are not secret anyway, they are just a generic icon / label to represent
the user. Also, they can always retrieve them by using getDrawable
anyway.

BUG: 67765768
Test: bit FrameworksCoreTests:android.content.pm.crossprofile.CrossProfileAppsTest

Change-Id: I44a7ba17ecc81d0d366184b2d411caa7a82de3ef
2017-12-01 18:44:10 +00:00
Jon Dormody
311a849ee8 Merge "Docs: Renamed ParcelFileDescritor to ParcelFileDescriptor Test: make ds-docs Bug: 1766768" into oc-dev am: ce7f1e6601 am: 3ba37e1f53 am: 96dad7e0a3
am: c0c7c3bcbb

Change-Id: I6d8c7f76139522fae1b506519aba4ab6f8e54d3b
2017-12-01 16:53:12 +00:00
Jon Dormody
ff1e93a341 Merge "Docs: Added mention that the getSharedPreferences method is thread safe." into oc-dev am: fb839ce59a am: 728ca235b5 am: 37db2694eb
am: f506b49aa6

Change-Id: Ie4a7176be63ddcc8f1e4e9fad98ee2644f0a6758
2017-12-01 16:42:30 +00:00
Jon Dormody
c0c7c3bcbb Merge "Docs: Renamed ParcelFileDescritor to ParcelFileDescriptor Test: make ds-docs Bug: 1766768" into oc-dev am: ce7f1e6601 am: 3ba37e1f53
am: 96dad7e0a3

Change-Id: Ib8bbd7fa3dfc9ee5caa3b9f7f2696c7461c3faf3
2017-12-01 16:40:51 +00:00
Jon Dormody
f506b49aa6 Merge "Docs: Added mention that the getSharedPreferences method is thread safe." into oc-dev am: fb839ce59a am: 728ca235b5
am: 37db2694eb

Change-Id: I98151cf907cd2f635c8f4a0e128ff697024b3a54
2017-12-01 16:28:29 +00:00
Jon Dormody
96dad7e0a3 Merge "Docs: Renamed ParcelFileDescritor to ParcelFileDescriptor Test: make ds-docs Bug: 1766768" into oc-dev am: ce7f1e6601
am: 3ba37e1f53

Change-Id: Ia807c8ccd0db5b37b010f64a417fc8e105c22866
2017-12-01 16:28:14 +00:00
Jon Dormody
37db2694eb Merge "Docs: Added mention that the getSharedPreferences method is thread safe." into oc-dev am: fb839ce59a
am: 728ca235b5

Change-Id: Ib6d81f2355ef9d902725e2e1ee1cd5337f4294ad
2017-12-01 16:16:53 +00:00
Jon Dormody
3ba37e1f53 Merge "Docs: Renamed ParcelFileDescritor to ParcelFileDescriptor Test: make ds-docs Bug: 1766768" into oc-dev
am: ce7f1e6601

Change-Id: If7798db1aea1f1d6cdb42a7d25509c814a31f6ca
2017-12-01 16:14:15 +00:00
Jon Dormody
728ca235b5 Merge "Docs: Added mention that the getSharedPreferences method is thread safe." into oc-dev
am: fb839ce59a

Change-Id: Ic135f510c6e5ff8a9a00f2d2be1fcc0c284dd5cf
2017-12-01 16:07:27 +00:00
Jon Dormody
ce7f1e6601 Merge "Docs: Renamed ParcelFileDescritor to ParcelFileDescriptor Test: make ds-docs Bug: 1766768" into oc-dev 2017-12-01 15:53:36 +00:00
Jonathan Dormody
1c7c4b2f14 Docs: Renamed ParcelFileDescritor to ParcelFileDescriptor
Test: make ds-docs
Bug: 1766768

Change-Id: Idfea122569bb6f80889be3f224f9629cfebc0ca3
2017-11-30 22:25:42 +00:00
Jiyong Park
002fdbdb95 Support privileged vendor apps
Privileged apps can now be located in the vendor partition. This is
mainly to move SoC-dependent apks to the vendor partition so that the
system partition becomes more generic.

Like existing privileged apps in the system partition, the list of
privileged apps in the vendor partition and the permissions they are
using must be white-listed. The whitelist can be specified via
<privapp-permissions> tags in one of /vendor/etc/permissions/*.xml
files. Note: vendors can only white-list the apps in vendor partition,
but not the apps in system partition.

This change also introduces a new flag 'vendor-privileged' to the
permission protection level. It is used to expose platform-defined
permissions to the privileged vendor apps. If a platform permission does
not have this flag, it is not granted to vendor apps even when the app
is privileged and white-listed.

Bug: 35301609
Test: `mm` under frameworks/base/tests/privapp-permissions
adb sync && adb reboot
adb shell cmd package \
com.android.framework.permission.privapp.tests.vendor
shows that the app is installed.
android.permission.BIND_IMS_SERVICE is in the installed permissions list
android.permission.MANAGE_USE is not in the installed permissions list,
but is in the requested permissions list.

Change-Id: I196375aaaa9ea3a2ba15686ef08cf3f70ade7046
2017-11-30 14:41:55 +09:00
Andrii Kulian
4d26c21a82 Merge changes from topic "lifecycle_transaction_base"
* changes:
  Add transaction unit tests
  Add basic lifecycle transaction containers
2017-11-28 20:47:34 +00:00
TreeHugger Robot
c26f4c5678 Merge "Remove scanFile argument" 2017-11-28 18:37:55 +00:00
Andrii Kulian
6b9d3a1400 Add transaction unit tests
Bug: 64797980
Test: android.app.servertransaction.ClientTransactionTests
Test: android.app.servertransaction.TransactionParcelTests
Change-Id: I108bacc819e9d43d0a2f5a30338ae88674a53239
2017-11-27 18:15:49 -08:00
Jeff Sharkey
c204c223a7 Deeper sanity checking of emitted types.
When emitting a method or field, verify that we're able to reference
all mentioned types.  This ensures that we don't accidentally
reference undefined classes/interfaces.

Test: manual inspection of API files
Bug: 69791141
Change-Id: I84e0c87fe83daa118661f61dbdf17b58ea5282d4
2017-11-27 17:07:40 -07:00
Nikolas Bravo
cde72f1be7 Fixes javadoc documentation of PackageInstaller.SessionParams#setOriginatingUid(int)
am: 8aaf928fcd

Change-Id: I4a2efd6052b1bcc5344fd23722745b3532fb01c9
2017-11-27 22:29:21 +00:00
Todd Kennedy
ddaaf4cf48 Remove scanFile argument
In several locations we were passing both a parsed Package object
and a scanFile File object. But, the Package object was parsed from
the scanFile! Instead, just pass the singular Package object and
pull the scanned file from it.

Bug: 63539144
Test: bit FrameworksServicesTests:com.android.server.pm.
Change-Id: Ibd200fb567e005869de61d9c123f211fa9a38f0a
2017-11-27 14:10:03 -08:00
Nikolas Bravo
8aaf928fcd Fixes javadoc documentation of PackageInstaller.SessionParams#setOriginatingUid(int)
* Current "See also" link in https://developer.android.com/reference/android/content/pm/PackageInstaller.SessionParams.html#setOriginatingUid(int) is not only wrong, but also broken
* Added a missing "the"

Bug: 69799046
Fixes: 69799046
Test: make ds-docs (run by asolovay@)
Change-Id: I90410ed3393b5c37afdf0476eb70821fae9f63fd
(cherry picked from commit 6283100a87)
2017-11-27 19:50:40 +00:00
Peter Visontay
79af02db03 Merge "Fix outdated docs of permission protection levels." 2017-11-23 11:06:46 +00:00
Christopher Tate
a732f014c5 The job scheduler now backs off jobs based on standby bucketing
The default parameters here translate to roughly this rate limiting:

  ACTIVE:   run jobs whenever
  WORKING:  ~ hourly
  FREQUENT: ~ every 6 hours
  RARE:     ~ daily

Bug: 63527785
Test: cts & manual (WIP)
      atest CtsJobSchedulerTestCases
Change-Id: I58f8e53e5bdf40601823e5a10a9f2383a6f67ae5
2017-11-22 22:07:06 +00:00
Peter Visontay
51fbad5a76 Fix outdated docs of permission protection levels.
1) Added deprecation notice to the 'system' and 'signatureOrSystem' protection levels.
These were deprecated in API Level 23:
https://developer.android.com/reference/android/content/pm/PermissionInfo.html#PROTECTION_SIGNATURE_OR_SYSTEM
https://developer.android.com/reference/android/content/pm/PermissionInfo.html#PROTECTION_FLAG_SYSTEM

2) Removed an outdated list of protection levels from PermissionInfo.protectionLevel's JavaDoc.
Its Javadoc has a link to an up-to-date list.

Test: Ran "make docs".
Change-Id: Ia6dc88ba3a66f248f60f010323d5ba40200c1cda
2017-11-22 20:31:14 +00:00
Todd Kennedy
916c83d227 Merge "Make sense out of scan & parse flags" 2017-11-22 20:02:48 +00:00
TreeHugger Robot
8377006984 Merge "Show warning when app was compiled against incompatible preview SDK" 2017-11-22 15:54:05 +00:00
Todd Kennedy
232d29e0cd Make sense out of scan & parse flags
Parse flags are often used confusingly to control policy during
APK parsing. Additionally, some flags [such as PARSE_IS_PRIVILEGED
or PARSE_IS_SYSTEM] aren't always determined based upon APK location
[they change based upon which apps are installed]. This means we
have to perform some gymnastics to set them correctly _before_
parsing a package.

Instead, these should be scan flags that can be determined at a
later point during package parsing. Then, based upon the scan flag
we apply policy on the package object to create the resulting
data structures.

Bug: 63539144
Bug: 69663125
Test: Manual; it builds, runs and applications can be installed / removed
Test: bit FrameworksServicesTests:com.android.server.pm.
Change-Id: I53fb18e58544e0a39f35eb6fb53c950e5c696aee
2017-11-22 15:39:04 +00:00
Alan Viverette
b6a25737d6 Show warning when app was compiled against incompatible preview SDK
Adds publicly-visible API for compile SDK version and codename. AAPT2 does
not support these yet, but that will be included in a follow-up CL.

Also refactors the Unsupported Display Size dialog out to a generic app
warnings manager class and fixes a bug there where the "always show"
preference was not persisted.

Improves documentation around threading and concurrency guarantees.

Bug: 64107584
Fixes: 68995409
Test: CtsActivityManagerDeviceTestCases
Change-Id: Ic86efa554b8b1caf80e5e004fda897d3483a68e8
2017-11-21 21:11:38 +00:00
Fyodor Kupolov
bc8d3e6049 Merge "Updated JavaDoc for onStartLoading" 2017-11-21 20:32:26 +00:00
TreeHugger Robot
0f02aeb66c Merge "Allow "cmd package bg-dexopt-job" to take a list of package names" 2017-11-18 04:37:45 +00:00
Arthur Eubanks
09dd1ec4b2 Allow "cmd package bg-dexopt-job" to take a list of package names
Modify "cmd package bg-dexopt-job" to accept an optional list of
packages to run bg-dexopt on to help with testing.

Test: make && flashall && automated tests (ag/2959616)
Test: adb shell cmd package bg-dexopt-job
Test: adb shell cmd package bg-dexopt-job pkg_name

BUG: 64807719
Change-Id: Ibf1fda88810dd4ec19fbbfe3322c35b201727707
2017-11-17 17:16:39 -08:00
Fyodor Kupolov
96481dee19 Updated JavaDoc for onStartLoading
Test: n/a
Bug: 68133232
Change-Id: I0c94913ac4510fff82787ee89ba29d6e66f3ba22
2017-11-17 15:30:03 -08:00
Peter Visontay
f702fd43b4 Add a link to the PackageInstaller API demos.
Test: Ran "make docs".
Change-Id: I8459bc2a4aaf3827f71a6af5478ff0f30fae6dc3
2017-11-17 14:19:46 +00:00
Philip P. Moltmann
b13f15332e Remove one legacy install path
Also removed everything needed only for this path

Test: Installed app via package installer, adb, google play store
Bug: 65261282
Change-Id: Ia8a03fa5900687cd2adf844ba7e6c07e0537382e
2017-11-16 11:32:47 -08:00
Jonathan Dormody
1bca5db0cb Docs: Added mention that the getSharedPreferences method is thread
safe.

Test: make ds-docs

Bug: 5370116
Change-Id: I5aa851db5e1dbcb3563f1ce15f96cc10c80e90ba
2017-11-16 11:25:20 -07:00
Philip P. Moltmann
81e46d9232 Doc that SharedPreferences is IO-expensive
Tried to find the right middle ground in between
- not exposing potentially changing implementation details
- being clear on what it is for and what not
- being too alarmist vs. being to weak

Test: compiled
Bug: 69177691
Change-Id: Ifb40e350a18bf72c113229f31e129b7e8fdacd2a
2017-11-15 13:31:56 -08:00
TreeHugger Robot
07201a7922 Merge "Enforce REQUEST_DELETE_PACKAGES for PackageInstaller.uninstall()" 2017-11-15 01:09:06 +00:00