345 Commits

Author SHA1 Message Date
Jeff Sharkey
16c8e3f494 PackageInstaller changes based on feedback.
Mostly cosmetic changes from API council feedback.

Bug: 16543552
Change-Id: Ic926829b3f77c31f50a899c59b779353daf00d59
2014-07-25 11:59:48 -07:00
Amith Yamasani
e5bcff624f Rename setApplicationBlocked to setApplicationHidden
This corrects the expected behavior of the app state. Hidden apps
can be installed by the store to be brought out of hidden state.

Bug: 16191518
Change-Id: Id128ce971ceee99ba1dea14ba07ce03bd8d77335
2014-07-21 22:18:40 +00:00
Jeff Sharkey
4ed745d359 Add code cache directory for apps.
This provides a directory where apps can cache compiled or optimized
code generated at runtime.  The platform will delete all files in
this location on both app and platform upgrade.

Bug: 16187224
Change-Id: I641b21d841c436247f35ff235317e3a4ba520441
2014-07-15 22:13:26 -07:00
Jeff Sharkey
69ea974f17 Merge "Public API for PackageInstaller!" into lmp-dev 2014-07-15 00:41:06 +00:00
Jeff Sharkey
6c833e07a0 Public API for PackageInstaller!
Flesh out documentation and finalize first cut of API.  Also surface
installLocation and splitNames through PackageInfo.

Bug: 14975160, 15348430
Change-Id: Ic27696d20ed06e508aa3526218e9cb20835af6a0
2014-07-14 23:06:52 -07:00
Christopher Tate
a7835b6b6b Add Context.getNoBackupFilesDir()
This is an app-private filesystem space exactly like the one
reported by Context.getFilesDir(), with one exception:  files
placed here are never backed up by the full-backup infrastructure.
If an app attempts to back up any of its contents via the normal
API it's immediately ignored with a logged warning.

The restriction is also enforced on the restore side, because
apps using support libraries might wind up creating full backup
archives containing no_backup subdirs on pre-L devices (via
adb backup, Helium, &c.).  We check for this before passing the
restore data to the app, and drop it if we detect the situation
so that the app never sees the bits.

Bug 16240573

Change-Id: I11216a391f1d32117ec7ce15aafc9cd93d0337de
2014-07-14 22:56:04 +00:00
dcashman
9d2f441f9b Initial KeySet API.
Previously submitted but reverted due to doc-compilation bug.

Bug: 6967056
Change-Id: I9bd7ef299a4c92c4b327f5b5d7e951f0753b4c8a
2014-07-14 12:50:51 -07:00
dcashman
5de7377fec Revert "Initial KeySet API."
This reverts commit 9a643fe02bc960e266484547dda5572b094a4c72.
2014-07-12 13:04:20 -07:00
dcashman
405912bce0 Initial KeySet API.
Bug: 6967056
Change-Id: I47a01bd5dc25591cc70f58f38920ad0a021094ae
2014-07-12 12:09:40 -07:00
Nicolas Prevot
7f7b0c759e Returning badged icons for components of corporate apps.
So, corporate apps in disambiguation dialogs are badged.
And updating the way we show the icon of the personal space to this new design.

BUG: 14377051

Change-Id: Idc707773a64a8feb2d9d4df88c425d5100542636
2014-07-02 12:09:51 +01:00
Alexandra Gherghina
0363c3eb08 Expose per-user APIs for content services.
Bug: 15466880
Change-Id: Ib5a030e78559307627fe0d2e80ce6f1a7825109d
2014-06-26 10:47:19 +01:00
Nicolas Prevot
88cc346d06 Show the icon of the personal space.
In an intent disambiguation dialog from a managed profile,
when the intent can be forwarded to the personal space:
show the icon of the parent next to "Personal apps".
And put it at the bottom of the dialog.

Change-Id: I523222aac5dde9653e784eb26cf23cdaf018b86c
2014-06-23 12:25:07 +01:00
Alexandra Gherghina
6e2ae2590d Adds cross-profile intent filters for the Settings app
Bug: 15466742
Change-Id: Id9af588f2f3d51a562ef2a06fe7404c96123cc2e
2014-06-19 18:04:45 +01:00
Nicolas Prevot
e7cd37e613 Merge "Introducing crossProfileIntentFilters that skip the current profile." 2014-06-17 21:55:55 +00:00
Brian Carlstrom
7f047f02ad am 80f1fe5f: am f8077cf2: am 8e21e215: Merge "Switch from core to core-libart"
* commit '80f1fe5f7cc80b6f1da142c782ccbbad45d878a8':
  Switch from core to core-libart
2014-06-19 02:16:34 +00:00
Brian Carlstrom
80f1fe5f7c am f8077cf2: am 8e21e215: Merge "Switch from core to core-libart"
* commit 'f8077cf2d7ee55dbf02ec0c65a05db7e5c2fabfc':
  Switch from core to core-libart
2014-06-19 02:08:10 +00:00
Brian Carlstrom
dbcae5ceb7 Switch from core to core-libart
Bug: 14298175
Change-Id: I89db18bf3d88f9511cb2ad943c64ecdbaf09d96f
2014-06-18 17:43:27 -07:00
Nicolas Prevot
63798c596d Introducing crossProfileIntentFilters that skip the current profile.
For these crossProfileIntentFilters, the activities in the current profile cannot
respond to the intent.
Only activities in the target profile can respond to the intent.

BUG: 14936725

Change-Id: I5e2704c2b56ff50a8339dd49284956391d7fad7e
2014-06-18 14:13:19 +01:00
dcashman
559321abbf Merge "Add ArrayUtils methods and tests for consumption by KeySet code." 2014-06-02 17:34:09 +00:00
dcashman
874d0d4032 Add ArrayUtils methods and tests for consumption by KeySet code.
Adds methods for dealing specifically with long data types.  Used by
PackageKeySetData as part of the KeySet work.  Add appropriate test methods
to MoreAsserts as well.

Bug: 6967056
Change-Id: I1e263301b353e0cd1b45126be6ef5ec310f311a8
2014-06-02 10:29:40 -07:00
Jeff Sharkey
43e1565370 am 9a78d4de: Merge "Per-app media directories on external storage." into lmp-preview-dev
* commit '9a78d4deb2d00dc67b2c11daf76b389e0712b535':
  Per-app media directories on external storage.
2014-05-30 23:51:46 +00:00
Jeff Sharkey
2ee3c1e189 Per-app media directories on external storage.
This change defines per-app directories on external storage that
will be scanned and included in MediaStore.  This gives apps a way
to write content to secondary shared storage in a way that can
easily be surfaced to other apps.

Bug: 14382377
Change-Id: I4cb367c870509e76f0c2c598f01e2f699780030a
2014-05-30 16:26:45 -07:00
Nicolas Prevot
8194899071 Rename code related to cross-profile intents.
For example, replace ForwardingIntentFilter by CrossProfileIntentFilter

Bug: 15023443

Change-Id: Iee8cdf578817ef9956bcdece803a49b0d07b67f7
2014-05-23 13:16:01 +01:00
Amith Yamasani
3cf75729d5 Variant of sendBroadcast with appOp flag for cross-user.
Needed for delivering SMS notifications to multiple users.

Change-Id: Ib772292699aba37144621742e6f0ee5c68aadd78
2014-05-16 12:37:29 -07:00
Jeff Sharkey
3a44f3f1b4 Initial support for split APKs, PackageInstaller.
Defines a new PackageInstaller class that will be used for installing
and upgrading packages.  An application desiring to install an
application creates a session, stages one or more package files in
that session, and then kicks off the install.

Previously, PackageManager would always make its own copy of a package
before inspecting it, to ensure the data could be trusted.  This new
session concept allows the installer to write package data directly to
its final resting place on disk, reducing disk I/O and footprint
requirements.  Writes are directed through an intermediate pipe
to ensure we can prevent mutations once an install has been initiated.
Also uses fallocate() internally to support optimal ext4 block
allocation using extents to reduce fragmentation.

Sessions are also the way we support installing multiple "split" APKs
in a single atomic operation.  For a set of packages to form a valid
application, they must have exactly the same package name, version
code, and certificates.  A session can also be used to add a small
handful of splits to an application by inheriting existing packages
when not performing a full install.

Add PackageParser support for extracting split names and certificates.

Bug: 14975160
Change-Id: I23d1bf4fbeb9f99a8c83be0c458900a0f0d1bccc
2014-05-14 18:12:24 -07:00
Tim Kilbourn
eeeacab5d5 DO NOT MERGE Hide leanback packagemanager apis.
Bug: 14116162
Change-Id: I410d720013ba4e2bc1b0f8a6973daba5ca9008c6
2014-05-06 14:33:02 -07:00
Nicolas Prevot
c79586ede6 Cleaning code related to the forwarding intent filters.
Checking for INTERACT_ACROSS_USERS_FULL
Adding equivalent methods in the PackageManager

Change-Id: Iaa1328fa666613a78e67ca669ea045144275e895
2014-05-06 13:54:48 +01:00
Jose Lima
68b9d97593 am 9e99cab7: am 970417c7: Added getLeanbackLaunchIntentForPackage()
* commit '9e99cab7d9a0ec2315140c21bb1958eb7ff76a09':
  Added getLeanbackLaunchIntentForPackage()
2014-04-11 19:01:21 +00:00
Jose Lima
970417c7d3 Added getLeanbackLaunchIntentForPackage()
Change-Id: I23be3bfa59be812a915adc37e08fdf59be8ad90f
2014-04-11 10:54:39 -07:00
Christopher Tate
f1977b4500 Expand install observer semantics
...and now fail conservatively when two apps both attempt to define
the same permission.  Apps signed with the same certificate are
permitted to redefine permissions.

We also finally have a (hidden) interface class for observing package
installation so that we can now rev the interface without breaking
existing callers.

Bug 13551375

Change-Id: Ifa4e59154dcccbb286ee46a35a6f25e4ad0f0f01
2014-03-27 12:37:47 -07:00
Glenn Kasten
7629a18a3f Revert "Expand install observer semantics"
This reverts commit ab8a501f255b272af887acb0e66eb71cdf24c755.

Change-Id: I4ab4ae1a96efa2adf9d5a513793d8b84eef38b4e
2014-03-26 19:59:48 +00:00
Christopher Tate
ab8a501f25 Expand install observer semantics
...and now fail conservatively when two apps both attempt to define
the same permission.

We also finally have a (hidden) interface class for observing package
installation so that we can now rev the interface without breaking
existing callers.

Bug 13551375

Change-Id: I3a286d024a30e812ee4b098f345401df3c00e178
2014-03-25 19:28:54 -07:00
Jose Lima
92703e62c1 resolved conflicts for merge of 4882ddfa to master
Change-Id: I179899697c148ac34a67b195e2dbd3df2f9138de
2014-03-13 21:26:48 -07:00
Jose Lima
f78e312db2 Add banner attribute to app manifest
Change-Id: I28b0dc6dee9623ec7534bb0e741b88f439b48c9f
2014-03-12 18:07:38 -07:00
John Spurlock
8a985d24ce Tabs -> spaces in frameworks/base.
Change-Id: I5a84e8e93ac99b5ed0212b37bf66efa5e53864be
2014-02-25 09:49:29 -05:00
quddusc
ac6b332764 am e014eb63: am fc6b772f: am bf6d0797: am 2f1c2e32: am 3126ce6e: Merge "docs: Fixed typo in InstrumentationTestRunner page. Bug: 11386360" into klp-docs
* commit 'e014eb6368f380545113fc115a6002da2d124726':
  docs: Fixed typo in InstrumentationTestRunner page. Bug: 11386360
2014-01-16 00:47:37 +00:00
quddusc
e8df6f4d53 docs: Fixed typo in InstrumentationTestRunner page.
Bug: 11386360

Change-Id: I7626fe6fe1a22e223a8929ed3e5178c8df8966c9
2014-01-14 12:47:34 -08:00
John Spurlock
6090995951 Remove unused imports from frameworks/base.
Change-Id: Ia1f99bd2c1105b0b0f70aa614f1f4a67b2840906
2013-11-20 11:31:47 -05:00
Mathew Inwood
1804e258fa Set mServiceCreated to false when onDestroy().
If tests call shutdownService() themselves, we should not call onDestroy()
again from tearDown(). Set mServiceCreated to false when we call onDestroy
to prevent this.

Change-Id: I618cb770cb43072273abdd2fdffd3390911203a1
2013-10-22 17:39:37 +01:00
Jeff Sharkey
85f5f81320 Add <intent-filter> support to <provider>.
For the new documents work, we're only interested in the subset of
ContentProviders that actually implement DocumentsContract.  Instead
of returning all providers, add <intent-filter> support to make it
easier to limit the set of returned ProviderInfo.

Define a well-known action for DocumentsProviders, and start using it
when querying for roots.  Continue supporting the old <meta-data>
approach until all apps have been updated.

Bug: 8599233
Change-Id: I05f049bba21311f5421738002f99ee214447c909
2013-10-07 14:19:13 -07:00
Christopher Tate
a2a0850de8 Add hidden API for querying available 'home' activities
To support improved home-app selection UX in Settings.

Bug 9958444

Change-Id: I106090784618bf7bea6fce28f4f9b9fb8480d310
2013-09-13 12:16:00 -07:00
Dianne Hackborn
95d785346b Fix issue #10688644: Java crash in com.android.phone:
java.lang.SecurityException: Operation not allowed

There was a situation I wasn't taking into account -- components
declared by the system has a special ability to run in the processes
of other uids.  This means that if that code loaded into another
process tries to do anything needing an app op verification, it will
fail, because it will say it is calling as the system package name but
it is not actually coming from the system uid.

To fix this, we add a new Context.getOpPackageName() to go along-side
getBasePackageName().  This is a special call for use by all app ops
verification, which will be initialized with either the base package
name, the actual package name, or now the default package name of the
process if we are creating a context for system code being loaded into
a non-system process.

I had to update all of the code doing app ops checks to switch to this
method to get the calling package name.

Also improve the security exception throw to have a more descriptive
error message.

Change-Id: Ic04f77b3938585b02fccabbc12d2f0dc62b9ef25
2013-09-11 09:59:47 -07:00
Dianne Hackborn
38ed2a471a Work on issue #10130785: Restore silence and vibrate settings...
...in settings > sound

Add a new ContentProvider API to canonicalize URIs, so they can
be transported across backup/restore.

Change-Id: Ie5af3662f6822a32310e49c7f1e1ff084986c56e
2013-09-06 16:39:59 -07:00
Jeff Sharkey
bd3b902567 Add CancellationSignal support to file operations.
Since ContentProvider file operations can end up doing substantial
network I/O before returning the file, allow clients to cancel their
file requests with CancellationSignal.

Ideally this would only be needed for openFile(), but ContentResolver
heavily relies on openAssetFile() and openTypedAssetFile() for common
cases.

Also improve documentation to mention reliable ParcelFileDescriptors
and encourage developers to move away from "rw" combination modes,
since they restrict provider flexibility.  Mention more about places
where pipes or socket pairs could be returned.

Improve DocumentsContract documentation.

Bug: 10329944
Change-Id: I49b2825ea433eb051624c4da3b77612fe3ffc99c
2013-08-23 11:27:25 -07:00
Jeff Sharkey
7f392defcc Catch a few extra users of UserEnvironment.
Change-Id: I3112773b72c329893e4118ef1c4f4087d899139e
2013-08-11 17:42:17 -07:00
Amith Yamasani
655d0e2029 Single-user restrictions
Introduces a new "blocked" state for each package. This is used to temporarily
disable an app via Settings->Restrictions.

PIN creation and challenge activities for use by Settings and other apps. PIN
is stored by the User Manager and it manages the interval for retry attempts
across reboots.

Change-Id: I4915329d1f72399bbcaf93a9ca9c0d2e69d098dd
2013-06-25 16:03:55 -07:00
Craig Mautner
48d0d18867 Add activity token to display system.
First step in adding activity specific information to displays.
Replace CompatibilityInfoHolder with DisplayAdjustmentsHolder that
holds an activity token in addition to the CompatibilityInfo.

Change-Id: Ie113cd8dd9c62e0b5311204e039a4829096bea68
2013-06-22 15:30:13 -07:00
Dianne Hackborn
c87c92e079 Add API to retrieve cursor notification URI.
Change-Id: I89f6c4d6ee6ef3675eff62ff6bca691b54c69f75
2013-05-15 15:39:47 -07:00
Dianne Hackborn
334d9aebc2 New ContentProvider initialization for testing.
Using this turns off app ops checks.

Change-Id: If29d4ca2fe9ddf1a1663d3a824b2f0afe7375862
2013-02-26 16:16:14 -08:00
Jim Miller
a75a883fe9 Add explicit userId to AppWidget binder calls
Keyguard currently relies on being in the system process to grab the
given user's widgets.  When we split keyguard into a new process,
it will need to have access to user-specific info to instantiate a
specific user's widgets.  In order to accomplish this, we add an
explicit userid to each binder call as well as new permission
check to allow keyguard access.

This also fixes a potential race condition of having an incorrect user id
due to an async call to change the user.  Every binder call now has a specific
user id. The user id is either the calling process user's id or an explicit
one passed by applications like keyguard. It is created once when an
AppWidgetManager is instantiated and remains for the lifetime of the object.

Fixed bug where widgets sometimes didn't show up for secondary users.

Moved permission check in AppWidgetService into getImplForUser()

Refactored to use userid from context associated AppWidgetManager instance.

Clean up AppWidgetHost to use userId from Context.

Remove redundant userId check in checkPermission since it's handled by
ActivityManager.handleIncomingUser()

Removed redundant userid check.

Upload after rebase...

Change-Id: Iae3e20f2b342c323bb58768b3d22051510f8268b
2013-02-20 15:41:14 -08:00