Merge "OOM-adjust an app to the foreground for startForegroundService" into oc-dev
diff --git a/api/current.txt b/api/current.txt
index 30db015..3af3c85 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -7083,7 +7083,7 @@
     method protected android.view.View getErrorView();
     method protected void prepareView(android.view.View);
     method public void setAppWidget(int, android.appwidget.AppWidgetProviderInfo);
-    method public void setAsyncExecutor(java.util.concurrent.Executor);
+    method public void setExecutor(java.util.concurrent.Executor);
     method public void updateAppWidget(android.widget.RemoteViews);
     method public void updateAppWidgetOptions(android.os.Bundle);
     method public void updateAppWidgetSize(android.os.Bundle, int, int, int, int);
@@ -47152,7 +47152,6 @@
   }
 
   public final class AccessibilityManager {
-    method public boolean addAccessibilityServicesStateChangeListener(android.view.accessibility.AccessibilityManager.AccessibilityServicesStateChangeListener);
     method public boolean addAccessibilityStateChangeListener(android.view.accessibility.AccessibilityManager.AccessibilityStateChangeListener);
     method public boolean addTouchExplorationStateChangeListener(android.view.accessibility.AccessibilityManager.TouchExplorationStateChangeListener);
     method public deprecated java.util.List<android.content.pm.ServiceInfo> getAccessibilityServiceList();
@@ -47161,16 +47160,11 @@
     method public void interrupt();
     method public boolean isEnabled();
     method public boolean isTouchExplorationEnabled();
-    method public boolean removeAccessibilityServicesStateChangeListener(android.view.accessibility.AccessibilityManager.AccessibilityServicesStateChangeListener);
     method public boolean removeAccessibilityStateChangeListener(android.view.accessibility.AccessibilityManager.AccessibilityStateChangeListener);
     method public boolean removeTouchExplorationStateChangeListener(android.view.accessibility.AccessibilityManager.TouchExplorationStateChangeListener);
     method public void sendAccessibilityEvent(android.view.accessibility.AccessibilityEvent);
   }
 
-  public static abstract interface AccessibilityManager.AccessibilityServicesStateChangeListener {
-    method public abstract void onAccessibilityServicesStateChanged();
-  }
-
   public static abstract interface AccessibilityManager.AccessibilityStateChangeListener {
     method public abstract void onAccessibilityStateChanged(boolean);
   }
diff --git a/api/system-current.txt b/api/system-current.txt
index 3408b5a..9a5ede3 100644
--- a/api/system-current.txt
+++ b/api/system-current.txt
@@ -7549,7 +7549,7 @@
     method protected android.view.View getErrorView();
     method protected void prepareView(android.view.View);
     method public void setAppWidget(int, android.appwidget.AppWidgetProviderInfo);
-    method public void setAsyncExecutor(java.util.concurrent.Executor);
+    method public void setExecutor(java.util.concurrent.Executor);
     method public void updateAppWidget(android.widget.RemoteViews);
     method public void updateAppWidgetOptions(android.os.Bundle);
     method public void updateAppWidgetSize(android.os.Bundle, int, int, int, int);
@@ -29316,19 +29316,19 @@
   }
 
   public class WifiScanner {
-    method public void configureWifiChange(int, int, int, int, int, android.net.wifi.WifiScanner.BssidInfo[]);
-    method public void configureWifiChange(android.net.wifi.WifiScanner.WifiChangeSettings);
+    method public deprecated void configureWifiChange(int, int, int, int, int, android.net.wifi.WifiScanner.BssidInfo[]);
+    method public deprecated void configureWifiChange(android.net.wifi.WifiScanner.WifiChangeSettings);
     method public boolean getScanResults();
     method public void startBackgroundScan(android.net.wifi.WifiScanner.ScanSettings, android.net.wifi.WifiScanner.ScanListener);
     method public void startBackgroundScan(android.net.wifi.WifiScanner.ScanSettings, android.net.wifi.WifiScanner.ScanListener, android.os.WorkSource);
     method public void startScan(android.net.wifi.WifiScanner.ScanSettings, android.net.wifi.WifiScanner.ScanListener);
     method public void startScan(android.net.wifi.WifiScanner.ScanSettings, android.net.wifi.WifiScanner.ScanListener, android.os.WorkSource);
-    method public void startTrackingBssids(android.net.wifi.WifiScanner.BssidInfo[], int, android.net.wifi.WifiScanner.BssidListener);
-    method public void startTrackingWifiChange(android.net.wifi.WifiScanner.WifiChangeListener);
+    method public deprecated void startTrackingBssids(android.net.wifi.WifiScanner.BssidInfo[], int, android.net.wifi.WifiScanner.BssidListener);
+    method public deprecated void startTrackingWifiChange(android.net.wifi.WifiScanner.WifiChangeListener);
     method public void stopBackgroundScan(android.net.wifi.WifiScanner.ScanListener);
     method public void stopScan(android.net.wifi.WifiScanner.ScanListener);
-    method public void stopTrackingBssids(android.net.wifi.WifiScanner.BssidListener);
-    method public void stopTrackingWifiChange(android.net.wifi.WifiScanner.WifiChangeListener);
+    method public deprecated void stopTrackingBssids(android.net.wifi.WifiScanner.BssidListener);
+    method public deprecated void stopTrackingWifiChange(android.net.wifi.WifiScanner.WifiChangeListener);
     field public static final int MAX_SCAN_PERIOD_MS = 1024000; // 0xfa000
     field public static final int MIN_SCAN_PERIOD_MS = 1000; // 0x3e8
     field public static final int REASON_DUPLICATE_REQEUST = -5; // 0xfffffffb
@@ -29355,7 +29355,7 @@
     method public abstract void onSuccess();
   }
 
-  public static class WifiScanner.BssidInfo {
+  public static deprecated class WifiScanner.BssidInfo {
     ctor public WifiScanner.BssidInfo();
     field public java.lang.String bssid;
     field public int frequencyHint;
@@ -29363,7 +29363,7 @@
     field public int low;
   }
 
-  public static abstract interface WifiScanner.BssidListener implements android.net.wifi.WifiScanner.ActionListener {
+  public static abstract deprecated interface WifiScanner.BssidListener implements android.net.wifi.WifiScanner.ActionListener {
     method public abstract void onFound(android.net.wifi.ScanResult[]);
     method public abstract void onLost(android.net.wifi.ScanResult[]);
   }
@@ -29373,7 +29373,7 @@
     field public int frequency;
   }
 
-  public static class WifiScanner.HotlistSettings implements android.os.Parcelable {
+  public static deprecated class WifiScanner.HotlistSettings implements android.os.Parcelable {
     ctor public WifiScanner.HotlistSettings();
     method public int describeContents();
     method public void writeToParcel(android.os.Parcel, int);
@@ -29427,12 +29427,12 @@
     field public int stepCount;
   }
 
-  public static abstract interface WifiScanner.WifiChangeListener implements android.net.wifi.WifiScanner.ActionListener {
+  public static abstract deprecated interface WifiScanner.WifiChangeListener implements android.net.wifi.WifiScanner.ActionListener {
     method public abstract void onChanging(android.net.wifi.ScanResult[]);
     method public abstract void onQuiescence(android.net.wifi.ScanResult[]);
   }
 
-  public static class WifiScanner.WifiChangeSettings implements android.os.Parcelable {
+  public static deprecated class WifiScanner.WifiChangeSettings implements android.os.Parcelable {
     ctor public WifiScanner.WifiChangeSettings();
     method public int describeContents();
     method public void writeToParcel(android.os.Parcel, int);
@@ -50733,7 +50733,6 @@
   }
 
   public final class AccessibilityManager {
-    method public boolean addAccessibilityServicesStateChangeListener(android.view.accessibility.AccessibilityManager.AccessibilityServicesStateChangeListener);
     method public boolean addAccessibilityStateChangeListener(android.view.accessibility.AccessibilityManager.AccessibilityStateChangeListener);
     method public boolean addTouchExplorationStateChangeListener(android.view.accessibility.AccessibilityManager.TouchExplorationStateChangeListener);
     method public deprecated java.util.List<android.content.pm.ServiceInfo> getAccessibilityServiceList();
@@ -50742,16 +50741,11 @@
     method public void interrupt();
     method public boolean isEnabled();
     method public boolean isTouchExplorationEnabled();
-    method public boolean removeAccessibilityServicesStateChangeListener(android.view.accessibility.AccessibilityManager.AccessibilityServicesStateChangeListener);
     method public boolean removeAccessibilityStateChangeListener(android.view.accessibility.AccessibilityManager.AccessibilityStateChangeListener);
     method public boolean removeTouchExplorationStateChangeListener(android.view.accessibility.AccessibilityManager.TouchExplorationStateChangeListener);
     method public void sendAccessibilityEvent(android.view.accessibility.AccessibilityEvent);
   }
 
-  public static abstract interface AccessibilityManager.AccessibilityServicesStateChangeListener {
-    method public abstract void onAccessibilityServicesStateChanged();
-  }
-
   public static abstract interface AccessibilityManager.AccessibilityStateChangeListener {
     method public abstract void onAccessibilityStateChanged(boolean);
   }
diff --git a/api/test-current.txt b/api/test-current.txt
index 3957532..6beff09 100644
--- a/api/test-current.txt
+++ b/api/test-current.txt
@@ -7114,7 +7114,7 @@
     method protected android.view.View getErrorView();
     method protected void prepareView(android.view.View);
     method public void setAppWidget(int, android.appwidget.AppWidgetProviderInfo);
-    method public void setAsyncExecutor(java.util.concurrent.Executor);
+    method public void setExecutor(java.util.concurrent.Executor);
     method public void updateAppWidget(android.widget.RemoteViews);
     method public void updateAppWidgetOptions(android.os.Bundle);
     method public void updateAppWidgetSize(android.os.Bundle, int, int, int, int);
@@ -47528,7 +47528,6 @@
   }
 
   public final class AccessibilityManager {
-    method public boolean addAccessibilityServicesStateChangeListener(android.view.accessibility.AccessibilityManager.AccessibilityServicesStateChangeListener);
     method public boolean addAccessibilityStateChangeListener(android.view.accessibility.AccessibilityManager.AccessibilityStateChangeListener);
     method public boolean addTouchExplorationStateChangeListener(android.view.accessibility.AccessibilityManager.TouchExplorationStateChangeListener);
     method public deprecated java.util.List<android.content.pm.ServiceInfo> getAccessibilityServiceList();
@@ -47537,16 +47536,11 @@
     method public void interrupt();
     method public boolean isEnabled();
     method public boolean isTouchExplorationEnabled();
-    method public boolean removeAccessibilityServicesStateChangeListener(android.view.accessibility.AccessibilityManager.AccessibilityServicesStateChangeListener);
     method public boolean removeAccessibilityStateChangeListener(android.view.accessibility.AccessibilityManager.AccessibilityStateChangeListener);
     method public boolean removeTouchExplorationStateChangeListener(android.view.accessibility.AccessibilityManager.TouchExplorationStateChangeListener);
     method public void sendAccessibilityEvent(android.view.accessibility.AccessibilityEvent);
   }
 
-  public static abstract interface AccessibilityManager.AccessibilityServicesStateChangeListener {
-    method public abstract void onAccessibilityServicesStateChanged();
-  }
-
   public static abstract interface AccessibilityManager.AccessibilityStateChangeListener {
     method public abstract void onAccessibilityStateChanged(boolean);
   }
diff --git a/core/java/android/app/FragmentManager.java b/core/java/android/app/FragmentManager.java
index b6a578b..508d704 100644
--- a/core/java/android/app/FragmentManager.java
+++ b/core/java/android/app/FragmentManager.java
@@ -1334,6 +1334,9 @@
                         f.performDestroyView();
                         dispatchOnFragmentViewDestroyed(f, false);
                         if (f.mView != null && f.mContainer != null) {
+                            // Stop any current animations:
+                            f.mView.clearAnimation();
+                            f.mContainer.endViewTransition(f.mView);
                             Animator anim = null;
                             if (mCurState > Fragment.INITIALIZING && !mDestroyed
                                     && f.mView.getVisibility() == View.VISIBLE
@@ -3009,6 +3012,7 @@
                 mExecutingActions = false;
             }
         }
+        execPendingActions();
     }
 
     /**
diff --git a/core/java/android/appwidget/AppWidgetHostView.java b/core/java/android/appwidget/AppWidgetHostView.java
index 624ec87..1242cb0 100644
--- a/core/java/android/appwidget/AppWidgetHostView.java
+++ b/core/java/android/appwidget/AppWidgetHostView.java
@@ -353,7 +353,7 @@
      *
      * @param executor the executor to use or null.
      */
-    public void setAsyncExecutor(Executor executor) {
+    public void setExecutor(Executor executor) {
         if (mLastExecutionSignal != null) {
             mLastExecutionSignal.cancel();
             mLastExecutionSignal = null;
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index 54915e8..bcf0b90 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -7538,7 +7538,11 @@
     @ViewDebug.ExportedProperty(mapping = {
             @ViewDebug.IntToString(from = IMPORTANT_FOR_AUTOFILL_AUTO, to = "auto"),
             @ViewDebug.IntToString(from = IMPORTANT_FOR_AUTOFILL_YES, to = "yes"),
-            @ViewDebug.IntToString(from = IMPORTANT_FOR_AUTOFILL_NO, to = "no")})
+            @ViewDebug.IntToString(from = IMPORTANT_FOR_AUTOFILL_NO, to = "no"),
+            @ViewDebug.IntToString(from = IMPORTANT_FOR_AUTOFILL_YES_EXCLUDE_DESCENDANTS,
+                to = "yesExcludeDescendants"),
+            @ViewDebug.IntToString(from = IMPORTANT_FOR_AUTOFILL_NO_EXCLUDE_DESCENDANTS,
+                to = "noExcludeDescendants")})
     public @AutofillImportance int getImportantForAutofill() {
         return (mPrivateFlags3
                 & PFLAG3_IMPORTANT_FOR_AUTOFILL_MASK) >> PFLAG3_IMPORTANT_FOR_AUTOFILL_SHIFT;
@@ -7550,7 +7554,8 @@
      * <p>See {@link #setImportantForAutofill(int)} for more info about this mode.
      *
      * @param mode {@link #IMPORTANT_FOR_AUTOFILL_AUTO}, {@link #IMPORTANT_FOR_AUTOFILL_YES},
-     * or {@link #IMPORTANT_FOR_AUTOFILL_NO}.
+     * {@link #IMPORTANT_FOR_AUTOFILL_NO}, {@link #IMPORTANT_FOR_AUTOFILL_YES_EXCLUDE_DESCENDANTS},
+     * or {@link #IMPORTANT_FOR_AUTOFILL_NO_EXCLUDE_DESCENDANTS}.
      *
      * @attr ref android.R.styleable#View_importantForAutofill
      */
diff --git a/core/java/android/view/accessibility/AccessibilityManager.java b/core/java/android/view/accessibility/AccessibilityManager.java
index 41f1df7..6c884c4 100644
--- a/core/java/android/view/accessibility/AccessibilityManager.java
+++ b/core/java/android/view/accessibility/AccessibilityManager.java
@@ -183,13 +183,17 @@
      * Listener for changes to the state of accessibility services. Changes include services being
      * enabled or disabled, or changes to the {@link AccessibilityServiceInfo} of a running service.
      * {@see #addAccessibilityServicesStateChangeListener}.
+     *
+     * @hide
      */
     public interface AccessibilityServicesStateChangeListener {
 
         /**
          * Called when the state of accessibility services changes.
+         *
+         * @param manager The manager that is calling back
          */
-        void onAccessibilityServicesStateChanged();
+        void onAccessibilityServicesStateChanged(AccessibilityManager manager);
     }
 
     /**
@@ -614,11 +618,13 @@
      *
      * @param listener The listener.
      * @return True if successfully registered.
+     *
+     * @hide
      */
-    public boolean addAccessibilityServicesStateChangeListener(
+    public void addAccessibilityServicesStateChangeListener(
             @NonNull AccessibilityServicesStateChangeListener listener) {
         // Final CopyOnWriteArrayList - no lock needed.
-        return mServicesStateChangeListeners.add(listener);
+        mServicesStateChangeListeners.add(listener);
     }
 
     /**
@@ -626,11 +632,13 @@
      *
      * @param listener The listener.
      * @return True if successfully unregistered.
+     *
+     * @hide
      */
-    public boolean removeAccessibilityServicesStateChangeListener(
+    public void removeAccessibilityServicesStateChangeListener(
             @NonNull AccessibilityServicesStateChangeListener listener) {
         // Final CopyOnWriteArrayList - no lock needed.
-        return mServicesStateChangeListeners.remove(listener);
+        mServicesStateChangeListeners.remove(listener);
     }
 
     /**
@@ -969,7 +977,7 @@
     private void handleNotifyServicesStateChanged() {
         // Listeners are a final CopyOnWriteArrayList, hence no lock needed.
         for (AccessibilityServicesStateChangeListener listener : mServicesStateChangeListeners) {
-            listener.onAccessibilityServicesStateChanged();
+            listener.onAccessibilityServicesStateChanged(this);
         }
     }
 
diff --git a/core/java/android/view/autofill/AutofillManager.java b/core/java/android/view/autofill/AutofillManager.java
index 8ed0762..e047ed2 100644
--- a/core/java/android/view/autofill/AutofillManager.java
+++ b/core/java/android/view/autofill/AutofillManager.java
@@ -91,7 +91,7 @@
      * android.service.autofill.FillCallback#onSuccess(android.service.autofill.FillResponse)} with
      * a {@code FillResponse} that requires authentication, the Intent that launches the
      * service authentication will contain the Bundle set by
-     * {@link android.service.autofill.FillResponse.Builder#setExtras(Bundle)} on this extra.
+     * {@link android.service.autofill.FillResponse.Builder#setClientState(Bundle)} on this extra.
      *
      * <p>
      * Type: {@link android.os.Bundle}
@@ -107,7 +107,7 @@
      *
      * @deprecated Use {@link android.service.autofill.FillRequest#FLAG_MANUAL_REQUEST}
      */
-    // TODO(b/33197203): remove
+    // TODO(b/33197203): remove (and change value of private flags)
     @Deprecated
     public static final int FLAG_MANUAL_REQUEST = 0x1;
 
diff --git a/core/java/android/widget/RemoteViewsAdapter.java b/core/java/android/widget/RemoteViewsAdapter.java
index 11e0a3f..0968652 100644
--- a/core/java/android/widget/RemoteViewsAdapter.java
+++ b/core/java/android/widget/RemoteViewsAdapter.java
@@ -47,11 +47,6 @@
 import java.util.LinkedList;
 import java.util.concurrent.Executor;
 
-import java.lang.ref.WeakReference;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.LinkedList;
-
 /**
  * An adapter to a RemoteViewsService which fetches and caches RemoteViews
  * to be later inflated as child views.
@@ -1114,7 +1109,7 @@
                 layout = (RemoteViewsFrameLayout) convertView;
             } else {
                 layout = new RemoteViewsFrameLayout(parent.getContext(), mCache);
-                layout.setAsyncExecutor(mAsyncViewLoadExecutor);
+                layout.setExecutor(mAsyncViewLoadExecutor);
             }
 
             if (isInCache) {
diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java
index 0fbb84b..16a31f1 100644
--- a/core/java/android/widget/TextView.java
+++ b/core/java/android/widget/TextView.java
@@ -10264,16 +10264,14 @@
                     positionInfoStartIndex + positionInfoLength,
                     viewportToContentHorizontalOffset(), viewportToContentVerticalOffset());
             CursorAnchorInfo cursorAnchorInfo = builder.setMatrix(null).build();
-            if (mTempRect == null) mTempRect = new Rect();
-            Rect viewBoundsInScreen = mTempRect;
-            info.getBoundsInScreen(viewBoundsInScreen);
+            int[] locationOnScreen = getLocationOnScreen();
             for (int i = 0; i < positionInfoLength; i++) {
                 int flags = cursorAnchorInfo.getCharacterBoundsFlags(positionInfoStartIndex + i);
                 if ((flags & FLAG_HAS_VISIBLE_REGION) == FLAG_HAS_VISIBLE_REGION) {
                     RectF bounds = cursorAnchorInfo
                             .getCharacterBounds(positionInfoStartIndex + i);
                     if (bounds != null) {
-                        bounds.offset(viewBoundsInScreen.left, viewBoundsInScreen.top);
+                        bounds.offset(locationOnScreen[0], locationOnScreen[1]);
                         boundingRects[i] = bounds;
                     }
                 }
diff --git a/core/tests/coretests/src/android/widget/AppWidgetHostViewTest.java b/core/tests/coretests/src/android/widget/AppWidgetHostViewTest.java
index 1e55fb1..4f31c4e 100644
--- a/core/tests/coretests/src/android/widget/AppWidgetHostViewTest.java
+++ b/core/tests/coretests/src/android/widget/AppWidgetHostViewTest.java
@@ -83,7 +83,7 @@
     @Test
     public void asyncInflation() throws Exception {
         RunnableList executor = new RunnableList();
-        mHostView.setAsyncExecutor(executor);
+        mHostView.setExecutor(executor);
 
         mHostView.updateAppWidget(mViews);
         assertNull(mHostView.findViewById(R.id.image));
@@ -100,7 +100,7 @@
     @Test
     public void asyncInflation_cancelled() throws Exception {
         RunnableList executor = new RunnableList();
-        mHostView.setAsyncExecutor(executor);
+        mHostView.setExecutor(executor);
 
         mHostView.updateAppWidget(mViews.clone());
         mHostView.updateAppWidget(mViews.clone());
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java b/packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java
index 5c9360a..30ff30f 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java
@@ -171,7 +171,14 @@
             mDisable1 = state1;
             mDisable2 = state2;
             mHandler.removeMessages(MSG_DISABLE);
-            mHandler.obtainMessage(MSG_DISABLE, state1, state2, animate).sendToTarget();
+            Message msg = mHandler.obtainMessage(MSG_DISABLE, state1, state2, animate);
+            if (Looper.myLooper() == mHandler.getLooper()) {
+                // If its the right looper execute immediately so hides can be handled quickly.
+                mHandler.handleMessage(msg);
+                msg.recycle();
+            } else {
+                msg.sendToTarget();
+            }
         }
     }
 
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarFragment.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarFragment.java
index fa404b5..4bfc16b 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarFragment.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarFragment.java
@@ -402,7 +402,7 @@
         ButtonDispatcher accessibilityButton = mNavigationBarView.getAccessibilityButton();
         accessibilityButton.setOnClickListener(this::onAccessibilityClick);
         accessibilityButton.setOnLongClickListener(this::onAccessibilityLongClick);
-        updateAccessibilityServicesState();
+        updateAccessibilityServicesState(mAccessibilityManager);
     }
 
     private boolean onHomeTouch(View v, MotionEvent event) {
@@ -565,7 +565,7 @@
         return true;
     }
 
-    private void updateAccessibilityServicesState() {
+    private void updateAccessibilityServicesState(AccessibilityManager accessibilityManager) {
         int requestingServices = 0;
         try {
             if (Settings.Secure.getIntForUser(mContentResolver,
@@ -579,7 +579,7 @@
         // AccessibilityManagerService resolves services for the current user since the local
         // AccessibilityManager is created from a Context with the INTERACT_ACROSS_USERS permission
         final List<AccessibilityServiceInfo> services =
-                mAccessibilityManager.getEnabledAccessibilityServiceList(
+                accessibilityManager.getEnabledAccessibilityServiceList(
                         AccessibilityServiceInfo.FEEDBACK_ALL_MASK);
         for (int i = services.size() - 1; i >= 0; --i) {
             AccessibilityServiceInfo info = services.get(i);
@@ -638,7 +638,7 @@
 
         @Override
         public void onChange(boolean selfChange) {
-            NavigationBarFragment.this.updateAccessibilityServicesState();
+            NavigationBarFragment.this.updateAccessibilityServicesState(mAccessibilityManager);
         }
     }
 
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicy.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicy.java
index bd16c96..5690495 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicy.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicy.java
@@ -561,12 +561,14 @@
         Intent browserIntent = getTaskIntent(taskId, userId);
         Notification.Builder builder = new Notification.Builder(mContext, NotificationChannels.GENERAL);
         if (browserIntent != null) {
+            // Make sure that this doesn't resolve back to an instant app
+            browserIntent.setComponent(null)
+                    .setPackage(null)
+                    .addFlags(Intent.FLAG_IGNORE_EPHEMERAL)
+                    .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+
             PendingIntent pendingIntent = PendingIntent.getActivity(mContext,
                     0 /* requestCode */, browserIntent, 0 /* flags */);
-            browserIntent.setComponent(null);
-            browserIntent.addFlags(Intent.FLAG_IGNORE_EPHEMERAL);
-            browserIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
-
             ComponentName aiaComponent = null;
             try {
                 aiaComponent = AppGlobals.getPackageManager().getInstantAppInstallerComponent();
diff --git a/services/autofill/java/com/android/server/autofill/AutofillManagerServiceImpl.java b/services/autofill/java/com/android/server/autofill/AutofillManagerServiceImpl.java
index e274e18..85fc580 100644
--- a/services/autofill/java/com/android/server/autofill/AutofillManagerServiceImpl.java
+++ b/services/autofill/java/com/android/server/autofill/AutofillManagerServiceImpl.java
@@ -49,6 +49,7 @@
 import android.service.autofill.AutofillService;
 import android.service.autofill.AutofillServiceInfo;
 import android.service.autofill.FillEventHistory;
+import android.service.autofill.FillEventHistory.Event;
 import android.service.autofill.FillRequest;
 import android.service.autofill.FillResponse;
 import android.service.autofill.IAutoFillService;
@@ -521,8 +522,7 @@
      */
     void setAuthenticationSelected() {
         synchronized (mLock) {
-            mEventHistory.addEvent(
-                    new FillEventHistory.Event(FillEventHistory.Event.TYPE_AUTHENTICATION_SELECTED, null));
+            mEventHistory.addEvent(new Event(Event.TYPE_AUTHENTICATION_SELECTED, null));
         }
     }
 
@@ -531,8 +531,8 @@
      */
     void setDatasetAuthenticationSelected(@Nullable String selectedDataset) {
         synchronized (mLock) {
-            mEventHistory.addEvent(new FillEventHistory.Event(
-                    FillEventHistory.Event.TYPE_DATASET_AUTHENTICATION_SELECTED, selectedDataset));
+            mEventHistory.addEvent(
+                    new Event(Event.TYPE_DATASET_AUTHENTICATION_SELECTED, selectedDataset));
         }
     }
 
@@ -541,7 +541,7 @@
      */
     void setSaveShown() {
         synchronized (mLock) {
-            mEventHistory.addEvent(new FillEventHistory.Event(FillEventHistory.Event.TYPE_SAVE_SHOWN, null));
+            mEventHistory.addEvent(new Event(Event.TYPE_SAVE_SHOWN, null));
         }
     }
 
@@ -550,8 +550,7 @@
      */
     void setDatasetSelected(@Nullable String selectedDataset) {
         synchronized (mLock) {
-            mEventHistory.addEvent(
-                    new FillEventHistory.Event(FillEventHistory.Event.TYPE_DATASET_SELECTED, selectedDataset));
+            mEventHistory.addEvent(new Event(Event.TYPE_DATASET_SELECTED, selectedDataset));
         }
     }
 
@@ -601,7 +600,8 @@
             }
         }
 
-        if (mEventHistory == null || mEventHistory.getEvents().size() == 0) {
+        if (mEventHistory == null || mEventHistory.getEvents() == null
+                || mEventHistory.getEvents().size() == 0) {
             pw.print(prefix); pw.println("No event on last fill response");
         } else {
             pw.print(prefix); pw.println("Events of last fill response:");
@@ -609,7 +609,7 @@
 
             int numEvents = mEventHistory.getEvents().size();
             for (int i = 0; i < numEvents; i++) {
-                FillEventHistory.Event event = mEventHistory.getEvents().get(i);
+                final Event event = mEventHistory.getEvents().get(i);
                 pw.println("  " + i + ": eventType=" + event.getType() + " datasetId="
                         + event.getDatasetId());
             }
diff --git a/services/autofill/java/com/android/server/autofill/Session.java b/services/autofill/java/com/android/server/autofill/Session.java
index 2b99614..d92ac74 100644
--- a/services/autofill/java/com/android/server/autofill/Session.java
+++ b/services/autofill/java/com/android/server/autofill/Session.java
@@ -17,7 +17,7 @@
 
 package com.android.server.autofill;
 
-import static android.view.autofill.AutofillManager.FLAG_MANUAL_REQUEST;
+import static android.service.autofill.FillRequest.FLAG_MANUAL_REQUEST;
 import static android.view.autofill.AutofillManager.FLAG_START_SESSION;
 import static android.view.autofill.AutofillManager.FLAG_VALUE_CHANGED;
 import static android.view.autofill.AutofillManager.FLAG_VIEW_ENTERED;
diff --git a/services/core/java/com/android/server/audio/AudioService.java b/services/core/java/com/android/server/audio/AudioService.java
index aa1b74c..d2d69cb 100644
--- a/services/core/java/com/android/server/audio/AudioService.java
+++ b/services/core/java/com/android/server/audio/AudioService.java
@@ -6098,9 +6098,7 @@
 
     // implementation of AccessibilityServicesStateChangeListener
     @Override
-    public void onAccessibilityServicesStateChanged() {
-        final AccessibilityManager accessibilityManager =
-                (AccessibilityManager) mContext.getSystemService(Context.ACCESSIBILITY_SERVICE);
+    public void onAccessibilityServicesStateChanged(AccessibilityManager accessibilityManager) {
         updateA11yVolumeAlias(accessibilityManager.isAccessibilityVolumeStreamActive());
     }
 
diff --git a/wifi/java/android/net/wifi/WifiScanner.java b/wifi/java/android/net/wifi/WifiScanner.java
index 40e34b1..c02ceef 100644
--- a/wifi/java/android/net/wifi/WifiScanner.java
+++ b/wifi/java/android/net/wifi/WifiScanner.java
@@ -906,6 +906,7 @@
     }
 
     /** specifies information about an access point of interest */
+    @Deprecated
     public static class BssidInfo {
         /** bssid of the access point; in XX:XX:XX:XX:XX:XX format */
         public String bssid;
@@ -919,6 +920,7 @@
 
     /** @hide */
     @SystemApi
+    @Deprecated
     public static class WifiChangeSettings implements Parcelable {
         public int rssiSampleSize;                          /* sample size for RSSI averaging */
         public int lostApSampleSize;                        /* samples to confirm AP's loss */
@@ -959,6 +961,7 @@
      * @param periodInMs indicates period of scan to find changes
      * @param bssidInfos access points to watch
      */
+    @Deprecated
     public void configureWifiChange(
             int rssiSampleSize,                             /* sample size for RSSI averaging */
             int lostApSampleSize,                           /* samples to confirm AP's loss */
@@ -974,6 +977,7 @@
     /**
      * interface to get wifi change events on; use this on {@link #startTrackingWifiChange}
      */
+    @Deprecated
     public interface WifiChangeListener extends ActionListener {
         /** indicates that changes were detected in wifi environment
          * @param results indicate the access points that exhibited change
@@ -990,6 +994,7 @@
      * @param listener object to report events on; this object must be unique and must also be
      *                 provided on {@link #stopTrackingWifiChange}
      */
+    @Deprecated
     public void startTrackingWifiChange(WifiChangeListener listener) {
         throw new UnsupportedOperationException();
     }
@@ -999,17 +1004,20 @@
      * @param listener object that was provided to report events on {@link
      * #stopTrackingWifiChange}
      */
+    @Deprecated
     public void stopTrackingWifiChange(WifiChangeListener listener) {
         throw new UnsupportedOperationException();
     }
 
     /** @hide */
     @SystemApi
+    @Deprecated
     public void configureWifiChange(WifiChangeSettings settings) {
         throw new UnsupportedOperationException();
     }
 
     /** interface to receive hotlist events on; use this on {@link #setHotlist} */
+    @Deprecated
     public static interface BssidListener extends ActionListener {
         /** indicates that access points were found by on going scans
          * @param results list of scan results, one for each access point visible currently
@@ -1023,6 +1031,7 @@
 
     /** @hide */
     @SystemApi
+    @Deprecated
     public static class HotlistSettings implements Parcelable {
         public BssidInfo[] bssidInfos;
         public int apLostThreshold;
@@ -1057,6 +1066,7 @@
      * @param listener object provided to report events on; this object must be unique and must
      *                 also be provided on {@link #stopTrackingBssids}
      */
+    @Deprecated
     public void startTrackingBssids(BssidInfo[] bssidInfos,
                                     int apLostThreshold, BssidListener listener) {
         throw new UnsupportedOperationException();
@@ -1066,6 +1076,7 @@
      * remove tracking of interesting access points
      * @param listener same object provided in {@link #startTrackingBssids}
      */
+    @Deprecated
     public void stopTrackingBssids(BssidListener listener) {
         throw new UnsupportedOperationException();
     }