DO NOT MERGE - Merge pi-platform-release (PPRL.190505.001) into stage-aosp-master

Bug: 132622481
Change-Id: I396a6d1d8f47348932b1a15790c98eb1f5913dbe
diff --git a/Android.bp b/Android.bp
new file mode 100644
index 0000000..a326fda
--- /dev/null
+++ b/Android.bp
@@ -0,0 +1,37 @@
+// Copyright (C) 2013 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+android_library {
+    name: "android-opt-datetimepicker",
+
+    sdk_version: "current",
+
+    srcs: [
+        "src/**/*.java",
+        "src/**/*.logtags",
+    ],
+
+    resource_dirs: ["res"],
+
+    static_libs: [
+        "androidx.annotation_annotation",
+        "androidx.core_core",
+        "androidx.legacy_legacy-support-core-utils",
+        "androidx.legacy_legacy-support-core-ui",
+    ],
+
+    optimize: {
+        proguard_flags_files: ["proguard.flags"],
+    },
+}
diff --git a/Android.mk b/Android.mk
deleted file mode 100644
index d84220d..0000000
--- a/Android.mk
+++ /dev/null
@@ -1,39 +0,0 @@
-# Copyright (C) 2013 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := android-opt-datetimepicker
-
-LOCAL_SDK_VERSION := current
-
-LOCAL_SRC_FILES := \
-     $(call all-java-files-under, src) \
-     $(call all-logtags-files-under, src)
-
-LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res
-
-LOCAL_USE_AAPT2 := true
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    android-support-annotations
-LOCAL_STATIC_ANDROID_LIBRARIES := \
-    android-support-compat \
-    android-support-core-utils \
-    android-support-core-ui
-
-LOCAL_PROGUARD_FLAG_FILES := proguard.flags
-
-include $(BUILD_STATIC_JAVA_LIBRARY)
diff --git a/res/values-as/strings.xml b/res/values-as/strings.xml
deleted file mode 100644
index 40bdcd6..0000000
--- a/res/values-as/strings.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- 
-     Copyright (C) 2013 The Android Open Source Project
-
-     Licensed under the Apache License, Version 2.0 (the "License");
-     you may not use this file except in compliance with the License.
-     You may obtain a copy of the License at
-
-          http://www.apache.org/licenses/LICENSE-2.0
-
-     Unless required by applicable law or agreed to in writing, software
-     distributed under the License is distributed on an "AS IS" BASIS,
-     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-     See the License for the specific language governing permissions and
-     limitations under the License.
- -->
-
-<resources xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="done_label" msgid="7007948707597430919">"সম্পন্ন হ’ল"</string>
-    <string name="hour_picker_description" msgid="7586639618712934060">"ঘণ্টাৰ বৃত্তাকাৰ শ্লাইডাৰ"</string>
-    <string name="minute_picker_description" msgid="6024811202872705251">"মিনিটৰ বৃত্তাকাৰ শ্লাইডাৰ"</string>
-    <string name="select_hours" msgid="7651068754188418859">"ঘণ্টা বাছনি কৰক"</string>
-    <string name="select_minutes" msgid="8327182090226828481">"মিনিট বাছনি কৰক"</string>
-    <string name="day_picker_description" msgid="3968620852217927702">"দিনৰ সৈতে মাহৰ গ্ৰিড"</string>
-    <string name="year_picker_description" msgid="6963340404644587098">"বছৰৰ সূচী"</string>
-    <string name="select_day" msgid="3973338219107019769">"মাহ আৰু দিন বাছনি কৰক"</string>
-    <string name="select_year" msgid="2603330600102539372">"বছৰ বাছনি কৰক"</string>
-    <string name="item_is_selected" msgid="2674929164900463786">"<xliff:g id="ITEM">%1$s</xliff:g> বাছনি কৰা হ’ল"</string>
-    <string name="deleted_key" msgid="6908431551612331381">"<xliff:g id="KEY">%1$s</xliff:g> মচা হ’ল"</string>
-</resources>
diff --git a/res/values-ca/strings.xml b/res/values-ca/strings.xml
index 4669c84..9fe6f5c 100644
--- a/res/values-ca/strings.xml
+++ b/res/values-ca/strings.xml
@@ -22,7 +22,7 @@
     <string name="minute_picker_description" msgid="6024811202872705251">"Control circular dels minuts"</string>
     <string name="select_hours" msgid="7651068754188418859">"Selecciona les hores"</string>
     <string name="select_minutes" msgid="8327182090226828481">"Selecciona els minuts"</string>
-    <string name="day_picker_description" msgid="3968620852217927702">"Quadrícula mensual de dies"</string>
+    <string name="day_picker_description" msgid="3968620852217927702">"Graella mensual de dies"</string>
     <string name="year_picker_description" msgid="6963340404644587098">"Llista anual"</string>
     <string name="select_day" msgid="3973338219107019769">"Selecciona un mes i un dia"</string>
     <string name="select_year" msgid="2603330600102539372">"Selecciona un any"</string>
diff --git a/res/values-my/strings.xml b/res/values-my/strings.xml
index 063860a..3a56056 100644
--- a/res/values-my/strings.xml
+++ b/res/values-my/strings.xml
@@ -21,7 +21,7 @@
     <string name="hour_picker_description" msgid="7586639618712934060">"နာရီ ရွေးစရာ စက်ဝိုင်း"</string>
     <string name="minute_picker_description" msgid="6024811202872705251">"မိနစ် ရွေးစရာ စက်ဝိုင်း"</string>
     <string name="select_hours" msgid="7651068754188418859">"နာရီများ ရွေးပါ"</string>
-    <string name="select_minutes" msgid="8327182090226828481">"မိနစ် ရွေးပါ"</string>
+    <string name="select_minutes" msgid="8327182090226828481">"မိနစ်များ ရွေးပါ"</string>
     <string name="day_picker_description" msgid="3968620852217927702">"လအလိုက် နေ့များ အကွက်"</string>
     <string name="year_picker_description" msgid="6963340404644587098">"ခုနှစ် စာရင်း"</string>
     <string name="select_day" msgid="3973338219107019769">"လ နှင့် နေ့ ရွေးပါ"</string>
diff --git a/res/values-or/strings.xml b/res/values-or/strings.xml
index 6e3977b..342f4f2 100644
--- a/res/values-or/strings.xml
+++ b/res/values-or/strings.xml
@@ -27,5 +27,5 @@
     <string name="select_day" msgid="3973338219107019769">"ମାସ ଓ ଦିନ ଚୟନ କରନ୍ତୁ"</string>
     <string name="select_year" msgid="2603330600102539372">"ବର୍ଷ ଚୟନ କରନ୍ତୁ"</string>
     <string name="item_is_selected" msgid="2674929164900463786">"<xliff:g id="ITEM">%1$s</xliff:g> ଚୟନ କରାଗଲା"</string>
-    <string name="deleted_key" msgid="6908431551612331381">"<xliff:g id="KEY">%1$s</xliff:g>କୁ ଡିଲିଟ୍‌ କରାଗଲା"</string>
+    <string name="deleted_key" msgid="6908431551612331381">"<xliff:g id="KEY">%1$s</xliff:g> ଡିଲିଟ୍‌ କରାଗଲା"</string>
 </resources>
diff --git a/src/com/android/datetimepicker/Utils.java b/src/com/android/datetimepicker/Utils.java
index 6c0adbe..cf3df7c 100644
--- a/src/com/android/datetimepicker/Utils.java
+++ b/src/com/android/datetimepicker/Utils.java
@@ -77,7 +77,7 @@
             case Calendar.NOVEMBER:
                 return 30;
             case Calendar.FEBRUARY:
-                return (year % 4 == 0) ? 29 : 28;
+                return (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0)) ? 29 : 28;
             default:
                 throw new IllegalArgumentException("Invalid Month");
         }
diff --git a/src/com/android/datetimepicker/date/MonthView.java b/src/com/android/datetimepicker/date/MonthView.java
index 63d073c..3ed0452 100644
--- a/src/com/android/datetimepicker/date/MonthView.java
+++ b/src/com/android/datetimepicker/date/MonthView.java
@@ -25,9 +25,9 @@
 import android.graphics.Rect;
 import android.graphics.Typeface;
 import android.os.Bundle;
-import android.support.v4.view.ViewCompat;
-import android.support.v4.view.accessibility.AccessibilityNodeInfoCompat;
-import android.support.v4.widget.ExploreByTouchHelper;
+import androidx.core.view.ViewCompat;
+import androidx.core.view.accessibility.AccessibilityNodeInfoCompat;
+import androidx.customview.widget.ExploreByTouchHelper;
 import android.text.format.DateFormat;
 import android.text.format.DateUtils;
 import android.text.format.Time;