14 Commits

Author SHA1 Message Date
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
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
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
Jeff Sharkey
a63ba59260 Add operation counts to network statistics.
Provide API to increment "operation counts" for a UID and tag, used
to eventually derive bytes/operation stats.  Internally is stored at
network layer, but should belong at data layer.  Switch profiling
to use data layer stats, which are emulated by summarizing network
layer details.

Read packet counts from new /proc/ columns and collect them into
NetworkStatsHistory.  Prevent double-counting by ignoring values from
first snapshot.  Watch for duplicate /proc/ entries.  Update tests
to verify packet and operation counters.

Bug: 5052136, 5097392
Change-Id: I1832f65a2b8a9188f8088f253474a667c21a2f09
2011-07-29 22:24:01 -07:00
Jeff Sharkey
41ff7ec824 Revise data limit notifs, watch kernel alerts.
Teach NetworkPolicy limits to "snooze" when requested by user, and
notify with both dialog and notification.  Register for network alerts
through NMS to trigger updates immediately instead of waiting for
next stats update.

Enforce that all NetworkPolicy are unique on a template basis, and
move SCREEN_ON/OFF broadcasts to background thread.  Launch SystemUI
and Settings directly instead of using actions, and include full
NetworkTemplate in extras.

Tests to verify notification and snooze behavior.

Bug: 5057979, 5023579, 4723336, 5045721
Change-Id: I03724beff94a7c0547cb5220431ba8d4cd44d077
2011-07-27 09:31:39 -07:00
Jeff Sharkey
2242af25df Add permission to fix NetworkPolicy tests.
Change-Id: I4d5265b2b08c1ec0c42b71ad0ceeb9952094caa0
2011-06-16 14:03:43 -07:00
Jeff Sharkey
21c9c45e5c Interface-level network policy, persist policies.
Define NetworkPolicy as cycle-reset day and warning/limit values, and
set/get through NetworkPolicyManager.  Watch ConnectivityManager for
network connection events, and apply quota rules based on matching
interfaces.  Policy service matches based on strong identity to support
IMSI-specific policy values.

Calculates remaining quota based on current stats recorded since the
last reset cycle day.  Tests to verify edge cases around February.

Persist network and UID policies in XML, and restore on boot.

Change-Id: Id40ba7d6eed6094fbd5e18e6331286c606880d80
2011-06-10 19:35:20 -07:00
Jeff Sharkey
9599cc5f21 Tests for NetworkPolicyManager rule generation.
Verifies that policy changes trigger rule updates that respect current
foregroundActivities status.  Also verifies logic that promotes a UID
based on its most-foreground PID.  Verifies that policy changes result
in immediate rule changes.

Also verifies that BACKGROUND_DATA_SETTING_CHANGED broadcasts are sent
by policy changes.

Change-Id: I4fd0dad9e1dbccee2c5968244bb1814e6cb2c6e1
2011-06-01 17:26:30 -07:00
Jeff Sharkey
b7342acebc Tests for ThrottleService, NTP into TrustedTime.
Wrote initial suite of tests for ThrottleService, checking a variety
of edge cases.  Checks going over limits, updating policies, and reset
after cycle elapses.

Moved NTP code in ThrottleService into new TrustedTime interface,
which makes it easier to understand, and allows tests to provide custom
clocks.

Change-Id: I0d62b8b3a169516a2ab2d33025f6fe30dc792be8
2011-04-28 12:28:36 -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
Svetoslav Ganov
0b29a58714 2604226 Add test cases for the internal accessibility infrastructure.
Change-Id: Iaeb2c11b6c2167632086b50d9c79e6459cc072b8
2010-04-26 21:23:54 -07:00
Neal Nguyen
3433d3c90e Modifying Services Tests XML file so it builds with the right permissions. 2010-02-02 17:09:00 -08:00
Neal Nguyen
1a44d5dcab Phase 2 of test cleanup: moving test files from AndroidTests closer to their sources.
Most of these are file moves; a couple notable exceptions are the changes due to the move, and fixing up test code:
- database/DatabaseCursorTest.java
- database/DatabaseStatementTest.java
- net/UriTest.java
2010-01-29 13:35:51 -08:00