OSDN Git Service

Merge "Bluetooth: fix connectGatt overload invocations" am: 404e9f209f am: c0fed83b84...
authorJakub Pawlowski <jpawlowski@google.com>
Thu, 8 Jun 2017 21:41:06 +0000 (21:41 +0000)
committerandroid-build-merger <android-build-merger@google.com>
Thu, 8 Jun 2017 21:41:06 +0000 (21:41 +0000)
am: fcc30a6db3

Change-Id: I8ce718a0322408565530840d5131998f03535159

33 files changed:
cmds/bmgr/src/com/android/commands/bmgr/Bmgr.java
core/java/android/app/FragmentManager.java
core/java/android/provider/Settings.java
core/java/android/text/TextLine.java
core/jni/AndroidRuntime.cpp
core/res/AndroidManifest.xml
core/tests/coretests/src/android/graphics/PaintTest.java
lowpan/java/android/net/lowpan/LowpanBeaconInfo.java
lowpan/java/android/net/lowpan/LowpanChannelInfo.java
lowpan/java/android/net/lowpan/LowpanCommissioningSession.java
lowpan/java/android/net/lowpan/LowpanCredential.java
lowpan/java/android/net/lowpan/LowpanEnergyScanResult.java
lowpan/java/android/net/lowpan/LowpanException.java
lowpan/java/android/net/lowpan/LowpanIdentity.java
lowpan/java/android/net/lowpan/LowpanInterface.java
lowpan/java/android/net/lowpan/LowpanManager.java
lowpan/java/android/net/lowpan/LowpanProvision.java
lowpan/java/android/net/lowpan/LowpanScanner.java
packages/CaptivePortalLogin/src/com/android/captiveportallogin/CaptivePortalLoginActivity.java
packages/SettingsProvider/src/com/android/providers/settings/SettingsBackupAgent.java
packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
packages/SystemUI/res/values/dimens.xml
packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java
packages/SystemUI/src/com/android/systemui/statusbar/car/CarStatusBar.java
packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardClockPositionAlgorithm.java
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationIconContainer.java
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java
proto/src/metrics_constants.proto
services/core/java/com/android/server/tv/TvInputManagerService.java
tools/aapt2/Main.cpp
tools/aapt2/readme.md

index 1bcfb22..1b77427 100644 (file)
@@ -270,7 +270,8 @@ public final class Bmgr {
             case BackupManager.ERROR_TRANSPORT_ABORTED:
                 return "Transport error";
             case BackupManager.ERROR_TRANSPORT_PACKAGE_REJECTED:
-                return "Transport rejected package";
+                return "Transport rejected package because it wasn't able to process it"
+                        + " at the time";
             case BackupManager.ERROR_AGENT_FAILURE:
                 return "Agent error";
             case BackupManager.ERROR_TRANSPORT_QUOTA_EXCEEDED:
index 9fb9c00..3ad30bf 100644 (file)
@@ -679,7 +679,8 @@ final class FragmentManagerImpl extends FragmentManager implements LayoutInflate
     ArrayList<Integer> mAvailBackStackIndices;
 
     ArrayList<OnBackStackChangedListener> mBackStackChangeListeners;
-    CopyOnWriteArrayList<Pair<FragmentLifecycleCallbacks, Boolean>> mLifecycleCallbacks;
+    final CopyOnWriteArrayList<Pair<FragmentLifecycleCallbacks, Boolean>>
+            mLifecycleCallbacks = new CopyOnWriteArrayList<>();
 
     int mCurState = Fragment.INITIALIZING;
     FragmentHostCallback<?> mHost;
@@ -3189,17 +3190,10 @@ final class FragmentManagerImpl extends FragmentManager implements LayoutInflate
 
     public void registerFragmentLifecycleCallbacks(FragmentLifecycleCallbacks cb,
             boolean recursive) {
-        if (mLifecycleCallbacks == null) {
-            mLifecycleCallbacks = new CopyOnWriteArrayList<>();
-        }
-        mLifecycleCallbacks.add(new Pair(cb, recursive));
+        mLifecycleCallbacks.add(new Pair<>(cb, recursive));
     }
 
     public void unregisterFragmentLifecycleCallbacks(FragmentLifecycleCallbacks cb) {
-        if (mLifecycleCallbacks == null) {
-            return;
-        }
-
         synchronized (mLifecycleCallbacks) {
             for (int i = 0, N = mLifecycleCallbacks.size(); i < N; i++) {
                 if (mLifecycleCallbacks.get(i).first == cb) {
@@ -3218,9 +3212,6 @@ final class FragmentManagerImpl extends FragmentManager implements LayoutInflate
                         .dispatchOnFragmentPreAttached(f, context, true);
             }
         }
-        if (mLifecycleCallbacks == null) {
-            return;
-        }
         for (Pair<FragmentLifecycleCallbacks, Boolean> p : mLifecycleCallbacks) {
             if (!onlyRecursive || p.second) {
                 p.first.onFragmentPreAttached(this, f, context);
@@ -3236,9 +3227,6 @@ final class FragmentManagerImpl extends FragmentManager implements LayoutInflate
                         .dispatchOnFragmentAttached(f, context, true);
             }
         }
-        if (mLifecycleCallbacks == null) {
-            return;
-        }
         for (Pair<FragmentLifecycleCallbacks, Boolean> p : mLifecycleCallbacks) {
             if (!onlyRecursive || p.second) {
                 p.first.onFragmentAttached(this, f, context);
@@ -3255,9 +3243,6 @@ final class FragmentManagerImpl extends FragmentManager implements LayoutInflate
                         .dispatchOnFragmentPreCreated(f, savedInstanceState, true);
             }
         }
-        if (mLifecycleCallbacks == null) {
-            return;
-        }
         for (Pair<FragmentLifecycleCallbacks, Boolean> p : mLifecycleCallbacks) {
             if (!onlyRecursive || p.second) {
                 p.first.onFragmentPreCreated(this, f, savedInstanceState);
@@ -3273,9 +3258,6 @@ final class FragmentManagerImpl extends FragmentManager implements LayoutInflate
                         .dispatchOnFragmentCreated(f, savedInstanceState, true);
             }
         }
-        if (mLifecycleCallbacks == null) {
-            return;
-        }
         for (Pair<FragmentLifecycleCallbacks, Boolean> p : mLifecycleCallbacks) {
             if (!onlyRecursive || p.second) {
                 p.first.onFragmentCreated(this, f, savedInstanceState);
@@ -3292,9 +3274,6 @@ final class FragmentManagerImpl extends FragmentManager implements LayoutInflate
                         .dispatchOnFragmentActivityCreated(f, savedInstanceState, true);
             }
         }
-        if (mLifecycleCallbacks == null) {
-            return;
-        }
         for (Pair<FragmentLifecycleCallbacks, Boolean> p : mLifecycleCallbacks) {
             if (!onlyRecursive || p.second) {
                 p.first.onFragmentActivityCreated(this, f, savedInstanceState);
@@ -3311,9 +3290,6 @@ final class FragmentManagerImpl extends FragmentManager implements LayoutInflate
                         .dispatchOnFragmentViewCreated(f, v, savedInstanceState, true);
             }
         }
-        if (mLifecycleCallbacks == null) {
-            return;
-        }
         for (Pair<FragmentLifecycleCallbacks, Boolean> p : mLifecycleCallbacks) {
             if (!onlyRecursive || p.second) {
                 p.first.onFragmentViewCreated(this, f, v, savedInstanceState);
@@ -3329,9 +3305,6 @@ final class FragmentManagerImpl extends FragmentManager implements LayoutInflate
                         .dispatchOnFragmentStarted(f, true);
             }
         }
-        if (mLifecycleCallbacks == null) {
-            return;
-        }
         for (Pair<FragmentLifecycleCallbacks, Boolean> p : mLifecycleCallbacks) {
             if (!onlyRecursive || p.second) {
                 p.first.onFragmentStarted(this, f);
@@ -3347,9 +3320,6 @@ final class FragmentManagerImpl extends FragmentManager implements LayoutInflate
                         .dispatchOnFragmentResumed(f, true);
             }
         }
-        if (mLifecycleCallbacks == null) {
-            return;
-        }
         for (Pair<FragmentLifecycleCallbacks, Boolean> p : mLifecycleCallbacks) {
             if (!onlyRecursive || p.second) {
                 p.first.onFragmentResumed(this, f);
@@ -3365,9 +3335,6 @@ final class FragmentManagerImpl extends FragmentManager implements LayoutInflate
                         .dispatchOnFragmentPaused(f, true);
             }
         }
-        if (mLifecycleCallbacks == null) {
-            return;
-        }
         for (Pair<FragmentLifecycleCallbacks, Boolean> p : mLifecycleCallbacks) {
             if (!onlyRecursive || p.second) {
                 p.first.onFragmentPaused(this, f);
@@ -3383,9 +3350,6 @@ final class FragmentManagerImpl extends FragmentManager implements LayoutInflate
                         .dispatchOnFragmentStopped(f, true);
             }
         }
-        if (mLifecycleCallbacks == null) {
-            return;
-        }
         for (Pair<FragmentLifecycleCallbacks, Boolean> p : mLifecycleCallbacks) {
             if (!onlyRecursive || p.second) {
                 p.first.onFragmentStopped(this, f);
@@ -3401,9 +3365,6 @@ final class FragmentManagerImpl extends FragmentManager implements LayoutInflate
                         .dispatchOnFragmentSaveInstanceState(f, outState, true);
             }
         }
-        if (mLifecycleCallbacks == null) {
-            return;
-        }
         for (Pair<FragmentLifecycleCallbacks, Boolean> p : mLifecycleCallbacks) {
             if (!onlyRecursive || p.second) {
                 p.first.onFragmentSaveInstanceState(this, f, outState);
@@ -3419,9 +3380,6 @@ final class FragmentManagerImpl extends FragmentManager implements LayoutInflate
                         .dispatchOnFragmentViewDestroyed(f, true);
             }
         }
-        if (mLifecycleCallbacks == null) {
-            return;
-        }
         for (Pair<FragmentLifecycleCallbacks, Boolean> p : mLifecycleCallbacks) {
             if (!onlyRecursive || p.second) {
                 p.first.onFragmentViewDestroyed(this, f);
@@ -3437,9 +3395,6 @@ final class FragmentManagerImpl extends FragmentManager implements LayoutInflate
                         .dispatchOnFragmentDestroyed(f, true);
             }
         }
-        if (mLifecycleCallbacks == null) {
-            return;
-        }
         for (Pair<FragmentLifecycleCallbacks, Boolean> p : mLifecycleCallbacks) {
             if (!onlyRecursive || p.second) {
                 p.first.onFragmentDestroyed(this, f);
@@ -3455,9 +3410,6 @@ final class FragmentManagerImpl extends FragmentManager implements LayoutInflate
                         .dispatchOnFragmentDetached(f, true);
             }
         }
-        if (mLifecycleCallbacks == null) {
-            return;
-        }
         for (Pair<FragmentLifecycleCallbacks, Boolean> p : mLifecycleCallbacks) {
             if (!onlyRecursive || p.second) {
                 p.first.onFragmentDetached(this, f);
index 784ed7a..4e70f4b 100755 (executable)
@@ -3973,6 +3973,15 @@ public final class Settings {
         };
 
         /**
+         * Keys we no longer back up under the current schema, but want to continue to
+         * process when restoring historical backup datasets.
+         *
+         * @hide
+         */
+        public static final String[] LEGACY_RESTORE_SETTINGS = {
+        };
+
+        /**
          * These are all public system settings
          *
          * @hide
@@ -7100,6 +7109,10 @@ public final class Settings {
             NOTIFICATION_BADGING
         };
 
+        /** @hide */
+        public static final String[] LEGACY_RESTORE_SETTINGS = {
+        };
+
         /**
          * These entries are considered common between the personal and the managed profile,
          * since the managed profile doesn't get to change them.
@@ -10103,6 +10116,10 @@ public final class Settings {
             BLUETOOTH_ON
         };
 
+        /** @hide */
+        public static final String[] LEGACY_RESTORE_SETTINGS = {
+        };
+
         private static final ContentProviderHolder sProviderHolder =
                 new ContentProviderHolder(CONTENT_URI);
 
index e4ed62a..d3f6982 100644 (file)
@@ -986,7 +986,17 @@ class TextLine {
             return 0f;
         }
 
+        final boolean needsSpanMeasurement;
         if (mSpanned == null) {
+            needsSpanMeasurement = false;
+        } else {
+            mMetricAffectingSpanSpanSet.init(mSpanned, mStart + start, mStart + limit);
+            mCharacterStyleSpanSet.init(mSpanned, mStart + start, mStart + limit);
+            needsSpanMeasurement = mMetricAffectingSpanSpanSet.numberOfSpans != 0
+                    || mCharacterStyleSpanSet.numberOfSpans != 0;
+        }
+
+        if (!needsSpanMeasurement) {
             final TextPaint wp = mWorkPaint;
             wp.set(mPaint);
             wp.setHyphenEdit(adjustHyphenEdit(start, limit, wp.getHyphenEdit()));
@@ -994,9 +1004,6 @@ class TextLine {
                     y, bottom, fmi, needWidth, measureLimit, null);
         }
 
-        mMetricAffectingSpanSpanSet.init(mSpanned, mStart + start, mStart + limit);
-        mCharacterStyleSpanSet.init(mSpanned, mStart + start, mStart + limit);
-
         // Shaping needs to take into account context up to metric boundaries,
         // but rendering needs to take into account character style boundaries.
         // So we iterate through metric runs to get metric bounds,
index 1adc6dd..659f47d 100644 (file)
@@ -613,6 +613,7 @@ int AndroidRuntime::startVm(JavaVM** pJavaVM, JNIEnv** pEnv, bool zygote)
     char useJitProfilesOptsBuf[sizeof("-Xjitsaveprofilinginfo:")-1 + PROPERTY_VALUE_MAX];
     char jitprithreadweightOptBuf[sizeof("-Xjitprithreadweight:")-1 + PROPERTY_VALUE_MAX];
     char jittransitionweightOptBuf[sizeof("-Xjittransitionweight:")-1 + PROPERTY_VALUE_MAX];
+    char hotstartupsamplesOptsBuf[sizeof("-Xps-hot-startup-method-samples:")-1 + PROPERTY_VALUE_MAX];
     char gctypeOptsBuf[sizeof("-Xgc:")-1 + PROPERTY_VALUE_MAX];
     char backgroundgcOptsBuf[sizeof("-XX:BackgroundGC=")-1 + PROPERTY_VALUE_MAX];
     char heaptargetutilizationOptsBuf[sizeof("-XX:HeapTargetUtilization=")-1 + PROPERTY_VALUE_MAX];
@@ -739,6 +740,12 @@ int AndroidRuntime::startVm(JavaVM** pJavaVM, JNIEnv** pEnv, bool zygote)
                        jittransitionweightOptBuf,
                        "-Xjittransitionweight:");
 
+    /*
+     * Profile related options.
+     */
+    parseRuntimeOption("dalvik.vm.hot-startup-method-samples", hotstartupsamplesOptsBuf,
+            "-Xps-hot-startup-method-samples:");
+
     property_get("ro.config.low_ram", propBuf, "");
     if (strcmp(propBuf, "true") == 0) {
       addOption("-XX:LowMemoryMode");
index 004ecfc..958592b 100644 (file)
     <permission android:name="android.permission.TV_VIRTUAL_REMOTE_CONTROLLER"
         android:protectionLevel="signature|privileged" />
 
+    <!-- Allows an application to change HDMI CEC active source.
+         <p>Not for use by third-party applications.
+         @hide -->
+    <permission android:name="android.permission.CHANGE_HDMI_CEC_ACTIVE_SOURCE"
+        android:protectionLevel="signature|privileged" />
+
     <!-- @SystemApi Allows an application to modify parental controls
          <p>Not for use by third-party applications.
          @hide -->
index 5811ca0..fd27dca 100644 (file)
@@ -148,7 +148,10 @@ public class PaintTest extends InstrumentationTestCase {
                         " U+" + Integer.toHexString(vs) + ")";
                 final String testString =
                         codePointsToString(new int[] {testCase.mBaseCodepoint, vs});
-                if (testCase.mVariationSelectors.contains(vs)) {
+                if (vs == 0xFE0E // U+FE0E is the text presentation emoji. hasGlyph is expected to
+                                 // return true for that variation selector if the font has the base
+                                 // glyph.
+                             || testCase.mVariationSelectors.contains(vs)) {
                     assertTrue(signature + " is expected to be true", p.hasGlyph(testString));
                 } else {
                     assertFalse(signature + " is expected to be false", p.hasGlyph(testString));
index b344527..e18abd5 100644 (file)
@@ -26,7 +26,7 @@ import java.util.TreeSet;
  *
  * @hide
  */
-//@SystemApi
+// @SystemApi
 public class LowpanBeaconInfo extends LowpanIdentity {
 
     private int mRssi = UNKNOWN;
@@ -104,7 +104,7 @@ public class LowpanBeaconInfo extends LowpanIdentity {
     }
 
     public Collection<Integer> getFlags() {
-        return mFlags.clone();
+        return (Collection<Integer>) mFlags.clone();
     }
 
     public boolean isFlagSet(int flag) {
index 50afe6d..621affe 100644 (file)
 
 package android.net.lowpan;
 
-
 /** Provides detailed information about a given channel. */
-//@SystemApi
+// @SystemApi
 public class LowpanChannelInfo {
 
     public static final int UNKNOWN_POWER = Integer.MAX_VALUE;
 
-    //////////////////////////////////////////////////////////////////////////
     // Instance Variables
 
     private String mName = null;
@@ -33,7 +31,6 @@ public class LowpanChannelInfo {
     private float mSpectrumBandwidth = 0.0f;
     private int mMaxTransmitPower = UNKNOWN_POWER;
 
-    //////////////////////////////////////////////////////////////////////////
     // Public Getters and Setters
 
     public String getName() {
index 9cad00c..1da085d 100644 (file)
@@ -30,7 +30,7 @@ import java.net.InetSocketAddress;
  *
  * @hide
  */
-//@SystemApi
+// @SystemApi
 public abstract class LowpanCommissioningSession {
     public LowpanCommissioningSession() {}
 
@@ -39,7 +39,7 @@ public abstract class LowpanCommissioningSession {
      *
      * @hide
      */
-    //@SystemApi
+    // @SystemApi
     public class Callback {
         public void onReceiveFromCommissioner(@NonNull byte[] packet) {};
 
index dea4d78..ca86021 100644 (file)
@@ -16,7 +16,6 @@
 
 package android.net.lowpan;
 
-
 import java.util.Map;
 
 /**
@@ -24,7 +23,7 @@ import java.util.Map;
  *
  * @hide
  */
-//@SystemApi
+// @SystemApi
 public class LowpanCredential {
 
     public static final int UNSPECIFIED_KEY_INDEX = 0;
@@ -84,8 +83,7 @@ public class LowpanCredential {
     void addToMap(Map<String, Object> parameters) throws LowpanException {
         if (isMasterKey()) {
             LowpanProperties.KEY_NETWORK_MASTER_KEY.putInMap(parameters, getMasterKey());
-            LowpanProperties.KEY_NETWORK_MASTER_KEY_INDEX.putInMap(
-                    parameters, getMasterKeyIndex());
+            LowpanProperties.KEY_NETWORK_MASTER_KEY_INDEX.putInMap(parameters, getMasterKeyIndex());
         } else {
             throw new LowpanException("Unsupported Network Credential");
         }
index c680687..91ed19c 100644 (file)
 
 package android.net.lowpan;
 
-
 /**
  * Describes the result from one channel of an energy scan.
  *
  * @hide
  */
-//@SystemApi
+// @SystemApi
 public class LowpanEnergyScanResult {
     public static final int UNKNOWN = Integer.MAX_VALUE;
 
index 8ff37f9..b43b2fe 100644 (file)
@@ -28,7 +28,7 @@ import android.util.AndroidException;
  * @see LowpanInterface
  * @hide
  */
-//@SystemApi
+// @SystemApi
 public class LowpanException extends AndroidException {
     // Make the eclipse warning about serializable exceptions go away
     private static final long serialVersionUID = 0x31863cbe562b0e11l; // randomly generated
index 2e7b560..9be45ef 100644 (file)
@@ -24,10 +24,9 @@ import java.util.Map;
  *
  * @hide
  */
-//@SystemApi
+// @SystemApi
 public class LowpanIdentity {
 
-    //////////////////////////////////////////////////////////////////////////
     // Constants
 
     /** @hide */
@@ -41,11 +40,10 @@ public class LowpanIdentity {
 
     public static final int UNKNOWN = Integer.MAX_VALUE;
 
-    //////////////////////////////////////////////////////////////////////////
     // Builder
 
     /** @hide */
-    //@SystemApi
+    // @SystemApi
     public static class Builder {
         private final LowpanIdentity identity = new LowpanIdentity();
 
@@ -102,7 +100,6 @@ public class LowpanIdentity {
 
     LowpanIdentity() {}
 
-    //////////////////////////////////////////////////////////////////////////
     // Instance Variables
 
     private String mName = null;
@@ -111,7 +108,6 @@ public class LowpanIdentity {
     private int mPanid = UNKNOWN;
     private int mChannel = UNKNOWN;
 
-    //////////////////////////////////////////////////////////////////////////
     // Public Getters and Setters
 
     public String getName() {
@@ -140,12 +136,10 @@ public class LowpanIdentity {
             LowpanProperties.KEY_NETWORK_NAME.putInMap(parameters, networkInfo.getName());
         }
         if (networkInfo.getPanid() != LowpanIdentity.UNKNOWN) {
-            LowpanProperties.KEY_NETWORK_PANID.putInMap(
-                    parameters, networkInfo.getPanid());
+            LowpanProperties.KEY_NETWORK_PANID.putInMap(parameters, networkInfo.getPanid());
         }
         if (networkInfo.getChannel() != LowpanIdentity.UNKNOWN) {
-            LowpanProperties.KEY_CHANNEL.putInMap(
-                    parameters, networkInfo.getChannel());
+            LowpanProperties.KEY_CHANNEL.putInMap(parameters, networkInfo.getChannel());
         }
         if (networkInfo.getXpanid() != null) {
             LowpanProperties.KEY_NETWORK_XPANID.putInMap(parameters, networkInfo.getXpanid());
index cd54819..2bb4ecd 100644 (file)
@@ -33,7 +33,7 @@ import java.util.Set;
  *
  * @hide
  */
-//@SystemApi
+// @SystemApi
 public class LowpanInterface {
     private static final String TAG = LowpanInterface.class.getSimpleName();
 
@@ -170,7 +170,7 @@ public class LowpanInterface {
      *
      * @hide
      */
-    //@SystemApi
+    // @SystemApi
     public abstract static class Callback {
         public void onConnectedChanged(boolean value) {}
 
@@ -244,7 +244,6 @@ public class LowpanInterface {
         LowpanException.throwAsPublicException(t);
     }
 
-    //////////////////////////////////////////////////////////////////////////
     // Private Property Helpers
 
     void setProperties(Map properties) throws LowpanException {
@@ -311,10 +310,9 @@ public class LowpanInterface {
 
     boolean getPropertyAsBoolean(LowpanProperty<Boolean> key) throws LowpanException {
         Boolean value = getProperty(key);
-        return (value != null) ? value : 0;
+        return (value != null) ? value : false;
     }
 
-    //////////////////////////////////////////////////////////////////////////
     // Public Actions
 
     /**
@@ -424,7 +422,6 @@ public class LowpanInterface {
         }
     }
 
-    //////////////////////////////////////////////////////////////////////////
     // Public Getters and Setters
 
     /**
@@ -448,13 +445,13 @@ public class LowpanInterface {
         return "";
     }
 
-  /**
-   * Indicates if the interface is enabled or disabled.
-   *
-   * @see #setEnabled
-   * @see android.net.lowpan.LowpanException#LOWPAN_DISABLED
-   */
-  public boolean isEnabled() {
+    /**
+     * Indicates if the interface is enabled or disabled.
+     *
+     * @see #setEnabled
+     * @see android.net.lowpan.LowpanException#LOWPAN_DISABLED
+     */
+    public boolean isEnabled() {
         try {
             return getPropertyAsBoolean(LowpanProperties.KEY_INTERFACE_ENABLED);
         } catch (LowpanException x) {
@@ -462,16 +459,16 @@ public class LowpanInterface {
         }
     }
 
-  /**
-   * Enables or disables the LoWPAN interface. When disabled, the interface is put into a low-power
-   * state and all commands that require the NCP to be queried will fail with {@link
-   * android.net.lowpan.LowpanException#LOWPAN_DISABLED}.
-   *
-   * @see #isEnabled
-   * @see android.net.lowpan.LowpanException#LOWPAN_DISABLED
-   * @hide
-   */
-  public void setEnabled(boolean enabled) throws LowpanException {
+    /**
+     * Enables or disables the LoWPAN interface. When disabled, the interface is put into a
+     * low-power state and all commands that require the NCP to be queried will fail with {@link
+     * android.net.lowpan.LowpanException#LOWPAN_DISABLED}.
+     *
+     * @see #isEnabled
+     * @see android.net.lowpan.LowpanException#LOWPAN_DISABLED
+     * @hide
+     */
+    public void setEnabled(boolean enabled) throws LowpanException {
         setProperty(LowpanProperties.KEY_INTERFACE_ENABLED, enabled);
     }
 
@@ -628,7 +625,6 @@ public class LowpanInterface {
         setProperties(map);
     }
 
-    //////////////////////////////////////////////////////////////////////////
     // Listener Support
 
     /**
@@ -644,7 +640,7 @@ public class LowpanInterface {
     public void registerCallback(@NonNull Callback cb, @Nullable Handler handler) {
         ILowpanInterfaceListener.Stub listenerBinder =
                 new ILowpanInterfaceListener.Stub() {
-                    public void onPropertiesChanged(Map<String, Object> properties) {
+                    public void onPropertiesChanged(Map properties) {
                         Runnable runnable =
                                 new Runnable() {
                                     @Override
@@ -724,36 +720,35 @@ public class LowpanInterface {
      */
     public void unregisterCallback(Callback cb) {
         int hashCode = System.identityHashCode(cb);
-        ILowpanInterfaceListener listenerBinder = mListenerMap.get(hashCode);
+        synchronized (mListenerMap) {
+            ILowpanInterfaceListener listenerBinder = mListenerMap.get(hashCode);
 
-        if (listenerBinder != null) {
-            synchronized (mListenerMap) {
+            if (listenerBinder != null) {
                 mListenerMap.remove(hashCode);
-            }
-            try {
-                mBinder.removeListener(listenerBinder);
-            } catch (RemoteException x) {
-                // Catch and ignore all binder exceptions
-                Log.e(TAG, x.toString());
+
+                try {
+                    mBinder.removeListener(listenerBinder);
+                } catch (RemoteException x) {
+                    // Catch and ignore all binder exceptions
+                    Log.e(TAG, x.toString());
+                }
             }
         }
     }
 
-  //////////////////////////////////////////////////////////////////////////
-  // Active and Passive Scanning
+    // Active and Passive Scanning
 
-  /**
-   * Creates a new {@link android.net.lowpan.LowpanScanner} object for this interface.
-   *
-   * <p>This method allocates a new unique object for each call.
-   *
-   * @see android.net.lowpan.LowpanScanner
-   */
-  public @NonNull LowpanScanner createScanner() {
+    /**
+     * Creates a new {@link android.net.lowpan.LowpanScanner} object for this interface.
+     *
+     * <p>This method allocates a new unique object for each call.
+     *
+     * @see android.net.lowpan.LowpanScanner
+     */
+    public @NonNull LowpanScanner createScanner() {
         return new LowpanScanner(mBinder);
     }
 
-    //////////////////////////////////////////////////////////////////////////
     // Route Management
 
     /**
index b58608d..ecdda49 100644 (file)
@@ -33,32 +33,24 @@ import java.util.HashMap;
  *
  * @hide
  */
-//@SystemApi
+// @SystemApi
 public class LowpanManager {
     private static final String TAG = LowpanManager.class.getSimpleName();
 
-    //////////////////////////////////////////////////////////////////////////
-    // Public Classes
-
     /** @hide */
-    //@SystemApi
+    // @SystemApi
     public abstract static class Callback {
-        public void onInterfaceAdded(LowpanInterface lowpan_interface) {}
+        public void onInterfaceAdded(LowpanInterface lowpanInterface) {}
 
-        public void onInterfaceRemoved(LowpanInterface lowpan_interface) {}
+        public void onInterfaceRemoved(LowpanInterface lowpanInterface) {}
     }
 
-    //////////////////////////////////////////////////////////////////////////
-    // Instance Variables
-
+    private Context mContext;
     private ILowpanManager mManager;
     private HashMap<Integer, ILowpanManagerListener> mListenerMap = new HashMap<>();
 
-    //////////////////////////////////////////////////////////////////////////
-
     private static LowpanManager sSingletonInstance;
 
-    //////////////////////////////////////////////////////////////////////////
     // Static Methods
 
     /** Returns a reference to the LowpanManager object, allocating it if necessary. */
@@ -75,7 +67,6 @@ public class LowpanManager {
         return sSingletonInstance;
     }
 
-    //////////////////////////////////////////////////////////////////////////
     // Constructors
 
     /**
@@ -84,28 +75,34 @@ public class LowpanManager {
      */
     private LowpanManager() {}
 
-    //////////////////////////////////////////////////////////////////////////
     // Private Methods
 
     /**
      * Returns a reference to the ILowpanManager interface, provided by the LoWPAN Manager Service.
      */
     @Nullable
-    private ILowpanManager getILowpanManager() {
+    private synchronized ILowpanManager getILowpanManager() {
+        // Use a local reference of this object for thread safety.
         ILowpanManager manager = mManager;
+
         if (manager == null) {
             IBinder serviceBinder =
                     new ServiceManager().getService(ILowpanManager.LOWPAN_SERVICE_NAME);
-            mManager = manager = ILowpanManager.Stub.asInterface(serviceBinder);
+
+            manager = ILowpanManager.Stub.asInterface(serviceBinder);
+
+            mManager = manager;
 
             // Add any listeners
             synchronized (mListenerMap) {
-                for (Integer hashObj : mListenerMap.keySet()) {
+                for (ILowpanManagerListener listener : mListenerMap.values()) {
                     try {
-                        manager.addListener(mListenerMap.get(hashObj));
+                        manager.addListener(listener);
+
                     } catch (RemoteException x) {
                         // Consider any failure here as implying the manager is defunct
-                        mManager = manager = null;
+                        mManager = null;
+                        manager = null;
                     }
                 }
             }
@@ -113,7 +110,6 @@ public class LowpanManager {
         return manager;
     }
 
-    //////////////////////////////////////////////////////////////////////////
     // Public Methods
 
     /**
@@ -141,6 +137,7 @@ public class LowpanManager {
                 manager = getILowpanManager();
             }
         }
+
         return ret;
     }
 
@@ -151,7 +148,7 @@ public class LowpanManager {
     @Nullable
     public LowpanInterface getInterface() {
         String[] ifaceList = getInterfaceList();
-        if (ifaceList != null && ifaceList.length > 0) {
+        if (ifaceList.length > 0) {
             return getInterface(ifaceList[0]);
         }
         return null;
@@ -165,24 +162,16 @@ public class LowpanManager {
     public String[] getInterfaceList() {
         ILowpanManager manager = getILowpanManager();
 
-        if (manager != null) {
+        // Maximum number of tries is two. We should only try
+        // more than once if our manager has died or there
+        // was some sort of AIDL buffer full event.
+        for (int i = 0; i < 2 && manager != null; i++) {
             try {
                 return manager.getInterfaceList();
-
             } catch (RemoteException x) {
                 // In all of the cases when we get this exception, we reconnect and try again
                 mManager = null;
-                try {
-                    manager = getILowpanManager();
-                    if (manager != null) {
-                        return manager.getInterfaceList();
-                    }
-                } catch (RemoteException ex) {
-                    // Something weird is going on, so we log it
-                    // and fall back thru to returning an empty array.
-                    Log.e(TAG, ex.toString());
-                    mManager = null;
-                }
+                manager = getILowpanManager();
             }
         }
 
@@ -200,14 +189,14 @@ public class LowpanManager {
             throws LowpanException {
         ILowpanManagerListener.Stub listenerBinder =
                 new ILowpanManagerListener.Stub() {
-                    public void onInterfaceAdded(ILowpanInterface lowpan_interface) {
+                    public void onInterfaceAdded(ILowpanInterface lowpanInterface) {
                         Runnable runnable =
                                 new Runnable() {
                                     @Override
                                     public void run() {
                                         cb.onInterfaceAdded(
                                                 LowpanInterface.getInterfaceFromBinder(
-                                                        lowpan_interface.asBinder()));
+                                                        lowpanInterface.asBinder()));
                                     }
                                 };
 
@@ -218,14 +207,14 @@ public class LowpanManager {
                         }
                     }
 
-                    public void onInterfaceRemoved(ILowpanInterface lowpan_interface) {
+                    public void onInterfaceRemoved(ILowpanInterface lowpanInterface) {
                         Runnable runnable =
                                 new Runnable() {
                                     @Override
                                     public void run() {
                                         cb.onInterfaceRemoved(
                                                 LowpanInterface.getInterfaceFromBinder(
-                                                        lowpan_interface.asBinder()));
+                                                        lowpanInterface.asBinder()));
                                     }
                                 };
 
index ace1f9c..7028807 100644 (file)
@@ -25,14 +25,13 @@ import java.util.Map;
  *
  * @hide
  */
-//@SystemApi
+// @SystemApi
 public class LowpanProvision {
 
-    //////////////////////////////////////////////////////////////////////////
     // Builder
 
     /** @hide */
-    //@SystemApi
+    // @SystemApi
     public static class Builder {
         private final LowpanProvision provision = new LowpanProvision();
 
@@ -53,13 +52,11 @@ public class LowpanProvision {
 
     private LowpanProvision() {}
 
-    //////////////////////////////////////////////////////////////////////////
     // Instance Variables
 
     private LowpanIdentity mIdentity = new LowpanIdentity();
     private LowpanCredential mCredential = null;
 
-    //////////////////////////////////////////////////////////////////////////
     // Public Getters and Setters
 
     @NonNull
@@ -72,7 +69,6 @@ public class LowpanProvision {
         return mCredential;
     }
 
-    //////////////////////////////////////////////////////////////////////////
     // LoWPAN-Internal Methods
 
     static void addToMap(Map<String, Object> parameters, LowpanProvision provision)
index 754f72e..e0df55d 100644 (file)
@@ -25,7 +25,6 @@ import android.util.Log;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashMap;
-import java.util.List;
 import java.util.Map;
 
 /**
@@ -36,11 +35,10 @@ import java.util.Map;
  * @see LowpanInterface
  * @hide
  */
-//@SystemApi
+// @SystemApi
 public class LowpanScanner {
     private static final String TAG = LowpanInterface.class.getSimpleName();
 
-    //////////////////////////////////////////////////////////////////////////
     // Public Classes
 
     /**
@@ -48,7 +46,7 @@ public class LowpanScanner {
      *
      * @hide
      */
-    //@SystemApi
+    // @SystemApi
     public abstract static class Callback {
         public void onNetScanBeacon(LowpanBeaconInfo beacon) {}
 
@@ -57,16 +55,14 @@ public class LowpanScanner {
         public void onScanFinished() {}
     }
 
-    //////////////////////////////////////////////////////////////////////////
     // Instance Variables
 
     private ILowpanInterface mBinder;
     private Callback mCallback = null;
     private Handler mHandler = null;
-    private List<Integer> mChannelMask = null;
+    private ArrayList<Integer> mChannelMask = null;
     private int mTxPower = Integer.MAX_VALUE;
 
-    //////////////////////////////////////////////////////////////////////////
     // Constructors/Accessors and Exception Glue
 
     LowpanScanner(@NonNull ILowpanInterface binder) {
@@ -74,7 +70,7 @@ public class LowpanScanner {
     }
 
     /** Sets an instance of {@link LowpanScanner.Callback} to receive events. */
-    public void setCallback(@Nullable Callback cb, @Nullable Handler handler) {
+    public synchronized void setCallback(@Nullable Callback cb, @Nullable Handler handler) {
         mCallback = cb;
         mHandler = handler;
     }
@@ -110,7 +106,7 @@ public class LowpanScanner {
      * @return the current channel mask, or <code>null</code> if no channel mask is currently set.
      */
     public @Nullable Collection<Integer> getChannelMask() {
-        return mChannelMask.clone();
+        return (Collection<Integer>) mChannelMask.clone();
     }
 
     /**
@@ -179,17 +175,24 @@ public class LowpanScanner {
         ILowpanNetScanCallback binderListener =
                 new ILowpanNetScanCallback.Stub() {
                     public void onNetScanBeacon(Map parameters) {
-                        Callback callback = mCallback;
-                        Handler handler = mHandler;
+                        Callback callback;
+                        Handler handler;
+
+                        synchronized (LowpanScanner.this) {
+                            callback = mCallback;
+                            handler = mHandler;
+                        }
 
                         if (callback == null) {
                             return;
                         }
 
-                        Runnable runnable = () -> callback.onNetScanBeacon(
-                                new LowpanBeaconInfo.Builder()
-                                        .updateFromMap(parameters)
-                                        .build());
+                        Runnable runnable =
+                                () ->
+                                        callback.onNetScanBeacon(
+                                                new LowpanBeaconInfo.Builder()
+                                                        .updateFromMap(parameters)
+                                                        .build());
 
                         if (handler != null) {
                             handler.post(runnable);
@@ -199,8 +202,13 @@ public class LowpanScanner {
                     }
 
                     public void onNetScanFinished() {
-                        Callback callback = mCallback;
-                        Handler handler = mHandler;
+                        Callback callback;
+                        Handler handler;
+
+                        synchronized (LowpanScanner.this) {
+                            callback = mCallback;
+                            handler = mHandler;
+                        }
 
                         if (callback == null) {
                             return;
@@ -218,7 +226,7 @@ public class LowpanScanner {
 
         try {
             mBinder.startNetScan(map, binderListener);
-        } catch (ServiceSpecificException|RemoteException x) {
+        } catch (ServiceSpecificException | RemoteException x) {
             LowpanException.throwAsPublicException(x);
         }
     }
@@ -257,7 +265,8 @@ public class LowpanScanner {
                             return;
                         }
 
-                        Runnable runnable = () -> {
+                        Runnable runnable =
+                                () -> {
                                     if (callback != null) {
                                         LowpanEnergyScanResult result =
                                                 new LowpanEnergyScanResult();
index 2703fbf..20b12b4 100644 (file)
@@ -47,6 +47,9 @@ import android.webkit.WebViewClient;
 import android.widget.ProgressBar;
 import android.widget.TextView;
 
+import com.android.internal.logging.MetricsLogger;
+import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
+
 import java.io.IOException;
 import java.net.HttpURLConnection;
 import java.net.MalformedURLException;
@@ -63,7 +66,14 @@ public class CaptivePortalLoginActivity extends Activity {
 
     private static final int SOCKET_TIMEOUT_MS = 10000;
 
-    private enum Result { DISMISSED, UNWANTED, WANTED_AS_IS };
+    private enum Result {
+        DISMISSED(MetricsEvent.ACTION_CAPTIVE_PORTAL_LOGIN_RESULT_DISMISSED),
+        UNWANTED(MetricsEvent.ACTION_CAPTIVE_PORTAL_LOGIN_RESULT_UNWANTED),
+        WANTED_AS_IS(MetricsEvent.ACTION_CAPTIVE_PORTAL_LOGIN_RESULT_WANTED_AS_IS);
+
+        final int metricsEvent;
+        Result(int metricsEvent) { this.metricsEvent = metricsEvent; }
+    };
 
     private URL mUrl;
     private String mUserAgent;
@@ -77,6 +87,9 @@ public class CaptivePortalLoginActivity extends Activity {
     @Override
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
+
+        logMetricsEvent(MetricsEvent.ACTION_CAPTIVE_PORTAL_LOGIN_ACTIVITY);
+
         mCm = ConnectivityManager.from(this);
         mNetwork = getIntent().getParcelableExtra(ConnectivityManager.EXTRA_NETWORK);
         mCaptivePortal = getIntent().getParcelableExtra(ConnectivityManager.EXTRA_CAPTIVE_PORTAL);
@@ -173,6 +186,7 @@ public class CaptivePortalLoginActivity extends Activity {
             mCm.unregisterNetworkCallback(mNetworkCallback);
             mNetworkCallback = null;
         }
+        logMetricsEvent(result.metricsEvent);
         switch (result) {
             case DISMISSED:
                 mCaptivePortal.reportCaptivePortalDismissed();
@@ -381,6 +395,7 @@ public class CaptivePortalLoginActivity extends Activity {
 
         @Override
         public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) {
+            logMetricsEvent(MetricsEvent.CAPTIVE_PORTAL_LOGIN_ACTIVITY_SSL_ERROR);
             Log.w(TAG, "SSL error (error: " + error.getPrimaryError() + " host: " +
                     // Only show host to avoid leaking private info.
                     Uri.parse(error.getUrl()).getHost() + " certificate: " +
@@ -492,4 +507,8 @@ public class CaptivePortalLoginActivity extends Activity {
         }
         return url.getHost();
     }
+
+    private void logMetricsEvent(int event) {
+        MetricsLogger.action(this, event, getPackageName());
+    }
 }
index 533c52b..96f51c1 100644 (file)
@@ -16,6 +16,7 @@
 
 package com.android.providers.settings;
 
+import android.annotation.Nullable;
 import android.annotation.UserIdInt;
 import android.app.backup.BackupAgentHelper;
 import android.app.backup.BackupDataInput;
@@ -30,7 +31,6 @@ import android.net.NetworkPolicyManager;
 import android.net.Uri;
 import android.net.wifi.WifiConfiguration;
 import android.net.wifi.WifiManager;
-import android.os.Handler;
 import android.os.ParcelFileDescriptor;
 import android.os.UserHandle;
 import android.provider.Settings;
@@ -590,14 +590,18 @@ public class SettingsBackupAgent extends BackupAgentHelper {
             Log.i(TAG, "restoreSettings: " + contentUri);
         }
 
-        // Figure out the white list and redirects to the global table.
+        // Figure out the white list and redirects to the global table.  We restore anything
+        // in either the backup whitelist or the legacy-restore whitelist for this table.
         final String[] whitelist;
         if (contentUri.equals(Settings.Secure.CONTENT_URI)) {
-            whitelist = Settings.Secure.SETTINGS_TO_BACKUP;
+            whitelist = concat(Settings.Secure.SETTINGS_TO_BACKUP,
+                    Settings.Secure.LEGACY_RESTORE_SETTINGS);
         } else if (contentUri.equals(Settings.System.CONTENT_URI)) {
-            whitelist = Settings.System.SETTINGS_TO_BACKUP;
+            whitelist = concat(Settings.System.SETTINGS_TO_BACKUP,
+                    Settings.System.LEGACY_RESTORE_SETTINGS);
         } else if (contentUri.equals(Settings.Global.CONTENT_URI)) {
-            whitelist = Settings.Global.SETTINGS_TO_BACKUP;
+            whitelist = concat(Settings.Global.SETTINGS_TO_BACKUP,
+                    Settings.Global.LEGACY_RESTORE_SETTINGS);
         } else {
             throw new IllegalArgumentException("Unknown URI: " + contentUri);
         }
@@ -648,6 +652,18 @@ public class SettingsBackupAgent extends BackupAgentHelper {
         }
     }
 
+    private final String[] concat(String[] first, @Nullable String[] second) {
+        if (second == null || second.length == 0) {
+            return first;
+        }
+        final int firstLen = first.length;
+        final int secondLen = second.length;
+        String[] both = new String[firstLen + secondLen];
+        System.arraycopy(first, 0, both, 0, firstLen);
+        System.arraycopy(second, 0, both, firstLen, secondLen);
+        return both;
+    }
+
     /**
      * Restores the owner info enabled and other settings in LockSettings.
      *
index f5d7dd8..1df2c80 100644 (file)
@@ -2895,7 +2895,7 @@ public class SettingsProvider extends ContentProvider {
         }
 
         private final class UpgradeController {
-            private static final int SETTINGS_VERSION = 145;
+            private static final int SETTINGS_VERSION = 146;
 
             private final int mUserId;
 
@@ -3478,22 +3478,25 @@ public class SettingsProvider extends ContentProvider {
                 }
 
                 if (currentVersion == 144) {
-                    // Version 145: Set the default value for WIFI_WAKEUP_AVAILABLE.
+                    // Version 145: Removed
+                    currentVersion = 145;
+                }
+
+                if (currentVersion == 145) {
+                    // Version 146: Set the default value for WIFI_WAKEUP_AVAILABLE.
                     if (userId == UserHandle.USER_SYSTEM) {
                         final SettingsState globalSettings = getGlobalSettingsLocked();
                         final Setting currentSetting = globalSettings.getSettingLocked(
                                 Settings.Global.WIFI_WAKEUP_AVAILABLE);
-                        if (currentSetting.isNull()) {
-                            final int defaultValue = getContext().getResources().getInteger(
-                                    com.android.internal.R.integer.config_wifi_wakeup_available);
-                            globalSettings.insertSettingLocked(
-                                    Settings.Global.WIFI_WAKEUP_AVAILABLE,
-                                    String.valueOf(defaultValue),
-                                    null, true, SettingsState.SYSTEM_PACKAGE_NAME);
-                        }
+                        final int defaultValue = getContext().getResources().getInteger(
+                                com.android.internal.R.integer.config_wifi_wakeup_available);
+                        globalSettings.insertSettingLocked(
+                                Settings.Global.WIFI_WAKEUP_AVAILABLE,
+                                String.valueOf(defaultValue),
+                                null, true, SettingsState.SYSTEM_PACKAGE_NAME);
                     }
 
-                    currentVersion = 145;
+                    currentVersion = 146;
                 }
 
                 // vXXX: Add new settings above this point.
index fe422db..fc9e585 100644 (file)
 
     <dimen name="global_actions_top_padding">100dp</dimen>
 
+    <!-- the maximum offset in either direction that elements are moved horizontally to prevent
+            burn-in on AOD -->
+    <dimen name="burn_in_prevention_offset_x">8dp</dimen>
+
+    <!-- the maximum offset in either direction that elements are moved vertically to prevent
+            burn-in on AOD -->
+    <dimen name="burn_in_prevention_offset_y">50dp</dimen>
+
     <dimen name="corner_size">16dp</dimen>
     <dimen name="top_padding">0dp</dimen>
     <dimen name="bottom_padding">48dp</dimen>
index d2c0f64..67ea258 100644 (file)
@@ -650,6 +650,10 @@ public class NotificationShelf extends ActivatableNotificationView implements
         updateRelativeOffset();
     }
 
+    public void setDarkOffsetX(int offsetX) {
+        mShelfIcons.setDarkOffsetX(offsetX);
+    }
+
     private class ShelfState extends ExpandableViewState {
         private float openedAmount;
         private boolean hasItemsInStableShelf;
index 76177a3..4a6bafc 100644 (file)
@@ -51,7 +51,14 @@ import com.android.systemui.statusbar.phone.NavigationBarView;
 import com.android.systemui.statusbar.phone.StatusBar;
 import com.android.systemui.statusbar.policy.BatteryController;
 import com.android.systemui.statusbar.policy.UserSwitcherController;
-
+import com.android.keyguard.KeyguardUpdateMonitor;
+import com.android.systemui.classifier.FalsingLog;
+import com.android.systemui.classifier.FalsingManager;
+import com.android.systemui.Prefs;
+
+import java.io.FileDescriptor;
+import java.io.PrintWriter;
+import java.util.Map;
 /**
  * A status bar (and navigation bar) tailored for the automotive use case.
  */
@@ -71,6 +78,7 @@ public class CarStatusBar extends StatusBar implements
     private ConnectedDeviceSignalController mConnectedDeviceSignalController;
     private CarNavigationBarView mNavigationBarView;
 
+    private final Object mQueueLock = new Object();
     @Override
     public void start() {
         super.start();
@@ -170,6 +178,43 @@ public class CarStatusBar extends StatusBar implements
     }
 
     @Override
+    public void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
+        //When executing dump() funciton simultaneously, we need to serialize them
+        //to get mStackScroller's position correctly.
+        synchronized (mQueueLock) {
+            pw.println("  mStackScroller: " + viewInfo(mStackScroller));
+            pw.println("  mStackScroller: " + viewInfo(mStackScroller)
+                    + " scroll " + mStackScroller.getScrollX()
+                    + "," + mStackScroller.getScrollY());
+        }
+
+        pw.print("  mTaskStackListener="); pw.println(mTaskStackListener);
+        pw.print("  mController=");
+        pw.println(mController);
+        pw.print("  mFullscreenUserSwitcher="); pw.println(mFullscreenUserSwitcher);
+        pw.print("  mCarBatteryController=");
+        pw.println(mCarBatteryController);
+        pw.print("  mBatteryMeterView=");
+        pw.println(mBatteryMeterView);
+        pw.print("  mConnectedDeviceSignalController=");
+        pw.println(mConnectedDeviceSignalController);
+        pw.print("  mNavigationBarView=");
+        pw.println(mNavigationBarView);
+
+        if (KeyguardUpdateMonitor.getInstance(mContext) != null) {
+            KeyguardUpdateMonitor.getInstance(mContext).dump(fd, pw, args);
+        }
+
+        FalsingManager.getInstance(mContext).dump(pw);
+        FalsingLog.dump(pw);
+
+        pw.println("SharedPreferences:");
+        for (Map.Entry<String, ?> entry : Prefs.getAll(mContext).entrySet()) {
+            pw.print("  "); pw.print(entry.getKey()); pw.print("="); pw.println(entry.getValue());
+        }
+    }
+
+    @Override
     public NavigationBarView getNavigationBarView() {
         return mNavigationBarView;
     }
index 7370c03..652288d 100644 (file)
 
 package com.android.systemui.statusbar.phone;
 
+import static com.android.systemui.statusbar.notification.NotificationUtils.interpolate;
+
 import android.content.res.Resources;
 import android.graphics.Path;
 import android.view.animation.AccelerateInterpolator;
 import android.view.animation.PathInterpolator;
 
 import com.android.systemui.R;
-import com.android.systemui.statusbar.notification.NotificationUtils;
 
 /**
  * Utility class to calculate the clock position and top padding of notifications on Keyguard.
@@ -40,6 +41,10 @@ public class KeyguardClockPositionAlgorithm {
     private static final float CLOCK_ADJ_TOP_PADDING_MULTIPLIER_MIN = 1.4f;
     private static final float CLOCK_ADJ_TOP_PADDING_MULTIPLIER_MAX = 3.2f;
 
+    private static final long MILLIS_PER_MINUTES = 1000 * 60;
+    private static final float BURN_IN_PREVENTION_PERIOD_Y = 521;
+    private static final float BURN_IN_PREVENTION_PERIOD_X = 83;
+
     private int mClockNotificationsMarginMin;
     private int mClockNotificationsMarginMax;
     private float mClockYFractionMin;
@@ -52,6 +57,8 @@ public class KeyguardClockPositionAlgorithm {
     private int mKeyguardStatusHeight;
     private float mEmptyDragAmount;
     private float mDensity;
+    private int mBurnInPreventionOffsetX;
+    private int mBurnInPreventionOffsetY;
 
     /**
      * The number (fractional) of notifications the "more" card counts when calculating how many
@@ -86,6 +93,10 @@ public class KeyguardClockPositionAlgorithm {
                 (float) res.getDimensionPixelSize(R.dimen.notification_shelf_height) /
                         res.getDimensionPixelSize(R.dimen.notification_min_height);
         mDensity = res.getDisplayMetrics().density;
+        mBurnInPreventionOffsetX = res.getDimensionPixelSize(
+                R.dimen.burn_in_prevention_offset_x);
+        mBurnInPreventionOffsetY = res.getDimensionPixelSize(
+                R.dimen.burn_in_prevention_offset_y);
     }
 
     public void setup(int maxKeyguardNotifications, int maxPanelHeight, float expandedHeight,
@@ -122,10 +133,12 @@ public class KeyguardClockPositionAlgorithm {
                 y + getClockNotificationsPadding() + mKeyguardStatusHeight);
         result.clockAlpha = getClockAlpha(result.clockScale);
 
-        result.stackScrollerPadding = (int) NotificationUtils.interpolate(
+        result.stackScrollerPadding = (int) interpolate(
                 result.stackScrollerPadding,
                 mClockBottom + y,
                 mDarkAmount);
+
+        result.clockX = (int) interpolate(0, burnInPreventionOffsetX(), mDarkAmount);
     }
 
     private float getClockScale(int notificationPadding, int clockY, int startPadding) {
@@ -154,9 +167,39 @@ public class KeyguardClockPositionAlgorithm {
     private int getClockY() {
         // Dark: Align the bottom edge of the clock at one third:
         // clockBottomEdge = result - mKeyguardStatusHeight / 2 + mClockBottom
-        float clockYDark = (0.33f * mHeight + (float) mKeyguardStatusHeight / 2 - mClockBottom);
+        float clockYDark = (0.33f * mHeight + (float) mKeyguardStatusHeight / 2 - mClockBottom)
+                + burnInPreventionOffsetY();
         float clockYRegular = getClockYFraction() * mHeight;
-        return (int) NotificationUtils.interpolate(clockYRegular, clockYDark, mDarkAmount);
+        return (int) interpolate(clockYRegular, clockYDark, mDarkAmount);
+    }
+
+    private float burnInPreventionOffsetY() {
+        return zigzag(System.currentTimeMillis() / MILLIS_PER_MINUTES,
+                mBurnInPreventionOffsetY * 2,
+                BURN_IN_PREVENTION_PERIOD_Y)
+                - mBurnInPreventionOffsetY;
+    }
+
+    private float burnInPreventionOffsetX() {
+        return zigzag(System.currentTimeMillis() / MILLIS_PER_MINUTES,
+                mBurnInPreventionOffsetX * 2,
+                BURN_IN_PREVENTION_PERIOD_X)
+                - mBurnInPreventionOffsetX;
+    }
+
+    /**
+     * Implements a continuous, piecewise linear, periodic zig-zag function
+     *
+     * Can be thought of as a linear approximation of abs(sin(x)))
+     *
+     * @param period period of the function, ie. zigzag(x + period) == zigzag(x)
+     * @param amplitude maximum value of the function
+     * @return a value between 0 and amplitude
+     */
+    private float zigzag(float x, float amplitude, float period) {
+        float xprime = (x % period) / (period / 2);
+        float interpolationAmount = (xprime <= 1) ? xprime : (2 - xprime);
+        return interpolate(0, amplitude, interpolationAmount);
     }
 
     private float getClockYExpansionAdjustment() {
@@ -230,5 +273,8 @@ public class KeyguardClockPositionAlgorithm {
          * the padding, but not the overall panel size.
          */
         public int stackScrollerPaddingAdjustment;
+
+        /** The x translation of the clock. */
+        public int clockX;
     }
 }
index a4fadc4..3937dd3 100644 (file)
@@ -123,6 +123,7 @@ public class NotificationIconContainer extends AlphaOptimizedFrameLayout {
     private boolean mDisallowNextAnimation;
     private boolean mAnimationsEnabled = true;
     private ArrayMap<String, ArrayList<StatusBarIcon>> mReplacingIcons;
+    private int mDarkOffsetX;
 
     public NotificationIconContainer(Context context, AttributeSet attrs) {
         super(context, attrs);
@@ -389,6 +390,14 @@ public class NotificationIconContainer extends AlphaOptimizedFrameLayout {
                 iconState.xTranslation = getWidth() - iconState.xTranslation - view.getWidth();
             }
         }
+
+        if (mDark && mDarkOffsetX != 0) {
+            for (int i = 0; i < childCount; i++) {
+                View view = getChildAt(i);
+                IconState iconState = mIconStates.get(view);
+                iconState.xTranslation += mDarkOffsetX;
+            }
+        }
     }
 
     private float getLayoutEnd() {
@@ -508,6 +517,10 @@ public class NotificationIconContainer extends AlphaOptimizedFrameLayout {
         mAnimationsEnabled = enabled;
     }
 
+    public void setDarkOffsetX(int offsetX) {
+        mDarkOffsetX = offsetX;
+    }
+
     public void setReplacingIcons(ArrayMap<String, ArrayList<StatusBarIcon>> replacingIcons) {
         mReplacingIcons = replacingIcons;
     }
index e2b9da0..4701f85 100644 (file)
@@ -18,6 +18,7 @@ package com.android.systemui.statusbar.phone;
 
 import android.animation.Animator;
 import android.animation.AnimatorListenerAdapter;
+import android.animation.AnimatorSet;
 import android.animation.ObjectAnimator;
 import android.animation.ValueAnimator;
 import android.app.ActivityManager;
@@ -43,15 +44,13 @@ import android.view.ViewTreeObserver;
 import android.view.WindowInsets;
 import android.view.accessibility.AccessibilityEvent;
 import android.widget.FrameLayout;
-import android.widget.TextView;
+
 import com.android.internal.logging.MetricsLogger;
 import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
 import com.android.keyguard.KeyguardStatusView;
 import com.android.systemui.DejankUtils;
-import com.android.systemui.Dependency;
 import com.android.systemui.Interpolators;
 import com.android.systemui.R;
-import com.android.systemui.SystemUIFactory;
 import com.android.systemui.classifier.FalsingManager;
 import com.android.systemui.fragments.FragmentHostManager;
 import com.android.systemui.fragments.FragmentHostManager.FragmentListener;
@@ -69,7 +68,6 @@ import com.android.systemui.statusbar.notification.NotificationUtils;
 import com.android.systemui.statusbar.policy.HeadsUpManager;
 import com.android.systemui.statusbar.policy.KeyguardUserSwitcher;
 import com.android.systemui.statusbar.policy.OnHeadsUpChangedListener;
-import com.android.systemui.statusbar.policy.UserInfoController;
 import com.android.systemui.statusbar.stack.NotificationStackScrollLayout;
 import com.android.systemui.statusbar.stack.StackStateAnimator;
 
@@ -168,8 +166,9 @@ public class NotificationPanelView extends PanelView implements
     private int mUnlockMoveDistance;
     private float mEmptyDragAmount;
 
-    private ObjectAnimator mClockAnimator;
-    private int mClockAnimationTarget = -1;
+    private Animator mClockAnimator;
+    private int mClockAnimationTargetX = Integer.MIN_VALUE;
+    private int mClockAnimationTargetY = Integer.MIN_VALUE;
     private int mTopPaddingAdjustment;
     private KeyguardClockPositionAlgorithm mClockPositionAlgorithm =
             new KeyguardClockPositionAlgorithm();
@@ -459,8 +458,9 @@ public class NotificationPanelView extends PanelView implements
                     mDarkAmount);
             mClockPositionAlgorithm.run(mClockPositionResult);
             if (animate || mClockAnimator != null) {
-                startClockAnimation(mClockPositionResult.clockY);
+                startClockAnimation(mClockPositionResult.clockX, mClockPositionResult.clockY);
             } else {
+                mKeyguardStatusView.setX(mClockPositionResult.clockX);
                 mKeyguardStatusView.setY(mClockPositionResult.clockY);
             }
             updateClock(mClockPositionResult.clockAlpha, mClockPositionResult.clockScale);
@@ -468,6 +468,7 @@ public class NotificationPanelView extends PanelView implements
             mTopPaddingAdjustment = mClockPositionResult.stackScrollerPaddingAdjustment;
         }
         mNotificationStackScroller.setIntrinsicPadding(stackScrollerPadding);
+        mNotificationStackScroller.setDarkShelfOffsetX(mClockPositionResult.clockX);
         requestScrollerTopPaddingUpdate(animate);
     }
 
@@ -523,11 +524,12 @@ public class NotificationPanelView extends PanelView implements
         return count;
     }
 
-    private void startClockAnimation(int y) {
-        if (mClockAnimationTarget == y) {
+    private void startClockAnimation(int x, int y) {
+        if (mClockAnimationTargetX == x && mClockAnimationTargetY == y) {
             return;
         }
-        mClockAnimationTarget = y;
+        mClockAnimationTargetX = x;
+        mClockAnimationTargetY = y;
         getViewTreeObserver().addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() {
             @Override
             public boolean onPreDraw() {
@@ -536,15 +538,20 @@ public class NotificationPanelView extends PanelView implements
                     mClockAnimator.removeAllListeners();
                     mClockAnimator.cancel();
                 }
-                mClockAnimator = ObjectAnimator
-                        .ofFloat(mKeyguardStatusView, View.Y, mClockAnimationTarget);
+                AnimatorSet set = new AnimatorSet();
+                set.play(ObjectAnimator.ofFloat(
+                        mKeyguardStatusView, View.Y, mClockAnimationTargetY))
+                        .with(ObjectAnimator.ofFloat(
+                                mKeyguardStatusView, View.X, mClockAnimationTargetX));
+                mClockAnimator = set;
                 mClockAnimator.setInterpolator(Interpolators.FAST_OUT_SLOW_IN);
                 mClockAnimator.setDuration(StackStateAnimator.ANIMATION_DURATION_STANDARD);
                 mClockAnimator.addListener(new AnimatorListenerAdapter() {
                     @Override
                     public void onAnimationEnd(Animator animation) {
                         mClockAnimator = null;
-                        mClockAnimationTarget = -1;
+                        mClockAnimationTargetX = Integer.MIN_VALUE;
+                        mClockAnimationTargetY = Integer.MIN_VALUE;
                     }
                 });
                 mClockAnimator.start();
@@ -2613,6 +2620,9 @@ public class NotificationPanelView extends PanelView implements
 
     public void refreshTime() {
         mKeyguardStatusView.refreshTime();
+        if (mDarkAmount > 0) {
+            positionClockAndNotifications();
+        }
     }
 
     public void setStatusAccessibilityImportance(int mode) {
index 9bd480d..75fd4b1 100644 (file)
@@ -6872,7 +6872,8 @@ public class StatusBar extends SystemUI implements DemoMode,
                 // If mAlwaysExpandNonGroupedNotification is false, then only expand the
                 // very first notification and if it's not a child of grouped notifications.
                 row.setSystemExpanded(mAlwaysExpandNonGroupedNotification
-                        || (visibleNotifications == 0 && !isChildNotification));
+                        || (visibleNotifications == 0 && !isChildNotification
+                        && !row.isLowPriority()));
             }
 
             entry.row.setShowAmbient(isDozing());
index a3d812c..cbd315b 100644 (file)
@@ -4252,6 +4252,10 @@ public class NotificationStackScrollLayout extends ViewGroup
         mHeadsUpGoingAwayAnimationsAllowed = headsUpGoingAwayAnimationsAllowed;
     }
 
+    public void setDarkShelfOffsetX(int shelfOffsetX) {
+        mShelf.setDarkOffsetX(shelfOffsetX);
+    }
+
     /**
      * A listener that is notified when some child locations might have changed.
      */
index 11ea841..fa2b1ee 100644 (file)
@@ -4090,6 +4090,11 @@ message MetricsEvent {
     // OS: O DR
     SETTINGS_ASSIST_GESTURE_FIRST_TIME = 1012;
 
+    // CaptivePortalLoginActivity displays SSL error page
+    // CATEGORY: GLOBAL_SYSTEM_UI
+    // OS: O DR
+    CAPTIVE_PORTAL_LOGIN_ACTIVITY_SSL_ERROR = 1013;
+
     // Add new aosp constants above this line.
     // END OF AOSP CONSTANTS
   }
index 25a0772..1afde55 100644 (file)
@@ -1218,6 +1218,12 @@ public final class TvInputManagerService extends SystemService {
 
         @Override
         public void setMainSession(IBinder sessionToken, int userId) {
+            if (mContext.checkCallingPermission(
+                    android.Manifest.permission.CHANGE_HDMI_CEC_ACTIVE_SOURCE)
+                    != PackageManager.PERMISSION_GRANTED) {
+                throw new SecurityException(
+                        "The caller does not have CHANGE_HDMI_CEC_ACTIVE_SOURCE permission");
+            }
             if (DEBUG) {
                 Slog.d(TAG, "setMainSession(sessionToken=" + sessionToken + ")");
             }
index 1d2e3a4..5978cdd 100644 (file)
@@ -27,7 +27,7 @@ namespace aapt {
 static const char* sMajorVersion = "2";
 
 // Update minor version whenever a feature or flag is added.
-static const char* sMinorVersion = "16";
+static const char* sMinorVersion = "17";
 
 int PrintVersion() {
   std::cerr << "Android Asset Packaging Tool (aapt) " << sMajorVersion << "."
index 0290e30..49cb8d4 100644 (file)
@@ -1,9 +1,19 @@
 # Android Asset Packaging Tool 2.0 (AAPT2) release notes
 
 ## Version 2.17
-### `aapt2 compile ...`
-- Fixed an issue where symlinks would not be followed when compiling PNGs. (bug 62144459)
+### `aapt2 ...`
+- Fixed issue where symlinks would not be followed when compiling PNGs. (bug 62144459)
 - Fixed issue where overlays that declared `<add-resource>` did not compile. (bug 38355988)
+- Fixed issue where `%n` in a string resource was interpreted as a format argument. (bug 37132275)
+- Allow empty resources to compile, giving them a value of `""` or `@null`, depending on the
+  accepted formats. (bug 38425050)
+- Resources declared via `<item>` with no format attribute were changed to accept all
+  resource types. (bug 62260121)
+- Allow `<layout>` element under `<activity>` in AndroidManifest.xml. (bug 62189611)
+- Fix issue where `--no-version-vector` did not apply to `pathInterpolator` and `objectAnimator`.
+  (bug 62211148)
+- Fix issue where overlaid `<style>` would not be merged, and would replace the original resource
+  instead. This fix brings behavior in-line with AAPT. (bug 38355988)
 
 ## Version 2.16
 ### `aapt2 link ...`