Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2b93300d authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Optimize intern for device id when reading from sqlite db" into main

parents 7bbf04a4 4f759954
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -164,7 +164,8 @@ class AppOpHistoryDbHelper extends SQLiteOpenHelper {

    // Convert null back to default device.
    private @NonNull String getDeviceIdForDatabaseRead(@Nullable String deviceId) {
        return deviceId == null ? VirtualDeviceManager.PERSISTENT_DEVICE_ID_DEFAULT : deviceId;
        return deviceId == null ?
                VirtualDeviceManager.PERSISTENT_DEVICE_ID_DEFAULT : deviceId.intern();
    }

    private int getDatabaseType(AggregationTimeWindow aggregationTimeWindow) {
@@ -323,7 +324,7 @@ class AppOpHistoryDbHelper extends SQLiteOpenHelper {
        int totalRejectCount = statement.getColumnInt(13);

        return new AggregatedAppOpAccessEvent(uid,
                packageName != null ? packageName.intern() : null, opCode, deviceId.intern(),
                packageName != null ? packageName.intern() : null, opCode, deviceId,
                attributionTag != null ? attributionTag.intern() : null,
                opFlags, uidState, attributionFlags, attributionChainId, accessTime,
                duration, totalDuration, totalAccessCount, totalRejectCount);