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

Commit 1f4f26b1 authored by Ruben Brunk's avatar Ruben Brunk
Browse files

Fix component management in VrManagerService.

- Add null checks to avoid crashing in transient state with no
  enabled packages during user switch.

Bug: 30574163
Change-Id: I316373e900d4be35be7691b50057d0701b7fb4a5
parent 828d4ff6
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -46,6 +46,7 @@ import android.service.vr.IVrListener;
import android.service.vr.IVrManager;
import android.service.vr.IVrStateCallbacks;
import android.service.vr.VrListenerService;
import android.text.TextUtils;
import android.util.ArrayMap;
import android.util.ArraySet;
import android.util.Slog;
@@ -643,7 +644,7 @@ public class VrManagerService extends SystemService implements EnabledComponentC

        for (String c : current) {
            ComponentName component = ComponentName.unflattenFromString(c);
            if (component.getPackageName().equals(pkg)) {
            if (component != null && component.getPackageName().equals(pkg)) {
                toRemove.add(c);
            }
        }
@@ -671,9 +672,11 @@ public class VrManagerService extends SystemService implements EnabledComponentC
        if (flat != null) {
            String[] allowed = flat.split(":");
            for (String s : allowed) {
                if (!TextUtils.isEmpty(s)) {
                    current.add(s);
                }
            }
        }
        return current;
    }