summaryrefslogtreecommitdiffstats
path: root/core/tests
Commit message (Collapse)AuthorAgeFilesLines
* am 5f5ea91f: am eb56ad18: am 08eb7dd6: Merge "extending timeout to stabilize ↵Tsu Chiang Chuang2012-02-132-3/+14
|\ | | | | | | | | | | | | tests" into ics-mr1 * commit '5f5ea91f60b4b7d2fcf3da3603cd745a53cba48f': extending timeout to stabilize tests
| * extending timeout to stabilize testsTsu Chiang Chuang2012-02-012-7/+18
| | | | | | | | Change-Id: I2e0a7ae35babdda18ade4f70d61b4c83c9d2c2d9
* | Merge "Adding a method for retching the root node in UiTestAutomationBridge"Svetoslav Ganov2012-02-071-0/+31
|\ \
| * | Adding a method for retching the root node in UiTestAutomationBridgeSvetoslav Ganov2012-02-071-0/+31
| | | | | | | | | | | | | | | | | | bug:5974791 Change-Id: I46a8b6a259ba31f27fcd6a71d06dc34efdb4de76
* | | Unify shorthand for byte-based units.Jeff Sharkey2012-02-031-4/+2
| | | | | | | | | | | | Change-Id: If990859dee3f0973e1d4c48f05312c84071b3328
* | | Multi-user - 1st major checkinAmith Yamasani2012-02-031-2/+4
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | Switching activity stacks Cache ContentProvider per user Long-press power to switch users (on phone) Added ServiceMap for separating services by user Launch PendingIntents on the correct user's uid Fix task switching from Recents list AppWidgetService is mostly working. Commands added to pm and am to allow creating and switching profiles. Change-Id: I15810e8cfbe50a04bd3323a7ef5a8ff4230870ed
* | Merge "Speedup the accessibility window querying APIs and clean up."Svetoslav Ganov2012-02-012-134/+87
|\ \
| * | Speedup the accessibility window querying APIs and clean up.Svetoslav Ganov2012-01-232-134/+87
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. Now when an interrogating client requires an AccessibilibtyNodeInfo we aggressively prefetch all the predecessors of that node and its descendants. The number of fetched nodes in one call is limited to keep the APIs responsive. The prefetched nodes infos are cached in the client process. The node info cache is invalidated partially or completely based on the fired accessibility events. For example, TYPE_WINDOW_STATE_CHANGED event clears the cache while TYPE_VIEW_FOCUSED removed the focused node from the cache, etc. Note that the cache is only for the currently active window. The ViewRootImple also keeps track of only the ids of the node infos it has sent to each querying process to avoid duplicating work. Usually only one process will query the screen content but we support the general case. Also all the caches are automatically invalidated so not additional bookkeeping is required. This simple strategy leads to 10X improving the speed of the querying APIs. 2. The Monkey and UI test automation framework were registering a raw event listener for accessibility events and hence perform connection and cache management in similar way to an AccessibilityService. This is fragile and requires the implementer to know internal framework stuff. Now the functionality required by the Monkey and the UI automation is encapsulated in a new UiTestAutomationBridge class. To enable this was requited some refactoring of AccessibilityService. 3. Removed the *doSomethiong*InActiveWindow methods from the AccessibilityInteractionClient and the AccessibilityInteractionConnection. The function of these methods is implemented by the not *InActiveWindow version while passing appropriate constants. 4. Updated the internal window Querying tests to use the new UiTestAutomationBridge. 5. If the ViewRootImple was not initialized the querying APIs of the IAccessibilityInteractionConnection implementation were returning immediately without calling the callback with null. This was causing the client side to wait until it times out. Now the client is notified as soon as the call fails. 6. Added a check to guarantee that Views with AccessibilityNodeProvider do not have children. bug:5879530 Change-Id: I3ee43718748fec6e570992c7073c8f6f1fc269b3
* | | Use PackageManager to detect wifi-only devices in ConnectivityManagerTest.Brett Chabot2012-02-015-47/+59
| | | | | | | | | | | | Change-Id: I9749bf9024a73af095d4a681bb902594828ad599
* | | Merge "Incorrect behavior of View clear focus."Svetoslav Ganov2012-01-302-9/+154
|\ \ \
| * | | Incorrect behavior of View clear focus.Svetoslav Ganov2012-01-252-9/+154
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The framework tries to have a focused view all the time. For that purpose when a view's focus is cleared the focus is given to the first focusable found from the top. The implementation of this behavior was causing the following issues: 1. If the fist focusable View tries to clear its focus it was getting focus but the onFocusChange callbacks were not properly invoked. Specifically, the onFocusChange for gaining focus was called first and then the same callback for clearing focus. Note that the callback for clearing focus is called when the View is already focused. Also note that at the end the View did not clear its focus, hence no focus change callbacks should be invoked. 2. If not the first focusable View tries to clear focus, the focus is given to another one but the callback for getting focus was called before the one for clearing, so client code may be mislead that there is more than one focused view at a time. 3. (Nit) The implementaion of clearFocus and unFocus in ViewGroup was calling the super implementaion when there is a focused child. Since there could be only one focused View, having a focused child means that the group is not focused and the call to the super implementation is not needed. 4. Added unit tests that verify the correct behavior, i.e. the focus of the first focused view cannot be cleared which means that no focus change callbacks are invoked. The callbacks should be called in expected order. Now the view focus clear precedes the view focus gain callback. However, in between is invoked the global focus change callback with the correct values. We may want to call that one after the View callbacks. If needed we can revisit this. Change-Id: Iee80baf5c75c82d3cda09679e4949483cad475f1
* | | | Move away from deprecated NetworkInfo extra.Jeff Sharkey2012-01-301-4/+4
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | Because the NetworkInfo included in CONNECTIVITY_ACTION broadcast extra does not reflect the state applicable to the calling UID, and the last sticky broadcast may have stale state, transition to calling ConnectivityManager.getActiveNetworkInfo() directly. Change-Id: I86b316fbedd0273585ad5f1248b091bc3a3a5520
* | | Fixing failing focus testsSvetoslav Ganov2012-01-254-21/+42
|/ / | | | | | | Change-Id: I3df6a72f6340cbf2e42ce4913e28471e9358088b
* | Introduce FileRotator.Jeff Sharkey2012-01-131-0/+428
| | | | | | | | | | | | | | | | | | | | Utility that rotates files over time, similar to logrotate. There is a single "active" file, which is periodically rotated into historical files, and eventually deleted entirely. Files are stored under a specific directory with a well-known prefix. Bug: 5386531 Change-Id: I29f821a881247e50ce0f6f73b20bbd020db39e43
* | Merge "Rewrite SQLite database wrappers."Jeff Brown2012-01-125-1680/+1
|\ \
| * | Rewrite SQLite database wrappers.Jeff Brown2012-01-125-1680/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The main theme of this change is encapsulation. This change preserves all existing functionality but the implementation is now much cleaner. Instead of a "database lock", access to the database is treated as a resource acquisition problem. If a thread's owns a database connection, then it can access the database; otherwise, it must acquire a database connection first, and potentially wait for other threads to give up theirs. The SQLiteConnectionPool encapsulates the details of how connections are created, configured, acquired, released and disposed. One new feature is that SQLiteConnectionPool can make scheduling decisions about which thread should next acquire a database connection when there is contention among threads. The factors considered include wait queue ordering (fairness among peers), whether the connection is needed for an interactive operation (unfairness on behalf of the UI), and whether the primary connection is needed or if any old connection will do. Thus one goal of the new SQLiteConnectionPool is to improve the utilization of database connections. To emulate some quirks of the old "database lock," we introduce the concept of the primary database connection. The primary database connection is the one that is typically used to perform write operations to the database. When a thread holds the primary database connection, it effectively prevents other threads from modifying the database (although they can still read). What's more, those threads will block when they try to acquire the primary connection, which provides the same kind of mutual exclusion features that the old "database lock" had. (In truth, we probably don't need to be requiring use of the primary database connection in as many places as we do now, but we can seek to refine that behavior in future patches.) Another significant change is that native sqlite3_stmt objects (prepared statements) are fully encapsulated by the SQLiteConnection object that owns them. This ensures that the connection can finalize (destroy) all extant statements that belong to a database connection when the connection is closed. (In the original code, this was very complicated because the sqlite3_stmt objects were managed by SQLiteCompiledSql objects which had different lifetime from the original SQLiteDatabase that created them. Worse, the SQLiteCompiledSql finalizer method couldn't actually destroy the sqlite3_stmt objects because it ran on the finalizer thread and therefore could not guarantee that it could acquire the database lock in order to do the work. This resulted in some rather tortured logic involving a list of pending finalizable statements and a high change of deadlocks or leaks.) Because sqlite3_stmt objects never escape the confines of the SQLiteConnection that owns them, we can also greatly simplify the design of the SQLiteProgram, SQLiteQuery and SQLiteStatement objects. They no longer have to wrangle a native sqlite3_stmt object pointer and manage its lifecycle. So now all they do is hold bind arguments and provide a fancy API. All of the JNI glue related to managing database connections and performing transactions is now bound to SQLiteConnection (rather than being scattered everywhere). This makes sense because SQLiteConnection owns the native sqlite3 object, so it is the only class in the system that can interact with the native SQLite database directly. Encapsulation for the win. One particularly tricky part of this change is managing the ownership of SQLiteConnection objects. At any given time, a SQLiteConnection is either owned by a SQLiteConnectionPool or by a SQLiteSession. SQLiteConnections should never be leaked, but we handle that case too (and yell about it with CloseGuard). A SQLiteSession object is responsible for acquiring and releasing a SQLiteConnection object on behalf of a single thread as needed. For example, the session acquires a connection when a transaction begins and releases it when finished. If the session cannot acquire a connection immediately, then the requested operation blocks until a connection becomes available. SQLiteSessions are thread-local. A SQLiteDatabase assigns a distinct session to each thread that performs database operations. This is very very important. First, it prevents two threads from trying to use the same SQLiteConnection at the same time (because two threads can't share the same session). Second, it prevents a single thread from trying to acquire two SQLiteConnections simultaneously from the same database (because a single thread can't have two sessions for the same database which, in addition to being greedy, could result in a deadlock). There is strict layering between the various database objects, objects at lower layers are not aware of objects at higher layers. Moreover, objects at higher layers generally own objects at lower layers and are responsible for ensuring they are properly disposed when no longer needed (good for the environment). API layer: SQLiteDatabase, SQLiteProgram, SQLiteQuery, SQLiteStatement. Session layer: SQLiteSession. Connection layer: SQLiteConnectionPool, SQLiteConnection. Native layer: JNI glue. By avoiding cyclic dependencies between layers, we make the architecture much more intelligible, maintainable and robust. Finally, this change adds a great deal of new debugging information. It is now possible to view a list of the most recent database operations including how long they took to run using "adb shell dumpsys dbinfo". (Because most of the interesting work happens in SQLiteConnection, it is easy to add debugging instrumentation to track all database operations in one place.) Change-Id: Iffb4ce72d8bcf20b4e087d911da6aa84d2f15297
* | | Merge "Fix indentation and whitespace."Jeff Brown2012-01-121-1058/+1058
|\ \ \ | |/ /
| * | Fix indentation and whitespace.Jeff Brown2012-01-121-1058/+1058
| | | | | | | | | | | | Change-Id: Iccb954fb77f21b230eecb3f06328e11b14611f17
* | | Merge "Clean up database tests a little bit."Jeff Brown2012-01-128-63/+41
|\ \ \ | |/ /
| * | Clean up database tests a little bit.Jeff Brown2012-01-128-63/+41
| | | | | | | | | | | | Change-Id: Ib05c699bf59187cb51627b5f352c2a15ad2c28bb
* | | am 87badc20: am 4ac4ab4e: Merge "Remove sleep from test acitivity to avoid ↵Xia Wang2012-01-111-2/+0
|\ \ \ | | |/ | |/| | | | | | | | | | | | | ANR when key event is injected bug#: 5737922" into ics-mr1 * commit '87badc20c7d5462ee27f13adf50acaf6a3232884': Remove sleep from test acitivity to avoid ANR when key event is injected bug#: 5737922
| * | Remove sleep from test acitivity to avoid ANR when key event is injectedXia Wang2011-12-191-2/+0
| | | | | | | | | | | | | | | | | | bug#: 5737922 Change-Id: I7871713c5000d122e63127b30d0151b8f5a29bcf
* | | Build all test apks as raw resource in FrameworksCoreTests.Ying Wang2012-01-1019-46/+59
| |/ |/| | | | | | | Bug: 5848975 Change-Id: I395013ded1c29e0914f72e03d0abd60bb4a7973a
* | Add textDirection="locale"Fabrice Di Meglio2012-01-061-14/+37
| | | | | | | | | | | | | | - also fix and update unit tests - see bug #5242821 Change-Id: I29e029bab8ade336a430f9a2a5073caaf11b8dda
* | Move the frameworks/base hostname verifier into libcore. Part 2/2Jesse Wilson2011-12-278-558/+0
| | | | | | | | | | Bug: http://b/5619726 Change-Id: I165eb3befcef104ff56ffb466c87c60b632f3194
* | Fix configured network statusIrfan Sheriff2011-12-121-0/+42
| | | | | | | | | | | | | | | | | | | | | | For a connected network, keep status as CURRENT. For a network, that is disconnected it should be ENABLED. A disabled network will have the status as DISABLED Also, add a unit test to ensure there is only one CURRENT network that is connected Change-Id: Iaa4a7124a0c372a8f6df3d846ae8c15d9b29cf13
* | am 96f660f4: am e63d67ef: Merge "Add extra 2 minute for wifi to shutdown" ↵Xia Wang2011-12-051-6/+8
|\ \ | |/ | | | | | | | | | | into ics-mr1 * commit '96f660f4a8b99ff387e17474f2574e4e284ceeb8': Add extra 2 minute for wifi to shutdown
| * Merge "Add extra 2 minute for wifi to shutdown" into ics-mr1Xia Wang2011-12-051-6/+8
| |\
| | * Add extra 2 minute for wifi to shutdownXia Wang2011-12-051-6/+8
| | | | | | | | | | | | Change-Id: I3cf2fbf5de8b96b75d5e460e4ad822a1947ff6e7
* | | Fixing the buildSvetoslav Ganov2011-11-301-0/+1
| | | | | | | | | | | | Change-Id: I125956773dd364b14f8d328e625df3c852001dbf
* | | resolved conflicts for merge of 26f7a81f to masterSvetoslav Ganov2011-11-301-114/+81
|\ \ \ | |/ / | | | | | | Change-Id: I6bf5fd7c0de7945cef84602dbe3a7bbed587700f
| * | Fixing memory leaks in the accessiiblity layer.Svetoslav Ganov2011-11-291-115/+83
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. AccessibilityInteractionConnections were removed from the AccessiiblityManagerService but their DeathRecipents were not unregistered, thus every removed interaction connection was essentially leaking. Such connection is registered in the system for every ViewRootImpl when accessiiblity is enabled and inregistered when disabled. 2. Every AccessibilityEvent and AccessiilbityEventInfo obtained from a widnow content querying accessibility service had a handle to a binder proxy over which to make queries. Hoewever, holding a proxy to a remote binder prevents the latter from being garbage collected. Therefore, now the events and infos have a connection id insteand and the hindden singleton AccessiiblityInteaction client via which queries are made has a registry with the connections. This class looks up the connection given its id before making an IPC. Now the connection is stored in one place and when an accessibility service is disconnected the system sets the connection to null so the binder object in the system process can be GCed. Note that before this change a bad implemented accessibility service could cache events or infos causing a leak in the system process. This should never happen. 3. SparseArray was not clearing the reference to the last moved element while garbage collecting thus causing a leak. bug:5664337 Change-Id: Id397f614b026d43bd7b57bb7f8186bca5cdfcff9
* | am 4f5434f3: am e5715521: am 2d9f4620: Fix buildXia Wang2011-11-281-1/+1
|\ \ | |/ | | | | | | * commit '4f5434f3a3ce51d7d6caf463e5571bb686e2bdd1': Fix build
| * am 2d9f4620: Fix buildXia Wang2011-11-281-1/+1
| |\ | | | | | | | | | | | | * commit '2d9f4620625405b916aa27177a6b5f82f8e5b15d': Fix build
| | * Fix buildXia Wang2011-11-281-1/+1
| | | | | | | | | | | | Change-Id: I465d85e4783763f311ed6ec0a09c1edde9712405
* | | am 6c509ef0: am da822367: am 25261f59: Merge "Increase time between wifi ↵Xia Wang2011-11-286-79/+89
|\ \ \ | |/ / | | | | | | | | | | | | | | | stop and wifi start: set to 2 minutes http://b/issue?id=5629901" into ics-mr0 * commit '6c509ef0bad761feecfd94b66d532ae05b450317': Increase time between wifi stop and wifi start: set to 2 minutes http://b/issue?id=5629901
| * | am 25261f59: Merge "Increase time between wifi stop and wifi start: set to 2 ↵Xia Wang2011-11-286-79/+89
| |\ \ | | |/ | | | | | | | | | | | | | | | minutes http://b/issue?id=5629901" into ics-mr0 * commit '25261f59af0d902f239e541b735f7dc31e714b07': Increase time between wifi stop and wifi start: set to 2 minutes http://b/issue?id=5629901
| | * Increase time between wifi stop and wifi start: set to 2 minutesXia Wang2011-11-216-79/+89
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | http://b/issue?id=5629901 Change on state validation: - When network state is broadcast in other network information, the test activity will record the state change which cause false alarm in the test. Change-Id: I8bd1e8c04ab97116f3a02ccc5543f34a7e651cda
| | * fix for build breakage.Tsu Chiang Chuang2011-11-141-2/+2
| | | | | | | | | | | | Change-Id: Ie324e46a79923813edd2e5e0c34ede79e6ee3eea
* | | am 70a1ee38: am 500afb87: Merge "Fix SCO start stop tests." into ics-mr1Eric Rowe2011-11-283-1/+14
|\ \ \ | |/ / | | | | | | | | | * commit '70a1ee38b24a7c8dfc789db024bdf54f277ddba3': Fix SCO start stop tests.
| * | Fix SCO start stop tests.Eric Rowe2011-11-223-1/+14
| | | | | | | | | | | | | | | Change-Id: Idf292bc244a494e2ffb11359e83c0d072907ea3b Bug-id: http://b/5644683
* | | am 06e4a400: am b3f2890a: am 047c4de2: Merge "Adding mobile microbenchmark ↵Tsu Chiang Chuang2011-11-151-1/+1
|\ \ \ | |/ / | | | | | | | | | | | | | | | tests." into ics-mr0 * commit '06e4a40017f1af75ec58d9d942ef0c4ddad20fd2': Adding mobile microbenchmark tests.
| * | am 047c4de2: Merge "Adding mobile microbenchmark tests." into ics-mr0Tsu Chiang Chuang2011-11-151-1/+1
| |\ \ | | |/ | | | | | | | | | * commit '047c4de2c548960fff428a92099003593cede5f8': Adding mobile microbenchmark tests.
| | * Adding mobile microbenchmark tests.Tsu Chiang Chuang2011-11-102-19/+117
| | | | | | | | | | | | Change-Id: Ifcd67b0265045778965aeff8e213c3929da02c3d
* | | am bc03c74c: am d968670d: Merge "Conservatively trim data usage stats." into ↵Jeff Sharkey2011-11-151-0/+4
|\ \ \ | |/ / | | | | | | | | | | | | | | | ics-mr1 * commit 'bc03c74c485669695805944a655795a6f9890956': Conservatively trim data usage stats.
| * | Merge "Conservatively trim data usage stats." into ics-mr1Jeff Sharkey2011-11-141-0/+4
| |\ \
| | * | Conservatively trim data usage stats.Jeff Sharkey2011-11-141-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of trusting NTP time alone, use the most-conservative of system clock and NTP. Bug: 5584564 Change-Id: I5dd87fc009959b1cf0a7d660e385a0b1a8be238b
| * | | Adding mobile microbenchmark tests.Tsu Chiang Chuang2011-11-102-17/+115
| |/ / | | | | | | | | | Change-Id: Ifcd67b0265045778965aeff8e213c3929da02c3d
* | | Merge "Adding mobile microbenchmark tests."Tsu Chiang Chuang2011-11-102-17/+115
|\ \ \
| * | | Adding mobile microbenchmark tests.Tsu Chiang Chuang2011-11-072-17/+115
| | | | | | | | | | | | | | | | Change-Id: Ifcd67b0265045778965aeff8e213c3929da02c3d