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

Commit ae8fd62f authored by Adrian Roos's avatar Adrian Roos
Browse files

Revert "Add null check for vrManager"

This reverts commit ecf80f0e.
Bug: 112064298
Change-Id: I3e6777ac47f666671bf43e22f485dc94865a369b
parent e19a4540
Loading
Loading
Loading
Loading
+4 −5
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@ import static android.os.HardwarePropertiesManager.TEMPERATURE_THROTTLING;
import static android.os.HardwarePropertiesManager.TEMPERATURE_THROTTLING_BELOW_VR_MIN;

import android.Manifest;
import android.app.ActivityManager;
import android.app.AppOpsManager;
import android.app.admin.DevicePolicyManager;
import android.content.Context;
@@ -33,8 +34,8 @@ import android.content.pm.PackageManager;
import android.os.Binder;
import android.os.CpuUsageInfo;
import android.os.IHardwarePropertiesManager;
import android.os.Process;
import android.os.UserHandle;

import com.android.internal.util.DumpUtils;
import com.android.server.vr.VrManagerInternal;

@@ -165,14 +166,12 @@ public class HardwarePropertiesManagerService extends IHardwarePropertiesManager
        final VrManagerInternal vrService = LocalServices.getService(VrManagerInternal.class);
        final DevicePolicyManager dpm = mContext.getSystemService(DevicePolicyManager.class);
        if (!dpm.isDeviceOwnerApp(callingPackage)
                && !vrService.isCurrentVrListener(callingPackage, userId)
                && mContext.checkCallingOrSelfPermission(Manifest.permission.DEVICE_POWER)
                        != PackageManager.PERMISSION_GRANTED) {
            throw new SecurityException("The caller is not a device owner"
            throw new SecurityException("The caller is not a device owner, bound VrListenerService"
                + ", or holding the DEVICE_POWER permission.");
        }
        if (vrService != null && !vrService.isCurrentVrListener(callingPackage, userId)) {
            throw new SecurityException("The caller is not bound VrListenerService.");
        }
    }
}