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

Commit 4f759954 authored by Manjeet Rulhania's avatar Manjeet Rulhania
Browse files

Optimize intern for device id when reading from sqlite db


Bug: 441229773
Test: presubmit
Flag: EXEMPT bug fix
Change-Id: I429ca80599190006541fe3e40c9a66e4921b74fd
parent d28cd594
Loading
Loading
Loading
Loading
+3 −2
Original line number Original line Diff line number Diff line
@@ -164,7 +164,8 @@ class AppOpHistoryDbHelper extends SQLiteOpenHelper {


    // Convert null back to default device.
    // Convert null back to default device.
    private @NonNull String getDeviceIdForDatabaseRead(@Nullable String deviceId) {
    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) {
    private int getDatabaseType(AggregationTimeWindow aggregationTimeWindow) {
@@ -323,7 +324,7 @@ class AppOpHistoryDbHelper extends SQLiteOpenHelper {
        int totalRejectCount = statement.getColumnInt(13);
        int totalRejectCount = statement.getColumnInt(13);


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