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

Change-Id: I39624bcabfd7b543993d1e706ca0a2b3264057d3
This commit is contained in:
Automerger Merge Worker
2020-03-06 19:33:05 +00:00
2 changed files with 19 additions and 0 deletions

View File

@@ -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

View File

@@ -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.