Fix potential NPE

Test: manual
Bug: 112753848
Change-Id: I741a93348b1d69b419527f5dd6983227c28bc9ca
This commit is contained in:
Beverly
2018-10-02 16:14:07 -04:00
parent f9151368ce
commit c629ee4d90

View File

@@ -48,6 +48,7 @@ import android.util.proto.ProtoOutputStream;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
@@ -722,10 +723,15 @@ public class NotificationManager {
public List<NotificationChannelGroup> getNotificationChannelGroups() {
INotificationManager service = getService();
try {
return service.getNotificationChannelGroups(mContext.getPackageName()).getList();
final ParceledListSlice<NotificationChannelGroup> parceledList =
service.getNotificationChannelGroups(mContext.getPackageName());
if (parceledList != null) {
return parceledList.getList();
}
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
return new ArrayList<>();
}
/**