diff options
61 files changed, 590 insertions, 194 deletions
diff --git a/cmds/bootanimation/BootAnimation.cpp b/cmds/bootanimation/BootAnimation.cpp index ebcc9ff0451f..495e56ce64b3 100644 --- a/cmds/bootanimation/BootAnimation.cpp +++ b/cmds/bootanimation/BootAnimation.cpp @@ -75,6 +75,7 @@ static const char ACCURATE_TIME_FLAG_FILE_PATH[] = "/data/system/time/time_is_ac // Java timestamp format. Don't show the clock if the date is before 2000-01-01 00:00:00. static const long long ACCURATE_TIME_EPOCH = 946684800000; static const char EXIT_PROP_NAME[] = "service.bootanim.exit"; +static const char PLAY_SOUND_PROP_NAME[] = "persist.sys.bootanim.play_sound"; static const int ANIM_ENTRY_NAME_MAX = 256; // --------------------------------------------------------------------------- @@ -778,8 +779,12 @@ bool BootAnimation::playAnimation(const Animation& animation) // only play audio file the first time we animate the part if (r == 0 && part.audioData) { - ALOGD("playing clip for part%d, size=%d", (int) i, part.audioLength); - audioplay::playClip(part.audioData, part.audioLength); + // Read the system property to see if we should play the sound. + // If not present, default to playing it. + if (property_get_bool(PLAY_SOUND_PROP_NAME, 1)) { + ALOGD("playing clip for part%d, size=%d", (int) i, part.audioLength); + audioplay::playClip(part.audioData, part.audioLength); + } } glClearColor( diff --git a/core/java/android/app/FragmentTransaction.java b/core/java/android/app/FragmentTransaction.java index e435580d55fe..633e85b78118 100644 --- a/core/java/android/app/FragmentTransaction.java +++ b/core/java/android/app/FragmentTransaction.java @@ -17,7 +17,8 @@ import java.lang.annotation.RetentionPolicy; * <div class="special reference"> * <h3>Developer Guides</h3> * <p>For more information about using fragments, read the - * <a href="{@docRoot}guide/topics/fundamentals/fragments.html">Fragments</a> developer guide.</p> + * <a href="{@docRoot}guide/components/fragments.html">Fragments</a> developer + * guide.</p> * </div> */ public abstract class FragmentTransaction { @@ -25,17 +26,17 @@ public abstract class FragmentTransaction { * Calls {@link #add(int, Fragment, String)} with a 0 containerViewId. */ public abstract FragmentTransaction add(Fragment fragment, String tag); - + /** * Calls {@link #add(int, Fragment, String)} with a null tag. */ public abstract FragmentTransaction add(@IdRes int containerViewId, Fragment fragment); - + /** * Add a fragment to the activity state. This fragment may optionally * also have its view (if {@link Fragment#onCreateView Fragment.onCreateView} * returns non-null) inserted into a container view of the activity. - * + * * @param containerViewId Optional identifier of the container this fragment is * to be placed in. If 0, it will not be placed in a container. * @param fragment The fragment to be added. This fragment must not already @@ -43,64 +44,64 @@ public abstract class FragmentTransaction { * @param tag Optional tag name for the fragment, to later retrieve the * fragment with {@link FragmentManager#findFragmentByTag(String) * FragmentManager.findFragmentByTag(String)}. - * + * * @return Returns the same FragmentTransaction instance. */ public abstract FragmentTransaction add(@IdRes int containerViewId, Fragment fragment, String tag); - + /** * Calls {@link #replace(int, Fragment, String)} with a null tag. */ public abstract FragmentTransaction replace(@IdRes int containerViewId, Fragment fragment); - + /** * Replace an existing fragment that was added to a container. This is * essentially the same as calling {@link #remove(Fragment)} for all * currently added fragments that were added with the same containerViewId * and then {@link #add(int, Fragment, String)} with the same arguments * given here. - * + * * @param containerViewId Identifier of the container whose fragment(s) are * to be replaced. * @param fragment The new fragment to place in the container. * @param tag Optional tag name for the fragment, to later retrieve the * fragment with {@link FragmentManager#findFragmentByTag(String) * FragmentManager.findFragmentByTag(String)}. - * + * * @return Returns the same FragmentTransaction instance. */ public abstract FragmentTransaction replace(@IdRes int containerViewId, Fragment fragment, String tag); - + /** * Remove an existing fragment. If it was added to a container, its view * is also removed from that container. - * + * * @param fragment The fragment to be removed. - * + * * @return Returns the same FragmentTransaction instance. */ public abstract FragmentTransaction remove(Fragment fragment); - + /** * Hides an existing fragment. This is only relevant for fragments whose * views have been added to a container, as this will cause the view to * be hidden. - * + * * @param fragment The fragment to be hidden. - * + * * @return Returns the same FragmentTransaction instance. */ public abstract FragmentTransaction hide(Fragment fragment); - + /** * Shows a previously hidden fragment. This is only relevant for fragments whose * views have been added to a container, as this will cause the view to * be shown. - * + * * @param fragment The fragment to be shown. - * + * * @return Returns the same FragmentTransaction instance. */ public abstract FragmentTransaction show(Fragment fragment); @@ -135,17 +136,17 @@ public abstract class FragmentTransaction { * <code>false</code> otherwise. */ public abstract boolean isEmpty(); - + /** * Bit mask that is set for all enter transitions. */ public static final int TRANSIT_ENTER_MASK = 0x1000; - + /** * Bit mask that is set for all exit transitions. */ public static final int TRANSIT_EXIT_MASK = 0x2000; - + /** Not set up for a transition. */ public static final int TRANSIT_UNSET = -1; /** No animation for transition. */ @@ -202,7 +203,7 @@ public abstract class FragmentTransaction { * animations. */ public abstract FragmentTransaction setTransitionStyle(@StyleRes int styleRes); - + /** * Add this transaction to the back stack. This means that the transaction * will be remembered after it is committed, and will reverse its operation @@ -269,7 +270,7 @@ public abstract class FragmentTransaction { * because the state after the commit can be lost if the activity needs to * be restored from its state. See {@link #commitAllowingStateLoss()} for * situations where it may be okay to lose the commit.</p> - * + * * @return Returns the identifier of this transaction's back stack entry, * if {@link #addToBackStack(String)} had been called. Otherwise, returns * a negative number. diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java index 5da55b164f54..f4c642fafede 100755 --- a/core/java/android/provider/Settings.java +++ b/core/java/android/provider/Settings.java @@ -5345,6 +5345,13 @@ public final class Settings { 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 4d584a3df4fb..9a73d0b1bfaa 100644 --- a/core/java/android/view/ViewConfiguration.java +++ b/core/java/android/view/ViewConfiguration.java @@ -64,6 +64,12 @@ public class ViewConfiguration { 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 @@ public class ViewConfiguration { } /** + * @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 4dc1009fe446..03c97bd9b00c 100644 --- a/core/java/android/view/ViewRootImpl.java +++ b/core/java/android/view/ViewRootImpl.java @@ -6039,7 +6039,8 @@ public final class ViewRootImpl implements ViewParent, 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/java/com/android/internal/policy/BackdropFrameRenderer.java b/core/java/com/android/internal/policy/BackdropFrameRenderer.java index 0ab3a41f1469..619303f34c32 100644 --- a/core/java/com/android/internal/policy/BackdropFrameRenderer.java +++ b/core/java/com/android/internal/policy/BackdropFrameRenderer.java @@ -385,7 +385,7 @@ public class BackdropFrameRenderer extends Thread implements Choreographer.Frame final int size = DecorView.getNavBarSize(bottomInset, rightInset, leftInset); if (DecorView.isNavBarToRightEdge(bottomInset, rightInset)) { mNavigationBarColor.setBounds(width - size, 0, width, height); - } else if (DecorView.isNavBarToLeftEdge(bottomInset, rightInset)) { + } else if (DecorView.isNavBarToLeftEdge(bottomInset, leftInset)) { mNavigationBarColor.setBounds(0, 0, size, height); } else { mNavigationBarColor.setBounds(0, height - size, width, height); diff --git a/core/jni/android_hardware_location_ContextHubService.cpp b/core/jni/android_hardware_location_ContextHubService.cpp index 9515a0e336aa..7a8a574b119e 100644 --- a/core/jni/android_hardware_location_ContextHubService.cpp +++ b/core/jni/android_hardware_location_ContextHubService.cpp @@ -603,6 +603,8 @@ static void passOnOsResponse(uint32_t hubHandle, uint32_t msgType, 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 cd02e0db2fd5..c300894d5541 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 e64421776605..c300894d5541 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 d4796a032631..f78d9b62a509 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-round-watch/styles_material.xml b/core/res/res/color/watch_switch_track_color_material.xml index a2f3c0243189..402a536b4d12 100644 --- a/core/res/res/values-round-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,8 +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"> - <item name="textAlignment">center</item> - </style> -</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 index fc840d9fa73f..307c6db91c3a 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 index 6f7ae02388a3..027991106c5a 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 ce8e20a12187..002dde83cd93 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 000000000000..b8772bc5ea3c --- /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/preference_widget_switch.xml b/core/res/res/layout-watch/preference_widget_switch.xml index 37d0c6bf1af6..ffc00b4d1c1a 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 000000000000..788602bf09ba --- /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 b465d97339a2..a6e93c99160d 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 b0455857e79e..6fbd2b279f0c 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 c6b7d3a70d97..ee56266390f1 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/styles_material.xml b/core/res/res/values-notround-watch/config_material.xml index cd8521f48421..a99674f3f060 100644 --- a/core/res/res/values-notround-watch/styles_material.xml +++ b/core/res/res/values-notround-watch/config_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,13 @@ See the License for the specific language governing permissions and limitations under the License. --> -<resources> - <style name="TextAppearance.Material.AlertDialogMessage" parent="TextAppearance.Material.Body1"/> + +<!-- 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 bf445ef3fd0e..871e910eb042 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-w180dp-notround-watch/dimens_material.xml b/core/res/res/values-w180dp-notround-watch/dimens_material.xml new file mode 100644 index 000000000000..79acf84b7e3f --- /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 000000000000..79acf84b7e3f --- /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 81b53e71b5d7..104d122e01d3 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 d579434d5e30..b48cde62158a 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/layout-watch/number_picker_material.xml b/core/res/res/values-watch/integers.xml index a1c0921482ad..46ed97d83182 100644 --- a/core/res/res/layout-watch/number_picker_material.xml +++ b/core/res/res/values-watch/integers.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <!-- -** +/* ** Copyright 2012, The Android Open Source Project ** ** Licensed under the Apache License, Version 2.0 (the "License"); @@ -16,16 +16,10 @@ ** limitations under the License. */ --> +<resources> + <!-- Specifies date picker mode to be 'spinner' --> + <integer name="date_picker_mode_material">1</integer> -<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> + <!-- 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 f5735e69347a..d09119fc7d6b 100644 --- a/core/res/res/values-watch/styles_material.xml +++ b/core/res/res/values-watch/styles_material.xml @@ -61,12 +61,19 @@ please see styles_device_defaults.xml. <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 @@ please see styles_device_defaults.xml. <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 4ae4367e8bc7..84bc25f26db4 100644 --- a/core/res/res/values-watch/themes_material.xml +++ b/core/res/res/values-watch/themes_material.xml @@ -59,4 +59,17 @@ please see styles_device_defaults.xml. <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 2835c6f5fa0a..18a6a839f900 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 a37be837d9f1..397635f402b1 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 f96cef9ad1c5..ae3116584e5d 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 71ac2f49ff71..2b69c75b7d9c 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 8d3cd487e644..3c46517abc9f 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 443553754193..90746e5b5e75 100644 --- a/core/res/res/values/styles_material.xml +++ b/core/res/res/values/styles_material.xml @@ -255,6 +255,8 @@ please see styles_device_defaults.xml. <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 @@ please see styles_device_defaults.xml. <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 @@ please see styles_device_defaults.xml. </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 @@ please see styles_device_defaults.xml. </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 @@ please see styles_device_defaults.xml. <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 2a40c0836ae5..45e4520f4fdc 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 7e2867de1d7a..0eb4c8d86928 100644 --- a/core/res/res/values/themes_material.xml +++ b/core/res/res/values/themes_material.xml @@ -114,9 +114,9 @@ please see themes_device_defaults.xml. <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 @@ please see themes_device_defaults.xml. <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 26af10c1809e..938cc0c3f7c0 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/docs/html/guide/topics/ui/notifiers/toasts.jd b/docs/html/guide/topics/ui/notifiers/toasts.jd index d9627274fa3e..2262a9ab9567 100644 --- a/docs/html/guide/topics/ui/notifiers/toasts.jd +++ b/docs/html/guide/topics/ui/notifiers/toasts.jd @@ -76,16 +76,22 @@ To nudge it down, increase the value of the last parameter. <h2 id="CustomToastView">Creating a Custom Toast View</h2> -<p>If a simple text message isn't enough, you can create a customized layout for your -toast notification. To create a custom layout, define a View layout, -in XML or in your application code, and pass the root {@link android.view.View} object -to the {@link android.widget.Toast#setView(View)} method.</p> - -<p>For example, you can create the layout for the toast visible in the screenshot to the right -with the following XML (saved as <em>toast_layout.xml</em>):</p> +<p> + If a simple text message isn't enough, you can create a customized layout + for your toast notification. To create a custom layout, define a View + layout, in XML or in your application code, and pass the root {@link + android.view.View} object to the {@link android.widget.Toast#setView(View)} + method. +</p> + +<p> + For example, you can create the layout for the toast visible in the + screenshot to the right with the following XML (saved as + <em>layout/custom_toast.xml</em>): +</p> <pre> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:id="@+id/toast_layout_root" + android:id="@+id/custom_toast_container" android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="fill_parent" @@ -105,13 +111,16 @@ with the following XML (saved as <em>toast_layout.xml</em>):</p> </LinearLayout> </pre> -<p>Notice that the ID of the LinearLayout element is "toast_layout_root". You must use this -ID to inflate the layout from the XML, as shown here:</p> +<p> + Notice that the ID of the LinearLayout element is "custom_toast_container". + You must use this ID and the ID of the XML layout file "custom_toast" to + inflate the layout, as shown here: +</p> <pre> LayoutInflater inflater = getLayoutInflater(); View layout = inflater.inflate(R.layout.custom_toast, - (ViewGroup) findViewById(R.id.toast_layout_root)); + (ViewGroup) findViewById(R.id.custom_toast_container)); TextView text = (TextView) layout.findViewById(R.id.text); text.setText("This is a custom toast"); diff --git a/keystore/java/android/security/keystore/KeyGenParameterSpec.java b/keystore/java/android/security/keystore/KeyGenParameterSpec.java index cbef540562e1..ed40b77be4a4 100644 --- a/keystore/java/android/security/keystore/KeyGenParameterSpec.java +++ b/keystore/java/android/security/keystore/KeyGenParameterSpec.java @@ -571,13 +571,12 @@ public final class KeyGenParameterSpec implements AlgorithmParameterSpec { * * <p>If this method returns {@code null}, and the spec is used to generate an asymmetric (RSA * or EC) key pair, the public key will have a self-signed certificate if it has purpose {@link - * KeyProperties#PURPOSE_SIGN} (see {@link #KeyGenParameterSpec(String, int)). If does not have - * purpose {@link KeyProperties#PURPOSE_SIGN}, it will have a fake certificate. + * KeyProperties#PURPOSE_SIGN}. If does not have purpose {@link KeyProperties#PURPOSE_SIGN}, it + * will have a fake certificate. * * <p>Symmetric keys, such as AES and HMAC keys, do not have public key certificates. If a - * {@link KeyGenParameterSpec} with {@link #hasAttestationCertificate()} returning - * non-{@code null} is used to generate a symmetric (AES or HMAC) key, - * {@link KeyGenerator#generateKey())} will throw + * KeyGenParameterSpec with getAttestationChallenge returning non-null is used to generate a + * symmetric (AES or HMAC) key, {@link javax.crypto.KeyGenerator#generateKey()} will throw * {@link java.security.InvalidAlgorithmParameterException}. * * @see Builder#setAttestationChallenge(byte[]) @@ -1050,11 +1049,6 @@ public final class KeyGenParameterSpec implements AlgorithmParameterSpec { return this; } - /* - * TODO(swillden): Update this documentation to describe the hardware and software root - * keys, including information about CRL/OCSP services for discovering revocations, and to - * link to documentation of the extension format and content. - */ /** * Sets whether an attestation certificate will be generated for this key pair, and what * challenge value will be placed in the certificate. The attestation certificate chain @@ -1074,17 +1068,15 @@ public final class KeyGenParameterSpec implements AlgorithmParameterSpec { * * <p>If {@code attestationChallenge} is {@code null}, and this spec is used to generate an * asymmetric (RSA or EC) key pair, the public key certificate will be self-signed if the - * key has purpose {@link KeyProperties#PURPOSE_SIGN} (see - * {@link #KeyGenParameterSpec(String, int)). If the key does not have purpose - * {@link KeyProperties#PURPOSE_SIGN}, it is not possible to use the key to sign a - * certificate, so the public key certificate will contain a dummy signature. + * key has purpose {@link android.security.keystore.KeyProperties#PURPOSE_SIGN}. If the key + * does not have purpose {@link android.security.keystore.KeyProperties#PURPOSE_SIGN}, it is + * not possible to use the key to sign a certificate, so the public key certificate will + * contain a dummy signature. * * <p>Symmetric keys, such as AES and HMAC keys, do not have public key certificates. If a - * {@code getAttestationChallenge} returns non-{@code null} and the spec is used to - * generate a symmetric (AES or HMAC) key, {@link KeyGenerator#generateKey()} will throw + * {@link #getAttestationChallenge()} returns non-null and the spec is used to generate a + * symmetric (AES or HMAC) key, {@link javax.crypto.KeyGenerator#generateKey()} will throw * {@link java.security.InvalidAlgorithmParameterException}. - * - * @see Builder#setAttestationChallenge(String attestationChallenge) */ @NonNull public Builder setAttestationChallenge(byte[] attestationChallenge) { diff --git a/packages/CaptivePortalLogin/res/values-bn-rBD/strings.xml b/packages/CaptivePortalLogin/res/values-bn-rBD/strings.xml index 20173b0dc3bf..24cbfbd6430e 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 40a3630a4e55..a11bf3212836 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 99850a5d5cd4..fb7180a0a3b8 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 643875fa6ea0..8578810daa2d 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 f7e9541b0d33..fad102f6e6f8 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 0f7fe6fc5124..0f3a7fbe9daa 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 @@ public class SettingsProvider extends ContentProvider { } 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 @@ public class SettingsProvider extends ContentProvider { 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/packages/WallpaperBackup/AndroidManifest.xml b/packages/WallpaperBackup/AndroidManifest.xml index b8cea20afcd4..c548101080b4 100644 --- a/packages/WallpaperBackup/AndroidManifest.xml +++ b/packages/WallpaperBackup/AndroidManifest.xml @@ -24,6 +24,7 @@ android:process="system" android:killAfterRestore="false" android:allowBackup="true" + android:backupInForeground="true" android:backupAgent=".WallpaperBackupAgent" android:fullBackupOnly="true" > </application> diff --git a/packages/WallpaperBackup/src/com/android/wallpaperbackup/WallpaperBackupAgent.java b/packages/WallpaperBackup/src/com/android/wallpaperbackup/WallpaperBackupAgent.java index 402d9adf0e7c..82b305087707 100644 --- a/packages/WallpaperBackup/src/com/android/wallpaperbackup/WallpaperBackupAgent.java +++ b/packages/WallpaperBackup/src/com/android/wallpaperbackup/WallpaperBackupAgent.java @@ -238,7 +238,7 @@ public class WallpaperBackupAgent extends BackupAgent { Slog.v(TAG, "Restored crop hint " + cropHint); } try (FileInputStream in = new FileInputStream(stage)) { - mWm.setStream(in, cropHint, true, which); + mWm.setStream(in, cropHint.isEmpty() ? null : cropHint, true, which); } finally {} // auto-closes 'in' } } diff --git a/services/core/java/com/android/server/am/AppErrors.java b/services/core/java/com/android/server/am/AppErrors.java index 1f156dfd1985..7eff773543c8 100644 --- a/services/core/java/com/android/server/am/AppErrors.java +++ b/services/core/java/com/android/server/am/AppErrors.java @@ -638,7 +638,8 @@ class AppErrors { // Allow restarting for started or bound foreground services that are crashing the // first time. This includes wallpapers. - if (sr.crashCount <= 1 && (sr.isForeground || procIsBoundForeground)) { + if ((data != null) && (sr.crashCount <= 1) + && (sr.isForeground || procIsBoundForeground)) { data.isRestartableForService = true; } } diff --git a/services/core/java/com/android/server/am/BroadcastQueue.java b/services/core/java/com/android/server/am/BroadcastQueue.java index a279290a34be..4ef6a0fe17ab 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 class BroadcastQueue { } 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 class BroadcastQueue { } 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 9dd07a9a9f90..73a17c613c4d 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 @@ final class CoreSettingsObserver extends ContentObserver { 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/am/RecentTasks.java b/services/core/java/com/android/server/am/RecentTasks.java index 5c05ab64e199..beb863b394af 100644 --- a/services/core/java/com/android/server/am/RecentTasks.java +++ b/services/core/java/com/android/server/am/RecentTasks.java @@ -653,12 +653,17 @@ class RecentTasks extends ArrayList<TaskRecord> { && task.realActivity.equals(tr.realActivity); // If the document is open in another app or is not the same // document, we don't need to trim it. - if (!sameActivity || !sameIntentFilter || multiTasksAllowed) { + if (!sameActivity) { continue; // Otherwise only trim if we are over our max recents for this task - } else if (maxRecents > 0 && !doTrim) { + } else if (maxRecents > 0) { --maxRecents; - continue; + if (!doTrim || !sameIntentFilter || multiTasksAllowed) { + // We don't want to trim if we are not over the max allowed entries and + // the caller doesn't want us to trim, the tasks are not of the same + // intent filter, or multiple entries fot the task is allowed. + continue; + } } // Hit the maximum number of documents for this task. Fall through // and remove this document from recents. diff --git a/services/core/java/com/android/server/net/NetworkPolicyManagerService.java b/services/core/java/com/android/server/net/NetworkPolicyManagerService.java index 8f9cc47f9224..e3ec11ff1e8c 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 @@ public class NetworkPolicyManagerService extends INetworkPolicyManager.Stub { */ 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 @@ public class NetworkPolicyManagerService extends INetworkPolicyManager.Stub { 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 @@ public class NetworkPolicyManagerService extends INetworkPolicyManager.Stub { 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 @@ public class NetworkPolicyManagerService extends INetworkPolicyManager.Stub { 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 @@ public class NetworkPolicyManagerService extends INetworkPolicyManager.Stub { 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/notification/ConditionProviders.java b/services/core/java/com/android/server/notification/ConditionProviders.java index 62fe70cf176f..2fab2887c28e 100644 --- a/services/core/java/com/android/server/notification/ConditionProviders.java +++ b/services/core/java/com/android/server/notification/ConditionProviders.java @@ -17,6 +17,8 @@ package com.android.server.notification; import android.annotation.NonNull; +import android.app.INotificationManager; +import android.app.NotificationManager; import android.content.ComponentName; import android.content.ContentResolver; import android.content.Context; @@ -161,6 +163,25 @@ public class ConditionProviders extends ManagedServices { } } + @Override + public void onPackagesChanged(boolean removingPackage, String[] pkgList) { + if (removingPackage) { + INotificationManager inm = NotificationManager.getService(); + + if (pkgList != null && (pkgList.length > 0)) { + for (String pkgName : pkgList) { + try { + inm.removeAutomaticZenRules(pkgName); + inm.setNotificationPolicyAccessGranted(pkgName, false); + } catch (Exception e) { + Slog.e(TAG, "Failed to clean up rules for " + pkgName, e); + } + } + } + } + super.onPackagesChanged(removingPackage, pkgList); + } + public ManagedServiceInfo checkServiceToken(IConditionProvider provider) { synchronized(mMutex) { return checkServiceTokenLocked(provider); diff --git a/services/core/java/com/android/server/notification/ManagedServices.java b/services/core/java/com/android/server/notification/ManagedServices.java index dc85dd7ef40e..14e2ba3896d8 100644 --- a/services/core/java/com/android/server/notification/ManagedServices.java +++ b/services/core/java/com/android/server/notification/ManagedServices.java @@ -217,8 +217,8 @@ abstract public class ManagedServices { return mEnabledServicesPackageNames.contains(pkg); } - public void onPackagesChanged(boolean queryReplace, String[] pkgList) { - if (DEBUG) Slog.d(TAG, "onPackagesChanged queryReplace=" + queryReplace + public void onPackagesChanged(boolean removingPackage, String[] pkgList) { + if (DEBUG) Slog.d(TAG, "onPackagesChanged removingPackage=" + removingPackage + " pkgList=" + (pkgList == null ? null : Arrays.asList(pkgList)) + " mEnabledServicesPackageNames=" + mEnabledServicesPackageNames); boolean anyServicesInvolved = false; @@ -234,7 +234,7 @@ abstract public class ManagedServices { if (anyServicesInvolved) { // if we're not replacing a package, clean up orphaned bits - if (!queryReplace) { + if (removingPackage) { updateSettingsAccordingToInstalledServices(); rebuildRestoredPackages(); } diff --git a/services/core/java/com/android/server/notification/NotificationManagerService.java b/services/core/java/com/android/server/notification/NotificationManagerService.java index 2dbbc88e0599..bb55240fc859 100644 --- a/services/core/java/com/android/server/notification/NotificationManagerService.java +++ b/services/core/java/com/android/server/notification/NotificationManagerService.java @@ -696,9 +696,9 @@ public class NotificationManagerService extends SystemService { int changeUserId = intent.getIntExtra(Intent.EXTRA_USER_HANDLE, UserHandle.USER_ALL); String pkgList[] = null; - boolean queryReplace = queryRemove && - intent.getBooleanExtra(Intent.EXTRA_REPLACING, false); - if (DBG) Slog.i(TAG, "action=" + action + " queryReplace=" + queryReplace); + boolean removingPackage = queryRemove && + !intent.getBooleanExtra(Intent.EXTRA_REPLACING, false); + if (DBG) Slog.i(TAG, "action=" + action + " removing=" + removingPackage); if (action.equals(Intent.ACTION_EXTERNAL_APPLICATIONS_UNAVAILABLE)) { pkgList = intent.getStringArrayExtra(Intent.EXTRA_CHANGED_PACKAGE_LIST); } else if (action.equals(Intent.ACTION_PACKAGES_SUSPENDED)) { @@ -747,10 +747,10 @@ public class NotificationManagerService extends SystemService { } } } - mListeners.onPackagesChanged(queryReplace, pkgList); - mRankerServices.onPackagesChanged(queryReplace, pkgList); - mConditionProviders.onPackagesChanged(queryReplace, pkgList); - mRankingHelper.onPackagesChanged(queryReplace, pkgList); + mListeners.onPackagesChanged(removingPackage, pkgList); + mRankerServices.onPackagesChanged(removingPackage, pkgList); + mConditionProviders.onPackagesChanged(removingPackage, pkgList); + mRankingHelper.onPackagesChanged(removingPackage, pkgList); } } }; @@ -3894,14 +3894,14 @@ public class NotificationManagerService extends SystemService { } @Override - public void onPackagesChanged(boolean queryReplace, String[] pkgList) { - if (DEBUG) Slog.d(TAG, "onPackagesChanged queryReplace=" + queryReplace + public void onPackagesChanged(boolean removingPackage, String[] pkgList) { + if (DEBUG) Slog.d(TAG, "onPackagesChanged removingPackage=" + removingPackage + " pkgList=" + (pkgList == null ? null : Arrays.asList(pkgList))); if (mRankerServicePackageName == null) { return; } - if (pkgList != null && (pkgList.length > 0)) { + if (pkgList != null && (pkgList.length > 0) && !removingPackage) { for (String pkgName : pkgList) { if (mRankerServicePackageName.equals(pkgName)) { registerRanker(); diff --git a/services/core/java/com/android/server/notification/RankingHelper.java b/services/core/java/com/android/server/notification/RankingHelper.java index 78b3f4134dd3..90484027446c 100644 --- a/services/core/java/com/android/server/notification/RankingHelper.java +++ b/services/core/java/com/android/server/notification/RankingHelper.java @@ -504,8 +504,8 @@ public class RankingHelper implements RankingConfig { return packageBans; } - public void onPackagesChanged(boolean queryReplace, String[] pkgList) { - if (queryReplace || pkgList == null || pkgList.length == 0 + public void onPackagesChanged(boolean removingPackage, String[] pkgList) { + if (!removingPackage || pkgList == null || pkgList.length == 0 || mRestoredWithoutUids.isEmpty()) { return; // nothing to do } diff --git a/services/core/java/com/android/server/notification/ZenModeConditions.java b/services/core/java/com/android/server/notification/ZenModeConditions.java index 86ca97d48531..1c12a961ad04 100644 --- a/services/core/java/com/android/server/notification/ZenModeConditions.java +++ b/services/core/java/com/android/server/notification/ZenModeConditions.java @@ -147,6 +147,7 @@ public class ZenModeConditions implements ConditionProviders.Callback { if (mConditionProviders.subscribeIfNecessary(rule.component, rule.conditionId)) { mSubscriptions.put(rule.conditionId, rule.component); } else { + rule.condition = null; if (DEBUG) Log.d(TAG, "zmc failed to subscribe"); } } diff --git a/services/core/java/com/android/server/policy/PhoneWindowManager.java b/services/core/java/com/android/server/policy/PhoneWindowManager.java index 46bf239b9b84..be64a47be0b1 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 @@ public class PhoneWindowManager implements WindowManagerPolicy { 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 @@ public class PhoneWindowManager implements WindowManagerPolicy { 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 @@ public class PhoneWindowManager implements WindowManagerPolicy { int mDoublePressOnPowerBehavior; int mTriplePressOnPowerBehavior; int mLongPressOnBackBehavior; + int mPanicPressOnBackBehavior; int mShortPressOnSleepBehavior; int mShortPressWindowBehavior; boolean mAwake; @@ -726,6 +733,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { 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 @@ public class PhoneWindowManager implements WindowManagerPolicy { 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 @@ public class PhoneWindowManager implements WindowManagerPolicy { } } + 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 @@ public class PhoneWindowManager implements WindowManagerPolicy { } } + private void finishBackKeyPress() { + mBackKeyPressCounter = 0; + } + private void cancelPendingPowerKeyAction() { if (!mPowerKeyHandled) { mPowerKeyHandled = true; @@ -1154,6 +1217,18 @@ public class PhoneWindowManager implements WindowManagerPolicy { } } + 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 @@ public class PhoneWindowManager implements WindowManagerPolicy { 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 @@ public class PhoneWindowManager implements WindowManagerPolicy { 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 @@ public class PhoneWindowManager implements WindowManagerPolicy { 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; - - // Reset back key state - cancelPendingBackKeyAction(); + boolean handled = interceptBackKeyUp(event); - // 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 e828650a3049..6258340c9422 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 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { 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 9d0c20ce4c5d..d3d5ea05c1af 100644 --- a/wifi/java/android/net/wifi/WifiConfiguration.java +++ b/wifi/java/android/net/wifi/WifiConfiguration.java @@ -817,6 +817,7 @@ public class WifiConfiguration implements Parcelable { */ 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 @@ public class WifiConfiguration implements Parcelable { */ 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", |