diff options
Diffstat (limited to 'core/java/android/content/RestrictionsManager.java')
| -rw-r--r-- | core/java/android/content/RestrictionsManager.java | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/core/java/android/content/RestrictionsManager.java b/core/java/android/content/RestrictionsManager.java index 6893067e060b..88aae6655428 100644 --- a/core/java/android/content/RestrictionsManager.java +++ b/core/java/android/content/RestrictionsManager.java @@ -719,10 +719,20 @@ public class RestrictionsManager { bundle.putBundle(entry.getKey(), childBundle); break; case RestrictionEntry.TYPE_BUNDLE_ARRAY: - restrictions = entry.getRestrictions(); - Bundle[] bundleArray = new Bundle[restrictions.length]; - for (int i = 0; i < restrictions.length; i++) { - bundleArray[i] = addRestrictionToBundle(new Bundle(), restrictions[i]); + RestrictionEntry[] bundleRestrictionArray = entry.getRestrictions(); + Bundle[] bundleArray = new Bundle[bundleRestrictionArray.length]; + for (int i = 0; i < bundleRestrictionArray.length; i++) { + RestrictionEntry[] bundleRestrictions = + bundleRestrictionArray[i].getRestrictions(); + if (bundleRestrictions == null) { + // Non-bundle entry found in bundle array. + Log.w(TAG, "addRestrictionToBundle: " + + "Non-bundle entry found in bundle array"); + bundleArray[i] = new Bundle(); + } else { + bundleArray[i] = convertRestrictionsToBundle(Arrays.asList( + bundleRestrictions)); + } } bundle.putParcelableArray(entry.getKey(), bundleArray); break; |
