From f50730e3b2bcc426e7bee7bf639ae6af14816728 Mon Sep 17 00:00:00 2001 From: Yasmin Date: Fri, 26 Apr 2019 12:03:38 +0100 Subject: [PATCH] Update the contract docummentation regarding UnsupportedOperationException. Test: atest ManagedProfileTest#testCrossProfileCalendar atest CalendarProvider2Test Bug: 130284827 Change-Id: I9e98efae6bc7229b995506a542940663c3fbae8f --- core/java/android/provider/CalendarContract.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/java/android/provider/CalendarContract.java b/core/java/android/provider/CalendarContract.java index fa244e480e115..2f68eb475e7a6 100644 --- a/core/java/android/provider/CalendarContract.java +++ b/core/java/android/provider/CalendarContract.java @@ -187,6 +187,10 @@ public final class CalendarContract { * {@link android.database.ContentObserver} for this URL in the primary profile will be * notified when there is a change in the managed profile calendar provider. * + *

Throw UnsupportedOperationException if another profile doesn't exist or is disabled, or + * if the calling package is not whitelisted to access cross-profile calendar, or if the + * feature has been disabled by the user in Settings. + * * @see Events#ENTERPRISE_CONTENT_URI * @see Calendars#ENTERPRISE_CONTENT_URI * @see Instances#ENTERPRISE_CONTENT_URI