diff options
author | android-build-team Robot <android-build-team-robot@google.com> | 2017-06-30 04:10:12 +0000 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2017-06-30 04:10:12 +0000 |
commit | 7fbd30edc8508eacbe6776390d95f43876844d1b (patch) | |
tree | 9f8868176f1371785535d841f1c260a4faf33152 | |
parent | 9bfcbe30ca407fe47c04ae1e0d9e0be272756adf (diff) | |
parent | a41f55718b45aab743a00cfeb1ecb792f55e0074 (diff) | |
download | base-7fbd30edc8508eacbe6776390d95f43876844d1b.tar.gz |
Merge cherrypicks of [2481491, 2481800, 2481782, 2481665, 2481547, 2481358, 2481802, 2481613, 2481668, 2481614, 2481594, 2481595, 2481548, 2481744, 2481493, 2481494, 2481709] into oc-release
Change-Id: Ie9bbb629b1cc534f289d3bb3e649cc4e0c0f0c97
-rw-r--r-- | core/java/android/view/View.java | 2 | ||||
-rw-r--r-- | core/java/android/view/ViewGroup.java | 10 | ||||
-rw-r--r-- | core/java/android/view/autofill/AutofillManager.java | 3 | ||||
-rw-r--r-- | core/java/com/android/internal/policy/PhoneWindow.java | 17 | ||||
-rw-r--r-- | services/core/java/com/android/server/policy/PhoneWindowManager.java | 11 |
5 files changed, 41 insertions, 2 deletions
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java index 488216595a3e..25c02d17f046 100644 --- a/core/java/android/view/View.java +++ b/core/java/android/view/View.java @@ -724,6 +724,8 @@ import java.util.function.Predicate; * @attr ref android.R.styleable#View_nextFocusUp * @attr ref android.R.styleable#View_onClick * @attr ref android.R.styleable#View_padding + * @attr ref android.R.styleable#View_paddingHorizontal + * @attr ref android.R.styleable#View_paddingVertical * @attr ref android.R.styleable#View_paddingBottom * @attr ref android.R.styleable#View_paddingLeft * @attr ref android.R.styleable#View_paddingRight diff --git a/core/java/android/view/ViewGroup.java b/core/java/android/view/ViewGroup.java index 66df335f07da..1dbc1aca88c5 100644 --- a/core/java/android/view/ViewGroup.java +++ b/core/java/android/view/ViewGroup.java @@ -7608,6 +7608,16 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager * See * {@link android.R.styleable#ViewGroup_MarginLayout ViewGroup Margin Layout Attributes} * for a list of all child view attributes that this class supports. + * + * @attr ref android.R.styleable#ViewGroup_MarginLayout_layout_margin + * @attr ref android.R.styleable#ViewGroup_MarginLayout_layout_marginHorizontal + * @attr ref android.R.styleable#ViewGroup_MarginLayout_layout_marginVertical + * @attr ref android.R.styleable#ViewGroup_MarginLayout_layout_marginLeft + * @attr ref android.R.styleable#ViewGroup_MarginLayout_layout_marginTop + * @attr ref android.R.styleable#ViewGroup_MarginLayout_layout_marginRight + * @attr ref android.R.styleable#ViewGroup_MarginLayout_layout_marginBottom + * @attr ref android.R.styleable#ViewGroup_MarginLayout_layout_marginStart + * @attr ref android.R.styleable#ViewGroup_MarginLayout_layout_marginEnd */ public static class MarginLayoutParams extends ViewGroup.LayoutParams { /** diff --git a/core/java/android/view/autofill/AutofillManager.java b/core/java/android/view/autofill/AutofillManager.java index 5b04f41c7ee2..e1e8317d8ccb 100644 --- a/core/java/android/view/autofill/AutofillManager.java +++ b/core/java/android/view/autofill/AutofillManager.java @@ -741,7 +741,8 @@ public final class AutofillManager { } /** - * Returns {@code true} if Autofill is supported for this user. + * Returns {@code true} if autofill is supported by the current device and + * is supported for this user. * * <p>Autofill is typically supported, but it could be unsupported in cases like: * <ol> diff --git a/core/java/com/android/internal/policy/PhoneWindow.java b/core/java/com/android/internal/policy/PhoneWindow.java index 8fe9100d2011..544afd993b37 100644 --- a/core/java/com/android/internal/policy/PhoneWindow.java +++ b/core/java/com/android/internal/policy/PhoneWindow.java @@ -3103,12 +3103,29 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { } /** + * Check if Setup or Post-Setup update is completed on TV + * @return true if completed + */ + private boolean isTvUserSetupComplete() { + boolean isTvSetupComplete = Settings.Secure.getInt(getContext().getContentResolver(), + Settings.Secure.USER_SETUP_COMPLETE, 0) != 0; + isTvSetupComplete &= Settings.Secure.getInt(getContext().getContentResolver(), + Settings.Secure.TV_USER_SETUP_COMPLETE, 0) != 0; + return isTvSetupComplete; + } + + /** * Helper method for adding launch-search to most applications. Opens the * search window using default settings. * * @return true if search window opened */ private boolean launchDefaultSearch(KeyEvent event) { + if (getContext().getPackageManager().hasSystemFeature(PackageManager.FEATURE_LEANBACK) + && !isTvUserSetupComplete()) { + // If we are in Setup or Post-Setup update mode on TV, consume the search key + return false; + } boolean result; final Callback cb = getCallback(); if (cb == null || isDestroyed()) { diff --git a/services/core/java/com/android/server/policy/PhoneWindowManager.java b/services/core/java/com/android/server/policy/PhoneWindowManager.java index 8112f9998c58..4477e5a0f173 100644 --- a/services/core/java/com/android/server/policy/PhoneWindowManager.java +++ b/services/core/java/com/android/server/policy/PhoneWindowManager.java @@ -1689,8 +1689,17 @@ public class PhoneWindowManager implements WindowManagerPolicy { } boolean isUserSetupComplete() { - return Settings.Secure.getIntForUser(mContext.getContentResolver(), + boolean isSetupComplete = Settings.Secure.getIntForUser(mContext.getContentResolver(), Settings.Secure.USER_SETUP_COMPLETE, 0, UserHandle.USER_CURRENT) != 0; + if (mHasFeatureLeanback) { + isSetupComplete &= isTvUserSetupComplete(); + } + return isSetupComplete; + } + + private boolean isTvUserSetupComplete() { + return Settings.Secure.getIntForUser(mContext.getContentResolver(), + Settings.Secure.TV_USER_SETUP_COMPLETE, 0, UserHandle.USER_CURRENT) != 0; } private void handleShortPressOnHome() { |