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

Commit 5e55f5de authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Merge cherrypicks of [19087061, 19066676] into tm-release.

Change-Id: I73aab10b34c918e10b9260f6430ed7246bf302b5
parents d1fb1f4e 6c95f48d
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -542,14 +542,17 @@ public class ApkLiteParseUtils {

                int minVer = DEFAULT_MIN_SDK_VERSION;
                String minCode = null;
                boolean minAssigned = false;
                int targetVer = DEFAULT_TARGET_SDK_VERSION;
                String targetCode = null;

                if (!TextUtils.isEmpty(minSdkVersionString)) {
                    try {
                        minVer = Integer.parseInt(minSdkVersionString);
                        minAssigned = true;
                    } catch (NumberFormatException ignored) {
                        minCode = minSdkVersionString;
                        minAssigned = !TextUtils.isEmpty(minCode);
                    }
                }

@@ -558,7 +561,7 @@ public class ApkLiteParseUtils {
                        targetVer = Integer.parseInt(targetSdkVersionString);
                    } catch (NumberFormatException ignored) {
                        targetCode = targetSdkVersionString;
                        if (minCode == null) {
                        if (!minAssigned) {
                            minCode = targetCode;
                        }
                    }
+6 −0
Original line number Diff line number Diff line
@@ -100,6 +100,7 @@ import com.android.server.LocalServices;
import com.android.server.SystemService;
import com.android.server.companion.presence.CompanionDevicePresenceMonitor;
import com.android.server.pm.UserManagerInternal;
import com.android.server.wm.ActivityTaskManagerInternal;

import java.io.File;
import java.io.FileDescriptor;
@@ -135,6 +136,7 @@ public class CompanionDeviceManagerService extends SystemService {
    private CompanionDevicePresenceMonitor mDevicePresenceMonitor;
    private CompanionApplicationController mCompanionAppController;

    private final ActivityTaskManagerInternal mAtmInternal;
    private final ActivityManagerInternal mAmInternal;
    private final IAppOpsService mAppOpsManager;
    private final PowerWhitelistManager mPowerWhitelistManager;
@@ -159,6 +161,7 @@ public class CompanionDeviceManagerService extends SystemService {
        mPowerWhitelistManager = context.getSystemService(PowerWhitelistManager.class);
        mAppOpsManager = IAppOpsService.Stub.asInterface(
                ServiceManager.getService(Context.APP_OPS_SERVICE));
        mAtmInternal = LocalServices.getService(ActivityTaskManagerInternal.class);
        mAmInternal = LocalServices.getService(ActivityManagerInternal.class);
        mPackageManagerInternal = LocalServices.getService(PackageManagerInternal.class);
        mUserManager = context.getSystemService(UserManager.class);
@@ -969,6 +972,9 @@ public class CompanionDeviceManagerService extends SystemService {
                companionAppUids.add(uid);
            }
        }
        if (mAtmInternal != null) {
            mAtmInternal.setCompanionAppUids(userId, companionAppUids);
        }
        if (mAmInternal != null) {
            // Make a copy of the set and send it to ActivityManager.
            mAmInternal.setCompanionAppUids(userId, new ArraySet<>(companionAppUids));
+4 −1
Original line number Diff line number Diff line
@@ -1540,6 +1540,7 @@ public class ParsingPackageUtils {
            try {
                int minVers = ParsingUtils.DEFAULT_MIN_SDK_VERSION;
                String minCode = null;
                boolean minAssigned = false;
                int targetVers = ParsingUtils.DEFAULT_TARGET_SDK_VERSION;
                String targetCode = null;
                int maxVers = Integer.MAX_VALUE;
@@ -1548,9 +1549,11 @@ public class ParsingPackageUtils {
                if (val != null) {
                    if (val.type == TypedValue.TYPE_STRING && val.string != null) {
                        minCode = val.string.toString();
                        minAssigned = !TextUtils.isEmpty(minCode);
                    } else {
                        // If it's not a string, it's an integer.
                        minVers = val.data;
                        minAssigned = true;
                    }
                }

@@ -1558,7 +1561,7 @@ public class ParsingPackageUtils {
                if (val != null) {
                    if (val.type == TypedValue.TYPE_STRING && val.string != null) {
                        targetCode = val.string.toString();
                        if (minCode == null) {
                        if (!minAssigned) {
                            minCode = targetCode;
                        }
                    } else {