- The lifetime of a database was previously tied to the SQLiteDatabase instance. This
is not the appropriate android behavior and breaks code that opens and closes the
same database path mulitple times. The behavior is changed to cache the database
connection which can then be shared across multiple SQLiteDatabase instances. A
new helper method ShadowSQLiteDatabase.deleteDatabase is added which a test can
use to delete the database. The database now supports the path and name parameter
such that calls with the same path/name reference the same database file.
This is a breaking change for tests. All tests in the project were updated to
handle the new behavior.
- Added missing implementations of various methods in ShadowSQLiteDatabase and
- Fixed nested transactions in ShadowSQLiteDatabase. The android implementation
supports nested transactions such that a transaction is only committed when its
outer-most transaction is ended successfully. I copied the logic from the
Android implementation to match the correct behavior. Also fixed the locking
semantics in this area to mach Android. Because h2/sqlite differ in how
transactions work, I made sqlite match the android behavior and maintained
backwards compatability with how the code was previously using h2.
- Removed some dead code from ShadowSQLiteDatabase.
Summary: android.os.Vibrator became an abstract class in Android 4.1.
This copies the dummy NullVibrator implementation from the 4.1 sdk
source and instructs robolectric to load that class if it sees that
android.os.Vibrator is abstract.
Test Plan: Linked against the r16 (jellybean) android.jar and ran unit
tests which relied on Vibrator.