200 Commits

Author SHA1 Message Date
Vasu Nori
65a8883f0e don't store mDatabase in SQLiteCursor as it is already in SQLiteQuery
SQLiteCursor has two members: mQuery, mDatabase
but mQuery already has mDatabase.
there is no need for SQLiteCursor.mDatabase.
and everytime SQLiteQuery.mDatabase is to be used, try to use a pooled database
connection handle, if possible.
Change-Id: I42b2376d714a1a4091c843e245a45b882bb7fee6
2010-07-21 16:04:04 -07:00
Hung Dang
cbfa242609 am d652751d: am b6761e73: am 28fe43be: Merge "Add the hook which can set the device to connect to wifi and in airplane mode after reboot. This is for the power test." into froyo
Merge commit 'd652751de782bac7e37916ed5786fcfa637a2be3'

* commit 'd652751de782bac7e37916ed5786fcfa637a2be3':
  Add the hook which can set the device to connect to wifi and in airplane mode after reboot. This is for the power test.
2010-07-16 16:25:27 -07:00
Hung Dang
d652751de7 am b6761e73: am 28fe43be: Merge "Add the hook which can set the device to connect to wifi and in airplane mode after reboot. This is for the power test." into froyo
Merge commit 'b6761e73ce6b255cfe96bfa1fa6ac611abcfc067' into gingerbread-plus-aosp

* commit 'b6761e73ce6b255cfe96bfa1fa6ac611abcfc067':
  Add the hook which can set the device to connect to wifi and in airplane mode after reboot. This is for the power test.
2010-07-16 15:18:03 -07:00
Hung Dang
b6761e73ce am 28fe43be: Merge "Add the hook which can set the device to connect to wifi and in airplane mode after reboot. This is for the power test." into froyo
Merge commit '28fe43be5c364a8f7f248a5ac05cf832a83737c2' into gingerbread

* commit '28fe43be5c364a8f7f248a5ac05cf832a83737c2':
  Add the hook which can set the device to connect to wifi and in airplane mode after reboot. This is for the power test.
2010-07-16 15:15:44 -07:00
The Android Open Source Project
506e6e0882 am 3a94ab02: merge from open-source master
Merge commit '3a94ab026f0434624f233e99b1a0aadb9152a09a'

* commit '3a94ab026f0434624f233e99b1a0aadb9152a09a':
  Allow ListPreference summary to use entry
2010-07-16 13:56:16 -07:00
The Android Open Source Project
3a94ab026f merge from open-source master
Change-Id: Ib00a02e90d5c2c0b4cc1919258b858930967198b
2010-07-16 13:50:12 -07:00
Yu Shan Emily Lau
ba1348e3c2 Add the hook which can set the device to connect to wifi and in airplane mode after reboot. This is for the power test.
Change-Id: I42527612764252d1c47bd29a2b88d5e3019cfdf9
2010-07-16 12:00:30 -07:00
Kenny Root
ba636df784 Allow ListPreference summary to use entry
Currently when ListPreferences are used in a PreferenceActivity, the summary
values are set to the same as the current index in mEntryValue. This patch
adds the ability for a string substitution to be used in the summary
which points to the corresponding entry in mEntries to aid in
localization.

For example a preference may be named "color" with the following attributes
in the locale "de" (German):

mEntryValues = { "red", "green", "blue" }
mEntries = { "rot", "grün", "blau" }
mSummary = "Die Farbe ist %1$s."

getSummary() returns "Die Farbe ist grün."

Change-Id: Iea169ac3d1c9d6290d853fc7c67a7c4c8a11bb90
2010-07-13 10:28:44 -07:00
Vasu Nori
e25539fdfd reduce locking when using SQLiteStatement
Do compiling of sql, binding of args and execution of the SQL
statement within one single database lock period.
This reduces the number of times the database lock
needs to be acquired during the course of compilation, binding
and execution of a SQLiteStatement.

Change-Id: I22b090ec9e10fc0aa2532a93bafe610af2546b58
2010-07-09 12:31:12 -07:00
Vasu Nori
57feb5d9a7 STOPSHIP CL in master - make sqlite WAL default for all apps
for testing the sqlite WAL feature in the next few weeks.

Change-Id: I07234647b5e90d9e3bb0a5310b6cc449d58db428
2010-07-08 11:41:52 -07:00
Vasu Nori
2827d6d974 for WAL to work, can't keep prepared SQL stmt_id in SQLiteStatement
Some (including the Contacts app) do the following:
  1. Open database
  2. As part of database_connection.onCreate(),
       Create some SQLiteStatement objects to cache them in the process
  3. attach databases
WAL doesn't work with attached databases. so, apps doing the above
should enable WAL only if there are no attached databases.

But we would like to enable WAL automatically for all apps after step #1 above
and disable WAL if the app subsequently does 'attach database' SQL.

this works only if there are no SQLiteStatement objects created in step # 2,
because SQLiteStatements cwmaintain a hard-reference to the database connection
for life and also to the prepared SQL statement id.
It is quite difficult to disable WAL in step # 3
    if it is enabled in step # 1
    and then a connection pool gets used by step # 2

would make WAL disabling easier if SQLiteStatement refers to prepared SQL
statement id only when it is needed (during binding and execute calls)
and thus NOT tied to a spacific database conenction.

also, from the standpoint of not blocking readers, it helps NOT to have
SQLiteStatement be married to a database connection and prepared SQL statement
id for life.

Change-Id: I464d57042965a28d2bde88e0f44b66ec119b40dc
2010-07-07 15:33:42 -07:00
Vasu Nori
6ac21d30be unittests for DatabaseConnectionPool (and fix bugs)
Change-Id: I6f251b4bdd472bd840ea1be6497660f8c31cd3e3
2010-07-07 14:26:10 -07:00
Vasu Nori
59d60420ba deprecate method returning prepared sql statement id
this method causes sql statement in a SQLiteProgram object to be never
re-compiled. thats not desirable, is it?
there should be no need for this method.

Change-Id: I207fad6415c1e2ef4097ee65a3ff347b5435b994
2010-07-03 16:31:35 -07:00
Vasu Nori
2776d57403 Merge "fix broken build: renaming a testfile" 2010-07-03 16:00:59 -07:00
Vasu Nori
7af57126b5 fix broken build: renaming a testfile
Change-Id: I973f604f4f87792b3f8734a6aea4a73d29e0b34b
2010-07-03 15:59:09 -07:00
Vasu Nori
d960ef8469 Merge "change name of a test to be more accurate" 2010-07-03 15:40:23 -07:00
Vasu Nori
709493707c change name of a test to be more accurate
Change-Id: Ie8c7d6ab4b80ae0446f9d67c8a04cef436948692
2010-07-03 15:36:27 -07:00
Vasu Nori
150daa1ae1 Merge "remove broken, unused and unwanted tests" 2010-07-02 11:46:00 -07:00
Vasu Nori
ed57af9e89 remove broken, unused and unwanted tests
Change-Id: I804b777b7c434c8a190d70d6a2556e1f157abe70
2010-07-02 11:16:45 -07:00
Vasu Nori
7501010b71 some refactoring and multi-threading fixes
Change-Id: I7a0497dc2ed7b1e21471d71532558ef243eb9f73
2010-07-02 10:58:29 -07:00
Xia Wang
2c8b142708 am 591908fd: am 120a58fb: Extend unit test framework for Wifi soft AP configuration Add test case: testApSsidWithAlphabet
Merge commit '591908fd3fd1a84303bbc76c5c44d5cb0ee0bc94'

* commit '591908fd3fd1a84303bbc76c5c44d5cb0ee0bc94':
  Extend unit test framework for Wifi soft AP configuration
2010-06-29 11:34:18 -07:00
Xia Wang
120a58fb80 Extend unit test framework for Wifi soft AP configuration
Add test case: testApSsidWithAlphabet

Change-Id: Ie188f241d15603015d264a7d568ed44ce4ca3ad8
2010-06-29 11:23:34 -07:00
Derek Sollenberger
b983c893d4 Rename a data storage object to better reflect its intended usage.
Change-Id: I18eae0665b59e7fee389a0e09955c5860a7e65f2
2010-06-28 12:59:48 -04:00
Derek Sollenberger
4aef697d58 Initial pass at unit tests for ZoomManager.
This CL also includes some minor changes to the ZoomManager that
make the manager easier to test as well as fix some uncovered issues.

Change-Id: I66a84d70ee75e765ccf9cccb2d123757a9470f93
2010-06-28 08:53:20 -04:00
Vasu Nori
e8bf6dbc40 fix broken test similar to I32c30f7d05e5bec7c6b2776ce9a80c8be61d856f
Change-Id: Idf075ea888dfab35afba0a28a838e3a15b7de545
2010-06-17 16:54:56 -07:00
Vasu Nori
0bcd289b99 move a sqlite test from framework-tests to coretests
Change-Id: Ic8d42a3c477e4ea0ad8eaa4e1869ae221b95ba46
2010-06-17 14:27:56 -07:00
Brett Chabot
83ea9e395e am 685fcf36: am c95812e6: Merge "Move out all framework-tests classes." into gingerbread
Merge commit '685fcf364b84d5ac911ae9cbbc4fec99f36cbd48'

* commit '685fcf364b84d5ac911ae9cbbc4fec99f36cbd48':
  Move out all framework-tests classes.
2010-06-16 14:42:51 -07:00
Brett Chabot
be81f4f15d Move out all framework-tests classes.
Previously tests/framework-tests contained a quarantined set of test classes
that needed access to package-private framework api. Running these tests
normally would cause the dalvik verifier to throw errors.

runtest now has support for turning off the dalvik verifier for frameworks
tests, so move this tests into their recommended location, close to the source
being tested.

Also move policy source into a 'src' folder to accommodate the tests move.

Change-Id: I62f839da185a55bc553b653bf583fd99da438512
2010-06-14 17:23:08 -07:00
Vasu Nori
d2cecfd375 fix broken-test
Change-Id: I3d33cda2e4f1ba68843d6a81b8c624ce4af8519f
2010-06-04 12:05:58 -07:00
The Android Open Source Project
4f2cf8af55 am 913dbc50: am a9f06fef: am ee7e6a78: merge from open-source master 2010-06-03 09:12:40 -07:00
The Android Open Source Project
a9f06fef8e am ee7e6a78: merge from open-source master
Merge commit 'ee7e6a78e28b360826f215e0e84d43b1513b6401' into kraken

* commit 'ee7e6a78e28b360826f215e0e84d43b1513b6401':
  Improved error-handling in Rfc822Tokenizer
2010-06-03 09:09:07 -07:00
The Android Open Source Project
ee7e6a78e2 merge from open-source master
Change-Id: Idf8d5661d7b261b74ac0b1271af98795ac5faff9
2010-06-03 09:03:58 -07:00
Vasu Nori
62697e57ed Merge "close() on anything other than database shouldn't acquire db lock." 2010-05-20 12:42:16 -07:00
Vasu Nori
6f37f83a48 close() on anything other than database shouldn't acquire db lock.
bug:2683001
implmentation details:
 1.close() on any sql statement is should simply queued up for finalization
    to be performed later. caller doesn't acquire database lock.
 2. the only effect of NOT close immediately is non-release of some memory.
 3. all such queued-up-finalizations are performed whenever there is
    another execute() of some sql statement on that database from ANY
    thread in the process.
 4. database close() automatically releases all unfinalized statements
    before closing the database.

Change-Id: If4c9c7fde6b8945a41abc6c8b992aa8c69854512
2010-05-20 12:35:17 -07:00
Daisuke Miyakawa
422017be68 Merge "Make vCard code a separated static library." 2010-05-20 11:30:26 -07:00
Daisuke Miyakawa
64545a8ced Make vCard code a separated static library.
- Move the library to a separate directory in framewokr/base, and rename its package from
  android.pim.vcard to com.android.vcard.
- Move all tests for the library under the directory.
- Confirm all tests for vCard are successful.

It would be better for us to have this directory somewhere else (like external/).
But I'll submit this here now and move it to the right place as soon as possible.
From the view of build mechanism, we can do that immediately.

BUG: 2689523
Change-Id: I435e10571b7160bfcc029bed7c37aaac1c6fd69a
2010-05-20 11:25:37 -07:00
Xia Wang
f3a6c73000 am 17530508: am cf7d2d50: am 3716ea04: am 06906796: If the network SSID is a string, it should be enclosed in double quotation marks. 2010-05-20 11:01:54 -07:00
Xia Wang
cf7d2d50a4 am 3716ea04: am 06906796: If the network SSID is a string, it should be enclosed in double quotation marks.
Merge commit '3716ea04d9fd59ff95bacdf6efac4ab5583e13fc' into kraken

* commit '3716ea04d9fd59ff95bacdf6efac4ab5583e13fc':
  If the network SSID is a string, it should be enclosed in double quotation marks.
2010-05-20 10:58:18 -07:00
Xia Wang
3716ea04d9 am 06906796: If the network SSID is a string, it should be enclosed in double quotation marks.
Merge commit '069067963cf0117cfb4a1aef99b550b126d9ca92' into froyo-plus-aosp

* commit '069067963cf0117cfb4a1aef99b550b126d9ca92':
  If the network SSID is a string, it should be enclosed in double quotation marks.
2010-05-20 10:56:13 -07:00
Xia Wang
069067963c If the network SSID is a string, it should be enclosed in double quotation marks.
bug id: 2701058

Change-Id: I40e10ba096053710d4974b005d0d2e7c309ccffe
2010-05-20 10:22:59 -07:00
Vasu Nori
8e5819662f Merge "DatabaseCorruptionHandler causes NPE" 2010-05-19 15:20:29 -07:00
Vasu Nori
85f08f9eae DatabaseCorruptionHandler causes NPE
it is trying to get attachedDb list (by executing a pragma) after closing
the database.
also added unittests.

Change-Id: I7dce665ec7354402cdef6fbe055455f5798e123c
2010-05-19 13:55:09 -07:00
Wink Saville
33c26f9fd0 am 199d3783: am 7e3b31d7: Merge "Update docs, add HANDLED, NOT_HANDLED and getCurrentMessage." into kraken 2010-05-19 13:09:11 -07:00
Wink Saville
a4f3bec29c Update docs, add HANDLED, NOT_HANDLED and getCurrentMessage.
The EBNF statemachine description language was to difficult
to remember changed to use a simpler and more obvious psuedo
language.

Added HANDLED and NOT_HANDLED as it makes the psuedo code
more obvious.

Added getCurrentMessage primarily for use by code in enter
so that it can know why the new state is being entered.

Change-Id: I1446e417b77684fbde0020b1da0975eedc57cce4
2010-05-19 09:11:38 -07:00
Suchi Amalapurapu
d7289efbad am 2be883c4: am 4ec730ca: am 7361b741: am 4a0823e5: Merge "Uncomment a test that was marked as STOPSHIP Add MediumTest tag" into froyo 2010-05-18 18:27:56 -07:00
Suchi Amalapurapu
6211c5690c am 5f0e438b: am 3d802ef7: am aa4db173: am 9a212adc: Fix 2641875 Initialize the cache path only if the container exists. This did exist before but was somehow removed. Fix a known test failure as well. 2010-05-18 18:27:28 -07:00
Suchi Amalapurapu
4ec730cabb am 7361b741: am 4a0823e5: Merge "Uncomment a test that was marked as STOPSHIP Add MediumTest tag" into froyo
Merge commit '7361b7410f2427022cc8917b00553dc26107cded' into kraken

* commit '7361b7410f2427022cc8917b00553dc26107cded':
  Uncomment a test that was marked as STOPSHIP
2010-05-18 14:55:48 -07:00
Suchi Amalapurapu
7361b7410f am 4a0823e5: Merge "Uncomment a test that was marked as STOPSHIP Add MediumTest tag" into froyo
Merge commit '4a0823e5486f16b10762076d629f2f7e4d5da476' into froyo-plus-aosp

* commit '4a0823e5486f16b10762076d629f2f7e4d5da476':
  Uncomment a test that was marked as STOPSHIP
2010-05-18 14:53:37 -07:00
Suchi Amalapurapu
fb7bacf6ba Uncomment a test that was marked as STOPSHIP
Add MediumTest tag

Change-Id: I0699d168d7ec70c076f4713e0e405c0779a290c6
2010-05-18 14:39:20 -07:00
Suchi Amalapurapu
3d802ef73b am aa4db173: am 9a212adc: Fix 2641875 Initialize the cache path only if the container exists. This did exist before but was somehow removed. Fix a known test failure as well.
Merge commit 'aa4db173a2465d74ea35cc7f736f6b2a5b01f72c' into kraken

* commit 'aa4db173a2465d74ea35cc7f736f6b2a5b01f72c':
  Fix 2641875
2010-05-18 13:17:58 -07:00