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

Commit 9e6b5f74 authored by Stanley Tng's avatar Stanley Tng Committed by android-build-merger
Browse files

Merge "Delete Database before removing from list" am: 11a891e3

am: a02c3bff

Change-Id: I643e02d9ac7fc3470dd6768f9214dc98150cbbf2
parents 73fd6ef3 a02c3bff
Loading
Loading
Loading
Loading
+3 −8
Original line number Diff line number Diff line
@@ -151,9 +151,10 @@ public class DatabaseManager {
                }
                createMetadata(address);
            } else {
                if (mMetadataCache.containsKey(address)) {
                Metadata metadata = mMetadataCache.get(address);
                if (metadata != null) {
                    mMetadataCache.remove(address);
                    deleteDatabase(mMetadataCache.get(address));
                    deleteDatabase(metadata);
                }
            }
        }
@@ -707,9 +708,6 @@ public class DatabaseManager {
    }

    private void updateDatabase(Metadata data) {
        if (data == null) {
            Log.e(TAG, "updateDatabase: data is null");
        }
        if (data.getAddress() == null) {
            Log.e(TAG, "updateDatabase: address is null");
            return;
@@ -723,9 +721,6 @@ public class DatabaseManager {
    }

    private void deleteDatabase(Metadata data) {
        if (data == null) {
            Log.e(TAG, "deleteDatabase: data is null");
        }
        if (data.getAddress() == null) {
            Log.e(TAG, "deleteDatabase: address is null");
            return;