Fix component management in VrManagerService. am: 1f4f26b1d5
am: 6bddc28000
Change-Id: I675a257623d9765b71c3080485666adade43aee4
This commit is contained in:
@@ -46,6 +46,7 @@ import android.service.vr.IVrListener;
|
|||||||
import android.service.vr.IVrManager;
|
import android.service.vr.IVrManager;
|
||||||
import android.service.vr.IVrStateCallbacks;
|
import android.service.vr.IVrStateCallbacks;
|
||||||
import android.service.vr.VrListenerService;
|
import android.service.vr.VrListenerService;
|
||||||
|
import android.text.TextUtils;
|
||||||
import android.util.ArrayMap;
|
import android.util.ArrayMap;
|
||||||
import android.util.ArraySet;
|
import android.util.ArraySet;
|
||||||
import android.util.Slog;
|
import android.util.Slog;
|
||||||
@@ -643,7 +644,7 @@ public class VrManagerService extends SystemService implements EnabledComponentC
|
|||||||
|
|
||||||
for (String c : current) {
|
for (String c : current) {
|
||||||
ComponentName component = ComponentName.unflattenFromString(c);
|
ComponentName component = ComponentName.unflattenFromString(c);
|
||||||
if (component.getPackageName().equals(pkg)) {
|
if (component != null && component.getPackageName().equals(pkg)) {
|
||||||
toRemove.add(c);
|
toRemove.add(c);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -671,7 +672,9 @@ public class VrManagerService extends SystemService implements EnabledComponentC
|
|||||||
if (flat != null) {
|
if (flat != null) {
|
||||||
String[] allowed = flat.split(":");
|
String[] allowed = flat.split(":");
|
||||||
for (String s : allowed) {
|
for (String s : allowed) {
|
||||||
current.add(s);
|
if (!TextUtils.isEmpty(s)) {
|
||||||
|
current.add(s);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return current;
|
return current;
|
||||||
|
|||||||
Reference in New Issue
Block a user