Snap for 7478028 from 5729362442e88937f0d28853772c4b9cee5feddf to mainline-documentsui-release

Change-Id: I84afe49616ed199a76855093b29bcded6e1b9a6f
diff --git a/Android.mk b/Android.mk
index 82d5d54..dce26a4 100644
--- a/Android.mk
+++ b/Android.mk
@@ -34,6 +34,9 @@
 LOCAL_RESOURCE_DIR := $(addprefix $(LOCAL_PATH)/, $(res_dirs))
 
 LOCAL_PACKAGE_NAME := Calendar
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
+LOCAL_NOTICE_FILE  := $(LOCAL_PATH)/NOTICE
 
 LOCAL_PROGUARD_FLAG_FILES := proguard.flags
 
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 1e78c72..c9c5a04 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -80,7 +80,8 @@
 
         <activity android:name="EventInfoActivity"
             android:parentActivityName="com.android.calendar.AllInOneActivity"
-            android:theme="@style/CalendarTheme.WithActionBar">
+            android:theme="@style/CalendarTheme.WithActionBar"
+            android:exported="true">
             <intent-filter>
                 <action android:name="android.intent.action.VIEW" />
                 <category android:name="android.intent.category.DEFAULT" />
@@ -117,7 +118,8 @@
 
         <activity android:name="GoogleCalendarUriIntentFilter" android:label="@string/app_label"
             android:theme="@android:style/Theme.NoDisplay"
-            android:configChanges="orientation|keyboardHidden">
+            android:configChanges="orientation|keyboardHidden"
+            android:exported="true">
 
             <intent-filter
                android:priority="50">
@@ -138,7 +140,8 @@
              android:theme="@android:style/Theme.Holo.Dialog" android:excludeFromRecents="true"
              android:label="@string/quick_response_dialog_title" />
 
-        <receiver android:name=".alerts.AlertReceiver">
+        <receiver android:name=".alerts.AlertReceiver"
+            android:exported="true">
             <intent-filter>
                 <action android:name="android.intent.action.EVENT_REMINDER" />
                 <action android:name="android.intent.action.TIME_SET" />
@@ -160,7 +163,8 @@
         <receiver android:name=".alerts.GlobalDismissManager"
                   android:exported="false" />
 
-        <receiver android:name=".UpgradeReceiver">
+        <receiver android:name=".UpgradeReceiver"
+            android:exported="true">
             <intent-filter>
                 <action android:name="android.intent.action.BOOT_COMPLETED" />
                 <category android:name="android.intent.category.DEFAULT" />
@@ -180,7 +184,8 @@
         <service android:name=".alerts.InitAlarmsService" />
 
         <!-- Declarations for the widget -->
-        <receiver android:name=".widget.CalendarAppWidgetProvider" android:label="@string/gadget_title">
+        <receiver android:name=".widget.CalendarAppWidgetProvider" android:label="@string/gadget_title"
+            android:exported="true">
             <intent-filter>
                 <action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
                 <action android:name="com.android.calendar.APPWIDGET_UPDATE" />
@@ -188,7 +193,8 @@
             <meta-data android:name="android.appwidget.provider" android:resource="@xml/appwidget_info" />
         </receiver>
 
-        <receiver android:name=".widget.CalendarAppWidgetService$CalendarFactory">
+        <receiver android:name=".widget.CalendarAppWidgetService$CalendarFactory"
+            android:exported="true">
             <intent-filter>
                 <action android:name="android.intent.action.TIMEZONE_CHANGED"/>
                 <action android:name="android.intent.action.DATE_CHANGED"/>
diff --git a/MODULE_LICENSE_APACHE2 b/MODULE_LICENSE_APACHE2
deleted file mode 100644
index e69de29..0000000
--- a/MODULE_LICENSE_APACHE2
+++ /dev/null
diff --git a/res/layout-sw600dp-w960dp-h527dp-land/all_in_one.xml b/res/layout-sw600dp-w960dp-h527dp-land/all_in_one.xml
index 7f64a7b..5e31582 100644
--- a/res/layout-sw600dp-w960dp-h527dp-land/all_in_one.xml
+++ b/res/layout-sw600dp-w960dp-h527dp-land/all_in_one.xml
@@ -55,7 +55,7 @@
             android:textSize="18sp" />
     </LinearLayout>
 
-    <!-- This is a dummy view to make hiding/unhiding easier -->
+    <!-- This is a nonessential view to make hiding/unhiding easier -->
     <View
         android:id="@+id/mini_month_container"
         android:layout_below="@id/date_group"
diff --git a/src/com/android/calendar/EventInfoFragment.java b/src/com/android/calendar/EventInfoFragment.java
index b95c7c3..0aa83d0 100644
--- a/src/com/android/calendar/EventInfoFragment.java
+++ b/src/com/android/calendar/EventInfoFragment.java
@@ -217,8 +217,8 @@
 
     static {
         if (!Utils.isJellybeanOrLater()) {
-            EVENT_PROJECTION[EVENT_INDEX_CUSTOM_APP_PACKAGE] = Events._ID; // dummy value
-            EVENT_PROJECTION[EVENT_INDEX_CUSTOM_APP_URI] = Events._ID; // dummy value
+            EVENT_PROJECTION[EVENT_INDEX_CUSTOM_APP_PACKAGE] = Events._ID; // nonessential value
+            EVENT_PROJECTION[EVENT_INDEX_CUSTOM_APP_URI] = Events._ID; // nonessential value
         }
     }
 
diff --git a/src/com/android/calendar/StickyHeaderListView.java b/src/com/android/calendar/StickyHeaderListView.java
index 25955a0..981e7af 100644
--- a/src/com/android/calendar/StickyHeaderListView.java
+++ b/src/com/android/calendar/StickyHeaderListView.java
@@ -58,7 +58,7 @@
     protected HeaderIndexer mIndexer = null;
     protected HeaderHeightListener mHeaderHeightListener = null;
     protected View mStickyHeader = null;
-    protected View mDummyHeader = null; // A invisible header used when a section has no header
+    protected View mNonessentialHeader = null; // A invisible header used when a section has no header
     protected ListView mListView = null;
     protected ListView.OnScrollListener mListener = null;
 
@@ -269,11 +269,11 @@
             boolean newView = false;
             if (sectionPos != mCurrentSectionPos) {
 
-                // No header for current position , use the dummy invisible one, hide the separator
+                // No header for current position , use the nonessential invisible one, hide the separator
                 if (sectionPos == -1) {
                     sectionSize = 0;
                     this.removeView(mStickyHeader);
-                    mStickyHeader = mDummyHeader;
+                    mStickyHeader = mNonessentialHeader;
                     if (mSeparatorView != null) {
                         mSeparatorView.setVisibility(View.GONE);
                     }
@@ -320,14 +320,14 @@
                     }
                 } else if (stickyHeaderHeight != 0) {
                     mStickyHeader.setTranslationY(0);
-                    if (mSeparatorView != null && !mStickyHeader.equals(mDummyHeader)) {
+                    if (mSeparatorView != null && !mStickyHeader.equals(mNonessentialHeader)) {
                         mSeparatorView.setVisibility(View.VISIBLE);
                     }
                 }
                 if (newView) {
                     mStickyHeader.setVisibility(View.INVISIBLE);
                     this.addView(mStickyHeader);
-                    if (mSeparatorView != null && !mStickyHeader.equals(mDummyHeader)){
+                    if (mSeparatorView != null && !mStickyHeader.equals(mNonessentialHeader)){
                         FrameLayout.LayoutParams params =
                                 new FrameLayout.LayoutParams(LayoutParams.MATCH_PARENT,
                                         mSeparatorWidth);
@@ -382,12 +382,12 @@
             setListView(new ListView(mContext));
         }
 
-        // Create a dummy view , it will be used in case a section has no header
-        mDummyHeader = new View (mContext);
+        // Create a nonessential view , it will be used in case a section has no header
+        mNonessentialHeader = new View (mContext);
         ViewGroup.LayoutParams params = new LayoutParams(LayoutParams.MATCH_PARENT,
                 1, Gravity.TOP);
-        mDummyHeader.setLayoutParams(params);
-        mDummyHeader.setBackgroundColor(Color.TRANSPARENT);
+        mNonessentialHeader.setLayoutParams(params);
+        mNonessentialHeader.setBackgroundColor(Color.TRANSPARENT);
 
         mChildViewsCreated = true;
     }
diff --git a/src/com/android/calendar/widget/CalendarAppWidgetService.java b/src/com/android/calendar/widget/CalendarAppWidgetService.java
index 6329463..ec702c7 100644
--- a/src/com/android/calendar/widget/CalendarAppWidgetService.java
+++ b/src/com/android/calendar/widget/CalendarAppWidgetService.java
@@ -542,6 +542,9 @@
                 }
 
                 AppWidgetManager widgetManager = AppWidgetManager.getInstance(mContext);
+                if (widgetManager == null) {
+                    return;
+                }
                 if (mAppWidgetId == -1) {
                     int[] ids = widgetManager.getAppWidgetIds(CalendarAppWidgetProvider
                             .getComponentName(mContext));
diff --git a/tests/Android.mk b/tests/Android.mk
index bacb8c0..2d74b1e 100644
--- a/tests/Android.mk
+++ b/tests/Android.mk
@@ -12,6 +12,9 @@
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 
 LOCAL_PACKAGE_NAME := CalendarTests
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
+LOCAL_NOTICE_FILE  := $(LOCAL_PATH)/../NOTICE
 
 LOCAL_INSTRUMENTATION_FOR := Calendar