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

Commit cb3d162c authored by Winson Chiu's avatar Winson Chiu Committed by Android (Google) Code Review
Browse files

Merge "Copy over PkgState in PackageSetting updateFrom" into rvc-dev

parents a95769b7 10bb870d
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -321,6 +321,8 @@ public class PackageSetting extends PackageSettingBase {

        Set<String> mimeGroupNames = other.mimeGroups != null ? other.mimeGroups.keySet() : null;
        updateMimeGroups(mimeGroupNames);

        getPkgState().updateFrom(other.getPkgState());
    }

    @NonNull
+17 −0
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@ import android.content.pm.SharedLibraryInfo;
import com.android.internal.util.DataClass;
import com.android.server.pm.PackageSetting;

import java.util.ArrayList;
import java.util.List;

/**
@@ -88,6 +89,22 @@ public class PackageStateUnserialized {
        return latestUse;
    }

    public void updateFrom(PackageStateUnserialized other) {
        this.hiddenUntilInstalled = other.hiddenUntilInstalled;

        if (!other.usesLibraryInfos.isEmpty()) {
            this.usesLibraryInfos = new ArrayList<>(other.usesLibraryInfos);
        }

        if (!other.usesLibraryFiles.isEmpty()) {
            this.usesLibraryFiles = new ArrayList<>(other.usesLibraryFiles);
        }

        this.updatedSystemApp = other.updatedSystemApp;
        this.lastPackageUsageTimeInMills = other.lastPackageUsageTimeInMills;
        this.overrideSeInfo = other.overrideSeInfo;
    }



    // Code below generated by codegen v1.0.14.