Merge "Make updateSurface non-blocking" into nyc-mr1-dev
am: 8d521bb9b3
Change-Id: I780518798ae7af101ae70e52fd44092ce18311c5
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
index 5da55b1..f4c642f 100755
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -5345,6 +5345,13 @@
public static final String LONG_PRESS_TIMEOUT = "long_press_timeout";
/**
+ * The duration in milliseconds between the first tap's up event and the second tap's
+ * down event for an interaction to be considered part of the same multi-press.
+ * @hide
+ */
+ public static final String MULTI_PRESS_TIMEOUT = "multi_press_timeout";
+
+ /**
* List of the enabled print services.
*
* N and beyond uses {@link #DISABLED_PRINT_SERVICES}. But this might be used in an upgrade
diff --git a/core/java/android/view/ViewConfiguration.java b/core/java/android/view/ViewConfiguration.java
index 4d584a3..9a73d0b 100644
--- a/core/java/android/view/ViewConfiguration.java
+++ b/core/java/android/view/ViewConfiguration.java
@@ -64,6 +64,12 @@
private static final int DEFAULT_LONG_PRESS_TIMEOUT = 500;
/**
+ * Defines the default duration in milliseconds between the first tap's up event and the second
+ * tap's down event for an interaction to be considered part of the same multi-press.
+ */
+ private static final int DEFAULT_MULTI_PRESS_TIMEOUT = 300;
+
+ /**
* Defines the time between successive key repeats in milliseconds.
*/
private static final int KEY_REPEAT_DELAY = 50;
@@ -441,6 +447,16 @@
}
/**
+ * @return the duration in milliseconds between the first tap's up event and the second tap's
+ * down event for an interaction to be considered part of the same multi-press.
+ * @hide
+ */
+ public static int getMultiPressTimeout() {
+ return AppGlobals.getIntCoreSetting(Settings.Secure.MULTI_PRESS_TIMEOUT,
+ DEFAULT_MULTI_PRESS_TIMEOUT);
+ }
+
+ /**
* @return the time before the first key repeat in milliseconds.
*/
public static int getKeyRepeatTimeout() {
diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java
index 4dc1009..03c97bd 100644
--- a/core/java/android/view/ViewRootImpl.java
+++ b/core/java/android/view/ViewRootImpl.java
@@ -6039,7 +6039,8 @@
return true;
}
return mEvent instanceof MotionEvent
- && mEvent.isFromSource(InputDevice.SOURCE_CLASS_POINTER);
+ && (mEvent.isFromSource(InputDevice.SOURCE_CLASS_POINTER)
+ || mEvent.isFromSource(InputDevice.SOURCE_ROTARY_ENCODER));
}
public boolean shouldSendToSynthesizer() {
diff --git a/core/jni/android_hardware_location_ContextHubService.cpp b/core/jni/android_hardware_location_ContextHubService.cpp
index 9515a0e..7a8a574 100644
--- a/core/jni/android_hardware_location_ContextHubService.cpp
+++ b/core/jni/android_hardware_location_ContextHubService.cpp
@@ -603,6 +603,8 @@
env->CallIntMethod(db.jniInfo.jContextHubService,
db.jniInfo.contextHubServiceMsgReceiptCallback,
jheader, jmsg);
+ env->DeleteLocalRef(jmsg);
+ env->DeleteLocalRef(jheader);
delete[] msg;
}
diff --git a/core/res/res/anim/watch_switch_thumb_to_off_animation.xml b/core/res/res/anim/watch_switch_thumb_to_off_animation.xml
index cd02e0d..c300894 100644
--- a/core/res/res/anim/watch_switch_thumb_to_off_animation.xml
+++ b/core/res/res/anim/watch_switch_thumb_to_off_animation.xml
@@ -1,4 +1,5 @@
-<?xml version="1.0" encoding="utf-8"?><!-- Copyright (C) 2016 The Android Open Source Project
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2016 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
@@ -17,20 +18,34 @@
android:interpolator="@android:interpolator/linear"
android:propertyName="pathData"
android:valueFrom="M 0.0,-7.0 l 0.0,0.0 c 3.8659932486,0.0 7.0,3.1340067514 7.0,7.0 l 0.0,0.0 c 0.0,3.8659932486 -3.1340067514,7.0 -7.0,7.0 l 0.0,0.0 c -3.8659932486,0.0 -7.0,-3.1340067514 -7.0,-7.0 l 0.0,0.0 c 0.0,-3.8659932486 3.1340067514,-7.0 7.0,-7.0 Z"
+ android:valueTo="M 0.0,-7.0 l 0.0,0.0 c 3.8659932486,0.0 7.0,3.1340067514 7.0,7.0 l 0.0,0.0 c 0.0,3.8659932486 -3.1340067514,7.0 -7.0,7.0 l 0.0,0.0 c -3.8659932486,0.0 -7.0,-3.1340067514 -7.0,-7.0 l 0.0,0.0 c 0.0,-3.8659932486 3.1340067514,-7.0 7.0,-7.0 Z"
+ android:valueType="pathType" />
+ <objectAnimator
+ android:duration="49"
+ android:interpolator="@android:interpolator/linear"
+ android:propertyName="pathData"
+ android:valueFrom="M 0.0,-7.0 l 0.0,0.0 c 3.8659932486,0.0 7.0,3.1340067514 7.0,7.0 l 0.0,0.0 c 0.0,3.8659932486 -3.1340067514,7.0 -7.0,7.0 l 0.0,0.0 c -3.8659932486,0.0 -7.0,-3.1340067514 -7.0,-7.0 l 0.0,0.0 c 0.0,-3.8659932486 3.1340067514,-7.0 7.0,-7.0 Z"
android:valueTo="M -3.0,-7.0 l 6.0,0.0 c 3.8659932486,0.0 7.0,3.1340067514 7.0,7.0 l 0.0,0.0 c 0.0,3.8659932486 -3.1340067514,7.0 -7.0,7.0 l -6.0,0.0 c -3.8659932486,0.0 -7.0,-3.1340067514 -7.0,-7.0 l 0.0,0.0 c 0.0,-3.8659932486 3.1340067514,-7.0 7.0,-7.0 Z"
android:valueType="pathType" />
<objectAnimator
- android:duration="66"
+ android:duration="83"
android:interpolator="@android:interpolator/linear"
android:propertyName="pathData"
android:valueFrom="M -3.0,-7.0 l 6.0,0.0 c 3.8659932486,0.0 7.0,3.1340067514 7.0,7.0 l 0.0,0.0 c 0.0,3.8659932486 -3.1340067514,7.0 -7.0,7.0 l -6.0,0.0 c -3.8659932486,0.0 -7.0,-3.1340067514 -7.0,-7.0 l 0.0,0.0 c 0.0,-3.8659932486 3.1340067514,-7.0 7.0,-7.0 Z"
android:valueTo="M -3.0,-7.0 l 6.0,0.0 c 3.8659932486,0.0 7.0,3.1340067514 7.0,7.0 l 0.0,0.0 c 0.0,3.8659932486 -3.1340067514,7.0 -7.0,7.0 l -6.0,0.0 c -3.8659932486,0.0 -7.0,-3.1340067514 -7.0,-7.0 l 0.0,0.0 c 0.0,-3.8659932486 3.1340067514,-7.0 7.0,-7.0 Z"
android:valueType="pathType" />
<objectAnimator
- android:duration="66"
+ android:duration="50"
android:interpolator="@android:interpolator/linear"
android:propertyName="pathData"
android:valueFrom="M -3.0,-7.0 l 6.0,0.0 c 3.8659932486,0.0 7.0,3.1340067514 7.0,7.0 l 0.0,0.0 c 0.0,3.8659932486 -3.1340067514,7.0 -7.0,7.0 l -6.0,0.0 c -3.8659932486,0.0 -7.0,-3.1340067514 -7.0,-7.0 l 0.0,0.0 c 0.0,-3.8659932486 3.1340067514,-7.0 7.0,-7.0 Z"
android:valueTo="M 0.0,-7.0 l 0.0,0.0 c 3.8659932486,0.0 7.0,3.1340067514 7.0,7.0 l 0.0,0.0 c 0.0,3.8659932486 -3.1340067514,7.0 -7.0,7.0 l 0.0,0.0 c -3.8659932486,0.0 -7.0,-3.1340067514 -7.0,-7.0 l 0.0,0.0 c 0.0,-3.8659932486 3.1340067514,-7.0 7.0,-7.0 Z"
android:valueType="pathType" />
+ <objectAnimator
+ android:duration="33"
+ android:interpolator="@android:interpolator/linear"
+ android:propertyName="pathData"
+ android:valueFrom="M 0.0,-7.0 l 0.0,0.0 c 3.8659932486,0.0 7.0,3.1340067514 7.0,7.0 l 0.0,0.0 c 0.0,3.8659932486 -3.1340067514,7.0 -7.0,7.0 l 0.0,0.0 c -3.8659932486,0.0 -7.0,-3.1340067514 -7.0,-7.0 l 0.0,0.0 c 0.0,-3.8659932486 3.1340067514,-7.0 7.0,-7.0 Z"
+ android:valueTo="M 0.0,-7.0 l 0.0,0.0 c 3.8659932486,0.0 7.0,3.1340067514 7.0,7.0 l 0.0,0.0 c 0.0,3.8659932486 -3.1340067514,7.0 -7.0,7.0 l 0.0,0.0 c -3.8659932486,0.0 -7.0,-3.1340067514 -7.0,-7.0 l 0.0,0.0 c 0.0,-3.8659932486 3.1340067514,-7.0 7.0,-7.0 Z"
+ android:valueType="pathType" />
</set>
diff --git a/core/res/res/anim/watch_switch_thumb_to_on_animation.xml b/core/res/res/anim/watch_switch_thumb_to_on_animation.xml
index e644217..c300894 100644
--- a/core/res/res/anim/watch_switch_thumb_to_on_animation.xml
+++ b/core/res/res/anim/watch_switch_thumb_to_on_animation.xml
@@ -18,20 +18,34 @@
android:interpolator="@android:interpolator/linear"
android:propertyName="pathData"
android:valueFrom="M 0.0,-7.0 l 0.0,0.0 c 3.8659932486,0.0 7.0,3.1340067514 7.0,7.0 l 0.0,0.0 c 0.0,3.8659932486 -3.1340067514,7.0 -7.0,7.0 l 0.0,0.0 c -3.8659932486,0.0 -7.0,-3.1340067514 -7.0,-7.0 l 0.0,0.0 c 0.0,-3.8659932486 3.1340067514,-7.0 7.0,-7.0 Z"
+ android:valueTo="M 0.0,-7.0 l 0.0,0.0 c 3.8659932486,0.0 7.0,3.1340067514 7.0,7.0 l 0.0,0.0 c 0.0,3.8659932486 -3.1340067514,7.0 -7.0,7.0 l 0.0,0.0 c -3.8659932486,0.0 -7.0,-3.1340067514 -7.0,-7.0 l 0.0,0.0 c 0.0,-3.8659932486 3.1340067514,-7.0 7.0,-7.0 Z"
+ android:valueType="pathType" />
+ <objectAnimator
+ android:duration="49"
+ android:interpolator="@android:interpolator/linear"
+ android:propertyName="pathData"
+ android:valueFrom="M 0.0,-7.0 l 0.0,0.0 c 3.8659932486,0.0 7.0,3.1340067514 7.0,7.0 l 0.0,0.0 c 0.0,3.8659932486 -3.1340067514,7.0 -7.0,7.0 l 0.0,0.0 c -3.8659932486,0.0 -7.0,-3.1340067514 -7.0,-7.0 l 0.0,0.0 c 0.0,-3.8659932486 3.1340067514,-7.0 7.0,-7.0 Z"
android:valueTo="M -3.0,-7.0 l 6.0,0.0 c 3.8659932486,0.0 7.0,3.1340067514 7.0,7.0 l 0.0,0.0 c 0.0,3.8659932486 -3.1340067514,7.0 -7.0,7.0 l -6.0,0.0 c -3.8659932486,0.0 -7.0,-3.1340067514 -7.0,-7.0 l 0.0,0.0 c 0.0,-3.8659932486 3.1340067514,-7.0 7.0,-7.0 Z"
android:valueType="pathType" />
<objectAnimator
- android:duration="66"
+ android:duration="83"
android:interpolator="@android:interpolator/linear"
android:propertyName="pathData"
android:valueFrom="M -3.0,-7.0 l 6.0,0.0 c 3.8659932486,0.0 7.0,3.1340067514 7.0,7.0 l 0.0,0.0 c 0.0,3.8659932486 -3.1340067514,7.0 -7.0,7.0 l -6.0,0.0 c -3.8659932486,0.0 -7.0,-3.1340067514 -7.0,-7.0 l 0.0,0.0 c 0.0,-3.8659932486 3.1340067514,-7.0 7.0,-7.0 Z"
android:valueTo="M -3.0,-7.0 l 6.0,0.0 c 3.8659932486,0.0 7.0,3.1340067514 7.0,7.0 l 0.0,0.0 c 0.0,3.8659932486 -3.1340067514,7.0 -7.0,7.0 l -6.0,0.0 c -3.8659932486,0.0 -7.0,-3.1340067514 -7.0,-7.0 l 0.0,0.0 c 0.0,-3.8659932486 3.1340067514,-7.0 7.0,-7.0 Z"
android:valueType="pathType" />
<objectAnimator
- android:duration="66"
+ android:duration="50"
android:interpolator="@android:interpolator/linear"
android:propertyName="pathData"
android:valueFrom="M -3.0,-7.0 l 6.0,0.0 c 3.8659932486,0.0 7.0,3.1340067514 7.0,7.0 l 0.0,0.0 c 0.0,3.8659932486 -3.1340067514,7.0 -7.0,7.0 l -6.0,0.0 c -3.8659932486,0.0 -7.0,-3.1340067514 -7.0,-7.0 l 0.0,0.0 c 0.0,-3.8659932486 3.1340067514,-7.0 7.0,-7.0 Z"
android:valueTo="M 0.0,-7.0 l 0.0,0.0 c 3.8659932486,0.0 7.0,3.1340067514 7.0,7.0 l 0.0,0.0 c 0.0,3.8659932486 -3.1340067514,7.0 -7.0,7.0 l 0.0,0.0 c -3.8659932486,0.0 -7.0,-3.1340067514 -7.0,-7.0 l 0.0,0.0 c 0.0,-3.8659932486 3.1340067514,-7.0 7.0,-7.0 Z"
android:valueType="pathType" />
+ <objectAnimator
+ android:duration="33"
+ android:interpolator="@android:interpolator/linear"
+ android:propertyName="pathData"
+ android:valueFrom="M 0.0,-7.0 l 0.0,0.0 c 3.8659932486,0.0 7.0,3.1340067514 7.0,7.0 l 0.0,0.0 c 0.0,3.8659932486 -3.1340067514,7.0 -7.0,7.0 l 0.0,0.0 c -3.8659932486,0.0 -7.0,-3.1340067514 -7.0,-7.0 l 0.0,0.0 c 0.0,-3.8659932486 3.1340067514,-7.0 7.0,-7.0 Z"
+ android:valueTo="M 0.0,-7.0 l 0.0,0.0 c 3.8659932486,0.0 7.0,3.1340067514 7.0,7.0 l 0.0,0.0 c 0.0,3.8659932486 -3.1340067514,7.0 -7.0,7.0 l 0.0,0.0 c -3.8659932486,0.0 -7.0,-3.1340067514 -7.0,-7.0 l 0.0,0.0 c 0.0,-3.8659932486 3.1340067514,-7.0 7.0,-7.0 Z"
+ android:valueType="pathType" />
</set>
diff --git a/core/res/res/color/watch_switch_thumb_color_material.xml b/core/res/res/color/watch_switch_thumb_color_material.xml
index d4796a0..f78d9b6 100644
--- a/core/res/res/color/watch_switch_thumb_color_material.xml
+++ b/core/res/res/color/watch_switch_thumb_color_material.xml
@@ -10,9 +10,9 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-
<selector xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:color="?android:colorButtonNormal" android:state_enabled="false" />
- <item android:color="?android:colorControlActivated" android:state_checked="true" />
- <item android:color="?android:colorButtonNormal" />
-</selector>
\ No newline at end of file
+ <item android:color="?attr/colorButtonNormal" android:alpha="?attr/disabledAlpha"
+ android:state_enabled="false" />
+ <item android:color="?attr/colorControlActivated" android:state_checked="true" />
+ <item android:color="?attr/colorButtonNormal" />
+</selector>
diff --git a/core/res/res/values-notround-watch/styles_material.xml b/core/res/res/color/watch_switch_track_color_material.xml
similarity index 63%
rename from core/res/res/values-notround-watch/styles_material.xml
rename to core/res/res/color/watch_switch_track_color_material.xml
index cd8521f4..402a536 100644
--- a/core/res/res/values-notround-watch/styles_material.xml
+++ b/core/res/res/color/watch_switch_track_color_material.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2016 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
@@ -13,6 +13,9 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<resources>
- <style name="TextAppearance.Material.AlertDialogMessage" parent="TextAppearance.Material.Body1"/>
-</resources>
+<!-- Used for the background of switch track for watch switch preference. -->
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:state_enabled="false"
+ android:alpha="0.4" android:color="?attr/colorPrimary" />
+ <item android:color="?attr/colorPrimary" />
+</selector>
diff --git a/core/res/res/layout-notround-watch/alert_dialog_header_micro.xml b/core/res/res/layout-notround-watch/alert_dialog_title_material.xml
similarity index 85%
rename from core/res/res/layout-notround-watch/alert_dialog_header_micro.xml
rename to core/res/res/layout-notround-watch/alert_dialog_title_material.xml
index fc840d9..307c6db 100644
--- a/core/res/res/layout-notround-watch/alert_dialog_header_micro.xml
+++ b/core/res/res/layout-notround-watch/alert_dialog_title_material.xml
@@ -30,12 +30,9 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@null" />
- <com.android.internal.widget.DialogTitle android:id="@+id/alertTitle"
+ <TextView android:id="@+id/alertTitle"
style="?android:attr/windowTitleStyle"
- android:ellipsize="end"
- android:layout_marginStart="8dp"
android:layout_marginBottom="8dp"
android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:textAlignment="viewStart" />
+ android:layout_height="wrap_content" />
</LinearLayout>
diff --git a/core/res/res/layout-round-watch/alert_dialog_header_micro.xml b/core/res/res/layout-round-watch/alert_dialog_title_material.xml
similarity index 84%
rename from core/res/res/layout-round-watch/alert_dialog_header_micro.xml
rename to core/res/res/layout-round-watch/alert_dialog_title_material.xml
index 6f7ae02..0279911 100644
--- a/core/res/res/layout-round-watch/alert_dialog_header_micro.xml
+++ b/core/res/res/layout-round-watch/alert_dialog_title_material.xml
@@ -27,12 +27,10 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@null" />
- <com.android.internal.widget.DialogTitle android:id="@+id/alertTitle"
+ <TextView android:id="@+id/alertTitle"
style="?android:attr/windowTitleStyle"
- android:ellipsize="end"
android:layout_marginTop="36dp"
- android:layout_marginBottom="4dp"
+ android:layout_marginBottom="8dp"
android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:textAlignment="center" />
+ android:layout_height="wrap_content" />
</FrameLayout>
diff --git a/core/res/res/layout-watch/alert_dialog_material.xml b/core/res/res/layout-watch/alert_dialog_material.xml
index ce8e20a..002dde8 100644
--- a/core/res/res/layout-watch/alert_dialog_material.xml
+++ b/core/res/res/layout-watch/alert_dialog_material.xml
@@ -39,7 +39,7 @@
<include android:id="@+id/title_template"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- layout="@layout/alert_dialog_header_micro"/>
+ layout="@layout/alert_dialog_title_material"/>
</FrameLayout>
<!-- Content Panel -->
@@ -50,7 +50,8 @@
<TextView android:id="@+id/message"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:textAppearance="@style/TextAppearance.Material.Body1"
+ android:gravity="@integer/config_dialogTextGravity"
+ android:textAppearance="@style/TextAppearance.Material.Subhead"
android:paddingStart="?dialogPreferredPadding"
android:paddingEnd="?dialogPreferredPadding"
android:paddingTop="8dip"
@@ -77,6 +78,7 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
+ android:layout_gravity="bottom"
android:orientation="vertical"
android:minHeight="@dimen/alert_dialog_button_bar_height"
android:paddingBottom="?dialogPreferredPadding"
diff --git a/core/res/res/layout-watch/date_picker_dialog.xml b/core/res/res/layout-watch/date_picker_dialog.xml
new file mode 100644
index 0000000..b8772bc
--- /dev/null
+++ b/core/res/res/layout-watch/date_picker_dialog.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2007 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.
+-->
+
+<DatePicker xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/datePicker"
+ android:layout_gravity="center_horizontal"
+ android:gravity="center_horizontal"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:spinnersShown="true"
+ android:calendarViewShown="false"
+ android:datePickerMode="@integer/date_picker_mode" />
diff --git a/core/res/res/layout-watch/number_picker_material.xml b/core/res/res/layout-watch/number_picker_material.xml
deleted file mode 100644
index a1c0921..0000000
--- a/core/res/res/layout-watch/number_picker_material.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-**
-** Copyright 2012, 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.
-*/
--->
-
-<merge xmlns:android="http://schemas.android.com/apk/res/android">
-
- <view class="android.widget.NumberPicker$CustomEditText"
- android:textAppearance="?android:attr/textAppearanceLarge"
- android:id="@+id/numberpicker_input"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:gravity="center"
- android:singleLine="true"
- android:background="@null" />
-
-</merge>
diff --git a/core/res/res/layout-watch/preference_widget_switch.xml b/core/res/res/layout-watch/preference_widget_switch.xml
index 37d0c6b..ffc00b4 100644
--- a/core/res/res/layout-watch/preference_widget_switch.xml
+++ b/core/res/res/layout-watch/preference_widget_switch.xml
@@ -24,7 +24,7 @@
android:thumb="@drawable/watch_switch_thumb_material_anim"
android:thumbTint="@color/watch_switch_thumb_color_material"
android:track="@drawable/watch_switch_track_material"
- android:trackTint="?android:colorPrimary"
+ android:trackTint="@color/watch_switch_track_color_material"
android:focusable="false"
android:clickable="false"
android:background="@null" />
diff --git a/core/res/res/layout-watch/time_picker_dialog.xml b/core/res/res/layout-watch/time_picker_dialog.xml
new file mode 100644
index 0000000..788602b
--- /dev/null
+++ b/core/res/res/layout-watch/time_picker_dialog.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+**
+** Copyright 2007, 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.
+*/
+-->
+
+<TimePicker xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/timePicker"
+ android:layout_gravity="center_horizontal"
+ android:gravity="center_horizontal"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:timePickerMode="@integer/time_picker_mode" />
diff --git a/core/res/res/layout/date_picker_legacy_holo.xml b/core/res/res/layout/date_picker_legacy_holo.xml
index b465d97..a6e93c9 100644
--- a/core/res/res/layout/date_picker_legacy_holo.xml
+++ b/core/res/res/layout/date_picker_legacy_holo.xml
@@ -41,8 +41,8 @@
android:id="@+id/month"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_marginTop="16dip"
- android:layout_marginBottom="16dip"
+ android:layout_marginTop="@dimen/picker_top_margin"
+ android:layout_marginBottom="@dimen/picker_bottom_margin"
android:layout_marginStart="8dip"
android:layout_marginEnd="8dip"
android:focusable="true"
@@ -54,8 +54,8 @@
android:id="@+id/day"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_marginTop="16dip"
- android:layout_marginBottom="16dip"
+ android:layout_marginTop="@dimen/picker_top_margin"
+ android:layout_marginBottom="@dimen/picker_bottom_margin"
android:layout_marginStart="8dip"
android:layout_marginEnd="8dip"
android:focusable="true"
@@ -67,8 +67,8 @@
android:id="@+id/year"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_marginTop="16dip"
- android:layout_marginBottom="16dip"
+ android:layout_marginTop="@dimen/picker_top_margin"
+ android:layout_marginBottom="@dimen/picker_bottom_margin"
android:layout_marginStart="8dip"
android:layout_marginEnd="16dip"
android:focusable="true"
diff --git a/core/res/res/layout/number_picker_material.xml b/core/res/res/layout/number_picker_material.xml
index b045585..6fbd2b2 100644
--- a/core/res/res/layout/number_picker_material.xml
+++ b/core/res/res/layout/number_picker_material.xml
@@ -22,4 +22,4 @@
android:gravity="center"
android:singleLine="true"
android:background="@null"
- android:textAppearance="@style/TextAppearance.Material.Body1" />
+ android:textAppearance="@style/TextAppearance.Material.NumberPicker" />
diff --git a/core/res/res/layout/time_picker_legacy_material.xml b/core/res/res/layout/time_picker_legacy_material.xml
index c6b7d3a..ee56266 100644
--- a/core/res/res/layout/time_picker_legacy_material.xml
+++ b/core/res/res/layout/time_picker_legacy_material.xml
@@ -40,8 +40,8 @@
android:id="@+id/hour"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_marginTop="16dip"
- android:layout_marginBottom="16dip"
+ android:layout_marginTop="@dimen/picker_top_margin"
+ android:layout_marginBottom="@dimen/picker_bottom_margin"
android:focusable="true"
android:focusableInTouchMode="true"
/>
@@ -62,8 +62,8 @@
android:id="@+id/minute"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_marginTop="16dip"
- android:layout_marginBottom="16dip"
+ android:layout_marginTop="@dimen/picker_top_margin"
+ android:layout_marginBottom="@dimen/picker_bottom_margin"
android:focusable="true"
android:focusableInTouchMode="true"
/>
@@ -75,8 +75,8 @@
android:id="@+id/amPm"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_marginTop="16dip"
- android:layout_marginBottom="16dip"
+ android:layout_marginTop="@dimen/picker_top_margin"
+ android:layout_marginBottom="@dimen/picker_bottom_margin"
android:layout_marginStart="8dip"
android:layout_marginEnd="8dip"
android:focusable="true"
diff --git a/core/res/res/values-notround-watch/config_material.xml b/core/res/res/values-notround-watch/config_material.xml
new file mode 100644
index 0000000..a99674f
--- /dev/null
+++ b/core/res/res/values-notround-watch/config_material.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2016 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.
+-->
+
+<!-- These resources are around just to allow their values to be customized
+ for different hardware and product builds, only for Material theme. Do not translate.
+
+ NOTE: The naming convention is "config_camelCaseValue". -->
+
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <!-- Gravity that should be used for dialog text styles. Equivalent to: Gravity.START | Gravity.TOP -->
+ <integer name="config_dialogTextGravity">0x00800033</integer>
+</resources>
diff --git a/core/res/res/values-round-watch/config_material.xml b/core/res/res/values-round-watch/config_material.xml
index bf445ef..871e910 100644
--- a/core/res/res/values-round-watch/config_material.xml
+++ b/core/res/res/values-round-watch/config_material.xml
@@ -19,4 +19,7 @@
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<!-- Don't clip on round screens so the list can scroll past the rounded edges. -->
<bool name="config_preferenceFragmentClipToPadding">false</bool>
+
+ <!-- Gravity that should be used for dialog text styles. Equivalent to: Gravity.CENTER_HORIZONTAL | Gravity.TOP -->
+ <integer name="config_dialogTextGravity">0x00000031</integer>
</resources>
diff --git a/core/res/res/values-round-watch/styles_material.xml b/core/res/res/values-round-watch/styles_material.xml
deleted file mode 100644
index a2f3c02..0000000
--- a/core/res/res/values-round-watch/styles_material.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Copyright (C) 2016 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>
- <style name="TextAppearance.Material.AlertDialogMessage" parent="TextAppearance.Material.Body1">
- <item name="textAlignment">center</item>
- </style>
-</resources>
diff --git a/core/res/res/values-w180dp-notround-watch/dimens_material.xml b/core/res/res/values-w180dp-notround-watch/dimens_material.xml
new file mode 100644
index 0000000..79acf84
--- /dev/null
+++ b/core/res/res/values-w180dp-notround-watch/dimens_material.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2016 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>
+ <dimen name="text_size_display_4_material">80sp</dimen>
+ <dimen name="text_size_display_3_material">50sp</dimen>
+ <dimen name="text_size_display_2_material">40sp</dimen>
+ <dimen name="text_size_display_1_material">30sp</dimen>
+ <dimen name="text_size_headline_material">20sp</dimen>
+ <dimen name="text_size_title_material">18sp</dimen>
+ <dimen name="text_size_subhead_material">18sp</dimen>
+ <dimen name="text_size_title_material_toolbar">18dp</dimen>
+ <dimen name="text_size_subtitle_material_toolbar">18dp</dimen>
+ <dimen name="text_size_menu_material">18sp</dimen>
+ <dimen name="text_size_menu_header_material">16sp</dimen>
+ <dimen name="text_size_body_2_material">16sp</dimen>
+ <dimen name="text_size_body_1_material">16sp</dimen>
+ <dimen name="text_size_caption_material">14sp</dimen>
+ <dimen name="text_size_button_material">16sp</dimen>
+
+ <dimen name="text_size_large_material">18sp</dimen>
+ <dimen name="text_size_medium_material">16sp</dimen>
+ <dimen name="text_size_small_material">14sp</dimen>
+</resources>
diff --git a/core/res/res/values-w210dp-round-watch/dimens_material.xml b/core/res/res/values-w210dp-round-watch/dimens_material.xml
new file mode 100644
index 0000000..79acf84
--- /dev/null
+++ b/core/res/res/values-w210dp-round-watch/dimens_material.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2016 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>
+ <dimen name="text_size_display_4_material">80sp</dimen>
+ <dimen name="text_size_display_3_material">50sp</dimen>
+ <dimen name="text_size_display_2_material">40sp</dimen>
+ <dimen name="text_size_display_1_material">30sp</dimen>
+ <dimen name="text_size_headline_material">20sp</dimen>
+ <dimen name="text_size_title_material">18sp</dimen>
+ <dimen name="text_size_subhead_material">18sp</dimen>
+ <dimen name="text_size_title_material_toolbar">18dp</dimen>
+ <dimen name="text_size_subtitle_material_toolbar">18dp</dimen>
+ <dimen name="text_size_menu_material">18sp</dimen>
+ <dimen name="text_size_menu_header_material">16sp</dimen>
+ <dimen name="text_size_body_2_material">16sp</dimen>
+ <dimen name="text_size_body_1_material">16sp</dimen>
+ <dimen name="text_size_caption_material">14sp</dimen>
+ <dimen name="text_size_button_material">16sp</dimen>
+
+ <dimen name="text_size_large_material">18sp</dimen>
+ <dimen name="text_size_medium_material">16sp</dimen>
+ <dimen name="text_size_small_material">14sp</dimen>
+</resources>
diff --git a/core/res/res/values-watch/config_material.xml b/core/res/res/values-watch/config_material.xml
index 81b53e7..104d122 100644
--- a/core/res/res/values-watch/config_material.xml
+++ b/core/res/res/values-watch/config_material.xml
@@ -29,7 +29,4 @@
<!-- Always overscan by default to ensure onApplyWindowInsets will always be called. -->
<bool name="config_windowOverscanByDefault">true</bool>
-
- <!-- Due to the smaller screen size, have dialog titles occupy more than 1 line. -->
- <integer name="config_dialogWindowTitleMaxLines">3</integer>
</resources>
diff --git a/core/res/res/values-watch/dimens_material.xml b/core/res/res/values-watch/dimens_material.xml
index d579434..b48cde6 100644
--- a/core/res/res/values-watch/dimens_material.xml
+++ b/core/res/res/values-watch/dimens_material.xml
@@ -14,5 +14,29 @@
limitations under the License.
-->
<resources>
+ <dimen name="text_size_display_4_material">71sp</dimen>
+ <dimen name="text_size_display_3_material">44sp</dimen>
+ <dimen name="text_size_display_2_material">36sp</dimen>
+ <dimen name="text_size_display_1_material">27sp</dimen>
+ <dimen name="text_size_headline_material">18sp</dimen>
+ <dimen name="text_size_title_material">16sp</dimen>
+ <dimen name="text_size_subhead_material">16sp</dimen>
+ <dimen name="text_size_title_material_toolbar">16dp</dimen>
+ <dimen name="text_size_subtitle_material_toolbar">16dp</dimen>
+ <dimen name="text_size_menu_material">16sp</dimen>
+ <dimen name="text_size_menu_header_material">14sp</dimen>
+ <dimen name="text_size_body_2_material">14sp</dimen>
+ <dimen name="text_size_body_1_material">14sp</dimen>
+ <dimen name="text_size_caption_material">12sp</dimen>
+ <dimen name="text_size_button_material">14sp</dimen>
+
+ <dimen name="text_size_large_material">16sp</dimen>
+ <dimen name="text_size_medium_material">14sp</dimen>
+ <dimen name="text_size_small_material">12sp</dimen>
+
<item name="text_line_spacing_multiplier_material" format="float" type="dimen">1.2</item>
+
+ <!-- Date and time picker legacy dimens -->
+ <dimen name="picker_top_margin">1dip</dimen>
+ <dimen name="picker_bottom_margin">1dip</dimen>
</resources>
diff --git a/core/res/res/values-watch/integers.xml b/core/res/res/values-watch/integers.xml
new file mode 100644
index 0000000..46ed97d
--- /dev/null
+++ b/core/res/res/values-watch/integers.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright 2012, 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>
+ <!-- Specifies date picker mode to be 'spinner' -->
+ <integer name="date_picker_mode_material">1</integer>
+
+ <!-- Specifies time picker mode to be 'spinner' -->
+ <integer name="time_picker_mode_material">1</integer>
+</resources>
diff --git a/core/res/res/values-watch/styles_material.xml b/core/res/res/values-watch/styles_material.xml
index f5735e6..d09119f 100644
--- a/core/res/res/values-watch/styles_material.xml
+++ b/core/res/res/values-watch/styles_material.xml
@@ -61,12 +61,19 @@
<item name="divider">@empty</item>
</style>
+ <style name="TextAppearance.Material.ListItem" parent="TextAppearance.Material.Body1" />
+ <style name="TextAppearance.Material.ListItemSecondary" parent="TextAppearance.Material.Caption" />
+
<style name="Widget.Material.TextView" parent="Widget.TextView">
<item name="breakStrategy">balanced</item>
</style>
<style name="Widget.Material.ButtonBar" parent="Widget.Material.BaseButtonBar" />
+ <style name="TextAppearance.Material.NumberPicker" parent="TextAppearance.Material.Body1">
+ <item name="textSize">@dimen/text_size_medium_material</item>
+ </style>
+
<!-- Alert dialog button bar button -->
<style name="Widget.Material.Button.ButtonBar.AlertDialog" parent="Widget.Material.Button.Borderless.Small">
<item name="paddingStart">@dimen/list_item_padding_start_material</item>
@@ -82,13 +89,21 @@
<item name="solidColor">@color/transparent</item>
<item name="selectionDivider">@drawable/numberpicker_selection_divider</item>
<item name="selectionDividerHeight">2dp</item>
- <item name="selectionDividersDistance">48dp</item>
- <item name="internalMinWidth">64dp</item>
- <item name="internalMaxHeight">180dp</item>
+ <item name="selectionDividersDistance">24dp</item>
+ <item name="internalMinWidth">32dp</item>
+ <item name="internalMaxHeight">90dp</item>
<item name="virtualButtonPressedDrawable">?selectableItemBackground</item>
<item name="descendantFocusability">blocksDescendants</item>
</style>
+ <style name="DialogWindowTitle.Material">
+ <item name="maxLines">3</item>
+ <item name="scrollHorizontally">false</item>
+ <item name="textAppearance">@style/TextAppearance.Material.DialogWindowTitle</item>
+ <item name="gravity">@integer/config_dialogTextGravity</item>
+ <item name="ellipsize">end</item>
+ </style>
+
<!-- DO NOTE TRANSLATE Spans within this text are applied to style composing regions
within an EditText widget. The text content is ignored and not used.
Note: This is @color/material_deep_teal_200, cannot use @color references here. -->
diff --git a/core/res/res/values-watch/themes_material.xml b/core/res/res/values-watch/themes_material.xml
index 4ae4367..84bc25f 100644
--- a/core/res/res/values-watch/themes_material.xml
+++ b/core/res/res/values-watch/themes_material.xml
@@ -59,4 +59,17 @@
<item name="colorBackgroundCacheHint">@color/background_cache_hint_selector_material_light</item>
<item name="windowIsFloating">false</item>
</style>
+
+ <!-- Force all settings themes to use normal Material theme. -->
+ <style name="Theme.Material.Settings" parent="Theme.Material"/>
+ <style name="Theme.Material.Settings.NoActionBar" parent="Theme.Material"/>
+ <style name="Theme.Material.Settings.BaseDialog" parent="Theme.Material.Dialog"/>
+ <style name="Theme.Material.Settings.Dialog" parent="Theme.Material.Settings.BaseDialog"/>
+ <style name="Theme.Material.Settings.Dialog.BaseAlert" parent="Theme.Material.Dialog.BaseAlert"/>
+ <style name="Theme.Material.Settings.Dialog.Alert" parent="Theme.Material.Settings.Dialog.BaseAlert"/>
+ <style name="Theme.Material.Settings.DialogWhenLarge" parent="Theme.Material.DialogWhenLarge"/>
+ <style name="Theme.Material.Settings.DialogWhenLarge.NoActionBar" parent="Theme.Material.DialogWhenLarge.NoActionBar"/>
+ <style name="Theme.Material.Settings.Dialog.Presentation" parent="Theme.Material.Dialog.Presentation"/>
+ <style name="Theme.Material.Settings.SearchBar" parent="Theme.Material.SearchBar"/>
+ <style name="Theme.Material.Settings.CompactMenu" parent="Theme.Material.CompactMenu"/>
</resources>
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index 2835c6f..18a6a83 100644
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -796,6 +796,12 @@
-->
<integer name="config_longPressOnBackBehavior">0</integer>
+ <!-- Control the behavior when the user panic presses the back button.
+ 0 - Nothing
+ 1 - Go to home
+ -->
+ <integer name="config_backPanicBehavior">0</integer>
+
<!-- Control the behavior when the user short presses the power button.
0 - Nothing
1 - Go to sleep (doze)
@@ -2513,4 +2519,7 @@
Note: Also update appropriate overlay files. -->
<string-array translatable="false" name="config_defaultFirstUserRestrictions">
</string-array>
+
+ <string name="config_networkOverLimitComponent" translatable="false">com.android.systemui/com.android.systemui.net.NetworkOverLimitActivity</string>
+ <string name="config_dataUsageSummaryComponent" translatable="false">com.android.settings/com.android.settings.Settings$DataUsageSummaryActivity</string>
</resources>
diff --git a/core/res/res/values/config_material.xml b/core/res/res/values/config_material.xml
index a37be83..397635f 100644
--- a/core/res/res/values/config_material.xml
+++ b/core/res/res/values/config_material.xml
@@ -32,9 +32,6 @@
<!-- True if windowOverscan should be on by default. -->
<bool name="config_windowOverscanByDefault">false</bool>
- <!-- Max number of lines for the dialog title. -->
- <integer name="config_dialogWindowTitleMaxLines">1</integer>
-
<!-- True if preference fragment should clip to padding. -->
<bool name="config_preferenceFragmentClipToPadding">true</bool>
</resources>
diff --git a/core/res/res/values/dimens_material.xml b/core/res/res/values/dimens_material.xml
index f96cef9..ae31165 100644
--- a/core/res/res/values/dimens_material.xml
+++ b/core/res/res/values/dimens_material.xml
@@ -189,4 +189,8 @@
<dimen name="day_picker_button_margin_top">0dp</dimen>
<dimen name="datepicker_view_animator_height">226dp</dimen>
+
+ <!-- Date and time picker legacy dimens -->
+ <dimen name="picker_top_margin">16dip</dimen>
+ <dimen name="picker_bottom_margin">16dip</dimen>
</resources>
diff --git a/core/res/res/values/integers.xml b/core/res/res/values/integers.xml
index 71ac2f4..2b69c75b 100644
--- a/core/res/res/values/integers.xml
+++ b/core/res/res/values/integers.xml
@@ -26,5 +26,12 @@
<integer name="date_picker_mode">1</integer>
<integer name="time_picker_mode">1</integer>
+
+ <!-- Specifies date picker mode to be 'calendar' -->
+ <integer name="date_picker_mode_material">2</integer>
+
+ <!-- Specifies time picker mode to be 'clock' -->
+ <integer name="time_picker_mode_material">2</integer>
+
<integer name="date_picker_header_max_lines_material">2</integer>
</resources>
diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml
index 8d3cd48..3c46517 100644
--- a/core/res/res/values/strings.xml
+++ b/core/res/res/values/strings.xml
@@ -1953,7 +1953,7 @@
<string name="lockscreen_access_pattern_cleared">Pattern cleared</string>
<!-- Accessibility description sent when user adds a dot to the pattern. [CHAR LIMIT=NONE] -->
<string name="lockscreen_access_pattern_cell_added">Cell added</string>
- <!-- Accessibility description sent when user adds a dot to the pattern. Announces the
+ <!-- Accessibility description sent when user adds a dot to the pattern. Announces the
actual cell when headphones are connected [CHAR LIMIT=NONE] -->
<string name="lockscreen_access_pattern_cell_added_verbose">
Cell <xliff:g id="cell_index" example="3">%1$s</xliff:g> added</string>
@@ -2033,6 +2033,12 @@
<!-- Button to restart the device after the factory test. -->
<string name="factorytest_reboot">Reboot</string>
+ <!-- Do not translate. timepicker mode, overridden for watch -->
+ <string name="time_picker_mode" translatable="false">"clock"</string>
+
+ <!-- Do not translate. datepicker mode, overridden for watch -->
+ <string name="date_picker_mode" translatable="false">"calendar"</string>
+
<!-- Do not translate. WebView User Agent string -->
<string name="web_user_agent" translatable="false">Mozilla/5.0 (Linux; U; <xliff:g id="x">Android %s</xliff:g>)
AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 <xliff:g id="mobile">%s</xliff:g>Safari/534.30</string>
diff --git a/core/res/res/values/styles_material.xml b/core/res/res/values/styles_material.xml
index 4435537..90746e5 100644
--- a/core/res/res/values/styles_material.xml
+++ b/core/res/res/values/styles_material.xml
@@ -255,6 +255,8 @@
<item name="textColor">?attr/textColorPrimary</item>
</style>
+ <style name="TextAppearance.Material.NumberPicker" parent="TextAppearance.Material.Body1"/>
+
<!-- Deprecated text styles -->
<style name="TextAppearance.Material.Inverse">
@@ -475,6 +477,9 @@
<item name="textColor">#66000000</item>
</style>
+ <style name="TextAppearance.Material.ListItem" parent="TextAppearance.Material.Subhead" />
+ <style name="TextAppearance.Material.ListItemSecondary" parent="TextAppearance.Material.Body1" />
+
<style name="Widget.Material.Notification.ProgressBar" parent="Widget.Material.Light.ProgressBar.Horizontal" />
<style name="Widget.Material.Notification.MessagingText" parent="Widget.Material.Light.TextView">
@@ -684,7 +689,7 @@
</style>
<style name="Widget.Material.TimePicker">
- <item name="timePickerMode">clock</item>
+ <item name="timePickerMode">@integer/time_picker_mode_material</item>
<item name="legacyLayout">@layout/time_picker_legacy_material</item>
<!-- Attributes for new-style TimePicker. -->
<item name="internalLayout">@layout/time_picker_material</item>
@@ -698,7 +703,7 @@
</style>
<style name="Widget.Material.DatePicker">
- <item name="datePickerMode">calendar</item>
+ <item name="datePickerMode">@integer/date_picker_mode_material</item>
<item name="legacyLayout">@layout/date_picker_legacy_holo</item>
<item name="calendarViewShown">true</item>
<!-- Attributes for new-style DatePicker. -->
@@ -1246,7 +1251,7 @@
<style name="DialogWindowTitleBackground.Material.Light" />
<style name="DialogWindowTitle.Material">
- <item name="maxLines">@integer/config_dialogWindowTitleMaxLines</item>
+ <item name="maxLines">1</item>
<item name="scrollHorizontally">true</item>
<item name="textAppearance">@style/TextAppearance.Material.DialogWindowTitle</item>
</style>
diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml
index 2a40c08..45e4520 100644
--- a/core/res/res/values/symbols.xml
+++ b/core/res/res/values/symbols.xml
@@ -375,6 +375,7 @@
<java-symbol type="integer" name="config_immersive_mode_confirmation_panic" />
<java-symbol type="integer" name="config_longPressOnPowerBehavior" />
<java-symbol type="integer" name="config_longPressOnBackBehavior" />
+ <java-symbol type="integer" name="config_backPanicBehavior" />
<java-symbol type="integer" name="config_lowMemoryKillerMinFreeKbytesAdjust" />
<java-symbol type="integer" name="config_lowMemoryKillerMinFreeKbytesAbsolute" />
<java-symbol type="integer" name="config_max_pan_devices" />
@@ -2646,6 +2647,10 @@
<!-- Colon separated list of package names that should be granted DND access -->
<java-symbol type="string" name="config_defaultDndAccessPackages" />
+ <!-- For NetworkPolicyManagerService -->
+ <java-symbol type="string" name="config_networkOverLimitComponent" />
+ <java-symbol type="string" name="config_dataUsageSummaryComponent" />
+
<java-symbol type="string" name="lockscreen_storage_locked" />
<!-- Used for MimeIconUtils. -->
diff --git a/core/res/res/values/themes_material.xml b/core/res/res/values/themes_material.xml
index 7e2867d..0eb4c8d 100644
--- a/core/res/res/values/themes_material.xml
+++ b/core/res/res/values/themes_material.xml
@@ -114,9 +114,9 @@
<item name="listPreferredItemHeightSmall">48dip</item>
<item name="listPreferredItemHeightLarge">80dip</item>
<item name="dropdownListPreferredItemHeight">?attr/listPreferredItemHeightSmall</item>
- <item name="textAppearanceListItem">@style/TextAppearance.Material.Subhead</item>
- <item name="textAppearanceListItemSmall">@style/TextAppearance.Material.Subhead</item>
- <item name="textAppearanceListItemSecondary">@style/TextAppearance.Material.Body1</item>
+ <item name="textAppearanceListItem">@style/TextAppearance.Material.ListItem</item>
+ <item name="textAppearanceListItemSmall">@style/TextAppearance.Material.ListItem</item>
+ <item name="textAppearanceListItemSecondary">@style/TextAppearance.Material.ListItemSecondary</item>
<item name="listPreferredItemPaddingLeft">@dimen/list_item_padding_horizontal_material</item>
<item name="listPreferredItemPaddingRight">@dimen/list_item_padding_horizontal_material</item>
<item name="listPreferredItemPaddingStart">@dimen/list_item_padding_start_material</item>
@@ -475,9 +475,9 @@
<item name="listPreferredItemHeightSmall">48dip</item>
<item name="listPreferredItemHeightLarge">80dip</item>
<item name="dropdownListPreferredItemHeight">?attr/listPreferredItemHeightSmall</item>
- <item name="textAppearanceListItem">@style/TextAppearance.Material.Subhead</item>
- <item name="textAppearanceListItemSmall">@style/TextAppearance.Material.Subhead</item>
- <item name="textAppearanceListItemSecondary">@style/TextAppearance.Material.Body1</item>
+ <item name="textAppearanceListItem">@style/TextAppearance.Material.ListItem</item>
+ <item name="textAppearanceListItemSmall">@style/TextAppearance.Material.ListItem</item>
+ <item name="textAppearanceListItemSecondary">@style/TextAppearance.Material.ListItemSecondary</item>
<item name="listPreferredItemPaddingLeft">@dimen/list_item_padding_horizontal_material</item>
<item name="listPreferredItemPaddingRight">@dimen/list_item_padding_horizontal_material</item>
<item name="listPreferredItemPaddingStart">@dimen/list_item_padding_start_material</item>
diff --git a/core/res/res/xml-watch/default_zen_mode_config.xml b/core/res/res/xml-watch/default_zen_mode_config.xml
index 26af10c..938cc0c 100644
--- a/core/res/res/xml-watch/default_zen_mode_config.xml
+++ b/core/res/res/xml-watch/default_zen_mode_config.xml
@@ -17,8 +17,8 @@
<!-- Default configuration for zen mode. See android.service.notification.ZenModeConfig. -->
<zen version="2">
- <!-- Allow starred contacts to go through only. Repeated calls on.
- Calls, messages, reminders, events off.-->
- <allow from="2" repeatCallers="true" calls="false" messages="false" reminders="false"
+ <!-- Allow starred contacts to go through only.
+ Repeated calls, calls, messages, reminders, events off. -->
+ <allow from="2" repeatCallers="false" calls="false" messages="false" reminders="false"
events="false"/>
</zen>
diff --git a/packages/CaptivePortalLogin/res/values-bn-rBD/strings.xml b/packages/CaptivePortalLogin/res/values-bn-rBD/strings.xml
index 20173b0..24cbfbd 100644
--- a/packages/CaptivePortalLogin/res/values-bn-rBD/strings.xml
+++ b/packages/CaptivePortalLogin/res/values-bn-rBD/strings.xml
@@ -4,7 +4,7 @@
<string name="app_name" msgid="5934709770924185752">"CaptivePortalLogin"</string>
<string name="action_use_network" msgid="6076184727448466030">"যেভাবে আছে সেভাবেই এই নেটওয়ার্ক ব্যবহার করুন"</string>
<string name="action_do_not_use_network" msgid="4577366536956516683">"এই নেটওয়ার্ক ব্যবহার করবেন না"</string>
- <string name="action_bar_label" msgid="917235635415966620">"নেটওয়ার্কে প্রবেশ করুন করুন"</string>
+ <string name="action_bar_label" msgid="917235635415966620">"নেটওয়ার্কে প্রবেশ করুন"</string>
<string name="ssl_error_warning" msgid="6653188881418638872">"আপনি যে নেটওয়ার্কে যোগ দেওয়ার চেষ্টা করছেন তাতে নিরাপত্তার সমস্যা আছে।"</string>
<string name="ssl_error_example" msgid="647898534624078900">"উদাহরণস্বরূপ, লগইন পৃষ্ঠাটি প্রদর্শিত প্রতিষ্ঠানের অন্তর্গত নাও হতে পারে৷"</string>
<string name="ssl_error_continue" msgid="6492718244923937110">"যাই হোক না কেন ব্রাউজারের মাধ্যমে অবিরত রাখুন"</string>
diff --git a/packages/SettingsLib/res/values-bs-rBA/strings.xml b/packages/SettingsLib/res/values-bs-rBA/strings.xml
index 40a3630..a11bf32 100644
--- a/packages/SettingsLib/res/values-bs-rBA/strings.xml
+++ b/packages/SettingsLib/res/values-bs-rBA/strings.xml
@@ -146,9 +146,9 @@
<string name="vpn_settings_not_available" msgid="956841430176985598">"VPN postavke nisu dostupne za ovog korisnika"</string>
<string name="tethering_settings_not_available" msgid="6765770438438291012">"Postavke za privezivanje nisu dostupne za ovog korisnika"</string>
<string name="apn_settings_not_available" msgid="7873729032165324000">"Postavke za naziv pristupne tačke nisu dostupne za ovog korisnika"</string>
- <string name="enable_adb" msgid="7982306934419797485">"Otklanjanje grešaka putem uređaja spojenog na USB"</string>
+ <string name="enable_adb" msgid="7982306934419797485">"USB otklanjanje grešaka"</string>
<string name="enable_adb_summary" msgid="4881186971746056635">"Način rada za uklanjanje grešaka kada je povezan USB"</string>
- <string name="clear_adb_keys" msgid="4038889221503122743">"Ukini odobrenja otklanjanja grešaka putem uređaja spojenog na USB"</string>
+ <string name="clear_adb_keys" msgid="4038889221503122743">"Ukini odobrenja otklanjanja grešaka USB-om"</string>
<string name="bugreport_in_power" msgid="7923901846375587241">"Prečica za izvještaj o greškama"</string>
<string name="bugreport_in_power_summary" msgid="1778455732762984579">"Prikaži tipku za prijavu grešaka u izborniku za potrošnju energije"</string>
<string name="keep_screen_on" msgid="1146389631208760344">"Ostani aktivan"</string>
@@ -185,9 +185,9 @@
<string name="allow_mock_location_summary" msgid="317615105156345626">"Dozvoli lažne lokacije"</string>
<string name="debug_view_attributes" msgid="6485448367803310384">"Omogući pregled atributa prikaza"</string>
<string name="mobile_data_always_on_summary" msgid="8149773901431697910">"Uvijek drži mobilne podatke aktivnim, čak i kada je Wi-Fi je aktivan (za brzo prebacivanje između mreža)."</string>
- <string name="adb_warning_title" msgid="6234463310896563253">"Omogućiti otklanjanje grešaka putem uređaja spojenog na USB?"</string>
- <string name="adb_warning_message" msgid="7316799925425402244">"Otklanjanje grešaka putem uređaja spojenog na USB je namijenjeno samo u svrhe razvoja aplikacija. Koristite ga za kopiranje podataka između računara i uređaja, instaliranje aplikacija na uređaj bez obavještenja te čitanje podataka iz zapisnika."</string>
- <string name="adb_keys_warning_message" msgid="5659849457135841625">"Opozvati pristup otklanjanju grešaka putem uređaja spojenog na USB za sve računare koje ste prethodno ovlastili?"</string>
+ <string name="adb_warning_title" msgid="6234463310896563253">"Omogućiti USB otklanjanje grešaka?"</string>
+ <string name="adb_warning_message" msgid="7316799925425402244">"USB otklanjanje grešaka je namijenjeno samo u svrhe razvoja aplikacija. Koristite ga za kopiranje podataka između računara i uređaja, instaliranje aplikacija na uređaj bez obavještenja te čitanje podataka iz zapisnika."</string>
+ <string name="adb_keys_warning_message" msgid="5659849457135841625">"Opozvati pristup otklanjanju grešaka USB-om za sve računare koje ste prethodno ovlastili?"</string>
<string name="dev_settings_warning_title" msgid="7244607768088540165">"Dopustiti postavke za razvoj?"</string>
<string name="dev_settings_warning_message" msgid="2298337781139097964">"Ove postavke su namijenjene samo za svrhe razvoja. Mogu izazvati pogrešno ponašanje uređaja i aplikacija na njemu."</string>
<string name="verify_apps_over_usb_title" msgid="4177086489869041953">"Verifikuj aplikacije putem USB-a"</string>
diff --git a/packages/SettingsLib/res/values-ca/strings.xml b/packages/SettingsLib/res/values-ca/strings.xml
index 99850a5..fb7180a 100644
--- a/packages/SettingsLib/res/values-ca/strings.xml
+++ b/packages/SettingsLib/res/values-ca/strings.xml
@@ -111,7 +111,7 @@
<string name="tts_play_example_summary" msgid="8029071615047894486">"Reprodueix una breu demostració de síntesi de veu"</string>
<string name="tts_install_data_title" msgid="4264378440508149986">"Instal·la dades de veu"</string>
<string name="tts_install_data_summary" msgid="5742135732511822589">"Instal·la les dades de veu necessàries per a la síntesi de veu"</string>
- <string name="tts_engine_security_warning" msgid="8786238102020223650">"Pot ser que aquest motor de síntesi de la parla pugui recopilar tot el text que es dirà en veu alta, incloses les dades personals, com ara les contrasenyes i els números de les targetes de crèdit. Ve del motor <xliff:g id="TTS_PLUGIN_ENGINE_NAME">%s</xliff:g>. Vols activar l\'ús d\'aquest motor de síntesi de la parla?"</string>
+ <string name="tts_engine_security_warning" msgid="8786238102020223650">"Pot ser que aquest motor de síntesi de la parla pugui recopilar tot el text que es dirà en veu alta, incloses les dades personals, com ara les contrasenyes i els números de les targetes de crèdit. Ve del motor <xliff:g id="TTS_PLUGIN_ENGINE_NAME">%s</xliff:g>. Voleu activar l\'ús d\'aquest motor de síntesi de la parla?"</string>
<string name="tts_engine_network_required" msgid="1190837151485314743">"Aquest idioma requereix una connexió de xarxa activa per a la sortida de síntesi de veu."</string>
<string name="tts_default_sample_string" msgid="4040835213373086322">"Això és un exemple de síntesi de veu"</string>
<string name="tts_status_title" msgid="7268566550242584413">"Estat de l\'idioma predeterminat"</string>
diff --git a/packages/SettingsLib/res/values-kn-rIN/strings.xml b/packages/SettingsLib/res/values-kn-rIN/strings.xml
index 643875f..8578810d 100644
--- a/packages/SettingsLib/res/values-kn-rIN/strings.xml
+++ b/packages/SettingsLib/res/values-kn-rIN/strings.xml
@@ -340,5 +340,5 @@
<string name="screen_zoom_summary_very_large" msgid="7108563375663670067">"ಸ್ವಲ್ಪ ದೊಡ್ಡ"</string>
<string name="screen_zoom_summary_extremely_large" msgid="7427320168263276227">"ದೊಡ್ಡ"</string>
<string name="screen_zoom_summary_custom" msgid="5611979864124160447">"ಕಸ್ಟಮ್ (<xliff:g id="DENSITYDPI">%d</xliff:g>)"</string>
- <string name="help_feedback_label" msgid="6815040660801785649">"ಸಹಾಯ ಮತ್ತು ಪ್ರತಿಕ್ರಿಯೆ"</string>
+ <string name="help_feedback_label" msgid="6815040660801785649">"ಸಹಾಯ & ಪ್ರತಿಕ್ರಿಯೆ"</string>
</resources>
diff --git a/packages/SettingsProvider/res/values/defaults.xml b/packages/SettingsProvider/res/values/defaults.xml
index f7e9541..fad102f 100644
--- a/packages/SettingsProvider/res/values/defaults.xml
+++ b/packages/SettingsProvider/res/values/defaults.xml
@@ -155,6 +155,9 @@
<!-- Default for Settings.Secure.LONG_PRESS_TIMEOUT_MILLIS -->
<integer name="def_long_press_timeout_millis">400</integer>
+ <!-- Default for Settings.Secure.MULTI_PRESS_TIMEOUT -->
+ <integer name="def_multi_press_timeout_millis">300</integer>
+
<!-- Default for Settings.Secure.SHOW_IME_WITH_HARD_KEYBOARD -->
<bool name="def_show_ime_with_hard_keyboard">false</bool>
diff --git a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
index 0f7fe6f..0f3a7fb 100644
--- a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
+++ b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
@@ -2102,7 +2102,7 @@
}
private final class UpgradeController {
- private static final int SETTINGS_VERSION = 130;
+ private static final int SETTINGS_VERSION = 131;
private final int mUserId;
@@ -2410,6 +2410,22 @@
currentVersion = 130;
}
+ if (currentVersion == 130) {
+ // Initialize new multi-press timeout to default value
+ final SettingsState systemSecureSettings = getSecureSettingsLocked(userId);
+ final String oldValue = systemSecureSettings.getSettingLocked(
+ Settings.Secure.MULTI_PRESS_TIMEOUT).getValue();
+ if (TextUtils.equals(null, oldValue)) {
+ systemSecureSettings.insertSettingLocked(
+ Settings.Secure.MULTI_PRESS_TIMEOUT,
+ String.valueOf(getContext().getResources().getInteger(
+ R.integer.def_multi_press_timeout_millis)),
+ SettingsState.SYSTEM_PACKAGE_NAME);
+ }
+
+ currentVersion = 131;
+ }
+
if (currentVersion != newVersion) {
Slog.w("SettingsProvider", "warning: upgrading settings database to version "
+ newVersion + " left it at "
diff --git a/services/core/java/com/android/server/am/BroadcastQueue.java b/services/core/java/com/android/server/am/BroadcastQueue.java
index a279290..4ef6a0f 100644
--- a/services/core/java/com/android/server/am/BroadcastQueue.java
+++ b/services/core/java/com/android/server/am/BroadcastQueue.java
@@ -226,11 +226,12 @@
}
public final boolean replaceParallelBroadcastLocked(BroadcastRecord r) {
+ final Intent intent = r.intent;
for (int i = mParallelBroadcasts.size() - 1; i >= 0; i--) {
- if (r.intent.filterEquals(mParallelBroadcasts.get(i).intent)) {
+ if (intent.filterEquals(mParallelBroadcasts.get(i).intent)) {
if (DEBUG_BROADCAST) Slog.v(TAG_BROADCAST,
"***** DROPPING PARALLEL ["
- + mQueueName + "]: " + r.intent);
+ + mQueueName + "]: " + intent);
mParallelBroadcasts.set(i, r);
return true;
}
@@ -239,11 +240,12 @@
}
public final boolean replaceOrderedBroadcastLocked(BroadcastRecord r) {
+ final Intent intent = r.intent;
for (int i = mOrderedBroadcasts.size() - 1; i > 0; i--) {
- if (r.intent.filterEquals(mOrderedBroadcasts.get(i).intent)) {
+ if (intent.filterEquals(mOrderedBroadcasts.get(i).intent)) {
if (DEBUG_BROADCAST) Slog.v(TAG_BROADCAST,
"***** DROPPING ORDERED ["
- + mQueueName + "]: " + r.intent);
+ + mQueueName + "]: " + intent);
mOrderedBroadcasts.set(i, r);
return true;
}
diff --git a/services/core/java/com/android/server/am/CoreSettingsObserver.java b/services/core/java/com/android/server/am/CoreSettingsObserver.java
index 9dd07a9..73a17c6 100644
--- a/services/core/java/com/android/server/am/CoreSettingsObserver.java
+++ b/services/core/java/com/android/server/am/CoreSettingsObserver.java
@@ -42,6 +42,7 @@
String, Class<?>>();
static {
sSecureSettingToTypeMap.put(Settings.Secure.LONG_PRESS_TIMEOUT, int.class);
+ sSecureSettingToTypeMap.put(Settings.Secure.MULTI_PRESS_TIMEOUT, int.class);
// add other secure settings here...
sSystemSettingToTypeMap.put(Settings.System.TIME_12_24, String.class);
diff --git a/services/core/java/com/android/server/net/NetworkPolicyManagerService.java b/services/core/java/com/android/server/net/NetworkPolicyManagerService.java
index 8f9cc47..e3ec11f 100644
--- a/services/core/java/com/android/server/net/NetworkPolicyManagerService.java
+++ b/services/core/java/com/android/server/net/NetworkPolicyManagerService.java
@@ -1035,7 +1035,7 @@
*/
private void notifyOverLimitNL(NetworkTemplate template) {
if (!mOverLimitNotified.contains(template)) {
- mContext.startActivity(buildNetworkOverLimitIntent(template));
+ mContext.startActivity(buildNetworkOverLimitIntent(mContext.getResources(), template));
mOverLimitNotified.add(template);
}
}
@@ -1079,7 +1079,7 @@
builder.setDeleteIntent(PendingIntent.getBroadcast(
mContext, 0, snoozeIntent, PendingIntent.FLAG_UPDATE_CURRENT));
- final Intent viewIntent = buildViewDataUsageIntent(policy.template);
+ final Intent viewIntent = buildViewDataUsageIntent(res, policy.template);
builder.setContentIntent(PendingIntent.getActivity(
mContext, 0, viewIntent, PendingIntent.FLAG_UPDATE_CURRENT));
@@ -1115,7 +1115,7 @@
builder.setContentTitle(title);
builder.setContentText(body);
- final Intent intent = buildNetworkOverLimitIntent(policy.template);
+ final Intent intent = buildNetworkOverLimitIntent(res, policy.template);
builder.setContentIntent(PendingIntent.getActivity(
mContext, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT));
break;
@@ -1150,7 +1150,7 @@
builder.setContentTitle(title);
builder.setContentText(body);
- final Intent intent = buildViewDataUsageIntent(policy.template);
+ final Intent intent = buildViewDataUsageIntent(res, policy.template);
builder.setContentIntent(PendingIntent.getActivity(
mContext, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT));
break;
@@ -3518,19 +3518,19 @@
return intent;
}
- private static Intent buildNetworkOverLimitIntent(NetworkTemplate template) {
+ private static Intent buildNetworkOverLimitIntent(Resources res, NetworkTemplate template) {
final Intent intent = new Intent();
- intent.setComponent(new ComponentName(
- "com.android.systemui", "com.android.systemui.net.NetworkOverLimitActivity"));
+ intent.setComponent(ComponentName.unflattenFromString(
+ res.getString(R.string.config_networkOverLimitComponent)));
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.putExtra(EXTRA_NETWORK_TEMPLATE, template);
return intent;
}
- private static Intent buildViewDataUsageIntent(NetworkTemplate template) {
+ private static Intent buildViewDataUsageIntent(Resources res, NetworkTemplate template) {
final Intent intent = new Intent();
- intent.setComponent(new ComponentName(
- "com.android.settings", "com.android.settings.Settings$DataUsageSummaryActivity"));
+ intent.setComponent(ComponentName.unflattenFromString(
+ res.getString(R.string.config_dataUsageSummaryComponent)));
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.putExtra(EXTRA_NETWORK_TEMPLATE, template);
return intent;
diff --git a/services/core/java/com/android/server/policy/PhoneWindowManager.java b/services/core/java/com/android/server/policy/PhoneWindowManager.java
index f7454a3..adf6453 100644
--- a/services/core/java/com/android/server/policy/PhoneWindowManager.java
+++ b/services/core/java/com/android/server/policy/PhoneWindowManager.java
@@ -200,6 +200,11 @@
static final int MULTI_PRESS_POWER_THEATER_MODE = 1;
static final int MULTI_PRESS_POWER_BRIGHTNESS_BOOST = 2;
+ // Number of presses needed before we induce panic press behavior on the back button
+ static final int PANIC_PRESS_BACK_COUNT = 4;
+ static final int PANIC_PRESS_BACK_NOTHING = 0;
+ static final int PANIC_PRESS_BACK_HOME = 1;
+
// These need to match the documentation/constant in
// core/res/res/values/config.xml
static final int LONG_PRESS_HOME_NOTHING = 0;
@@ -406,6 +411,7 @@
volatile boolean mBackKeyHandled;
volatile boolean mBeganFromNonInteractive;
volatile int mPowerKeyPressCounter;
+ volatile int mBackKeyPressCounter;
volatile boolean mEndCallKeyHandled;
volatile boolean mCameraGestureTriggeredDuringGoingToSleep;
volatile boolean mGoingToSleep;
@@ -464,6 +470,7 @@
int mDoublePressOnPowerBehavior;
int mTriplePressOnPowerBehavior;
int mLongPressOnBackBehavior;
+ int mPanicPressOnBackBehavior;
int mShortPressOnSleepBehavior;
int mShortPressWindowBehavior;
boolean mAwake;
@@ -726,6 +733,7 @@
private static final int MSG_SHOW_TV_PICTURE_IN_PICTURE_MENU = 17;
private static final int MSG_BACK_LONG_PRESS = 18;
private static final int MSG_DISPOSE_INPUT_CONSUMER = 19;
+ private static final int MSG_BACK_DELAYED_PRESS = 20;
private static final int MSG_REQUEST_TRANSIENT_BARS_ARG_STATUS = 0;
private static final int MSG_REQUEST_TRANSIENT_BARS_ARG_NAVIGATION = 1;
@@ -792,10 +800,15 @@
break;
case MSG_BACK_LONG_PRESS:
backLongPress();
+ finishBackKeyPress();
break;
case MSG_DISPOSE_INPUT_CONSUMER:
disposeInputConsumer((InputConsumer) msg.obj);
break;
+ case MSG_BACK_DELAYED_PRESS:
+ backMultiPressAction((Long) msg.obj, msg.arg1);
+ finishBackKeyPress();
+ break;
}
}
}
@@ -1010,6 +1023,52 @@
}
}
+ private void interceptBackKeyDown() {
+ // Reset back key state for long press
+ mBackKeyHandled = false;
+
+ // Cancel multi-press detection timeout.
+ if (hasPanicPressOnBackBehavior()) {
+ if (mBackKeyPressCounter != 0
+ && mBackKeyPressCounter < PANIC_PRESS_BACK_COUNT) {
+ mHandler.removeMessages(MSG_BACK_DELAYED_PRESS);
+ }
+ }
+
+ if (hasLongPressOnBackBehavior()) {
+ Message msg = mHandler.obtainMessage(MSG_BACK_LONG_PRESS);
+ msg.setAsynchronous(true);
+ mHandler.sendMessageDelayed(msg,
+ ViewConfiguration.get(mContext).getDeviceGlobalActionKeyTimeout());
+ }
+ }
+
+ // returns true if the key was handled and should not be passed to the user
+ private boolean interceptBackKeyUp(KeyEvent event) {
+ // Cache handled state
+ boolean handled = mBackKeyHandled;
+
+ if (hasPanicPressOnBackBehavior()) {
+ // Check for back key panic press
+ ++mBackKeyPressCounter;
+
+ final long eventTime = event.getDownTime();
+
+ if (mBackKeyPressCounter <= PANIC_PRESS_BACK_COUNT) {
+ // This could be a multi-press. Wait a little bit longer to confirm.
+ Message msg = mHandler.obtainMessage(MSG_BACK_DELAYED_PRESS,
+ mBackKeyPressCounter, 0, eventTime);
+ msg.setAsynchronous(true);
+ mHandler.sendMessageDelayed(msg, ViewConfiguration.getMultiPressTimeout());
+ }
+ }
+
+ // Reset back long press state
+ cancelPendingBackKeyAction();
+
+ return handled;
+ }
+
private void interceptPowerKeyDown(KeyEvent event, boolean interactive) {
// Hold a wake lock until the power key is released.
if (!mPowerKeyWakeLock.isHeld()) {
@@ -1140,6 +1199,10 @@
}
}
+ private void finishBackKeyPress() {
+ mBackKeyPressCounter = 0;
+ }
+
private void cancelPendingPowerKeyAction() {
if (!mPowerKeyHandled) {
mPowerKeyHandled = true;
@@ -1154,6 +1217,18 @@
}
}
+ private void backMultiPressAction(long eventTime, int count) {
+ if (count >= PANIC_PRESS_BACK_COUNT) {
+ switch (mPanicPressOnBackBehavior) {
+ case PANIC_PRESS_BACK_NOTHING:
+ break;
+ case PANIC_PRESS_BACK_HOME:
+ launchHomeFromHotKey();
+ break;
+ }
+ }
+ }
+
private void powerPress(long eventTime, boolean interactive, int count) {
if (mScreenOnEarly && !mScreenOnFully) {
Slog.i(TAG, "Suppressed redundant power key press while "
@@ -1312,6 +1387,10 @@
return mLongPressOnBackBehavior != LONG_PRESS_BACK_NOTHING;
}
+ private boolean hasPanicPressOnBackBehavior() {
+ return mPanicPressOnBackBehavior != PANIC_PRESS_BACK_NOTHING;
+ }
+
private void interceptScreenshotChord() {
if (mScreenshotChordEnabled
&& mScreenshotChordVolumeDownKeyTriggered && mScreenshotChordPowerKeyTriggered
@@ -1639,6 +1718,8 @@
mLongPressOnBackBehavior = mContext.getResources().getInteger(
com.android.internal.R.integer.config_longPressOnBackBehavior);
+ mPanicPressOnBackBehavior = mContext.getResources().getInteger(
+ com.android.internal.R.integer.config_backPanicBehavior);
mShortPressOnPowerBehavior = mContext.getResources().getInteger(
com.android.internal.R.integer.config_shortPressOnPowerBehavior);
@@ -5621,20 +5702,11 @@
switch (keyCode) {
case KeyEvent.KEYCODE_BACK: {
if (down) {
- mBackKeyHandled = false;
- if (hasLongPressOnBackBehavior()) {
- Message msg = mHandler.obtainMessage(MSG_BACK_LONG_PRESS);
- msg.setAsynchronous(true);
- mHandler.sendMessageDelayed(msg,
- ViewConfiguration.get(mContext).getDeviceGlobalActionKeyTimeout());
- }
+ interceptBackKeyDown();
} else {
- boolean handled = mBackKeyHandled;
+ boolean handled = interceptBackKeyUp(event);
- // Reset back key state
- cancelPendingBackKeyAction();
-
- // Don't pass back press to app if we've already handled it
+ // Don't pass back press to app if we've already handled it via long press
if (handled) {
result &= ~ACTION_PASS_TO_USER;
}
diff --git a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
index e828650..6258340 100644
--- a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
+++ b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
@@ -5876,8 +5876,10 @@
updateDeviceOwnerLocked();
disableSecurityLoggingIfNotCompliant();
try {
- // Reactivate backup service.
- mInjector.getIBackupManager().setBackupServiceActive(UserHandle.USER_SYSTEM, true);
+ if (mInjector.getIBackupManager() != null) {
+ // Reactivate backup service.
+ mInjector.getIBackupManager().setBackupServiceActive(UserHandle.USER_SYSTEM, true);
+ }
} catch (RemoteException e) {
throw new IllegalStateException("Failed reactivating backup service.", e);
}
diff --git a/wifi/java/android/net/wifi/WifiConfiguration.java b/wifi/java/android/net/wifi/WifiConfiguration.java
index 9d0c20c..d3d5ea0 100644
--- a/wifi/java/android/net/wifi/WifiConfiguration.java
+++ b/wifi/java/android/net/wifi/WifiConfiguration.java
@@ -817,6 +817,7 @@
*/
public static final int NETWORK_SELECTION_ENABLE = 0;
/**
+ * @deprecated it is not used any more.
* This network is disabled because higher layer (>2) network is bad
*/
public static final int DISABLED_BAD_LINK = 1;
@@ -862,7 +863,7 @@
*/
private static final String[] QUALITY_NETWORK_SELECTION_DISABLE_REASON = {
"NETWORK_SELECTION_ENABLE",
- "NETWORK_SELECTION_DISABLED_BAD_LINK",
+ "NETWORK_SELECTION_DISABLED_BAD_LINK", // deprecated
"NETWORK_SELECTION_DISABLED_ASSOCIATION_REJECTION ",
"NETWORK_SELECTION_DISABLED_AUTHENTICATION_FAILURE",
"NETWORK_SELECTION_DISABLED_DHCP_FAILURE",