310 Commits

Author SHA1 Message Date
Dianne Hackborn
7d19e0242f More mult-user API work.
- You can now use android:singleUser with receivers and providers.
- New API to send ordered broadcasts as a user.
- New Process.myUserHandle() API.

For now I am trying out "user handle" as the name for the numbers
representing users.

Change-Id: I754c713ab172494bb4251bc7a37a17324a2e235e
2012-08-07 19:19:22 -07:00
Scott Main
b53e9b42c3 am a8583c29: am 40eee61e: docs: fix broken links and update sitemap text file
* commit 'a8583c2934836572632bb82d1fe7607392d4ca72':
  docs: fix broken links and update sitemap text file
2012-08-07 14:05:28 -07:00
Scott Main
40eee61e25 docs: fix broken links
and update sitemap text file

Change-Id: I6982c3f029c46135ae856b8484d906c2882bad3a
2012-08-06 18:04:23 -07:00
Dianne Hackborn
329465c6b2 Merge "Add APIs for interacting across users." into jb-mr1-dev 2012-08-02 19:14:39 -07:00
Dianne Hackborn
b4163a6e12 Add APIs for interacting across users.
- Expose the existing Context.sendBroadcast() as
  Context.sendBroadcastAsUser().
- Add new android:singleUser attribute for services.
- Add new INTERACT_ACROSS_USERS_FULL permission for full
  system-level access to cross-user interface (allows
  sendBroadcastAsUser() to send to any receiver).
- Add new INTERACT_ACROSS_USERS_FULL permission for
  more restricted cross-user interaction: this is required
  for android:singleUser, and allows you to use
  sendBroadcastAsUser() but only to send to your own
  receivers.

Change-Id: I0de88f6718e9505f4de72e3f45d29c0f503b76e9
2012-08-02 19:07:57 -07:00
rich cannings
24713907fe Pass URLs to package verifiers
This change passes the originating URL and accompanied referrer to
package verifiers, when available.

Bug: 6544677
Change-Id: If9ff6663ad7f3426b7aea2aceb1413b689788138
2012-08-02 11:26:47 -07:00
Scott Main
54da5b5d68 am dd4448ef: am 32189e26: Merge "misc doc bug fixes" into jb-dev
* commit 'dd4448ef6807f096cdfdf632857baefd7cbc85ec':
  misc doc bug fixes
2012-07-25 15:05:39 -07:00
Jeff Smith
ddd88726a2 am 71930dd7: am a45746ef: Fix several cases of broken droiddoc syntax external issue 35214
* commit '71930dd77e4dc6f6be5c648019d2ab0da5f0584c':
  Fix several cases of broken droiddoc syntax external issue 35214
2012-07-25 15:05:23 -07:00
Scott Main
32189e260c Merge "misc doc bug fixes" into jb-dev 2012-07-25 11:52:51 -07:00
Jeff Smith
a45746efad Fix several cases of broken droiddoc syntax
external issue 35214

patch contributed by Jeff Smith <whydoubt@yahoo.com>

Change-Id: I70dcee88a140699bf3e1ab369bed6dcd2fdd3d83
2012-07-25 10:49:25 -07:00
Scott Main
fe3b1cb27d misc doc bug fixes
Change-Id: I68963d79422e5cedb1726e91e9639860b13a2471
2012-07-24 18:13:11 -07:00
Scott Main
adba6ffbb9 am 101a120c: am 9be0105f: docs: fix several links
* commit '101a120c27f68fb7d44e6221244cb9441dfc4285':
  docs: fix several links
2012-06-22 13:35:52 -07:00
Scott Main
9be0105fbc docs: fix several links
Change-Id: I89d9fd64dc22c90680bb05415cc966c255165af9
2012-06-22 12:35:08 -07:00
Amith Yamasani
b8151ecd6e Add an icon to the user information.
Store the icon in the user folder under /data/system,
similar to how the wallpaper is stored.

Change-Id: Id8ccb55b9e2ba7b4c557505a7f69f04eca1518cf
2012-06-12 18:18:29 -07:00
Dianne Hackborn
ce783749b1 am f3b4c93e: am ae5811c7: Merge "Fix (mostly) issue #5109947: Race condition between retrieving a..." into jb-dev
* commit 'f3b4c93e0da9af2db9e16864faa734cf70fecfe3':
  Fix (mostly) issue #5109947: Race condition between retrieving a...
2012-05-29 15:57:52 -07:00
Dianne Hackborn
6ae8d18218 Fix (mostly) issue #5109947: Race condition between retrieving a...
...content provider and updating its oom adj

This introduces the concept of an "unstable" reference on a content
provider.  When holding such a reference (and no normal stable ref),
the content provider dying will not cause the client process to be
killed.

This is used in ContentResolver.query(), .openAssetFileDescriptor(),
and .openTypedAssetFileDescriptor() to first access the provider
with an unstable reference, and if at the point of calling into the
provider we find it is dead then acquiring a new stable reference
and doing the operation again.  Thus if the provider process dies
at any point until we get the result back, our own process will not
be killed and we can safely retry the operation.

Arguably there is still the potential for a race -- if somehow the
provider is killed way late by the OOM killer after the query or
open has returned -- but this should now be *extremely* unlikely.
We also continue to have the issue with the other calls, but these
are much less critical, and the same model can't be used there (we
wouldn't want to execute two insert operations for example).

The implementation of this required some significant changes to the
underlying plumbing of content providers, now keeping track of the
two different reference counts, and managing them appropriately.  To
facilitate this, the activity manager now has a formal connection
object for a client reference on a content provider, which hands to
the application when opening the provider.

These changes have allowed a lot of the code to be cleaned up and
subtle issues closed.  For example, when a process is crashing, we
now have a much better idea of the state of content provider clients
(olding a stable ref, unstable ref, or waiting for it to launch), so
that we can correctly handle each of these.

The client side code is also a fair amount cleaner, though in the
future there is more than should be done.  In particular, the two
ProviderClientRecord and ProviderRefCount classes should be combined
into one, part of which is exposed to the ContentResolver internal
API as a reference on a content provider with methods for updating
reference counts and such.  Some day we'll do that.

Change-Id: I87b10d1b67573ab899e09ca428f1b556fd669c8c
2012-05-29 13:33:09 -07:00
Brett Chabot
1b953b8fbf Merge "Delete duplicate copies of junit source." 2012-05-11 11:14:42 -07:00
Dianne Hackborn
652b6d1e59 Add infrastructure for accessing "unstable" content providers.
We have an API and some stuff that purports to this, but no real
implementation yet.

Change-Id: I93555440014a50fdf79fa3f65318d90fb82265b4
2012-05-09 18:18:40 -07:00
Brett Chabot
a0b2786304 Delete duplicate copies of junit source.
Bug 5826326

Change-Id: Ie361b3778076686c5a59d8392aadb8c86a9ae981
2012-05-09 18:08:31 -07:00
Jeff Brown
947f1c8db0 Merge "Move CancellationSignal to android.os package." into jb-dev 2012-05-08 10:51:12 -07:00
Jeff Brown
a7771df369 Move CancellationSignal to android.os package.
Bug: 6427830
Change-Id: I39451bb1e1d4a8d976ed1c671234f0c8c61658dd
2012-05-07 20:06:46 -07:00
Anonymous Coward
ceb1b0bfae Add encryption parameters to package installation
Change-Id: Ic9f8ab9f8110f08bb3c00725cfce5b8ee7b766f3
2012-05-07 16:34:49 -07:00
Brett Chabot
f1253cd68a Upgrade junit.runner classes to their JUnit4.10 implementation.
Bug 5826326

Change-Id: If7e4c48a4369c1056dee5a2049c891bb6ab7d8d0
2012-04-11 19:01:30 -07:00
Brian Muramatsu
87571b75e6 Try Alternate Constructor for Single Method Tests
Some tests do not have a no argument constructor. If they don't
have one, then try a constructor with a String argument. A lot
of CTS tests from open source projects have different practices
and may not have a no arg constructor.

Change-Id: I87c490c22347a2f4b03c3125308be0d2259f9208
2012-04-03 11:46:56 -07:00
Amith Yamasani
135936072b User management and switching
Broadcast intents that get sent out when users are added/removed/switched.

More work on generating user-specific information in package manager queries.
APIs to update user name and query a user by id.
Removed Package.mSetStopped and mSetEnabled, since they're not user specific.

User removal:
- Cleanup ActivityManager, PackageManager, WallpaperManager, AppWidgetService
  and AccountManager.
- Shutdown processes belonging to the user.

Don't show vibrate option in long-press power if there's no vibrator.

Lock the screen when switching users, to force unlocking.

Change-Id: Ib23a721cb75285eef5fd6ba8c7272462764038fa
2012-03-27 11:23:01 -07:00
David Hu
b2e822fc2a Remove unused BandwidthTestRunner
Change-Id: I5d77682cf662cc88e3d182501c78bb77805e74d1
2012-03-19 21:03:35 -07:00
David Hu
ca4aab9cd7 BandwidthTestCase
A test case that measures bandwidth metrics when annotated with
android.test.BandwidthTest and adds the metrics to the status bundle

Change-Id: I085110c66c7fcf651aefeeac3d4cdf5bd438ff67
2012-03-19 18:33:58 -07:00
Dianne Hackborn
a4972e951b Add new "options" argument to all startActivity APIs.
This will be used to allow new features to be requested...  such as,
say, a special kind of animation.  Right now there are no options
defined.

Change-Id: I4eb6f27275cdd4bf186f6da316ab93a2372ad4b7
2012-03-14 12:57:14 -07:00
Dianne Hackborn
e639da7baa New development permissions.
These are permissions that an application can request, but won't
normally be granted.  To have the permission granted, the user
must explicitly do so through a new "adb shell pm grant" command.

I put these permissions in the "development tools" permission
group.  Looking at the stuff there, I think all of the permissions
we already had in that group should be turned to development
permissions; I don't think any of them are protecting public APIs,
and they are really not things normal applications should use.

The support this, the protectionLevel of a permission has been
modified to consist of a base protection type with additional
flags.  The signatureOrSystem permission has thus been converted
to a signature base type with a new "system" flag; you can use
"system" and/or "dangerous" flags with signature permissions as
desired.

The permissions UI has been updated to understand these new types
of permissions and know when to display them.  Along with doing
that, it also now shows you which permissions are new when updating
an existing application.

This also starts laying the ground-work for "optional" permissions
(which development permissions are a certain specialized form of).
Completing that work requires some more features in the package
manager to understand generic optional permissions (having a
facility to not apply them when installing), along with the
appropriate UI for the app and user to manage those permissions.

Change-Id: I6571785c6bb5f6b291862b7a9be584885f88f3a5
2012-02-23 16:39:15 -08:00
Amith Yamasani
67cf7d314b Fix Power Control widget
Some changes in AppWidgetService were interfering with widget permissions.

Added some hidden methods in Context to communicate the requesting user
information instead of using the calling uid.

Bug: 6019296
Change-Id: I5e519fd3fbbfa5b3fcc5c297b729c671dac8e7c7
2012-02-16 15:03:42 -08:00
Amith Yamasani
37ce3a8af6 Multi-user - wallpaper service
- Allow each user to have their own wallpaper (live or static).
- Migrate old wallpaper on upgrade.
- Update SystemBackupAgent to backup/restore from primary user's
  new wallpaper directory.

Reduce dependency on Binder.getOrigCallingUser() by passing the
userId for bindService.

Change-Id: I19c8c3296d3d2efa7f28f951d4b84407489e2166
2012-02-10 14:34:07 -08:00
Jeff Brown
4c1241df8f Rename CancellationSignal using preferred spelling.
Bug: 5943637
Change-Id: I12a339f285f4db58e79acb5fd8ec2fc1acda5265
2012-02-02 18:02:16 -08:00
Jeff Brown
75ea64fc54 Implement a cancelation mechanism for queries.
Added new API to enable cancelation of SQLite and content provider
queries by means of a CancelationSignal object.  The application
creates a CancelationSignal object and passes it as an argument
to the query.  The cancelation signal can then be used to cancel
the query while it is executing.

If the cancelation signal is raised before the query is executed,
then it is immediately terminated.

Change-Id: If2c76e9a7e56ea5e98768b6d4f225f0a1ca61c61
2012-01-27 17:33:21 -08:00
David Hu
0df0ed5814 Merge "BandwidthTestRunner" 2012-01-05 14:39:45 -08:00
Joe Fernandez
3aef8e1d1b docs: Add developer guide cross-references, Project ACRE, round 4
Change-Id: I1b43414aaec8ea217b39a0d780c80a25409d0991
2011-12-22 15:08:23 -08:00
David Hu
8cc9a8e132 BandwidthTestRunner
Added BandwidthTest annotation and BandwidthTestRunner to start
and stop the network traffic profiler

Change-Id: Id29ac21ab99ff36bd864121276db59b61eb6e154
2011-12-14 22:43:58 -08:00
Jeff Brown
d2183654e0 Fix ownership of CursorWindows across processes.
Bug: 5332296

Ensure that there is always an owner for each CursorWindow
and that references to each window are acquired/released
appropriately at all times.

Added synchronization to CursorToBulkCursorAdaptor to
prevent the underlying Cursor and CursorWindow from being
remotely accessed in ways that might violate invariants,
resulting in leaks or other problems.

Ensured that CursorToBulkCursorAdaptor promptly releases
its references to the Cursor and CursorWindow when closed
so they don't stick around longer than they should, even
if the remote end hangs onto the IBulkCursor for some reason.

CursorWindow respects Parcelable.FLAG_WRITE_RETURN_VALUE
as an indication that one reference to the CursorWindow is
being released.  Correspondingly, CursorToBulkCursorAdaptor
acquires a reference to the CursorWindow before returning
it to the caller.  This change also prevents races from
resulting in the transfer of an invalid CursorWindow over
the wire.

Ensured that BulkCursorToCursorAdaptor promptly releases
its reference to the IBulkCursor when closed and throws
on attempts to access the cursor while closed.

Modified ContentProviderNative to handle both parts of
the wrapping and unwrapping of Cursors into IBulkCursors.
This makes it a lot easier to ensure that the right
things happen on both ends.  Also, it turns out that
the only caller of IContentProvider.bulkQuery was
ContentProviderNative itself so there was no need
to support bulkQuery on ContentProviderProxy and it was
just getting in the way.

Implement CloseGuard on CursorWindow.

Change-Id: Ib3c8305d3cc62322f38a06698d404a2989bb6ef9
2011-10-09 22:10:36 -07:00
Kenny Root
05ca4c9064 Allow non-required package verifiers
* Verifiers can be specified in the AndroidManifest.xml

* Those verifiers can respond to the new Intent action

* PackageManager API for those verifiers: verifyPendingInstall

Change-Id: I4892bce2e6984871e6e93c60a1ca0dae145f5df5
2011-09-23 16:03:03 -07:00
Kenny Root
0d3647dc00 am 9c711282: Merge "Unhide new PackageManager APIs for API 14" into ics-factoryrom
* commit '9c711282ad234e104c34eb4408d85fc1bb149ded':
  Unhide new PackageManager APIs for API 14
2011-09-21 18:56:52 -07:00
Kenny Root
3a9b5fbb97 Unhide new PackageManager APIs for API 14
Change-Id: I83110285ccee39a4cd872a1c2af8357f541833d4
2011-09-20 14:35:10 -07:00
David Hu
97567340a4 Merge "Return the bundle object" 2011-09-19 12:11:11 -07:00
David Hu
cbc584d7eb Return the bundle object
Added the ability for the test runner to return the bundle object
so the tests can get access to input arguments

Change-Id: I73a704bb2279238bd91a376aacecbe5f607af649
2011-09-19 11:33:45 -07:00
Kenny Root
0aaa0d9317 Add verifier device identity
This adds a special device identifier that is usable only for device
validation. The user will be presented with this number encoded in
easily-transcribable Base32 in the Developer options of Settings.

Change-Id: I4843f55ee90d689a51d0269b22454ca04c1be7ec
2011-09-13 16:02:43 -07:00
Jesse Wilson
c69efa5efc Remove frameworks' reference to an obsolete Bouncycastle keystore file.
Without this, some SSL code fails with an exception:
java.io.FileNotFoundException: /system/etc/security/cacerts.bks: open failed: ENOENT (No such file or directory)
at libcore.io.IoBridge.open(IoBridge.java:410)
at java.io.FileInputStream.<init>(FileInputStream.java:78)
at java.io.FileInputStream.<init>(FileInputStream.java:105)
at org.apache.harmony.xnet.provider.jsse.DefaultSSLContextImpl.getTrustManagers(DefaultSSLContextImpl.java:115)
at org.apache.harmony.xnet.provider.jsse.SSLContextImpl.<init>(SSLContextImpl.java:71)
at org.apache.harmony.xnet.provider.jsse.OpenSSLContextImpl.<init>(OpenSSLContextImpl.java:34)
at org.apache.harmony.xnet.provider.jsse.DefaultSSLContextImpl.<init>(DefaultSSLContextImpl.java:59)
at java.lang.Class.newInstanceImpl(Native Method)
at java.lang.Class.newInstance(Class.java:1319)
at java.security.Provider.newInstance(Provider.java:989)
... 15 more
Caused by: libcore.io.ErrnoException: open failed: ENOENT (No such file or directory)
at libcore.io.Posix.open(Native Method)
at libcore.io.BlockGuardOs.open(BlockGuardOs.java:98)
at libcore.io.IoBridge.open(IoBridge.java:393)
... 24 more

Change-Id: I91de30746c1355ff9e0c2a9479392a50fe45aa23
2011-09-07 14:52:12 -04:00
Kenny Root
5ab2157bf1 Infrastructure to support package verifier
Allow a package verifier to approve or disapprove of a package being
installed.

Change-Id: Ibfea0f2b1aaa4ab1589a4e59f96144702b9bf94b
2011-08-15 17:26:31 -07:00
Rodrigo Damazio Bovendorp
3fe3f7328f Fixing initialization cleanup in activity instrumentation test case
Change-Id: I798fed657ccdc27430edc07d1e911b34c45426b5
2011-08-01 17:10:58 -03:00
Brett Chabot
877d428e39 Test runner cleanup: delete unused old classes.
Change-Id: Iaaabd47d4074f936a811fc1b6575088d70842564
2011-06-01 20:03:39 -07:00
Dianne Hackborn
44bc17c6b5 Rework display size access.
Applications now get the display size from the window manager.  No
behavior should be changed yet, this is just prep for some real
changes.

Change-Id: I2958a6660895c1cba2b670509600014e55ee9273
2011-04-21 15:17:52 -07:00
Amith Yamasani
beb182a494 Merge "Package manager changes to store and update user information." 2011-04-11 12:14:17 -07:00
Amith Yamasani
4b2e934928 Package manager changes to store and update user information.
Some API stubs for managing users and storing their details.
List of users is stored in an xml file.
Each user's properties are stored in a separate xml file.

Some unit tests for modifying the XML files.

Change-Id: If2ce2420723111bd426f6762def3c2afc19a0ae5
2011-04-11 12:12:58 -07:00