Merge "Remove isV2App"

This commit is contained in:
Treehugger Robot
2019-04-17 19:22:53 +00:00
committed by Gerrit Code Review
3 changed files with 3 additions and 11 deletions

View File

@@ -10722,7 +10722,7 @@ public class PackageManagerService extends IPackageManager.Stub
sharedUserSetting.isPrivileged() | pkg.isPrivileged() : pkg.isPrivileged(); sharedUserSetting.isPrivileged() | pkg.isPrivileged() : pkg.isPrivileged();
pkg.applicationInfo.seInfo = SELinuxMMAC.getSeInfo(pkg, isPrivileged, pkg.applicationInfo.seInfo = SELinuxMMAC.getSeInfo(pkg, isPrivileged,
pkg.applicationInfo.targetSandboxVersion, targetSdkVersion); targetSdkVersion);
pkg.applicationInfo.seInfoUser = SELinuxUtil.assignSeinfoUser(pkgSetting.readUserState( pkg.applicationInfo.seInfoUser = SELinuxUtil.assignSeinfoUser(pkgSetting.readUserState(
userId == UserHandle.USER_ALL ? UserHandle.USER_SYSTEM : userId)); userId == UserHandle.USER_ALL ? UserHandle.USER_SYSTEM : userId));

View File

@@ -69,9 +69,6 @@ public final class SELinuxMMAC {
// Append privapp to existing seinfo label // Append privapp to existing seinfo label
private static final String PRIVILEGED_APP_STR = ":privapp"; private static final String PRIVILEGED_APP_STR = ":privapp";
// Append v2 to existing seinfo label
private static final String SANDBOX_V2_STR = ":v2";
// Append targetSdkVersion=n to existing seinfo label where n is the app's targetSdkVersion // Append targetSdkVersion=n to existing seinfo label where n is the app's targetSdkVersion
private static final String TARGETSDKVERSION_STR = ":targetSdkVersion="; private static final String TARGETSDKVERSION_STR = ":targetSdkVersion=";
@@ -323,14 +320,13 @@ public final class SELinuxMMAC {
* *
* @param pkg object representing the package to be labeled. * @param pkg object representing the package to be labeled.
* @param isPrivileged boolean. * @param isPrivileged boolean.
* @param targetSandboxVersion int.
* @param targetSdkVersion int. If this pkg runs as a sharedUser, targetSdkVersion is the * @param targetSdkVersion int. If this pkg runs as a sharedUser, targetSdkVersion is the
* greater of: lowest targetSdk for all pkgs in the sharedUser, or * greater of: lowest targetSdk for all pkgs in the sharedUser, or
* MINIMUM_TARGETSDKVERSION. * MINIMUM_TARGETSDKVERSION.
* @return String representing the resulting seinfo. * @return String representing the resulting seinfo.
*/ */
public static String getSeInfo(PackageParser.Package pkg, boolean isPrivileged, public static String getSeInfo(PackageParser.Package pkg, boolean isPrivileged,
int targetSandboxVersion, int targetSdkVersion) { int targetSdkVersion) {
String seInfo = null; String seInfo = null;
synchronized (sPolicies) { synchronized (sPolicies) {
if (!sPolicyRead) { if (!sPolicyRead) {
@@ -351,10 +347,6 @@ public final class SELinuxMMAC {
seInfo = DEFAULT_SEINFO; seInfo = DEFAULT_SEINFO;
} }
if (targetSandboxVersion == 2) {
seInfo += SANDBOX_V2_STR;
}
if (isPrivileged) { if (isPrivileged) {
seInfo += PRIVILEGED_APP_STR; seInfo += PRIVILEGED_APP_STR;
} }

View File

@@ -139,7 +139,7 @@ public final class SharedUserSetting extends SettingBase {
for (PackageParser.Package pkg : pkgList) { for (PackageParser.Package pkg : pkgList) {
final boolean isPrivileged = isPrivileged() | pkg.isPrivileged(); final boolean isPrivileged = isPrivileged() | pkg.isPrivileged();
pkg.applicationInfo.seInfo = SELinuxMMAC.getSeInfo(pkg, isPrivileged, pkg.applicationInfo.seInfo = SELinuxMMAC.getSeInfo(pkg, isPrivileged,
pkg.applicationInfo.targetSandboxVersion, seInfoTargetSdkVersion); seInfoTargetSdkVersion);
} }
} }