Fixed
Status Update
Comments
yb...@google.com <yb...@google.com>
da...@google.com <da...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-master-dev
commit 26288a9e8c3cb7ef4888ed252e2765bda7ab7d54
Author: Jeremy Woods <jbwoods@google.com>
Date: Thu Jul 30 18:45:38 2020
override equals and hashCode for NavOptions
Lets implement these methods to simplify comparing NavOptions.
Equals method generated using studio.
Test: ./gradlew bOS
Bug: 161586466
Change-Id: I1beb8d06aa72ed6ad7bfe77d1f134a9793bc7e38
M navigation/navigation-common/src/main/java/androidx/navigation/NavOptions.java
https://android-review.googlesource.com/1381476
Branch: androidx-master-dev
commit 26288a9e8c3cb7ef4888ed252e2765bda7ab7d54
Author: Jeremy Woods <jbwoods@google.com>
Date: Thu Jul 30 18:45:38 2020
override equals and hashCode for NavOptions
Lets implement these methods to simplify comparing NavOptions.
Equals method generated using studio.
Test: ./gradlew bOS
Bug: 161586466
Change-Id: I1beb8d06aa72ed6ad7bfe77d1f134a9793bc7e38
M navigation/navigation-common/src/main/java/androidx/navigation/NavOptions.java
Description
Version used:1.1.1
Devices/Android versions reproduced on: All
File: FrameworkSQLiteOpenHelper
OpenHelper(Context context, String name, final FrameworkSQLiteDatabase[] dbRef,
final Callback callback) {
super(context, name, null, callback.version,
new DatabaseErrorHandler() {
@Override
public void onCorruption(SQLiteDatabase dbObj) {
FrameworkSQLiteDatabase db = dbRef[0];
if (db != null) {
callback.onCorruption(db);
}
}
});
mCallback = callback;
mDbRef = dbRef;
}
callback.onCorruption(db) will never called when the db is corrupted, cause dbRef[0] always is null.
Maybe this code is better:
OpenHelper(Context context, String name, final FrameworkSQLiteDatabase[] dbRef,
final Callback callback) {
super(context, name, null, callback.version,
new DatabaseErrorHandler() {
@Override
public void onCorruption(SQLiteDatabase dbObj) {
FrameworkSQLiteDatabase db = dbRef[0];
callback.onCorruption(db != null ? db : new FrameworkSQLiteDatabase(dbObj));
}
});
mCallback = callback;
mDbRef = dbRef;
}