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

Commit dfcc4cb6 authored by Raphael Kim's avatar Raphael Kim Committed by Automerger Merge Worker
Browse files

Merge "Re-introduce ActivityTaskManager in CdmService" into tm-dev am: 06258e35

parents f6507452 06258e35
Loading
Loading
Loading
Loading
+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));