Loading services/java/com/android/server/pm/Installer.java +9 −2 Original line number Diff line number Diff line Loading @@ -397,7 +397,14 @@ public final class Installer { return execute(builder.toString()); } public boolean restoreconData() { return (execute("restorecondata") == 0); public boolean restoreconData(String pkgName, String seinfo, int uid) { StringBuilder builder = new StringBuilder("restorecondata"); builder.append(' '); builder.append(pkgName); builder.append(' '); builder.append(seinfo != null ? seinfo : "!"); builder.append(' '); builder.append(uid); return (execute(builder.toString()) == 0); } } services/java/com/android/server/pm/PackageManagerService.java +12 −7 Original line number Diff line number Diff line Loading @@ -393,6 +393,9 @@ public class PackageManagerService extends IPackageManager.Stub { // If mac_permissions.xml was found for seinfo labeling. boolean mFoundPolicyFile; // If a recursive restorecon of /data/data/<pkg> is needed. private boolean mShouldRestoreconData = SELinuxMMAC.shouldRestorecon(); // All available activities, for your resolving pleasure. final ActivityIntentResolver mActivities = new ActivityIntentResolver(); Loading Loading @@ -1486,13 +1489,6 @@ public class PackageManagerService extends IPackageManager.Stub { // can downgrade to reader mSettings.writeLPr(); if (SELinuxMMAC.shouldRestorecon()) { Slog.i(TAG, "Relabeling of /data/data and /data/user issued."); if (mInstaller.restoreconData()) { SELinuxMMAC.setRestoreconDone(); } } EventLog.writeEvent(EventLogTags.BOOT_PROGRESS_PMS_READY, SystemClock.uptimeMillis()); Loading Loading @@ -4617,6 +4613,11 @@ public class PackageManagerService extends IPackageManager.Stub { } } pkg.applicationInfo.dataDir = dataPath.getPath(); if (mShouldRestoreconData) { Slog.i(TAG, "SELinux relabeling of " + pkg.packageName + " issued."); mInstaller.restoreconData(pkg.packageName, pkg.applicationInfo.seinfo, pkg.applicationInfo.uid); } } else { if (DEBUG_PACKAGE_SCANNING) { if ((parseFlags & PackageParser.PARSE_CHATTY) != 0) Loading Loading @@ -11062,6 +11063,10 @@ public class PackageManagerService extends IPackageManager.Stub { */ public void scanAvailableAsecs() { updateExternalMediaStatusInner(true, false, false); if (mShouldRestoreconData) { SELinuxMMAC.setRestoreconDone(); mShouldRestoreconData = false; } } /* Loading Loading
services/java/com/android/server/pm/Installer.java +9 −2 Original line number Diff line number Diff line Loading @@ -397,7 +397,14 @@ public final class Installer { return execute(builder.toString()); } public boolean restoreconData() { return (execute("restorecondata") == 0); public boolean restoreconData(String pkgName, String seinfo, int uid) { StringBuilder builder = new StringBuilder("restorecondata"); builder.append(' '); builder.append(pkgName); builder.append(' '); builder.append(seinfo != null ? seinfo : "!"); builder.append(' '); builder.append(uid); return (execute(builder.toString()) == 0); } }
services/java/com/android/server/pm/PackageManagerService.java +12 −7 Original line number Diff line number Diff line Loading @@ -393,6 +393,9 @@ public class PackageManagerService extends IPackageManager.Stub { // If mac_permissions.xml was found for seinfo labeling. boolean mFoundPolicyFile; // If a recursive restorecon of /data/data/<pkg> is needed. private boolean mShouldRestoreconData = SELinuxMMAC.shouldRestorecon(); // All available activities, for your resolving pleasure. final ActivityIntentResolver mActivities = new ActivityIntentResolver(); Loading Loading @@ -1486,13 +1489,6 @@ public class PackageManagerService extends IPackageManager.Stub { // can downgrade to reader mSettings.writeLPr(); if (SELinuxMMAC.shouldRestorecon()) { Slog.i(TAG, "Relabeling of /data/data and /data/user issued."); if (mInstaller.restoreconData()) { SELinuxMMAC.setRestoreconDone(); } } EventLog.writeEvent(EventLogTags.BOOT_PROGRESS_PMS_READY, SystemClock.uptimeMillis()); Loading Loading @@ -4617,6 +4613,11 @@ public class PackageManagerService extends IPackageManager.Stub { } } pkg.applicationInfo.dataDir = dataPath.getPath(); if (mShouldRestoreconData) { Slog.i(TAG, "SELinux relabeling of " + pkg.packageName + " issued."); mInstaller.restoreconData(pkg.packageName, pkg.applicationInfo.seinfo, pkg.applicationInfo.uid); } } else { if (DEBUG_PACKAGE_SCANNING) { if ((parseFlags & PackageParser.PARSE_CHATTY) != 0) Loading Loading @@ -11062,6 +11063,10 @@ public class PackageManagerService extends IPackageManager.Stub { */ public void scanAvailableAsecs() { updateExternalMediaStatusInner(true, false, false); if (mShouldRestoreconData) { SELinuxMMAC.setRestoreconDone(); mShouldRestoreconData = false; } } /* Loading