946 Commits

Author SHA1 Message Date
Elliott Hughes
025148cc4d Explain why the frameworks/base DateUtilsTest isn't merged with CTS' DateUtilsTest.
Change-Id: Icbdb4e9133a9ae1c1b37f822367e1ac86e9e36cb
2013-03-07 14:30:17 -08:00
Wink Saville
b5a1ce2f5d Merge "Allow three digit phone numbers" 2013-02-20 23:04:32 +00:00
Wink Saville
1c2acdc6e8 Fix broken test.
Change-Id: I8c5649c9b3d917cf13b94d49da44eaf510643df6
2013-02-15 15:20:37 -08:00
Irfan Sheriff
46e0931080 Fix connectivitymanagertest
Change-Id: If5687eacec0f502c39b102eb5cf7d9383f0ec056
2013-02-15 14:55:15 -08:00
Bin Zhu
a37fc575a4 Allow three digit phone numbers
The comment for the PHONE pattern says:

"<digit><digit|sdd>+<digit>"

But the actual pattern requires that the string contains
more than that. A phone number should be allowed to be
three digits.

Change-Id: I86d2f3d634cd0c1654dad9814906f151055dc23a
2013-02-15 11:54:41 +01:00
Xia Wang
63d2581676 am 599f9611: am f3ef10b1: am 2297d1e7: Merge "Fix WiFi test:" into jb-mr1.1-dev
# Via Android Git Automerger (2) and others
* commit '599f9611aab587d13b4d7bac94fc628c675591a1':
  Fix WiFi test:
2013-01-30 19:01:14 -08:00
Xia Wang
f2991add02 Fix WiFi test:
-- In environment where there are too many APs, sometimes, the AP will not show in the scan list.
    Part of the reason is due to the change that the scanning on each frequency is shortened to save power.
    to avoid that, change the test to connect without scanning.

 -- Increase the timer to wait for WiFi to be connected

Change-Id: If1a72607b3c7ad13dbbf788607665986eaf5b6b3
2013-01-30 18:52:27 -08:00
Brian Carlstrom
bc7d5a55b2 am 537fb0af: Merge "Use most specific attributes for distinguished name display"
* commit '537fb0afe24a520e7b9a2442786b6fb4fe194392':
  Use most specific attributes for distinguished name display
2013-01-04 15:47:39 -08:00
Brian Carlstrom
91154ce658 Use most specific attributes for distinguished name display
Bug: 7894348
Bug: http://code.google.com/p/android/issues/detail?id=41662
Change-Id: I8048a53b8a9a17b384f12b6a4f40071bb3dd3e04
2013-01-04 15:27:24 -08:00
Jeff Sharkey
9f43afad9d am 68363456: am 7420ab68: Merge "Utility to format human-friendly durations." into jb-mr1.1-dev
* commit '68363456c1f360c0f1afe637a1f3028519e059ed':
  Utility to format human-friendly durations.
2012-11-15 11:54:43 -08:00
Jeff Sharkey
53f6e8a9b9 Utility to format human-friendly durations.
Bug: 6777872
Change-Id: Ie7ebcb456306f4f88b4707030dd7beda3fc90368
2012-11-13 17:26:39 -08:00
Kenny Root
58ed5d748c am 768d9e1a: Merge "Correct executable bit for source files"
* commit '768d9e1a72ceee7d4a5f608776b87b62d6ce4a04':
  Correct executable bit for source files
2012-11-07 11:52:12 -08:00
Kenny Root
3a084af2e9 Correct executable bit for source files
Many media files and source code files were marked as executable in Git.
Remove those.

Also a shell script and python script were not marked as executable.

Change-Id: Ieb51bafb46c895a21d2e83696f5a901ba752b2c5
2012-11-07 10:27:31 -08:00
Xia Wang
33185d4f68 am f1e32af5: am c86e8dff: Merge "Fix WiFi stress test" into jb-mr1-dev
* commit 'f1e32af5ae629a1a0f73ee12aa6390ea9e527d32':
  Fix WiFi stress test
2012-10-31 21:23:31 -07:00
Xia Wang
b2a2096903 Fix WiFi stress test
- Disable lock screen after screen is turned on.
   Without disabling lock screen, device will screen off automatically after around 10 seconds

 - Add a longer timer for ping test when the data traffic is stalled.
   For a short ping test, it is hard to tell whether it is a transient issue or a real issue.

   bug# 7426823

Change-Id: If1a560e11dcdff519562bb2a22651d1fd523b5a2
2012-10-31 17:03:23 -07:00
Adam Powell
a23f69a878 am 86e0d95d: Merge "Reattach header view after DPAD scroll."
* commit '86e0d95de1007d339af467c1484b09878ee528fc':
  Reattach header view after DPAD scroll.
2012-10-23 15:01:43 -07:00
Adam Powell
86e0d95de1 Merge "Reattach header view after DPAD scroll." 2012-10-23 14:04:19 -07:00
Kenny Root
a3e90798b7 Robustly add symlink and add for non-primary users
Amazingly, some apps still don't use the nativeLibraryPath. So add a lib
symlink for non-primary users to fix that.

Also, there was an error when the symlink existed that it would give up.
This shouldn't really happen, but in that case, just remove it and
create a new one to be safe.

Also, move the downgrade code to the appropriate place. This downgrade
case triggered the above symlink existing bug.

Bug: 7318366
Bug: 7371571
Change-Id: Ia175b36d98f00bdc2f2433b909aafd524eb34d15
2012-10-18 15:12:09 -07:00
Xia Wang
2ab453b52b Fix connectivity manager test for tablet with data connection, multi-user support
bug#7366674

Change-Id: Ibbb4becebfc833529e85d8a311366586c5ba54ee
2012-10-17 12:03:29 -07:00
Jeff Sharkey
9d0791bf6a Fix build, only invalidate when creating user.
Bug: 7276595
Change-Id: I322f9d76a682b2d45fc556e35381442458168fe5
2012-10-10 00:01:26 -07:00
Jeff Sharkey
6ab72d74b8 Make RegisteredServicesCache multi-user aware.
RegisteredServicesCache is used to track account authenticators and
sync adapters, which can vary based on user.  This change requires
that callers now provide a userId when making cache requests.  It
continues persisting into a single file for now, which is keyed based
on UID.

It now watches for package broadcasts from all users, and scans
packages on-demand.  It changes cache callers to provide a relevant
userId, and evicts cache entries when users are stopped.

Changes SyncManager to only work with accounts from running users,
only kicking off pending syncs once a user is started.

Bug: 7276595, 7316150
Change-Id: I79466a84aa69aa37e4bd9691c5d6221d3662ff29
2012-10-09 21:39:19 -07:00
Ben Gruver
9dbbfcda81 Merge "Pass the originating uid to the package verifier" into jb-mr1-dev 2012-09-28 10:58:19 -07:00
Jeff Sharkey
625239a054 Migrate more Secure settings to Global.
Migrate networking, storage, battery, DropBox, and PackageManager
related Secure settings to Global table.

Bug: 7232014, 7231331, 7231198
Change-Id: I772c2a9586a2f708c9db95622477f235064b8f4d
2012-09-27 16:22:53 -07:00
Ben Gruver
37d83a3caf Pass the originating uid to the package verifier
Bug: 6923241
Change-Id: I85a3e0d53b469543cb0551d3a440d2663b5d0697
2012-09-27 13:02:06 -07:00
Xia Wang
3272a38dbc Fix Wifi Stress test after wifi settings are moved to Settings.global
Change-Id: I823e99b39bc340683b686bb0dd43a473865656f0
2012-09-26 09:23:59 -07:00
Jeff Sharkey
4fbbda4cec Handle multi-user mountObb() requests.
Since emulated external storage paths differ based on execution
context, carefully fix up paths for various use-cases:

1. When sending paths to DefaultContainerService, always scope
   OBB paths as belonging to USER_OWNER.
2. When sending paths to vold, always build emulated storage paths
   visible to root.
3. Always use the original untouched path when talking with apps.

Mount OBB containers using shared app GID, so that an app can read
the mount point across users.

Handle legacy paths like "/sdcard" by resolving the canonical path
before sending to MountService.  Move tests to servicestests, and
add tests for new path generation logic.

Bug: 7212801
Change-Id: I078c52879cd08d9c8a52cc8c83ac7ced1e8035e7
2012-09-25 17:34:48 -07:00
Dianne Hackborn
50cdf7c306 Fix issue #7214090: Need to be able to post notifications to all users
Also fix a bunch of system services that should be doing this.  And
while doing that, found I needed to fix PendingIntent to evaluate
USER_CURRENT at the point of sending, not creation.

Note that this may end up with us having some notification shown to
non-primary users that lead to settings UI that should only be for
the primary user (such as the vpn notification).  I'm not sure what
to do about this, maybe we need a different UI to come up there or
something, but showing the actual notification for those users at
least seems less broken than not telling them at all.

Change-Id: Iffc51e2d7c847e3d05064d292ab93937646a1ab7
2012-09-24 10:55:46 -07:00
Tsu Chiang Chuang
6cc5d7fc0b Merge "fix broken user build: do not throw an error when in user flavor." into jb-mr1-dev 2012-09-20 15:35:00 -07:00
Tsu Chiang Chuang
0cfb73de1c fix broken user build: do not throw an error when in user flavor.
Change-Id: I43d210f1b342707acbdb79f9ef6c924b43684dd3
2012-09-20 15:27:23 -07:00
Tsu Chiang Chuang
c1ec220c4b Merge "Change the way how airplane mode is set, since it has been moved to Settings.Global namespace. Also run as a system app, since only system apps can change airplane mode." into jb-mr1-dev 2012-09-20 15:04:10 -07:00
Tsu Chiang Chuang
35fae68cc3 Change the way how airplane mode is set, since it has been moved to
Settings.Global namespace. Also run as a system app, since only system
apps can change airplane mode.

Change-Id: I317f9c94361cfca182356fd292e5b0b41553d1ab
2012-09-20 14:58:48 -07:00
Jeff Sharkey
daa57e8d18 Migrate network stats from removed users.
When a user is removed, migrate all network stats belonging to that
user into special UID_REMOVED bucket.  Also removes those stats from
kernel to avoid double-counting if another user is created.

Bug: 7194784
Change-Id: I03f1d660fe3754566326b7749cae8068fc224ea9
2012-09-19 14:54:05 -07:00
Geremy Condra
fd5a80f6e9 Code cleanup for X509TrustManagerExtensionsTest.java
Change-Id: I85584f7a9dbc726be811f783d125efcf70c9f6af
2012-09-18 14:44:54 -07:00
Geremy Condra
cb4c581975 Fix bad isinstance check in X509TrustManagerExtensions and add test.
Change-Id: I333957186655b2543a637dafa8c51b0bba9d4dfb
2012-09-18 13:43:32 -07:00
Christopher Tate
16aa973617 Per-user content observer APIs
Callers with INTERACT_ACROSS_USERS_FULL permission can now observe content
for a given user's view (and can notify content uri changes targeted to a
specific user).  An observer watching for UserHandle.USER_ALL will see all
notifications for the given uri across all users; similarly, a notifier
who specifies USER_ALL will broadcast the change to all observers across
all users.

The API handles both USER_ALL or USER_CURRENT, and explicitly forbids
any other "pseudouser" designations.

This CL also revs the Settings provider to notify with USER_ALL for
changes to global settings, and with only the affected user's handle
for all other changes.

Bug 7122169

Change-Id: I94248b11aa91d1beb0a36432e82fe5725bb1264f
2012-09-17 16:35:36 -07:00
Kenny Root
e15bdc2da4 Add test for failed dexopt
Bug: 7010829
Change-Id: Ie0616ff2c3739ad73733857de6d04243b2be2fca
2012-09-16 16:25:51 -07:00
rich cannings
13d428e830 Send more information to verifiers
Send package name, version code and the uid of the application requesting the
install to package verifiers.

Bug: 7164155
Change-Id: I2464dc5d4551f60b4f38f7982495a8920c83e1cd
2012-09-14 14:25:52 -07:00
Christopher Tate
78d2a66ac1 Fix Settings writes to a different user
Oops.  Stacked bugs:  first, the desired user handle was not properly
being passed from the call() entry point to the database operations;
then on top of that, the client-side cache management was still
looking in the local user's cache for the data, so a request to read
a different user's settings would return the local user's instead if
that key was already known to the local user's cache.

Reads and writes of a different user's settings are now uncached,
so they're relatively much slower.  They're rare, however, so this
is not something to worry about unless we encounter a real world
case where it's a significant factor.

This CL also adds a bit of cross-user settings read/write testing
to the existing provider suite.  These new tests caught both the
known wrong-user-write bug and discovered the client-side cache
bug, so yay.

Finally, the existing wholesale mutual-exclusion approach would
deadlock in certain circumstances due to the fact that the
settings database creation code might have to call out to the
Package Manager while populating the bookmark/shortcut table,
and the Package Manager would then call back into the settings
provider in the course of handling that request.  The synchronization
regime has been significantly tightened up now: now the database
code [which is known to deal with concurrency itself] is allowed
to cope with multiple parallel openers of the same db; this
allows the settings provider to avoid calling out to other parts
of the system even implicitly while its internal lock is held.

Change-Id: Ib77d445b4a2ec658cc5c210830f6977c981f87ed
2012-09-13 19:15:54 -07:00
Mattias Niklewski
158d6b70ac Reattach header view after DPAD scroll.
A header view that was scrolled off screen using the DPAD would not be
reattached properly when scrolled back into view, due to the flag
recycledHeaderFooter. Solved this by using detachViewFromParent()
instead of removeViewInLayout(). Compare to
AbsListView.trackMotionScroll().

Change-Id: I0ac0ec0f9bf23bc62430c1f62ae7d1a8570b0a24
2012-09-11 14:18:23 +02:00
Christopher Tate
4e2eb6581f Merge "Update airplane-mode manipulation for the new Settings namespace" into jb-mr1-dev 2012-09-10 17:16:17 -07:00
Christopher Tate
c09cdce1b0 Update airplane-mode manipulation for the new Settings namespace
Quick Settings and global actions (aka longpress-Power) toggles are
included in this CL.  The Settings app manipulations are updated in
a different CL because that's a different git package.

Bug 7132230

Change-Id: I50838f5e8d7b25a750d2bcae90bf384b09816dbb
2012-09-10 16:50:57 -07:00
Kenny Root
ddbe50df2c Move native libraries to /data/app-lib
Instead of unpacking libraries into /data/data/<appname>/lib, unpack
them into /data/app-lib so that multi-user applications can use the same
libraries.

Change-Id: I636dafb5a9eea8cf5a41f1360698e7695455f385
2012-09-10 11:54:36 -07:00
Kenny Root
e64e097147 Add a native library to test APKs
In order to make sure we have unpacking and deletion working, add a fake
JNI library to every APK.

This can be expanded in the future to make sure replacement is working
correctly as well.

Change-Id: I1ad04c61df9518429aa17795b8a9d3608791cd8e
2012-09-09 15:12:16 -07:00
Kenny Root
7e921a157d Add more testing for native libraries
Make sure that native library paths have the correct permissions and
owners. Also make it easier to do a "String#startsWith" test so we can
get better errors when it fails.

Change the observer to have more sane semantics with a CountDownLatch
instead of weird synchronization on a local variable.

Change-Id: I2437e5ea886d6e6cb8b4edeab80d6053b79857d4
2012-09-09 15:12:16 -07:00
Kenny Root
25c925e665 Throw ALL the exceptions! (in the PackageManagerTests)
Change all the test method headers to throw Exception so we don't have
to try to catch anything during the tests. Catching an exception might
mask an error during the tests.

Also fix a lot of formatting errors that have built up over the years.
This includes 3-space indentations instead of 4-space, missing spaces
between braces and parens, too-long lines, wrapping when it isn't
needed, etc.

Change-Id: Ifccea5f0706b6f9235f37974a5f80bee76c654dd
2012-09-09 12:32:03 -07:00
Nick Kralevich
7de350a913 installd: fix forward locking symlink
installd was not creating a compatibility symlink when
installing a forward locked application.  Fix.

Bug: 7121527
Change-Id: Ied507ab2b759d8658af563e6ac8f0dbb0d286cce
2012-09-07 15:48:11 -07:00
Dianne Hackborn
4120375d46 Remove Binder.getOrigCallingUid().
Replaced all remaining places that used it with explicit user
specification.

While doing this, I ran into stuff that was creating PendingIntent
objects (that now need to specify the explicit user they are for),
which are also posting notifications...  but have no way to specify
the user for the notification.

So the notification manager in the system process now also gets a
formal concept of a user associated with the notification, which
is passed in to all the necessary aidl calls.  I also removed the
old deprecated aidl interface for posting/cancelling notifications,
since we now always need a user supplied.

There is more work that needs to be done here, though.  For example
I think we need to be able to specify USER_ALL for a notification that
should be shown to all users (such as low storage or low battery).
Along with that, the PendingIntent creation needs to be tweaked to
be able to handle USER_CURRENT by evaluating the user at the point the
pending intent is sent.

That's for another change, however.

Change-Id: I468e14dce8def0e13e0870571e7c31ed32b6310c
2012-08-31 15:11:13 -07:00
Dianne Hackborn
5ac72a2959 Improve multi-user broadcasts.
You can now use ALL and CURRENT when sending broadcasts, to specify
where the broadcast goes.

Sticky broadcasts are now correctly separated per user, and registered
receivers are filtered based on the requested target user.

New Context APIs for more kinds of sending broadcasts as users.

Updating a bunch of system code that sends broadcasts to explicitly
specify which user the broadcast goes to.

Made a single version of the code for interpreting the requested
target user ID that all entries to activity manager (start activity,
send broadcast, start service) use.

Change-Id: Ie29f02dd5242ef8c8fa56c54593a315cd2574e1c
2012-08-30 14:33:22 -07:00
Dianne Hackborn
7767eac323 Keep track of whether an app is installed for each user.
This add a new per-user state for an app, indicating whether
it is installed for that user.

All system apps are always installed for all users (we still
use disable to "uninstall" them).

Now when you call into the package manager to install an app,
it will only install the app for that user unless you supply
a flag saying to install for all users.  Only being installed
for the user is just the normal install state, but all other
users have marked in their state for that app that it is not
installed.

When you call the package manager APIs for information about
apps, uninstalled apps are treated as really being not visible
(somewhat more-so than disabled apps), unless you use the
GET_UNINSTALLED_PACKAGES flag.

If another user calls to install an app that is already installed,
just not for them, then the normal install process takes place
but in addition that user's installed state is toggled on.

The package manager will not send PACKAGE_ADDED, PACKAGE_REMOVED,
PACKAGE_REPLACED etc broadcasts to users who don't have a package
installed or not being involved in a change in the install state.
There are a few things that are not quite right with this -- for
example if you go through a full install (with a new apk) of an
app for one user who doesn't have it already installed, you will
still get the PACKAGED_REPLACED messages even though this is
technically the first install for your user.  I'm not sure how
much of an issue this is.

When you call the existing API to uninstall an app, this toggles
the installed state of the app for that user to be off.  Only if
that is the last user user that has the app uinstalled will it
actually be removed from the device.  Again there is a new flag
you can pass in to force the app to be uninstalled for all users.

Also fixed issues with cleaning external storage of apps, which
was not dealing with multiple users.  We now keep track of cleaning
each user for each package.

Change-Id: I00e66452b149defc08c5e0183fa673f532465ed5
2012-08-24 13:53:13 -07:00
Dianne Hackborn
0c38049502 Improve multi-user app management.
Introduce API to get per-user storage information, keep track
of services associated with users, and various small cleanup.

Change-Id: I5d4e784e7ff3cccfed627d66a090d2f464202634
2012-08-21 10:34:20 -07:00