Fix bug that the dream is set to "" when null is passed.
Currently if null is passed, the active dream is set to "" instead of null. This is problematic because our code doesn't have logic for handling "" like null. Test: atest NudgeToSetupDreamCallbackTest Test: manually flash device and run Test: atest DreamManagerServiceTests Bug: 213368707 Change-Id: Ic4922fb61f7ceef9fc48e81f1455872861e34af5
This commit is contained in:
@@ -484,14 +484,15 @@ public final class DreamManagerService extends SystemService {
|
||||
}
|
||||
|
||||
private static String componentsToString(ComponentName[] componentNames) {
|
||||
if (componentNames == null) {
|
||||
return null;
|
||||
}
|
||||
StringBuilder names = new StringBuilder();
|
||||
if (componentNames != null) {
|
||||
for (ComponentName componentName : componentNames) {
|
||||
if (names.length() > 0) {
|
||||
names.append(',');
|
||||
}
|
||||
names.append(componentName.flattenToString());
|
||||
for (ComponentName componentName : componentNames) {
|
||||
if (names.length() > 0) {
|
||||
names.append(',');
|
||||
}
|
||||
names.append(componentName.flattenToString());
|
||||
}
|
||||
return names.toString();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user