459 Commits

Author SHA1 Message Date
Brad Fitzpatrick
43194ce05e am 52d70722: am cb842753: Merge "Closing cursor in finalizer to avoid GREF and fd leak in acore"
* commit '52d70722654548d156bd7a1cb8c1f05b94b09f06':
  Closing cursor in finalizer to avoid GREF and fd leak in acore
2011-01-12 00:04:27 -08:00
Jesse Wilson
eb97c0ddc0 Patch new JSON APIs with changes informed by GSON.
Change-Id: I86c12a123080cc06ab23d11d1563bb52c5902517
2011-01-10 12:56:31 -08:00
Brad Fitzpatrick
52d7072265 am cb842753: Merge "Closing cursor in finalizer to avoid GREF and fd leak in acore"
* commit 'cb8427538dfdc5eae941e377b11bfd11a95fc5a5':
  Closing cursor in finalizer to avoid GREF and fd leak in acore
2011-01-10 08:32:35 -08:00
Johannes Carlsson
872a52c6b6 Closing cursor in finalizer to avoid GREF and fd leak in acore
The finalize() call did not clean up completely, this eventually
caused the android.process.acore to crash since it ran out of fds
and GREF to increased above 2000 if an application forgot to close
its cursor objects. A warning was also added when this happens so
that application developers can correct their mistake. The
included test case tries to verify that the finalizer works as
expected by creating a bunch of Cursor objects without closing
them (without this fix the acore process crashes after about 400
iterations and the test case ends with "Process crashed").

Change-Id: I11e485cef1ac02e718b2742108aa88793666c31d
2011-01-10 12:46:21 +01:00
Kenny Root
b0512c3725 Merge "Fix check for required features" into honeycomb 2011-01-09 07:15:26 -08:00
Kenny Root
1683afac14 Fix check for required features
The required features check was in an null check for usesLibraries, so
it wasn't checking for required features when an application did not use
a library.

Bug: 3331713
Change-Id: I96d366ba00d4962b84f3796be97e2b622eb331a5
2011-01-07 15:43:05 -08:00
Gilles Debunne
79ff914f21 Added support for Unicode surrogate characters in word selection
Inspired by https://review.source.android.com/#change,16606

Change-Id: I896354f5aba83c1919c008f07b6d0b2abf0b8e01
2011-01-07 11:59:26 -08:00
Gilles Debunne
87380bcaeb Added support for asian characters in text selection.
Inspired by https://review.source.android.com/#change,16606

Test class has been revamped to mimic new behavior: selectCurrentWord
is no longer used to add words to the dictionary. We rely on the suggestion
bar in the IME for that.

Change-Id: I1cb88df54dffb166c75f75fefb743ff55a33519b
2011-01-04 14:18:13 -08:00
Vasu Nori
6141e13f6e when cursorwindow allocation fails, print the number of cursors left open
the reason for bug:3281533, bug:3127159 is probably too many cursors are left
un-closed in the process.
print the info on the number of cursors left open when the exception
"cursorwindow allocation failed" occurs.
This should help us figure out if that indeed is the reason
and which process is leaving the cursors open.

Change-Id: I4b46be63f5dfbe9b102ad7a9cf9dd21e70f71e14
2011-01-04 10:40:15 -08:00
Alon Albert
2967aa3e60 am 672ebb61: Merge "Improved ignore-backoff handling Allow a non-epidited ignore-backoff op to pass through an expidited backed off op." into gingerbread
* commit '672ebb61a755e4bbe60e4e884b1adadf186733b6':
  Improved ignore-backoff handling Allow a non-epidited ignore-backoff op to pass through an expidited backed off op.
2010-12-28 14:57:09 -08:00
Alon Albert
672ebb61a7 Merge "Improved ignore-backoff handling Allow a non-epidited ignore-backoff op to pass through an expidited backed off op." into gingerbread 2010-12-28 14:44:51 -08:00
Vasu Nori
3079d44a9d Merge "fix all flaky tests to make them work consistently." 2010-12-23 16:48:18 -08:00
Irfan Sheriff
b45e726bf5 Fix wifi broadcasts
Add the missing wifi disable broadcast and also send out
supplicant disconnect on shutdown.

Added unit test cases.

Bug: 3294055

Change-Id: Ia56a8ec9d17784c5aac5b8b369c04837f9057c54
2010-12-22 14:43:13 -08:00
Alon Albert
d41fe75f09 Improved ignore-backoff handling
Allow a non-epidited ignore-backoff op to pass through
an expidited backed off op.

To do this, I first refactored the complicated if statement:

            if (best == null
                    || ((bestSyncableIsUnknownAndNotARetry == syncableIsUnknownAndNotARetry)
                        ? (best.expedited == op.expedited
                           ? opRunTime < bestRunTime
                           : op.expedited)
                        : syncableIsUnknownAndNotARetry)) {
                best = op;
                bestSyncableIsUnknownAndNotARetry = syncableIsUnknownAndNotARetry;
                bestRunTime = opRunTime;
            }

Into a more readable:
            boolean setBest = false;
            if (best == null) {
                setBest = true;
            } else if (bestSyncableIsUnknownAndNotARetry == syncableIsUnknownAndNotARetry) {
                if (best.expedited == op.expedited) {
                    if (opRunTime < bestRunTime) {
                        //  if both have same level, earlier time wins
                        setBest = true;
                    }
                } else {
                    if (op.expedited) {
                        setBest = true;
                    }
                }
            } else {
                if (syncableIsUnknownAndNotARetry) {
                    setBest = true;
                }
            }
            if (setBest) {
                best = op;
                bestSyncableIsUnknownAndNotARetry = syncableIsUnknownAndNotARetry;
                bestRunTime = opRunTime;
            }

The refactoring was all done automatically with IntelliJ to avoid human error
in the conversion.

After verifying this code still behaved as expected including the error
condition in the bug, I added handling for the cases when a non-expidited op
may override an expedited op if certain conditions occur, specificaly, if the
expidited op is backed off and the non-expidited op is not.

Finally, refactored to make it testable and added tests and logging.

Bug: 3128963

Change-Id: I131cbcec6073ea5fe425f6b5aa88ca56c02b6598
2010-12-22 14:40:43 -08:00
Vasu Nori
6f35c0ecba fix all flaky tests to make them work consistently.
Change-Id: I688f7e058511089bec7fa21e972e23780604d98a
2010-12-22 14:35:56 -08:00
Dianne Hackborn
20c915d803 am 5261cea2: Merge "Fix issue #3224616: TimeUtils.formatDuration() can drop 0s." into gingerbread
* commit '5261cea2e0cd61801e102114039a19ab449b53fe':
  Fix issue #3224616: TimeUtils.formatDuration() can drop 0s.
2010-12-21 13:33:06 -08:00
Xia Wang
b057c3dbe6 Merge "Few changes for Wi-Fi Stress Test" 2010-12-21 13:13:42 -08:00
Xia Wang
73055f12d7 Few changes for Wi-Fi Stress Test
Add WIFI_IDLE_MS to 1min in Wi-Fi stress test. bug#3284797
Wake up device using PowerManagerService.userActivityWithForce instead
of full wake lock.
Turn screen on when running Wi-Fi tests.

Change-Id: Ib763136cef515eec8b1d25183cf7a84ae1038ef2
2010-12-21 11:31:06 -08:00
Jesse Wilson
bd1c5da28d Remove unused performance tests.
Change-Id: I5a252e314831716f99ce5fbb32d983c7473ee787
2010-12-21 10:23:28 -08:00
Bjorn Bringert
f5f7510486 Fix issue #3224616: TimeUtils.formatDuration() can drop 0s.
Integrated from master.

Change-Id: Ie12dd25cce03c06fafb7df1335266322df43b038
2010-12-20 15:23:02 -08:00
Jesse Wilson
43c0db48d2 Merge "Test that DefaultHttpClient responds gracefully when the server closes a socket. http://b/2612240" 2010-12-17 10:59:30 -08:00
Jesse Wilson
0cb0d7a2d4 Test that DefaultHttpClient responds gracefully when the server closes a socket.
http://b/2612240

Change-Id: Iafde060572f7865b72fc568b3b55578ed5dd9c94
2010-12-16 19:38:32 -08:00
Irfan Sheriff
d3040307ab Merge "Fix ssid storage regression" 2010-12-16 14:46:32 -08:00
Jesse Wilson
e8a56933de Merge "New tests for AndroidHttpClient with a proxy server." 2010-12-16 12:16:52 -08:00
Jesse Wilson
bf1df887d4 New tests for AndroidHttpClient with a proxy server.
Change-Id: I03ec2f1257824c8675156dd80f6045512d1a36fe
http://b/3254717
2010-12-16 12:06:32 -08:00
Irfan Sheriff
58938159ec Fix ssid storage regression
I introduced a bug with change Ic12fd78f. Quite
possibly a copy-paste issue.

Bug: 3281928
Change-Id: I040fa8580c3d6d5c585d0e5cc4306daab2f44c3d
2010-12-16 07:45:58 -08:00
Vasu Nori
82e891b325 fix downloadmanager tests. add few more. fix some. isolate flaky ones
the following work
  frameworks/base/core/tests/coretests/src/android/app/DownloadManagerFunctionalTest.java
    ideally, most of the tests in this should be moved to cts testsuite.
    will require reformatting of comments
    and probably removal of one or two tests using hidden public API.

  packages/providers/DownloadProvider/tests/src/com/android/providers/downloads/DownloadManagerFunctionalTest.java
  packages/providers/DownloadProvider/tests/src/com/android/providers/downloads/PublicApiFunctionalTest.java
  packages/providers/DownloadProvider/tests/src/com/android/providers/downloads/ThreadingTest.java
  packages/providers/DownloadProvider/tests/public_api_access/src/com/android/providers/downloads/public_api_access_tests/PublicApiAccessTest.java
  packages/providers/DownloadProvider/tests/permission/src/com/android/providers/downloads/permission/tests/DownloadProviderPermissionsTest.java

the following need work
  frameworks/base/core/tests/coretests/src/android/app/DownloadManagerStressTest.java
 some of these tests fail in a flaky way. they need work

Change-Id: Ib64645005a8f5faa32e0b9a4c5cacfe6e6ae3063
2010-12-16 00:36:50 -08:00
Xia Wang
8efaeb03ea Disable airplane mode once the test is finished. #3276498
Verify wifi state in 3g->AM->3g test.

Change-Id: I3ce7ebad963c09be666b508f05eddbd0ded255d7
2010-12-10 17:20:30 -08:00
Xia Wang
93ca011c60 Make Wi-Fi stress tests output log consistent.
Fix: record average at the beginning of each iteration

Change-Id: Ia129348dbf79ecf7efc7169b8bbfac3755ccce63
2010-12-09 19:07:59 -08:00
Fred Quintana
0c4d04ac2e allow sync adapter authors to control more policies
- let the SyncManager know that the SyncAdapter can handle
  parallel syncs even within sync adapter types
- allow indicating that the sync adapter should be auto
  initialized without requiring the sync adapter to run first.
  When this setting is used then setIsSyncable(1) is automatically
  called for the sync adapter.

Change-Id: Ib40eba95c2556eaee4bb0fe715f379af1b72b84a
2010-12-09 14:24:34 -08:00
Svetoslav Ganov
02b93914b4 Merge "bug 3248277 android.webkit.AccessibilityInjectorTest tests are flaky on trygon" 2010-12-08 11:39:13 -08:00
Eric Rowe
f9dee3b1d3 Merge "Allow extra flags to be fired in BT stress tests" 2010-12-08 11:11:48 -08:00
Xia Wang
8c1c1e875e Make the scan test log consistent.
Change-Id: I44fd790c21fed6bb2b615a047b762b5ac7c451bb
2010-12-07 15:39:11 -08:00
Svetoslav Ganov
ea26a4feb6 bug 3248277 android.webkit.AccessibilityInjectorTest tests are flaky on trygon
Change-Id: I06332bc6eafb692b9ec829a093d23eccde897a2a
2010-12-07 14:32:33 -08:00
Xia Wang
90e1c782a6 Add Wi-Fi stress tests.
- Wi-Fi scan stress
- Wi-Fi reconnection stress
- Measure Wi-Fi scanning performance:
  . Average scanning time
  . Scanning quality

Change-Id: Ifce496876811816b452aed4ae9642fdb2db44798
2010-12-07 14:21:51 -08:00
Jesse Wilson
ee3567558f Merge "Test that we use proxies specified by system properties." 2010-12-06 15:24:28 -08:00
Jesse Wilson
10733a71c5 Test that we use proxies specified by system properties.
This tests that we use the properties and also that the
precedence prefers client and request properties.

Change-Id: I480dacaf373e3ddd7642d3c918fa50695b36cdba
http://b/3254717
2010-12-06 15:10:11 -08:00
Fred Quintana
384977fcea Merge "add caching to the AccountManagerService" 2010-12-06 09:55:54 -08:00
Fred Quintana
56285a60e8 add caching to the AccountManagerService
- cache the accounts, userdata and authtokens
 - make the AccountManagerServiceTest work again
 - add a log statement for every binder call

http://b/issue?id=3188457

Change-Id: I96b94b9b690cf391fe4341e2a72893a6d823777b
2010-12-03 15:35:48 -08:00
Xia Wang
3c3743c541 Merge "Add Wi-Fi connection test for static IP" 2010-12-02 16:39:53 -08:00
Xia Wang
a42a1e6b6f Add Wi-Fi connection test for static IP
- Add support in access point parser to support static ip settings
- Add Wi-Fi test with static IP configuration
- Use WifiManager new APIs
- Fix issue: if the expected AP is not in the scan list, retry scanning.
  Maximum is 5.
- Fix issue: wait for wifi state change before connecting to AP.

Change-Id: Id09b921c8a6a4b14f3c65cdea0b58c7e6f395520
2010-12-02 16:25:26 -08:00
Xia Wang
5343f5a84e am 3591bebd: Merge "Restore Wi-Fi configuration after the test. DO NOT MERGE" into gingerbread
* commit '3591bebd5957a8547fc54659179a19440636e7f9':
  Restore Wi-Fi configuration after the test. DO NOT MERGE
2010-12-02 13:44:54 -08:00
Xia Wang
fddbe98cca Restore Wi-Fi configuration after the test. DO NOT MERGE
- save Wi-Fi configuration and restore it after the test, other tests
  may need data connection
- Fix issue: reset dhcp after parsing a static IP setting.

bug: 3240713

Change-Id: I2158cab6fb6751414893b6a950d9e5bb20021645
2010-12-01 15:18:31 -08:00
Eric Rowe
5d0ed7b952 Allow extra flags to be fired in BT stress tests
Change-Id: I69a7748a3cbbd5aa7d2e4e3d9201389d67180761
2010-12-01 12:35:46 -08:00
Jesse Wilson
47413708eb Add a test to demonstrate parsing of trailing URI parameters.
Change-Id: I1fde21381cf74b5e4847bb2c2a9ef52f8ac6a2bb
http://b/3124097
2010-12-01 11:48:51 -08:00
Xia Wang
a23fff3351 am c1c04ad0: Merge "Add Wi-Fi tests for static IP. DO NOT MERGE" into gingerbread
* commit 'c1c04ad047d7ca2f13aa5c9883da7219df5bee57':
  Add Wi-Fi tests for static IP. DO NOT MERGE
2010-11-24 13:29:56 -08:00
Bjorn Bringert
93fbae34ce Merge "Don't drop zeros in the second position in formatDuration()" 2010-11-24 03:25:17 -08:00
Fabrice Di Meglio
7e118b5ba0 Fix bug #2898737 (add unit tests for SyncOperation.toKey())
Change-Id: I25ae95c9ca67ae5dcb71ff427d976e3e93b48125
2010-11-23 17:31:29 -08:00
Bjorn Bringert
901b3796fd Don't drop zeros in the second position in formatDuration()
Bug: 3223250
Change-Id: I462c96af51cc052f9df1dc3d2c668551b10155ea
2010-11-23 14:43:12 +00:00
Xia Wang
739d0aed02 Add Wi-Fi tests for static IP. DO NOT MERGE
- Add support in parser to parse static IP settings
- Add test for static IP configuration

Change-Id: I37e11ceb0f34c87113d8281b4de09893506c29e7
2010-11-22 19:10:01 -08:00