130 Commits

Author SHA1 Message Date
Amith Yamasani
e4cf73437a Starting point for User Restrictions API
Restrictions saved as key/value pairs, mostly booleans right now
but might be expanded to other types later.

Save and restore restrictions in the user manager service.
Enforce some of the restrictions at the framework level. Some
are enforced (also) at the app level, such as in Settings.

Change-Id: Id11ffe129cb6a177e094edf79635727388c26f40
2013-02-08 15:52:47 -08:00
Dianne Hackborn
f265ea9d83 App ops: vibration, neighboring cells, dialing, etc.
Improve handling of vibration op, so that apps are
better blamed (there is now a hidden vibrator API that
supplies the app to blame, and the system now uses this
when vibrating on behalf of an app).

Add operation for retrieving neighboring cell information.

Add a new op for calling a phone number.  This required
plumbing information about the launching package name through
the activity manager, which required changing the internal
startActivity class, which required hitting a ton of code that
uses those internal APIs.

Change-Id: I3f8015634fdb296558f07fe654fb8d53e5c94d07
2013-02-01 15:14:29 -08:00
Dianne Hackborn
d4d9364019 Maybe fix build.
Change-Id: Ibad8edb15e7cc332d6c29958a386d32a96f4e755
2013-01-29 16:12:48 -08:00
Jeff Sharkey
56dc0e02fc Merge "Tests to assert correct January behavior." 2013-01-23 01:35:21 +00:00
Jeff Sharkey
1539905b46 Tests to assert correct January behavior.
Change-Id: I162102b6f1b892b79e2f5b96cb0184abb85d00bc
2013-01-22 17:32:53 -08:00
Sasha Levitskiy
ca6486e7f5 Removed Throttle Manager as obsolete
Change-Id: I63e8514f34c880d0badaab33a347f54a80c84da6
2013-01-14 16:59:33 -08:00
Amith Yamasani
03cb98aecf Move Observer test to servicetests
Change-Id: Ib3493af4eb3185db79004a3cad5473161ed51f71
2012-12-11 11:15:25 -08:00
Amith Yamasani
e03c17f1cb Merge "Move one more test." 2012-12-11 11:08:06 -08:00
Amith Yamasani
814a8d35ae Move one more test.
Change-Id: Iea0e0b5727746f2332db2ab1c1b216326eb50f13
2012-12-11 11:06:21 -08:00
Amith Yamasani
8ff9a156c0 Fix build. Forgot to move this test.
Change-Id: I06aab8ec6e2dac86b65bbeed3587444260fec2e8
2012-12-11 10:42:09 -08:00
Jeff Sharkey
7a96c39c51 Move lingering services to services.jar.
This helps reduce the pressure on framework.jar, and makes it clear
that it should only be used by the system_server.

Bug: 7333397
Change-Id: I0858904239535380fbf30562b793e277d8c3f054
2012-12-11 09:50:50 -08:00
Dianne Hackborn
b2e18e91ec am b443ddbb: am 2c41c4a2: Fix build.
* commit 'b443ddbbc7f1c7ed2d30310f80323cd4a5bf3e8d':
  Fix build.
2012-11-29 14:26:45 -08:00
Dianne Hackborn
b443ddbbc7 am 2c41c4a2: Fix build.
* commit '2c41c4a2766dcce506fc0e9e361fc8198553293c':
  Fix build.
2012-11-28 19:48:57 -08:00
Dianne Hackborn
2c41c4a276 Fix build.
Change-Id: Icc1f2913b4e889609066b0ff1dddcd9be0230897
2012-11-28 18:46:45 -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
Amith Yamasani
283d1409dd am f624d72c: am 8074e98b: Merge "Fix crashes when quickly adding and removing users" into jb-mr1-dev
* commit 'f624d72cb0fe40fd5748d4f0d1a93bf267aa3ed8':
  Fix crashes when quickly adding and removing users
2012-10-21 07:50:55 -07:00
Amith Yamasani
f624d72cb0 am 8074e98b: Merge "Fix crashes when quickly adding and removing users" into jb-mr1-dev
* commit '8074e98b20ac04fdc032a1ed00dd6763b7e04147':
  Fix crashes when quickly adding and removing users
2012-10-21 07:48:02 -07:00
Amith Yamasani
db6a14cc85 Fix crashes when quickly adding and removing users
Make USER_REMOVED an ordered broadcast and send it before the user's
state is completely removed from the system. This gives services the
opportunity to clean up their state, while still having access to the
user's directory and UserInfo object (such as serial number).

Tell SyncManager to skip over dying/partially created users.

Improve UserManager tests, waiting for users to be removed fully.

Bug: 7382252

Change-Id: I93cfb39c9efe6f15087bf83c569a2d154ef27168
2012-10-19 16:23:30 -07:00
Jeff Sharkey
ae1af49a91 am 3a8af8ef: Merge "Migrate more Secure settings to Global." into jb-mr1-dev
* commit '3a8af8efff93ca8ee80fc8c7841e7bee9a8b7786':
  Migrate more Secure settings to Global.
2012-09-27 19:34:28 -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
Jeff Sharkey
031c410adc am 68b7a6d1: Merge "First step towards cleaning up Global settings." into jb-mr1-dev
* commit '68b7a6d14b68b38324ffd275c7227805c7d99b2d':
  First step towards cleaning up Global settings.
2012-09-26 20:19:32 -07:00
Jeff Sharkey
bdfce2ec05 First step towards cleaning up Global settings.
Remove all @Deprecated @hide settings, and clean up any stragglers.

Bug: 7232125
Change-Id: Ibf67093c728d4a28565129b923edb1701d3b2789
2012-09-26 17:18:49 -07:00
Jeff Sharkey
558f6d654f am 6e065a72: Merge "Handle multi-user mountObb() requests." into jb-mr1-dev
* commit '6e065a729dbf08f99209a7710da80442a394ec0d':
  Handle multi-user mountObb() requests.
2012-09-25 17:53:35 -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
Svetoslav Ganov
31a2b8c7bf am 0a5c5567: Merge "Multi-user support for the accessibility layer." into jb-mr1-dev
* commit '0a5c5567f2d7e203d95c80a8d3353d0acd98b5f9':
  Multi-user support for the accessibility layer.
2012-09-21 17:50:51 -07:00
Svetoslav Ganov
58d37b55bd Multi-user support for the accessibility layer.
1. This change converts the accessibility manager service to
   maintain a state per user. When the user changes the services
   for the user that is going away are disconnected, the local
   accessibility managers in the processes for this user are
   disabled, the state is swapped with the new user's one, and
   the new user state is refreshed.

   This change updates all calls into the system to use their
   user specific versions when applicable. For example, regisetring
   content observers, package monitors, calls into other system
   services, etc.

   There are some components that are shared across users such
   as UI created by the system process and the SystemUI package.
   Such components are managed as a global state shared across
   all users and are updated accordingly on a user switch. Since
   the SystemUI is running in a normal app process this change
   adds hidden APIs on the local window manager to allow the
   SystemUI to notify the accessibility layer that it will run
   accross users.

   Calls to AccessibiltyManager's isEnabled(), isTouchExplorationEnabled()
   and sendAccessibilityEvent return false or a are a nop for a
   background user sice he should not send accessibility events,
   and should not perform touch exploration.

   Update the internal accessibility tests due to changes in the
   AccessibilityManager.

   This change also fixes several issues that were encountered
   such as calling out the accessibility manager service with a
   lock held.

   Removed some incorrect debugging code from the TouchExplorer
   that was leading to a system crash.

bug:6967373

Change-Id: I2cf32ffdee1d827a8197ae4ce717dc0ff798b259
2012-09-21 16:48:07 -07:00
Andy Stadler
d44daaba44 Move files to make eclipse-java happy
No changes to text at all, just moving the java files to match their
declared packages.

There was no original bug# but this cleans up the code submitted in
the original Change-Id: I42307f58074157b33b6e01216aab10022340d449

Change-Id: I233fa7f21167a42565aadb7ad109600b1a1a5721
2012-09-18 14:08:30 -07:00
Jeff Sharkey
8e53462d94 am d0c6ccba: Move NetworkPolicy from apps to UID.
* commit 'd0c6ccbafdebc73d03cf3cd47f02f9f6c78a69ff':
  Move NetworkPolicy from apps to UID.
2012-09-15 16:12:23 -07:00
Jeff Sharkey
d0c6ccbafd Move NetworkPolicy from apps to UID.
For multi-user devices, switch to storing policy per-user instead of
per-app.  Also watch for user added/removed broadcasts to clean up
policies and apply global restrictions.

Bug: 7121279
Change-Id: Ia7326bd0ebe0586fa4ec6d3a62f6313dc8814007
2012-09-14 23:00:27 -07:00
Geremy Condra
b631084613 DO NOT MERGE Add components for the Android Config Updater to system server.
This adds the necessary bits to verify and install configuration
updates using system server. It also includes the cert pinning
updater as the first user.

Change-Id: I42307f58074157b33b6e01216aab10022340d449
2012-09-12 17:53:53 -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
Amith Yamasani
1952637425 Remove permission requirement for some UserManager calls
Update javadocs to be explicit about permissions.
Minor fixes in UserManagerService

Change-Id: I0d355e0a60e5dbdb49ed06091111d480ff249f3d
2012-08-22 10:28:56 -07:00
Amith Yamasani
2a00329c6d UserHandle to UserSerialNo mapping
Use AtomicFile for usermanager files.

Added a MANAGE_USERS permission that apps (signature permission) can use
to create/query/modify/remove users.

Change-Id: I5cf232232d0539e7508df8ec9b216e29c2351cd9
2012-08-17 09:06:10 -07:00
Dianne Hackborn
f02b60aa4f Rename UserId to UserHandle.
This is the start of turning this into a formal public API.

Change-Id: I5786d2c320f1de41a06ed5d0f65adb68967287a0
2012-08-16 12:46:38 -07:00
Amith Yamasani
258848d2ae User Manager service to manage users and query user details
Moved a bunch of methods from PackageManager to UserManager.

Fix launching of activities from recents to correct user.

Guest creation APIs

Change-Id: I0733405e6eb2829675665e225c759d6baa2b708f
2012-08-11 18:24:07 -07:00
Jeff Sharkey
fb878b66b9 Isolate NetworkStateTracker creation, test.
Change ConnectivityService to use a factory when creating
NetworkStateTrackers, which gives us a good place to inject mocks
for testing.  Add initial tests to verify that network routes are
added and removed as networks changed.

Change-Id: I11cbc61a84c2ed4afa2670036295b1494eab26e1
2012-08-08 16:23:41 -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
Jeff Sharkey
787c9ec558 Merge "Transition from DEV network stats to XT." into jb-dev 2012-05-18 11:40:42 -07:00
Jeff Sharkey
70c70530bd Transition from DEV network stats to XT.
When XT stats are available, transition to prefer them over DEV,
since they aren't subject to hardware driver bugs.  Only switches at
the first atomic XT bucket, and adds a Settings.Secure flag to force
back to DEV if needed.  Includes tests to cover transition.

Fix tests where device overlay would change which network types
reflected data usage.  Test both history and summary APIs.  Fixed
collection timestamps to reflect full buckets.

Bug: 6504744
Change-Id: Idd7f3b2fdb064c36547c85c51c214fd938c59b7e
2012-05-17 10:10:39 -07:00
Svetoslav Ganov
53e184d34e Accessibility service needs to request permission to be bound to.
1. Every accessibility services targeting JellyBean or higher has
   to request a special permission for the system to bind to it.

Change-Id: I6e579326bdf3597f148d6c67317455701ec8af68
2012-05-16 15:57:15 -07:00
Geremy Condra
3d33c268cc Adds support for the CertBlacklister.
The CertBlacklister is a mechanism for allowing is to use gservices
to blacklist certs by serial number or public key.

Change-Id: Ie4b0c966a8a43c9823fb550c0b1691204f133ae7
2012-05-12 13:09:45 -07:00
Jeff Sharkey
0cf6de0c93 Fix network stats and policy tests.
Bug: 6299195
Change-Id: I1941b5f7329940cc7469bd3fda17c3dc3a656250
2012-05-04 15:15:42 -07:00
Jeff Sharkey
ac3fcb1590 Reduce persist threshold for lower warning/limit.
Default is 2MB persist threshold, but even that can be substantial
for devices on 100MB/month plans. This change gradually reduces the
persist threshold up to 8x lower (256kb outstanding) based on lowest
active policy.

Bug: 5382676
Change-Id: Ief4e8cdb169bfb151a3d1b45722a8eaa01926508
2012-05-03 12:12:10 -07:00
Jeff Sharkey
e8914c3627 Begin collecting xtables iface counters.
Add method to parse new iface_stat_fmt proc stats, or return null
when kernel support is unavailable. Add test and remove older, unused
parsing code. Create new "xt" recorder to persist the new xtables
counters when available.

Add SSID support to NetworkIdentity to fix policy tests.

Bug: 6422414
Change-Id: I77f70e9acb79a559ab626f3af5c4f3599801ed43
2012-05-01 21:04:26 -07:00
Jeff Sharkey
bfdd680ab4 Migrate to @Override to remove warnings.
Bug: 6303344
Change-Id: I0d33b2ed448467379d576ccd71fb5ae20c878852
2012-04-09 10:57:21 -07:00
Jeff Sharkey
b52e3e5509 INetworkStatsSession with lifecycle for caching.
Users outside system_server now explicitly communicate their
lifecycle, which keeps a strong-reference chain to any fully loaded
NetworkStatsCollection histories.

Bug: 6236498
Change-Id: I8e22739b6e89a626b676967a736d7117fd000778
2012-04-06 13:38:29 -07:00
Jeff Sharkey
8fc27e8b87 Support metered Wi-Fi NetworkPolicy.
Add networkId field to NetworkIdentity to identify Wi-Fi networks by
SSID.  Add support for policies without usage cycles.

Only apply mobile policies when SIM state is ready, which is cleaner
than just checking for airplane mode.  Also avoids creating no-op
default policies when subscriberId is null.

Bug: 3001465, 3291052
Change-Id: I1f8aaa49a5db306df022c402ea7f3f5d4bc0cfc7
2012-04-05 16:02:25 -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
Jeff Sharkey
6143f31537 Merge "NetworkPolicy multi-user tests." 2012-03-22 15:29:40 -07:00