summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaman Tenneti <rtenneti@google.com>2019-11-04 18:35:09 -0800
committerRaman Tenneti <rtenneti@google.com>2019-11-04 18:35:09 -0800
commitb6db3e07a4e15feef0c82712ce3924180bbf704b (patch)
treea65cd079bf95c1b2c974179f431b980e068b1e30
parent623f47500c1fd590e304e1170ddd02f8db713de4 (diff)
downloadCalendar-b6db3e07a4e15feef0c82712ce3924180bbf704b.tar.gz
AOSP/Calendar - Fix crash bug when null action is sent to com.android.calendar/.widget.CalendarAppWidgetProvider.
BUG: 143601593 Test: manual - Ran the following tests on Pixel phone. Tested the calendar UI. $ make -j 40 $ make Calendar -j $ ls -l out/target/product/generic/system/product/app/Calendar/Calendar.apk out/target/product/generic/testcases/CalendarTests/arm/CalendarTests.apk $ adb install -r -d -g out/target/product/generic/system/product/app/Calendar/Calendar.apk $ adb install -r -d -g ~/Downloads/AndroidCalendarCrashPoc.apk Performing Streamed Install Success $ adb shell am broadcast -n com.android.calendar/.widget.CalendarAppWidgetProvider Broadcasting: Intent { flg=0x400000 cmp=com.android.calendar/.widget.CalendarAppWidgetProvider } Broadcast completed: result=0 Verified calendar app doesn't crash with the above (as mentioned in the above bug). Change-Id: If211a453d1633fc7d432670243cf87f35dafabb4
-rw-r--r--src/com/android/calendar/widget/CalendarAppWidgetProvider.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/com/android/calendar/widget/CalendarAppWidgetProvider.java b/src/com/android/calendar/widget/CalendarAppWidgetProvider.java
index 2864d47a..3a69efd3 100644
--- a/src/com/android/calendar/widget/CalendarAppWidgetProvider.java
+++ b/src/com/android/calendar/widget/CalendarAppWidgetProvider.java
@@ -64,11 +64,11 @@ public class CalendarAppWidgetProvider extends AppWidgetProvider {
performUpdate(context, appWidgetManager,
appWidgetManager.getAppWidgetIds(getComponentName(context)),
null /* no eventIds */);
- } else if (action.equals(Intent.ACTION_PROVIDER_CHANGED)
+ } else if (action != null && (action.equals(Intent.ACTION_PROVIDER_CHANGED)
|| action.equals(Intent.ACTION_TIME_CHANGED)
|| action.equals(Intent.ACTION_TIMEZONE_CHANGED)
|| action.equals(Intent.ACTION_DATE_CHANGED)
- || action.equals(Utils.getWidgetScheduledUpdateAction(context))) {
+ || action.equals(Utils.getWidgetScheduledUpdateAction(context)))) {
Intent service = new Intent(context, CalendarAppWidgetService.class);
context.startService(service);
} else {