summaryrefslogtreecommitdiffstats
path: root/services/tests
Commit message (Collapse)AuthorAgeFilesLines
...
* Touch exploration separate setting and API to poll the latter state.Svetoslav Ganov2011-07-181-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | 1. Seperated touch exploration to be a seperate setting rather being magically enabled by the system of accessiiblity is on the there is at leas one accessibility service that speaks enabled. Now there is a setting for requesting touch exploration but still the system will enabled it only if that makes sense i.e. accessibility is on and one accessibility service that speaks is enabled. 2. Added public API for checking of touch exploration is enabled. 3. Added description attribute in accessibility service declaration which will be shown to the user before enabling the service. 4. Added API for quick cloning of AccessibilityNodeInfo. 5. Added clone functionality to SparseArray, SparseIntArray, and SparseBooleanArray. bug:5034010 bug:5033928 Change-Id: Ia442edbe55c20309244061cd9d24e0545c01b54f
* Hide NetworkTemplate details, buffered stats I/O.Jeff Sharkey2011-07-142-9/+8
| | | | | | | | Move template matching to builder methods instead of exposing the internal constants. Also rule to match Ethernet usage. Buffer reading and writing of network stats, making operations 5x faster. Change-Id: Iedb2d0ab3b26a976811c050f84a164e909eb74b6
* Include full network history around current time.Jeff Sharkey2011-07-121-20/+18
| | | | | | | | | | When requesting historical values with time ranges, always include full values for buckets that span current time. (It doesn't make sense to interpolate partial data.) Move getTotalData() to return full Entry objects to prepare for packet counts. Bug: 4691901 Change-Id: I717bd721be9f1d4a47c4121e46e07a56cb15bbf1
* Hide NetworkStatsHistory internals.Jeff Sharkey2011-07-123-42/+46
| | | | | | | Instead of exposing internal storage details, offer getValues() accessor which populates values into a recycled structure. Change-Id: I5228d7099a8f61b2018a435a813435a67dae49b4
* Return stats from inactive ifaces, packet counts.Jeff Sharkey2011-07-112-8/+66
| | | | | | | | | | | | | When an iface goes inactive, xt_qtaguid maintains historical counters instead of discarding. Now reading and returning those values in NetworkManagementService summary calls. Tests to verify stats are returned. Modify NetworkStats to include rxPackets and txPackets values, and move to Entry to eventually hide internal storage details. Bug: 4984539 Change-Id: I1ba0bb5580c62e946d9dff2cc2a6f64aff403efc
* Migrate bandwidth control to NMS, omit history.Jeff Sharkey2011-06-301-4/+0
| | | | | | | | | | | | Both stats and policy make NMS calls that depend on bandwidth control being enabled, so move enable/disable into NMS and drop calls when disabled. This avoids throwing heavy ISE exceptions when disabled. Only include recent data when writing NetworkStatsHistory as part of dumpsys call. Introduce manual poll event for Settings UI. Bug: 4982115, 4770435, 4515856 Change-Id: I257820b057af2f0f99c736fb4f61e55b9fdc3e66
* Enforce background data flag, rules through netd.Jeff Sharkey2011-06-301-2/+37
| | | | | | | | | | Connect up netd penalty box through NMS, and enforce the existing background data flag by putting all UIDs in penalty box. Allow platform applications to have policy applied. Only dispatch unique rules to netd, avoiding any repeats. Bug: 4598463, 4965677 Change-Id: Ibf9beff998ba7a1ea92f5e2f7eeba7b483d4b918
* Merge "Push interface quota rules from NetworkPolicyManager to kernel."Jeff Sharkey2011-06-291-7/+11
|\
| * Push interface quota rules from NetworkPolicyManager to kernel.Ashish Sharma2011-06-291-7/+11
| | | | | | | | Change-Id: Id2b758f561820b44839f69bf5fbd676cae771fe3
* | Move socket tagging from libcore.Jesse Wilson2011-06-281-2/+2
|/ | | | Change-Id: I7515896936c5bbd212c88e2801b831914219a925
* Better network stats parsing, integer tags, async.Jeff Sharkey2011-06-285-23/+262
| | | | | | | | | | | | | | Change NMS parsing to handle extended /proc/ stats formats by pairing values with header keys. Move TrafficStats to integer tags to match kernel internals, and offer well-known tags for system services. Async policy event dispatch from NPMS, and update tests to block for event dispatch. Narrow app policy to exclude apps signed with system key, which are usually critical. Bug: 4948913, 4903489, 4585280 Change-Id: Idb357227ccaa617906411f309371cea18d7bc519
* Persist "tagged" network stats along with UIDs.Jeff Sharkey2011-06-191-30/+194
| | | | | | | | | | | | | | | | | Now stores tags other than TAG_NONE (0x0), which are useful for app debugging. Combine UID and tag together into single long key, and expose tag data through AIDL when requested. Change NMS to track TAG_NONE as total UID traffic, matching the kernel definition. Added TAG_MAX_HISTORY to control how long tag-granularity statistics are stored; overall UID usage is still kept for UID_MAX_HISTORY. Fix bug to trim NetworkStatsHistory outside normal polling loops to catch non-active networks and UIDs. Test to verify UID and tag packing, and to verify that UID traffic on two networks are combined to match MOBILE_ALL template. Change-Id: If0e039416d9e7f63b1a39e04cddfb1133b5a78ee
* Handle removed UIDs in network stats and policy.Jeff Sharkey2011-06-192-15/+185
| | | | | | | | | | | | When UID_REMOVED, clean up any existing UID network policy so it doesn't linger for future apps. Also move any NetworkStatsHistory to special UID_REMOVED tracking bucket. Tests for new removal code. Also test detailed UID stats, including network changes to verify template matching logic. Bug: 4584212 Change-Id: I9faadf6b6f3830eb45d86c7f1980a27cdbcdb11e
* Read "qtaguid" network stats, refactor templates.Jeff Sharkey2011-06-183-34/+40
| | | | | | | | | | | | | | | | Teach NMS to read qtaguid stats from kernel, but fall back to older stats when kernel doesn't support. Add "tags" to NetworkStats entries to support qtaguid. To work around double-reporting bug, subtract tagged stats from TAG_NONE entry. Flesh out stronger NetworkTemplate. All NetworkStatsService requests now require a template, and moved matching logic into template. Record UID stats keyed on complete NetworkIdentitySet definition, similar to how interface stats are stored. Since previous UID stats didn't have iface breakdown, discard during file format upgrade. Change-Id: I0447b5e7d205d73d28e71c889c568e536e91b8e4
* Notify policy listeners about metered ifaces.Jeff Sharkey2011-06-171-11/+19
| | | | | | | | | | Currently, kernel definition of metered networks is applied at the interface level. This change maintain list of those metered ifaces and notifies policy listeners, like ConnectivityService. (This gives us a consistent picture of when a network would be blocked.) Bug: 4601393 Change-Id: I277d5ca96ab967a1c1c3f1da8f9587557cd6d74c
* Add permission to fix NetworkPolicy tests.Jeff Sharkey2011-06-161-0/+1
| | | | Change-Id: I4d5265b2b08c1ec0c42b71ad0ceeb9952094caa0
* Fix NetworkPolicy tests after notifications.Jeff Sharkey2011-06-151-6/+20
| | | | Change-Id: I569e9ceba6d89459b347ed151fd9bda2909dc892
* Fix test-related build breakage.Jeff Sharkey2011-06-131-5/+9
| | | | Change-Id: I48a3dbbdc49d742d6ad19cff34ee8da4b3949bb8
* Growable NetworkStats object instead of builder.Jeff Sharkey2011-06-113-16/+15
| | | | | | | | | NetworkStats now grows in place with arraycopy() instead of callers needing to know record count a priori. Better growth calculation for both NetworkStats and NetworkStatsHistory; 50% each time. Better estimates of buckets needed in calling services. Change-Id: I3adbffa0b7407612cc6349d9135a8b4eb63cd440
* Persist UID stats, lazy loading, resize buckets.Jeff Sharkey2011-06-111-61/+173
| | | | | | | | | | | | | | Persisting detailed UID stats in separate "netstats_detail.bin" file to enable different schedules for summary and detail polling. Only load detailed UID history on demand, since it's not needed during boot. Add test to verify UID stats are persisted across simulated reboot. Move external settings into well-named interface, which is still backed by Settings.Secure. During periodic poll events, resize any history to match current bucket duration setting. Test to verify. Change-Id: I6366f3583a591f8ba859b0e5987daf8cafa4e95a
* Move data cycle methods to framework object.Jeff Sharkey2011-06-101-1/+1
| | | | | | | Moved so they can be used by both system service and Settings UI, since they both work with data usage cycles. Still covered by tests. Change-Id: I01c0c4db6da9457dd867c9167d31a5f9f8e5f5d9
* Interface-level network policy, persist policies.Jeff Sharkey2011-06-102-4/+141
| | | | | | | | | | | | | | | 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
* Persist network stats using AtomicFile.Jeff Sharkey2011-06-091-0/+280
| | | | | | | | | | | | Implements read/write of network stats using AtomicFile, along with magic number and versioning. Stores in "/data/system/netstats.bin" for now. Tests to verify that stats are persisted across a simulated reboot, and to verify that TEMPLATE_WIFI is working. Fixed bug where kernel counters rolling backwards would cause negative stats to be recorded; now we clamp deltas at 0. Change-Id: I53bce26fc8fd3f4ab1e34ce135d302edfa34db34
* Collect historical network stats.Jeff Sharkey2011-06-011-4/+8
| | | | | | | | | | | | | | | | | | Periodically records delta network traffic into historical buckets to support other services, such NetworkPolicyManager and Settings UI. Introduces NetworkStatsHistory structure which contains sparse, uniform buckets of data usage defined by timestamps. Service periodically polls NetworkStats and records changes into buckets. It only persists to disk when substantial changes have occured. Current parameters create 4 buckets each day, and persist for 90 days, resulting in about 8kB of data per network. Only records stats for "well known" network interfaces that have been claimed by Telephony or Wi-Fi subsystems. Historical stats are also keyed off identity (such as IMSI) to support SIM swapping. Change-Id: Ia27d1289556a2bf9545fbc4f3b789425a01be53a
* Tests for NetworkPolicyManager rule generation.Jeff Sharkey2011-06-014-75/+409
| | | | | | | | | | | | 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
* Accessibility serviceconfiguration via meta-dataSvetoslav Ganov2011-05-312-7/+11
| | | | | | | | | | | | | | | | | | Note: This is a part of two CL change and contains the system changes without updates to the settings. 1. Added a mechanism for configuring an accessibility service via XML file specified in a meta-data tag (similar to IMEs). 2. Added property for specifying a settings activity for an accessibility service. 3. Refactored the APIs in AccessibilityManager to return lists of AccessiblityServiceInfo instead ServiceInfo since the former describes an AccessibilityService in particular (similar to IMEs). Change-Id: Ie8781bb7e0cdb329e583b6702a612a507367ad7b
* APIs to profile network usage for current UID.Jeff Sharkey2011-05-211-0/+2
| | | | | | | | | | | | | | | Added startDataProfiling() and stopDataProfiling() to TrafficStats, which can be used by apps to measure network usage delta between two points in time. Currently takes two NetworkStats snapshots and returns delta, which will eventually include tag-level granularity. Added tests for NetworkStats delta subtraction. Added NMS.getNetworkStatsUidDetail() that returns stats for specific UID. Always gives stats access for the calling UID, otherwise enforces that caller has permission. Fix readSingleLongFromFile(), since /proc/ files don't have well-defined lengths. Change-Id: Ic5b6414d8effbd66846e275b00d4b8a82c74589d
* Return NetworkStats bundle from NM service.Jeff Sharkey2011-05-041-4/+24
| | | | | | | | | | | | | Introduce NetworkStats which is a collection of network statistics, which should match the structure communicated by kernel module through netd. Will introduce tags and fg/bg stats later. Kept entirely in a flat data structure to optimize parcel speed. Initial pass at returning NetworkStats from NetworkManagementService, both summary and details. Will eventually pull data from kernel module over netd connection. Change-Id: I92d9f61678ec8c22e2ce26775fb035a0cf32413f
* Use passive provider for location based country detectionDaisuke Miyakawa2011-04-281-25/+80
| | | | | Bug: 4345419 Change-Id: Ia3e071b97c6971538ea994fdee6029db928201d6
* Tests for ThrottleService, NTP into TrustedTime.Jeff Sharkey2011-04-283-1/+407
| | | | | | | | | | | | 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
* Plumbing in PackageManager and installd for multi-user support.Amith Yamasani2011-04-151-15/+16
| | | | | | | | | | | | | | | | | | | | - Create /data/user directory and symlink /data/user/0 -> /data/data for backward compatibility - Create data directories for all packages for new user - Remove data directories when removing a user - Create data directories for all users when a package is created - Clear / Remove data for multiple users - Fixed a bug in verifying the location of a system app - pm commands for createUser and removeUser (will be disabled later) - symlink duplicate lib directories to the original lib directory Change-Id: Id9fdfcf0e62406a8896aa811314dfc08d5f6ed95
* Package manager changes to store and update user information.Amith Yamasani2011-04-112-1/+107
| | | | | | | | | | 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
* 3205857 java.lang.ExceptionInInitializerError at ↵Svetoslav Ganov2010-12-091-15/+11
| | | | | | java.lang.Class.newInstanceImpl(Native Method) Change-Id: I72ab33da2f5cc0bbaa89f3b996ff4ac48deadf73
* Add new system service CountryDetectorBai Tao2010-07-283-0/+732
| | | | | | | | | | a. The CountryDetector detects the country the user is in in order of mobile network, location, sim card or locale. It will be used by contact and contact provider. b. All added APIs are hidden at this stage. Change-Id: I4ba278571ffb6ab6ded0996d4f440a18534f8ed4
* am 7da38863: am 3685db7f: am e8605af5: Merge "Avoid leaking file descriptors ↵Dan Egnor2010-07-211-0/+208
|\ | | | | | | | | | | | | | | | | when returning drop box events." into froyo Merge commit '7da38863d4382746090bf50413b1774ab04f6bc1' * commit '7da38863d4382746090bf50413b1774ab04f6bc1': Avoid leaking file descriptors when returning drop box events.
| * Avoid leaking file descriptors when returning drop box events.Dan Egnor2010-07-211-0/+208
| | | | | | | | | | | | | | | | | | | | | | | | | | | | We can't use Parcel.writeValue() to write the ParcelFileDescriptor, otherwise it leaks when returning the value to the caller (the flag gets lost). Change the way DropBoxManager.Entry gets serialized so that it uses a bit of its own flags value to track whether the data is a byte[] or a ParcelFileDescriptor. Modify the dropbox unit test to add extensive checking of Entry serialization and deserialization under various circumstances, and to include a regression test to ensure that FD leaking doesn't happen. Bug: 2847738 Change-Id: I4ccd17dd03ffab234340cd359e6f3510fdf81193
* | 2744878 com.android.server.AccessibilityManagerServiceTest:testInterrupt is ↵Svetoslav Ganov2010-06-072-23/+87
| | | | | | | | | | | | failing Change-Id: I73d056c7dcf8edddae2ef9cb28ec7d2b3203bb9b
* | 2604226 Add test cases for the internal accessibility infrastructure.Svetoslav Ganov2010-04-265-0/+1193
|/ | | | Change-Id: Iaeb2c11b6c2167632086b50d9c79e6459cc072b8
* Limit DropBox storage to 1000 files (by default).Dan Egnor2010-03-241-0/+50
| | | | | | | Also does trimming asynchronously (not directly in the broadcast receiver). Bug: 2541253 Change-Id: I7daf8bc618e2dce68a98571f5f7fbce4df1d6a76
* Unittests for EntropyService. Make EntropyService more testable.Nick Kralevich2010-03-191-0/+41
| | | | | | | | I've been meaning to write these tests for a long time... Use "runtest frameworks-services" to run these tests. Change-Id: I3a3cb7eda547f4a790f38be884b4a583426c7326
* Modifying Services Tests XML file so it builds with the right permissions.Neal Nguyen2010-02-022-8/+5
|
* Phase 2 of test cleanup: moving test files from AndroidTests closer to their ↵Neal Nguyen2010-01-293-0/+569
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