Skip to content

Commit

Permalink
Update ShadowNativeSQLiteConnection.nativeOpen to not ignore parameters
Browse files Browse the repository at this point in the history
The parameters 'lookasideSlotSize' and 'lookasideSlotCount' were being
unnecessarily ignored. Update ShadowNativeSQLiteConnection.nativeOpen
methods to include them.

PiperOrigin-RevId: 582043627
  • Loading branch information
hoisie authored and Copybara-Service committed Nov 13, 2023
1 parent 961385c commit d2d6b77
Showing 1 changed file with 18 additions and 14 deletions.
Expand Up @@ -23,19 +23,11 @@ public class ShadowNativeSQLiteConnection extends ShadowSQLiteConnection {
@Implementation(maxSdk = O)
protected static Number nativeOpen(
String path, int openFlags, String label, boolean enableTrace, boolean enableProfile) {
DefaultNativeRuntimeLoader.injectAndLoad();
return PerfStatsCollector.getInstance()
.measure(
"androidsqlite",
() -> {
long result =
SQLiteConnectionNatives.nativeOpen(
path, openFlags, label, enableTrace, enableProfile, 0, 0);
if (RuntimeEnvironment.getApiLevel() < LOLLIPOP) {
return PreLPointers.register(result);
}
return result;
});
long result = nativeOpen(path, openFlags, label, enableTrace, enableProfile, 0, 0);
if (RuntimeEnvironment.getApiLevel() < LOLLIPOP) {
return PreLPointers.register(result);
}
return result;
}

@Implementation(minSdk = O_MR1)
Expand All @@ -47,7 +39,19 @@ protected static long nativeOpen(
boolean enableProfile,
int lookasideSlotSize,
int lookasideSlotCount) {
return nativeOpen(path, openFlags, label, enableTrace, enableProfile).longValue();
DefaultNativeRuntimeLoader.injectAndLoad();
return PerfStatsCollector.getInstance()
.measure(
"androidsqlite",
() ->
SQLiteConnectionNatives.nativeOpen(
path,
openFlags,
label,
enableTrace,
enableProfile,
lookasideSlotSize,
lookasideSlotCount));
}

@Implementation(maxSdk = KITKAT_WATCH)
Expand Down

0 comments on commit d2d6b77

Please sign in to comment.