Merge "Resolve race condition in old API message handler"
diff --git a/Android.bp b/Android.bp
index 028e8a4..1586440 100644
--- a/Android.bp
+++ b/Android.bp
@@ -801,6 +801,40 @@
     },
 }
 
+// ====  java proto device library (for test only)  ==============================
+java_library {
+    name: "platformprotosnano",
+    proto: {
+        type: "nano",
+        output_params: ["store_unknown_fields=true"],
+        include_dirs: ["external/protobuf/src"],
+    },
+
+    sdk_version: "current",
+    srcs: [
+        "core/proto/**/*.proto",
+        "libs/incident/proto/android/os/**/*.proto",
+    ],
+}
+
+// ====  java proto device library (for test only)  ==============================
+java_library {
+    name: "platformprotoslite",
+    proto: {
+        type: "lite",
+        include_dirs: ["external/protobuf/src"],
+    },
+
+    srcs: [
+        "core/proto/**/*.proto",
+        "libs/incident/proto/android/os/**/*.proto",
+    ],
+    // Protos have lots of MissingOverride and similar.
+    errorprone: {
+        javacflags: ["-XepDisableAllChecks"],
+    },
+}
+
 // ====  c++ proto device library  ==============================
 cc_library {
     name: "libplatformprotos",
@@ -1022,10 +1056,6 @@
         ":openjdk_javadoc_files",
         ":non_openjdk_javadoc_files",
         ":android_icu4j_src_files_for_docs",
-        ":gen-ojluni-jaif-annotated-srcs",
-    ],
-    exclude_srcs: [
-        ":annotated_ojluni_files",
     ],
     srcs_lib: "framework",
     srcs_lib_whitelist_dirs: frameworks_base_subdirs,
@@ -1072,13 +1102,9 @@
         ":openjdk_javadoc_files",
         ":non_openjdk_javadoc_files",
         ":android_icu4j_src_files_for_docs",
-        ":gen-ojluni-jaif-annotated-srcs",
         "test-mock/src/**/*.java",
         "test-runner/src/**/*.java",
     ],
-    exclude_srcs: [
-        ":annotated_ojluni_files",
-    ],
     srcs_lib: "framework",
     srcs_lib_whitelist_dirs: frameworks_base_subdirs,
     srcs_lib_whitelist_pkgs: packages_to_document,
@@ -1457,10 +1483,6 @@
         ":openjdk_javadoc_files",
         ":non_openjdk_javadoc_files",
         ":android_icu4j_src_files_for_docs",
-        ":gen-ojluni-jaif-annotated-srcs",
-    ],
-    exclude_srcs: [
-        ":annotated_ojluni_files",
     ],
     srcs_lib: "framework",
     srcs_lib_whitelist_dirs: frameworks_base_subdirs,
diff --git a/Android.mk b/Android.mk
index edbb94d..29454e4 100644
--- a/Android.mk
+++ b/Android.mk
@@ -321,36 +321,6 @@
 	$(hide) mkdir -p $(OUT_DOCS)/offline-sdk
 	( unzip -qo $< -d $(OUT_DOCS)/offline-sdk && touch -f $@ ) || exit 1
 
-# ====  java proto device library (for test only)  ==============================
-include $(CLEAR_VARS)
-LOCAL_MODULE := platformprotosnano
-LOCAL_MODULE_TAGS := tests
-LOCAL_PROTOC_OPTIMIZE_TYPE := nano
-LOCAL_PROTOC_FLAGS := \
-    -Iexternal/protobuf/src
-LOCAL_PROTO_JAVA_OUTPUT_PARAMS := \
-    store_unknown_fields = true
-LOCAL_SDK_VERSION := current
-LOCAL_SRC_FILES := \
-    $(call all-proto-files-under, core/proto) \
-    $(call all-proto-files-under, libs/incident/proto/android/os)
-include $(BUILD_STATIC_JAVA_LIBRARY)
-
-
-# ====  java proto device library (for test only)  ==============================
-include $(CLEAR_VARS)
-LOCAL_MODULE := platformprotoslite
-LOCAL_MODULE_TAGS := tests
-LOCAL_PROTOC_OPTIMIZE_TYPE := lite
-LOCAL_PROTOC_FLAGS := \
-    -Iexternal/protobuf/src
-LOCAL_SRC_FILES := \
-    $(call all-proto-files-under, core/proto) \
-    $(call all-proto-files-under, libs/incident/proto/android/os)
-# Protos have lots of MissingOverride and similar.
-LOCAL_ERROR_PRONE_FLAGS := -XepDisableAllChecks
-include $(BUILD_STATIC_JAVA_LIBRARY)
-
 # ==== hiddenapi lists =======================================
 include $(CLEAR_VARS)
 
diff --git a/api/current.txt b/api/current.txt
index 300ab3a..fc595ac 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -39005,6 +39005,7 @@
   public static class CustomDescription.Builder {
     ctor public CustomDescription.Builder(android.widget.RemoteViews);
     method public android.service.autofill.CustomDescription.Builder addChild(int, android.service.autofill.Transformation);
+    method public android.service.autofill.CustomDescription.Builder addOnClickAction(int, android.service.autofill.OnClickAction);
     method public android.service.autofill.CustomDescription.Builder batchUpdate(android.service.autofill.Validator, android.service.autofill.BatchUpdates);
     method public android.service.autofill.CustomDescription build();
   }
@@ -39143,6 +39144,9 @@
     field public static final android.os.Parcelable.Creator<android.service.autofill.LuhnChecksumValidator> CREATOR;
   }
 
+  public abstract interface OnClickAction {
+  }
+
   public final class RegexValidator implements android.os.Parcelable android.service.autofill.Validator {
     ctor public RegexValidator(android.view.autofill.AutofillId, java.util.regex.Pattern);
     method public int describeContents();
@@ -39238,6 +39242,18 @@
     method public static android.service.autofill.Validator or(android.service.autofill.Validator...);
   }
 
+  public final class VisibilitySetterAction implements android.service.autofill.OnClickAction android.os.Parcelable {
+    method public int describeContents();
+    method public void writeToParcel(android.os.Parcel, int);
+    field public static final android.os.Parcelable.Creator<android.service.autofill.VisibilitySetterAction> CREATOR;
+  }
+
+  public static class VisibilitySetterAction.Builder {
+    ctor public VisibilitySetterAction.Builder(int, int);
+    method public android.service.autofill.VisibilitySetterAction build();
+    method public android.service.autofill.VisibilitySetterAction.Builder setVisibility(int, int);
+  }
+
 }
 
 package android.service.carrier {
diff --git a/api/test-current.txt b/api/test-current.txt
index 35c6c48..1657de5 100644
--- a/api/test-current.txt
+++ b/api/test-current.txt
@@ -998,6 +998,10 @@
     method public void apply(android.service.autofill.ValueFinder, android.widget.RemoteViews, int) throws java.lang.Exception;
   }
 
+  public final class CustomDescription implements android.os.Parcelable {
+    method public android.util.SparseArray<android.service.autofill.InternalOnClickAction> getActions();
+  }
+
   public final class DateTransformation extends android.service.autofill.InternalTransformation implements android.os.Parcelable android.service.autofill.Transformation {
     method public void apply(android.service.autofill.ValueFinder, android.widget.RemoteViews, int) throws java.lang.Exception;
   }
@@ -1014,6 +1018,11 @@
     method public void apply(android.service.autofill.ValueFinder, android.widget.RemoteViews, int) throws java.lang.Exception;
   }
 
+  public abstract class InternalOnClickAction implements android.service.autofill.OnClickAction android.os.Parcelable {
+    ctor public InternalOnClickAction();
+    method public abstract void onClick(android.view.ViewGroup);
+  }
+
   public abstract class InternalSanitizer implements android.os.Parcelable android.service.autofill.Sanitizer {
     ctor public InternalSanitizer();
   }
@@ -1044,6 +1053,10 @@
     method public abstract android.view.autofill.AutofillValue findRawValueByAutofillId(android.view.autofill.AutofillId);
   }
 
+  public final class VisibilitySetterAction extends android.service.autofill.InternalOnClickAction implements android.service.autofill.OnClickAction android.os.Parcelable {
+    method public void onClick(android.view.ViewGroup);
+  }
+
 }
 
 package android.service.notification {
diff --git a/config/hiddenapi-light-greylist.txt b/config/hiddenapi-light-greylist.txt
index c84142a..3a96cd3 100644
--- a/config/hiddenapi-light-greylist.txt
+++ b/config/hiddenapi-light-greylist.txt
@@ -455,6 +455,59 @@
 Landroid/database/IContentObserver;->onChange(ZLandroid/net/Uri;I)V
 Landroid/hardware/biometrics/BiometricConstants;->BIOMETRIC_ERROR_VENDOR_BASE:I
 Landroid/hardware/biometrics/BiometricFingerprintConstants;->FINGERPRINT_ERROR_VENDOR_BASE:I
+Landroid/hardware/camera2/CameraCharacteristics;->CONTROL_AVAILABLE_HIGH_SPEED_VIDEO_CONFIGURATIONS:Landroid/hardware/camera2/CameraCharacteristics$Key;
+Landroid/hardware/camera2/CameraCharacteristics;->CONTROL_MAX_REGIONS:Landroid/hardware/camera2/CameraCharacteristics$Key;
+Landroid/hardware/camera2/CameraCharacteristics;->DEPTH_AVAILABLE_DEPTH_MIN_FRAME_DURATIONS:Landroid/hardware/camera2/CameraCharacteristics$Key;
+Landroid/hardware/camera2/CameraCharacteristics;->DEPTH_AVAILABLE_DEPTH_STALL_DURATIONS:Landroid/hardware/camera2/CameraCharacteristics$Key;
+Landroid/hardware/camera2/CameraCharacteristics;->DEPTH_AVAILABLE_DEPTH_STREAM_CONFIGURATIONS:Landroid/hardware/camera2/CameraCharacteristics$Key;
+Landroid/hardware/camera2/CameraCharacteristics;->LED_AVAILABLE_LEDS:Landroid/hardware/camera2/CameraCharacteristics$Key;
+Landroid/hardware/camera2/CameraCharacteristics;->LENS_INFO_SHADING_MAP_SIZE:Landroid/hardware/camera2/CameraCharacteristics$Key;
+Landroid/hardware/camera2/CameraCharacteristics;->LOGICAL_MULTI_CAMERA_PHYSICAL_IDS:Landroid/hardware/camera2/CameraCharacteristics$Key;
+Landroid/hardware/camera2/CameraCharacteristics;->QUIRKS_USE_PARTIAL_RESULT:Landroid/hardware/camera2/CameraCharacteristics$Key;
+Landroid/hardware/camera2/CameraCharacteristics;->REQUEST_AVAILABLE_CHARACTERISTICS_KEYS:Landroid/hardware/camera2/CameraCharacteristics$Key;
+Landroid/hardware/camera2/CameraCharacteristics;->REQUEST_AVAILABLE_PHYSICAL_CAMERA_REQUEST_KEYS:Landroid/hardware/camera2/CameraCharacteristics$Key;
+Landroid/hardware/camera2/CameraCharacteristics;->REQUEST_AVAILABLE_REQUEST_KEYS:Landroid/hardware/camera2/CameraCharacteristics$Key;
+Landroid/hardware/camera2/CameraCharacteristics;->REQUEST_AVAILABLE_RESULT_KEYS:Landroid/hardware/camera2/CameraCharacteristics$Key;
+Landroid/hardware/camera2/CameraCharacteristics;->REQUEST_AVAILABLE_SESSION_KEYS:Landroid/hardware/camera2/CameraCharacteristics$Key;
+Landroid/hardware/camera2/CameraCharacteristics;->REQUEST_MAX_NUM_OUTPUT_STREAMS:Landroid/hardware/camera2/CameraCharacteristics$Key;
+Landroid/hardware/camera2/CameraCharacteristics;->SCALER_AVAILABLE_FORMATS:Landroid/hardware/camera2/CameraCharacteristics$Key;
+Landroid/hardware/camera2/CameraCharacteristics;->SCALER_AVAILABLE_INPUT_OUTPUT_FORMATS_MAP:Landroid/hardware/camera2/CameraCharacteristics$Key;
+Landroid/hardware/camera2/CameraCharacteristics;->SCALER_AVAILABLE_JPEG_MIN_DURATIONS:Landroid/hardware/camera2/CameraCharacteristics$Key;
+Landroid/hardware/camera2/CameraCharacteristics;->SCALER_AVAILABLE_JPEG_SIZES:Landroid/hardware/camera2/CameraCharacteristics$Key;
+Landroid/hardware/camera2/CameraCharacteristics;->SCALER_AVAILABLE_MIN_FRAME_DURATIONS:Landroid/hardware/camera2/CameraCharacteristics$Key;
+Landroid/hardware/camera2/CameraCharacteristics;->SCALER_AVAILABLE_PROCESSED_MIN_DURATIONS:Landroid/hardware/camera2/CameraCharacteristics$Key;
+Landroid/hardware/camera2/CameraCharacteristics;->SCALER_AVAILABLE_PROCESSED_SIZES:Landroid/hardware/camera2/CameraCharacteristics$Key;
+Landroid/hardware/camera2/CameraCharacteristics;->SCALER_AVAILABLE_STALL_DURATIONS:Landroid/hardware/camera2/CameraCharacteristics$Key;
+Landroid/hardware/camera2/CameraCharacteristics;->SCALER_AVAILABLE_STREAM_CONFIGURATIONS:Landroid/hardware/camera2/CameraCharacteristics$Key;
+Landroid/hardware/camera2/CaptureRequest;->JPEG_GPS_COORDINATES:Landroid/hardware/camera2/CaptureRequest$Key;
+Landroid/hardware/camera2/CaptureRequest;->JPEG_GPS_PROCESSING_METHOD:Landroid/hardware/camera2/CaptureRequest$Key;
+Landroid/hardware/camera2/CaptureRequest;->JPEG_GPS_TIMESTAMP:Landroid/hardware/camera2/CaptureRequest$Key;
+Landroid/hardware/camera2/CaptureRequest;->LED_TRANSMIT:Landroid/hardware/camera2/CaptureRequest$Key;
+Landroid/hardware/camera2/CaptureRequest;->REQUEST_ID:Landroid/hardware/camera2/CaptureRequest$Key;
+Landroid/hardware/camera2/CaptureRequest;->TONEMAP_CURVE_BLUE:Landroid/hardware/camera2/CaptureRequest$Key;
+Landroid/hardware/camera2/CaptureRequest;->TONEMAP_CURVE_GREEN:Landroid/hardware/camera2/CaptureRequest$Key;
+Landroid/hardware/camera2/CaptureRequest;->TONEMAP_CURVE_RED:Landroid/hardware/camera2/CaptureRequest$Key;
+Landroid/hardware/camera2/CaptureResult;->JPEG_GPS_COORDINATES:Landroid/hardware/camera2/CaptureResult$Key;
+Landroid/hardware/camera2/CaptureResult;->JPEG_GPS_PROCESSING_METHOD:Landroid/hardware/camera2/CaptureResult$Key;
+Landroid/hardware/camera2/CaptureResult;->JPEG_GPS_TIMESTAMP:Landroid/hardware/camera2/CaptureResult$Key;
+Landroid/hardware/camera2/CaptureResult;->LED_TRANSMIT:Landroid/hardware/camera2/CaptureResult$Key;
+Landroid/hardware/camera2/CaptureResult;->QUIRKS_PARTIAL_RESULT:Landroid/hardware/camera2/CaptureResult$Key;
+Landroid/hardware/camera2/CaptureResult;->REQUEST_FRAME_COUNT:Landroid/hardware/camera2/CaptureResult$Key;
+Landroid/hardware/camera2/CaptureResult;->REQUEST_ID:Landroid/hardware/camera2/CaptureResult$Key;
+Landroid/hardware/camera2/CaptureResult;->STATISTICS_FACE_IDS:Landroid/hardware/camera2/CaptureResult$Key;
+Landroid/hardware/camera2/CaptureResult;->STATISTICS_FACE_LANDMARKS:Landroid/hardware/camera2/CaptureResult$Key;
+Landroid/hardware/camera2/CaptureResult;->STATISTICS_FACE_RECTANGLES:Landroid/hardware/camera2/CaptureResult$Key;
+Landroid/hardware/camera2/CaptureResult;->STATISTICS_FACE_SCORES:Landroid/hardware/camera2/CaptureResult$Key;
+Landroid/hardware/camera2/CaptureResult;->STATISTICS_LENS_SHADING_MAP:Landroid/hardware/camera2/CaptureResult$Key;
+Landroid/hardware/camera2/CaptureResult;->STATISTICS_OIS_TIMESTAMPS:Landroid/hardware/camera2/CaptureResult$Key;
+Landroid/hardware/camera2/CaptureResult;->STATISTICS_OIS_X_SHIFTS:Landroid/hardware/camera2/CaptureResult$Key;
+Landroid/hardware/camera2/CaptureResult;->STATISTICS_OIS_Y_SHIFTS:Landroid/hardware/camera2/CaptureResult$Key;
+Landroid/hardware/camera2/CaptureResult;->STATISTICS_PREDICTED_COLOR_GAINS:Landroid/hardware/camera2/CaptureResult$Key;
+Landroid/hardware/camera2/CaptureResult;->STATISTICS_PREDICTED_COLOR_TRANSFORM:Landroid/hardware/camera2/CaptureResult$Key;
+Landroid/hardware/camera2/CaptureResult;->SYNC_FRAME_NUMBER:Landroid/hardware/camera2/CaptureResult$Key;
+Landroid/hardware/camera2/CaptureResult;->TONEMAP_CURVE_BLUE:Landroid/hardware/camera2/CaptureResult$Key;
+Landroid/hardware/camera2/CaptureResult;->TONEMAP_CURVE_GREEN:Landroid/hardware/camera2/CaptureResult$Key;
+Landroid/hardware/camera2/CaptureResult;->TONEMAP_CURVE_RED:Landroid/hardware/camera2/CaptureResult$Key;
 Landroid/hardware/display/IDisplayManager$Stub;->asInterface(Landroid/os/IBinder;)Landroid/hardware/display/IDisplayManager;
 Landroid/hardware/display/IDisplayManager;->getDisplayInfo(I)Landroid/view/DisplayInfo;
 Landroid/hardware/fingerprint/IFingerprintService$Stub$Proxy;-><init>(Landroid/os/IBinder;)V
@@ -1670,628 +1723,9 @@
 Landroid/webkit/IWebViewUpdateService;->getCurrentWebViewPackageName()Ljava/lang/String;
 Landroid/webkit/IWebViewUpdateService;->getValidWebViewPackages()[Landroid/webkit/WebViewProviderInfo;
 Landroid/webkit/IWebViewUpdateService;->isFallbackPackage(Ljava/lang/String;)Z
-Landroid/widget/AbsListView$FlingRunnable;->endFling()V
-Landroid/widget/AbsListView$FlingRunnable;->mScroller:Landroid/widget/OverScroller;
-Landroid/widget/AbsListView$FlingRunnable;->start(I)V
-Landroid/widget/AbsListView$LayoutParams;->scrappedFromPosition:I
-Landroid/widget/AbsListView$LayoutParams;->viewType:I
-Landroid/widget/AbsListView$RecycleBin;->clear()V
-Landroid/widget/AbsListView$RecycleBin;->mRecyclerListener:Landroid/widget/AbsListView$RecyclerListener;
-Landroid/widget/AbsListView$SavedState;->firstId:J
-Landroid/widget/AbsListView$SavedState;->viewTop:I
-Landroid/widget/AbsListView;->canScrollDown()Z
-Landroid/widget/AbsListView;->canScrollUp()Z
-Landroid/widget/AbsListView;->findMotionRow(I)I
-Landroid/widget/AbsListView;->invokeOnItemScrollListener()V
-Landroid/widget/AbsListView;->isVerticalScrollBarHidden()Z
-Landroid/widget/AbsListView;->mActivePointerId:I
-Landroid/widget/AbsListView;->mAdapter:Landroid/widget/ListAdapter;
-Landroid/widget/AbsListView;->mChoiceActionMode:Landroid/view/ActionMode;
-Landroid/widget/AbsListView;->mContextMenuInfo:Landroid/view/ContextMenu$ContextMenuInfo;
-Landroid/widget/AbsListView;->mDataSetObserver:Landroid/widget/AbsListView$AdapterDataSetObserver;
-Landroid/widget/AbsListView;->mEdgeGlowBottom:Landroid/widget/EdgeEffect;
-Landroid/widget/AbsListView;->mEdgeGlowTop:Landroid/widget/EdgeEffect;
-Landroid/widget/AbsListView;->mFastScroll:Landroid/widget/FastScroller;
-Landroid/widget/AbsListView;->mFlingRunnable:Landroid/widget/AbsListView$FlingRunnable;
-Landroid/widget/AbsListView;->mIsChildViewEnabled:Z
-Landroid/widget/AbsListView;->mLayoutMode:I
-Landroid/widget/AbsListView;->mMaximumVelocity:I
-Landroid/widget/AbsListView;->mMotionPosition:I
-Landroid/widget/AbsListView;->mMotionY:I
-Landroid/widget/AbsListView;->mOnScrollListener:Landroid/widget/AbsListView$OnScrollListener;
-Landroid/widget/AbsListView;->mOverflingDistance:I
-Landroid/widget/AbsListView;->mOverscrollDistance:I
-Landroid/widget/AbsListView;->mPendingCheckForLongPress:Landroid/widget/AbsListView$CheckForLongPress;
-Landroid/widget/AbsListView;->mPendingCheckForTap:Landroid/widget/AbsListView$CheckForTap;
-Landroid/widget/AbsListView;->mPopup:Landroid/widget/PopupWindow;
-Landroid/widget/AbsListView;->mPositionScroller:Landroid/widget/AbsListView$AbsPositionScroller;
-Landroid/widget/AbsListView;->mRecycler:Landroid/widget/AbsListView$RecycleBin;
-Landroid/widget/AbsListView;->mSelectionBottomPadding:I
-Landroid/widget/AbsListView;->mSelectionTopPadding:I
-Landroid/widget/AbsListView;->mSelector:Landroid/graphics/drawable/Drawable;
-Landroid/widget/AbsListView;->mSelectorPosition:I
-Landroid/widget/AbsListView;->mSelectorRect:Landroid/graphics/Rect;
-Landroid/widget/AbsListView;->mTouchMode:I
-Landroid/widget/AbsListView;->mTouchSlop:I
-Landroid/widget/AbsListView;->mVelocityTracker:Landroid/view/VelocityTracker;
-Landroid/widget/AbsListView;->performLongPress(Landroid/view/View;IJ)Z
-Landroid/widget/AbsListView;->performLongPress(Landroid/view/View;IJFF)Z
-Landroid/widget/AbsListView;->positionSelector(ILandroid/view/View;ZFF)V
-Landroid/widget/AbsListView;->reportScrollStateChange(I)V
-Landroid/widget/AbsListView;->resurrectSelectionIfNeeded()Z
-Landroid/widget/AbsListView;->smoothScrollBy(IIZZ)V
-Landroid/widget/AbsListView;->trackMotionScroll(II)Z
-Landroid/widget/AbsListView;->updateSelectorState()V
-Landroid/widget/AbsSeekBar;->drawThumb(Landroid/graphics/Canvas;)V
-Landroid/widget/AbsSeekBar;->mDisabledAlpha:F
-Landroid/widget/AbsSeekBar;->mIsDragging:Z
-Landroid/widget/AbsSeekBar;->mIsUserSeekable:Z
-Landroid/widget/AbsSeekBar;->mSplitTrack:Z
-Landroid/widget/AbsSeekBar;->mThumb:Landroid/graphics/drawable/Drawable;
-Landroid/widget/AbsSeekBar;->mTouchProgressOffset:F
-Landroid/widget/AbsSeekBar;->trackTouchEvent(Landroid/view/MotionEvent;)V
-Landroid/widget/ActionMenuPresenter;->dismissPopupMenus()Z
-Landroid/widget/ActionMenuPresenter;->isOverflowMenuShowing()Z
-Landroid/widget/ActionMenuPresenter;->onRestoreInstanceState(Landroid/os/Parcelable;)V
-Landroid/widget/ActionMenuPresenter;->onSaveInstanceState()Landroid/os/Parcelable;
-Landroid/widget/ActionMenuView$ActionMenuChildView;->needsDividerBefore()Z
-Landroid/widget/ActionMenuView$LayoutParams;->cellsUsed:I
-Landroid/widget/ActionMenuView$LayoutParams;->expandable:Z
-Landroid/widget/ActionMenuView$LayoutParams;->expanded:Z
-Landroid/widget/ActionMenuView$LayoutParams;->extraPixels:I
-Landroid/widget/ActionMenuView$LayoutParams;->isOverflowButton:Z
-Landroid/widget/ActionMenuView$LayoutParams;->preventEdgeOffset:Z
-Landroid/widget/ActionMenuView;->hasDividerBeforeChildAt(I)Z
-Landroid/widget/ActionMenuView;->isOverflowMenuShowPending()Z
-Landroid/widget/ActionMenuView;->isOverflowReserved()Z
-Landroid/widget/ActionMenuView;->peekMenu()Lcom/android/internal/view/menu/MenuBuilder;
-Landroid/widget/ActionMenuView;->setExpandedActionViewsExclusive(Z)V
-Landroid/widget/ActionMenuView;->setMenuCallbacks(Lcom/android/internal/view/menu/MenuPresenter$Callback;Lcom/android/internal/view/menu/MenuBuilder$Callback;)V
-Landroid/widget/ActivityChooserModel;->chooseActivity(I)Landroid/content/Intent;
-Landroid/widget/ActivityChooserModel;->get(Landroid/content/Context;Ljava/lang/String;)Landroid/widget/ActivityChooserModel;
-Landroid/widget/ActivityChooserModel;->getActivity(I)Landroid/content/pm/ResolveInfo;
-Landroid/widget/ActivityChooserModel;->getActivityCount()I
-Landroid/widget/ActivityChooserModel;->setIntent(Landroid/content/Intent;)V
-Landroid/widget/ActivityChooserModel;->setOnChooseActivityListener(Landroid/widget/ActivityChooserModel$OnChooseActivityListener;)V
-Landroid/widget/ActivityChooserView;->setExpandActivityOverflowButtonDrawable(Landroid/graphics/drawable/Drawable;)V
-Landroid/widget/AdapterView;->mDataChanged:Z
-Landroid/widget/AdapterView;->mFirstPosition:I
-Landroid/widget/AdapterView;->mNeedSync:Z
-Landroid/widget/AdapterView;->mNextSelectedPosition:I
-Landroid/widget/AdapterView;->mNextSelectedRowId:J
-Landroid/widget/AdapterView;->mOldSelectedPosition:I
-Landroid/widget/AdapterView;->mOnItemClickListener:Landroid/widget/AdapterView$OnItemClickListener;
-Landroid/widget/AdapterView;->mOnItemSelectedListener:Landroid/widget/AdapterView$OnItemSelectedListener;
-Landroid/widget/AdapterView;->mSelectedPosition:I
-Landroid/widget/AdapterView;->mSyncPosition:I
-Landroid/widget/AdapterView;->selectionChanged()V
-Landroid/widget/AdapterView;->setNextSelectedPositionInt(I)V
-Landroid/widget/AdapterView;->setSelectedPositionInt(I)V
-Landroid/widget/AnalogClock;->mDial:Landroid/graphics/drawable/Drawable;
-Landroid/widget/AnalogClock;->mHourHand:Landroid/graphics/drawable/Drawable;
-Landroid/widget/AnalogClock;->mMinuteHand:Landroid/graphics/drawable/Drawable;
-Landroid/widget/AppSecurityPermissions;-><init>(Landroid/content/Context;Ljava/lang/String;)V
-Landroid/widget/AppSecurityPermissions;->getPermissionCount()I
-Landroid/widget/AppSecurityPermissions;->getPermissionsView()Landroid/view/View;
-Landroid/widget/ArrayAdapter;->mLock:Ljava/lang/Object;
-Landroid/widget/ArrayAdapter;->mObjects:Ljava/util/List;
-Landroid/widget/ArrayAdapter;->mOriginalValues:Ljava/util/ArrayList;
-Landroid/widget/AutoCompleteTextView;->doAfterTextChanged()V
-Landroid/widget/AutoCompleteTextView;->doBeforeTextChanged()V
-Landroid/widget/AutoCompleteTextView;->ensureImeVisible(Z)V
-Landroid/widget/AutoCompleteTextView;->isInputMethodNotNeeded()Z
-Landroid/widget/AutoCompleteTextView;->mHintView:Landroid/widget/TextView;
-Landroid/widget/AutoCompleteTextView;->mObserver:Landroid/widget/AutoCompleteTextView$PopupDataSetObserver;
-Landroid/widget/AutoCompleteTextView;->mPassThroughClickListener:Landroid/widget/AutoCompleteTextView$PassThroughClickListener;
-Landroid/widget/AutoCompleteTextView;->mPopup:Landroid/widget/ListPopupWindow;
-Landroid/widget/AutoCompleteTextView;->setDropDownAlwaysVisible(Z)V
-Landroid/widget/AutoCompleteTextView;->setDropDownAnimationStyle(I)V
-Landroid/widget/AutoCompleteTextView;->setDropDownDismissedOnCompletion(Z)V
-Landroid/widget/AutoCompleteTextView;->setForceIgnoreOutsideTouch(Z)V
-Landroid/widget/AutoCompleteTextView;->showDropDownAfterLayout()V
-Landroid/widget/BaseAdapter;->mDataSetObservable:Landroid/database/DataSetObservable;
-Landroid/widget/CalendarView;->mDelegate:Landroid/widget/CalendarView$CalendarViewDelegate;
-Landroid/widget/CheckedTextView;->mCheckMarkDrawable:Landroid/graphics/drawable/Drawable;
-Landroid/widget/CheckedTextView;->mCheckMarkGravity:I
-Landroid/widget/CompoundButton;->mBroadcasting:Z
-Landroid/widget/CompoundButton;->mButtonDrawable:Landroid/graphics/drawable/Drawable;
-Landroid/widget/CompoundButton;->mOnCheckedChangeListener:Landroid/widget/CompoundButton$OnCheckedChangeListener;
-Landroid/widget/CursorAdapter;->mChangeObserver:Landroid/widget/CursorAdapter$ChangeObserver;
-Landroid/widget/CursorAdapter;->mContext:Landroid/content/Context;
-Landroid/widget/CursorAdapter;->mCursor:Landroid/database/Cursor;
-Landroid/widget/CursorAdapter;->mDataSetObserver:Landroid/database/DataSetObserver;
-Landroid/widget/CursorAdapter;->mDataValid:Z
-Landroid/widget/CursorAdapter;->mRowIDColumn:I
-Landroid/widget/DatePicker;->mDelegate:Landroid/widget/DatePicker$DatePickerDelegate;
-Landroid/widget/DatePicker;->setValidationCallback(Landroid/widget/DatePicker$ValidationCallback;)V
-Landroid/widget/DateTimeView;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
-Landroid/widget/DateTimeView;->setTime(J)V
-Landroid/widget/DateTimeView;->update()V
-Landroid/widget/EdgeEffect;->mGlowScaleY:F
-Landroid/widget/EdgeEffect;->mPaint:Landroid/graphics/Paint;
-Landroid/widget/Editor$InputContentType;->privateImeOptions:Ljava/lang/String;
-Landroid/widget/Editor;->invalidateTextDisplayList()V
-Landroid/widget/Editor;->mCreatedWithASelection:Z
-Landroid/widget/Editor;->mInsertionControllerEnabled:Z
-Landroid/widget/Editor;->mSelectHandleCenter:Landroid/graphics/drawable/Drawable;
-Landroid/widget/Editor;->mSelectHandleLeft:Landroid/graphics/drawable/Drawable;
-Landroid/widget/Editor;->mSelectHandleRight:Landroid/graphics/drawable/Drawable;
-Landroid/widget/Editor;->mSelectionControllerEnabled:Z
-Landroid/widget/Editor;->mShowCursor:J
-Landroid/widget/Editor;->mShowSoftInputOnFocus:Z
-Landroid/widget/ExpandableListView;->GROUP_STATE_SETS:[[I
-Landroid/widget/ExpandableListView;->mChildDivider:Landroid/graphics/drawable/Drawable;
-Landroid/widget/ExpandableListView;->mConnector:Landroid/widget/ExpandableListConnector;
-Landroid/widget/ExpandableListView;->mGroupIndicator:Landroid/graphics/drawable/Drawable;
-Landroid/widget/ExpandableListView;->mIndicatorLeft:I
-Landroid/widget/ExpandableListView;->mIndicatorRight:I
-Landroid/widget/ExpandableListView;->mOnChildClickListener:Landroid/widget/ExpandableListView$OnChildClickListener;
-Landroid/widget/ExpandableListView;->mOnGroupClickListener:Landroid/widget/ExpandableListView$OnGroupClickListener;
-Landroid/widget/ExpandableListView;->mOnGroupCollapseListener:Landroid/widget/ExpandableListView$OnGroupCollapseListener;
-Landroid/widget/ExpandableListView;->mOnGroupExpandListener:Landroid/widget/ExpandableListView$OnGroupExpandListener;
-Landroid/widget/FastScroller;-><init>(Landroid/widget/AbsListView;I)V
-Landroid/widget/FastScroller;->mContainerRect:Landroid/graphics/Rect;
-Landroid/widget/FastScroller;->mHeaderCount:I
-Landroid/widget/FastScroller;->mLongList:Z
-Landroid/widget/FastScroller;->mMinimumTouchTarget:I
-Landroid/widget/FastScroller;->mThumbDrawable:Landroid/graphics/drawable/Drawable;
-Landroid/widget/FastScroller;->mThumbImage:Landroid/widget/ImageView;
-Landroid/widget/FastScroller;->mTrackDrawable:Landroid/graphics/drawable/Drawable;
-Landroid/widget/FastScroller;->mTrackImage:Landroid/widget/ImageView;
-Landroid/widget/FastScroller;->onInterceptTouchEvent(Landroid/view/MotionEvent;)Z
-Landroid/widget/FastScroller;->onSizeChanged(IIII)V
-Landroid/widget/FastScroller;->onTouchEvent(Landroid/view/MotionEvent;)Z
-Landroid/widget/FastScroller;->remove()V
-Landroid/widget/FastScroller;->setState(I)V
-Landroid/widget/Filter;->setDelayer(Landroid/widget/Filter$Delayer;)V
-Landroid/widget/FrameLayout;->mForegroundPaddingBottom:I
-Landroid/widget/FrameLayout;->mForegroundPaddingLeft:I
-Landroid/widget/FrameLayout;->mForegroundPaddingRight:I
-Landroid/widget/FrameLayout;->mForegroundPaddingTop:I
-Landroid/widget/FrameLayout;->mMeasureAllChildren:Z
-Landroid/widget/Gallery$FlingRunnable;->startUsingVelocity(I)V
-Landroid/widget/Gallery;->fillToGalleryLeft()V
-Landroid/widget/Gallery;->fillToGalleryRight()V
-Landroid/widget/Gallery;->getCenterOfGallery()I
-Landroid/widget/Gallery;->getCenterOfView(Landroid/view/View;)I
-Landroid/widget/Gallery;->makeAndAddView(IIIZ)Landroid/view/View;
-Landroid/widget/Gallery;->mDownTouchPosition:I
-Landroid/widget/Gallery;->mDownTouchView:Landroid/view/View;
-Landroid/widget/Gallery;->mFlingRunnable:Landroid/widget/Gallery$FlingRunnable;
-Landroid/widget/Gallery;->mGestureDetector:Landroid/view/GestureDetector;
-Landroid/widget/Gallery;->moveDirection(I)Z
-Landroid/widget/Gallery;->mSelectedChild:Landroid/view/View;
-Landroid/widget/Gallery;->mSpacing:I
-Landroid/widget/Gallery;->trackMotionScroll(I)V
-Landroid/widget/GridLayout;->UNDEFINED_ALIGNMENT:Landroid/widget/GridLayout$Alignment;
-Landroid/widget/GridView;->determineColumns(I)Z
-Landroid/widget/GridView;->fillDown(II)Landroid/view/View;
-Landroid/widget/GridView;->fillUp(II)Landroid/view/View;
-Landroid/widget/GridView;->mColumnWidth:I
-Landroid/widget/GridView;->mHorizontalSpacing:I
-Landroid/widget/GridView;->mNumColumns:I
-Landroid/widget/GridView;->mRequestedColumnWidth:I
-Landroid/widget/GridView;->mRequestedHorizontalSpacing:I
-Landroid/widget/GridView;->mRequestedNumColumns:I
-Landroid/widget/GridView;->mVerticalSpacing:I
-Landroid/widget/GridView;->sequenceScroll(I)Z
-Landroid/widget/HeaderViewListAdapter;->mAdapter:Landroid/widget/ListAdapter;
-Landroid/widget/HeaderViewListAdapter;->mFooterViewInfos:Ljava/util/ArrayList;
-Landroid/widget/HeaderViewListAdapter;->mHeaderViewInfos:Ljava/util/ArrayList;
-Landroid/widget/HorizontalScrollView;->mChildToScrollTo:Landroid/view/View;
-Landroid/widget/HorizontalScrollView;->mEdgeGlowLeft:Landroid/widget/EdgeEffect;
-Landroid/widget/HorizontalScrollView;->mEdgeGlowRight:Landroid/widget/EdgeEffect;
-Landroid/widget/HorizontalScrollView;->mIsBeingDragged:Z
-Landroid/widget/HorizontalScrollView;->mLastMotionX:I
-Landroid/widget/HorizontalScrollView;->mOverflingDistance:I
-Landroid/widget/HorizontalScrollView;->mOverscrollDistance:I
-Landroid/widget/HorizontalScrollView;->mScroller:Landroid/widget/OverScroller;
-Landroid/widget/HorizontalScrollView;->mVelocityTracker:Landroid/view/VelocityTracker;
-Landroid/widget/HorizontalScrollView;->recycleVelocityTracker()V
-Landroid/widget/ImageView;->animateTransform(Landroid/graphics/Matrix;)V
-Landroid/widget/ImageView;->mAdjustViewBounds:Z
-Landroid/widget/ImageView;->mAlpha:I
-Landroid/widget/ImageView;->mCropToPadding:Z
-Landroid/widget/ImageView;->mDrawable:Landroid/graphics/drawable/Drawable;
-Landroid/widget/ImageView;->mDrawableHeight:I
-Landroid/widget/ImageView;->mDrawableWidth:I
-Landroid/widget/ImageView;->mDrawMatrix:Landroid/graphics/Matrix;
-Landroid/widget/ImageView;->mMaxHeight:I
-Landroid/widget/ImageView;->mMaxWidth:I
-Landroid/widget/ImageView;->mRecycleableBitmapDrawable:Landroid/graphics/drawable/BitmapDrawable;
-Landroid/widget/ImageView;->mResource:I
-Landroid/widget/ImageView;->mUri:Landroid/net/Uri;
-Landroid/widget/ImageView;->resizeFromDrawable()V
-Landroid/widget/ImageView;->resolveUri()V
-Landroid/widget/ImageView;->scaleTypeToScaleToFit(Landroid/widget/ImageView$ScaleType;)Landroid/graphics/Matrix$ScaleToFit;
-Landroid/widget/ImageView;->setImageResourceAsync(I)Ljava/lang/Runnable;
-Landroid/widget/ImageView;->setImageURIAsync(Landroid/net/Uri;)Ljava/lang/Runnable;
-Landroid/widget/ImageView;->updateDrawable(Landroid/graphics/drawable/Drawable;)V
-Landroid/widget/LinearLayout$LayoutParams;->encodeProperties(Landroid/view/ViewHierarchyEncoder;)V
-Landroid/widget/LinearLayout;->INDEX_BOTTOM:I
-Landroid/widget/LinearLayout;->INDEX_TOP:I
-Landroid/widget/LinearLayout;->mDivider:Landroid/graphics/drawable/Drawable;
-Landroid/widget/LinearLayout;->mGravity:I
-Landroid/widget/LinearLayout;->mMaxAscent:[I
-Landroid/widget/LinearLayout;->mMaxDescent:[I
-Landroid/widget/LinearLayout;->mTotalLength:I
-Landroid/widget/LinearLayout;->mUseLargestChild:Z
-Landroid/widget/ListPopupWindow;->buildDropDown()I
-Landroid/widget/ListPopupWindow;->isDropDownAlwaysVisible()Z
-Landroid/widget/ListPopupWindow;->mDropDownList:Landroid/widget/DropDownListView;
-Landroid/widget/ListPopupWindow;->mPopup:Landroid/widget/PopupWindow;
-Landroid/widget/ListPopupWindow;->setDropDownAlwaysVisible(Z)V
-Landroid/widget/ListPopupWindow;->setForceIgnoreOutsideTouch(Z)V
-Landroid/widget/ListPopupWindow;->setListItemExpandMax(I)V
-Landroid/widget/ListView;->arrowScroll(I)Z
-Landroid/widget/ListView;->correctTooHigh(I)V
-Landroid/widget/ListView;->correctTooLow(I)V
-Landroid/widget/ListView;->fillDown(II)Landroid/view/View;
-Landroid/widget/ListView;->fillSpecific(II)Landroid/view/View;
-Landroid/widget/ListView;->fillUp(II)Landroid/view/View;
-Landroid/widget/ListView;->getHeightForPosition(I)I
-Landroid/widget/ListView;->isDirectChildHeaderOrFooter(Landroid/view/View;)Z
-Landroid/widget/ListView;->makeAndAddView(IIZIZ)Landroid/view/View;
-Landroid/widget/ListView;->mAreAllItemsSelectable:Z
-Landroid/widget/ListView;->mDivider:Landroid/graphics/drawable/Drawable;
-Landroid/widget/ListView;->mDividerHeight:I
-Landroid/widget/ListView;->measureHeightOfChildren(IIIII)I
-Landroid/widget/ListView;->mFooterViewInfos:Ljava/util/ArrayList;
-Landroid/widget/ListView;->mHeaderViewInfos:Ljava/util/ArrayList;
-Landroid/widget/ListView;->scrollListItemsBy(I)V
-Landroid/widget/ListView;->setSelectionInt(I)V
-Landroid/widget/ListView;->trackMotionScroll(II)Z
-Landroid/widget/MediaController;->mAnchor:Landroid/view/View;
-Landroid/widget/MediaController;->mContext:Landroid/content/Context;
-Landroid/widget/MediaController;->mCurrentTime:Landroid/widget/TextView;
-Landroid/widget/MediaController;->mDecor:Landroid/view/View;
-Landroid/widget/MediaController;->mDecorLayoutParams:Landroid/view/WindowManager$LayoutParams;
-Landroid/widget/MediaController;->mEndTime:Landroid/widget/TextView;
-Landroid/widget/MediaController;->mFfwdButton:Landroid/widget/ImageButton;
-Landroid/widget/MediaController;->mFfwdListener:Landroid/view/View$OnClickListener;
-Landroid/widget/MediaController;->mNextButton:Landroid/widget/ImageButton;
-Landroid/widget/MediaController;->mPauseButton:Landroid/widget/ImageButton;
-Landroid/widget/MediaController;->mPlayer:Landroid/widget/MediaController$MediaPlayerControl;
-Landroid/widget/MediaController;->mPrevButton:Landroid/widget/ImageButton;
-Landroid/widget/MediaController;->mProgress:Landroid/widget/ProgressBar;
-Landroid/widget/MediaController;->mRewButton:Landroid/widget/ImageButton;
-Landroid/widget/MediaController;->mRewListener:Landroid/view/View$OnClickListener;
-Landroid/widget/MediaController;->mRoot:Landroid/view/View;
-Landroid/widget/MediaController;->mSeekListener:Landroid/widget/SeekBar$OnSeekBarChangeListener;
-Landroid/widget/MediaController;->mShowing:Z
-Landroid/widget/MediaController;->mWindow:Landroid/view/Window;
-Landroid/widget/MediaController;->mWindowManager:Landroid/view/WindowManager;
-Landroid/widget/MediaController;->updatePausePlay()V
-Landroid/widget/NumberPicker;->changeValueByOne(Z)V
-Landroid/widget/NumberPicker;->getTwoDigitFormatter()Landroid/widget/NumberPicker$Formatter;
-Landroid/widget/NumberPicker;->initializeSelectorWheelIndices()V
-Landroid/widget/NumberPicker;->mFlingScroller:Landroid/widget/Scroller;
-Landroid/widget/NumberPicker;->mInputText:Landroid/widget/EditText;
-Landroid/widget/NumberPicker;->mMaximumFlingVelocity:I
-Landroid/widget/NumberPicker;->mMaxValue:I
-Landroid/widget/NumberPicker;->mMinHeight:I
-Landroid/widget/NumberPicker;->mMinWidth:I
-Landroid/widget/NumberPicker;->mOnValueChangeListener:Landroid/widget/NumberPicker$OnValueChangeListener;
-Landroid/widget/NumberPicker;->mSelectionDivider:Landroid/graphics/drawable/Drawable;
-Landroid/widget/NumberPicker;->mSelectionDividerHeight:I
-Landroid/widget/NumberPicker;->mSelectorIndices:[I
-Landroid/widget/NumberPicker;->mSelectorWheelPaint:Landroid/graphics/Paint;
-Landroid/widget/NumberPicker;->mTextSize:I
-Landroid/widget/NumberPicker;->SELECTOR_MIDDLE_ITEM_INDEX:I
-Landroid/widget/NumberPicker;->SELECTOR_WHEEL_ITEM_COUNT:I
-Landroid/widget/OverScroller$SplineOverScroller;->mCurrVelocity:F
-Landroid/widget/OverScroller;-><init>(Landroid/content/Context;Landroid/view/animation/Interpolator;Z)V
-Landroid/widget/OverScroller;->extendDuration(I)V
-Landroid/widget/OverScroller;->isScrollingInDirection(FF)Z
-Landroid/widget/OverScroller;->mInterpolator:Landroid/view/animation/Interpolator;
-Landroid/widget/OverScroller;->mScrollerY:Landroid/widget/OverScroller$SplineOverScroller;
-Landroid/widget/OverScroller;->setInterpolator(Landroid/view/animation/Interpolator;)V
-Landroid/widget/PopupMenu;->mContext:Landroid/content/Context;
-Landroid/widget/PopupMenu;->mPopup:Lcom/android/internal/view/menu/MenuPopupHelper;
-Landroid/widget/PopupWindow;->computeAnimationResource()I
-Landroid/widget/PopupWindow;->createPopupLayoutParams(Landroid/os/IBinder;)Landroid/view/WindowManager$LayoutParams;
-Landroid/widget/PopupWindow;->invokePopup(Landroid/view/WindowManager$LayoutParams;)V
-Landroid/widget/PopupWindow;->mAboveAnchor:Z
-Landroid/widget/PopupWindow;->mAboveAnchorBackgroundDrawable:Landroid/graphics/drawable/Drawable;
-Landroid/widget/PopupWindow;->mAnchor:Ljava/lang/ref/WeakReference;
-Landroid/widget/PopupWindow;->mAnimationStyle:I
-Landroid/widget/PopupWindow;->mBackgroundView:Landroid/view/View;
-Landroid/widget/PopupWindow;->mBelowAnchorBackgroundDrawable:Landroid/graphics/drawable/Drawable;
-Landroid/widget/PopupWindow;->mContentView:Landroid/view/View;
-Landroid/widget/PopupWindow;->mContext:Landroid/content/Context;
-Landroid/widget/PopupWindow;->mDecorView:Landroid/widget/PopupWindow$PopupDecorView;
-Landroid/widget/PopupWindow;->mHeightMode:I
-Landroid/widget/PopupWindow;->mIsDropdown:Z
-Landroid/widget/PopupWindow;->mIsShowing:Z
-Landroid/widget/PopupWindow;->mLastHeight:I
-Landroid/widget/PopupWindow;->mLastWidth:I
-Landroid/widget/PopupWindow;->mLayoutInScreen:Z
-Landroid/widget/PopupWindow;->mNotTouchModal:Z
-Landroid/widget/PopupWindow;->mOnDismissListener:Landroid/widget/PopupWindow$OnDismissListener;
-Landroid/widget/PopupWindow;->mOnScrollChangedListener:Landroid/view/ViewTreeObserver$OnScrollChangedListener;
-Landroid/widget/PopupWindow;->mOverlapAnchor:Z
-Landroid/widget/PopupWindow;->mTouchInterceptor:Landroid/view/View$OnTouchListener;
-Landroid/widget/PopupWindow;->mWidthMode:I
-Landroid/widget/PopupWindow;->mWindowLayoutType:I
-Landroid/widget/PopupWindow;->mWindowManager:Landroid/view/WindowManager;
-Landroid/widget/PopupWindow;->preparePopup(Landroid/view/WindowManager$LayoutParams;)V
-Landroid/widget/PopupWindow;->setAllowScrollingAnchorParent(Z)V
-Landroid/widget/PopupWindow;->setClipToScreenEnabled(Z)V
-Landroid/widget/PopupWindow;->setEpicenterBounds(Landroid/graphics/Rect;)V
-Landroid/widget/PopupWindow;->setLayoutInScreenEnabled(Z)V
-Landroid/widget/PopupWindow;->setLayoutInsetDecor(Z)V
-Landroid/widget/PopupWindow;->setTouchModal(Z)V
-Landroid/widget/PopupWindow;->showAtLocation(Landroid/os/IBinder;III)V
-Landroid/widget/PopupWindow;->updateAboveAnchor(Z)V
-Landroid/widget/ProgressBar;->mCurrentDrawable:Landroid/graphics/drawable/Drawable;
-Landroid/widget/ProgressBar;->mDuration:I
-Landroid/widget/ProgressBar;->mIndeterminate:Z
-Landroid/widget/ProgressBar;->mMaxHeight:I
-Landroid/widget/ProgressBar;->mMinHeight:I
-Landroid/widget/ProgressBar;->mMinWidth:I
-Landroid/widget/ProgressBar;->mMirrorForRtl:Z
-Landroid/widget/ProgressBar;->mOnlyIndeterminate:Z
-Landroid/widget/ProgressBar;->refreshProgress(IIZZ)V
-Landroid/widget/ProgressBar;->setProgressInternal(IZZ)Z
-Landroid/widget/ProgressBar;->startAnimation()V
-Landroid/widget/ProgressBar;->stopAnimation()V
-Landroid/widget/ProgressBar;->tileify(Landroid/graphics/drawable/Drawable;Z)Landroid/graphics/drawable/Drawable;
-Landroid/widget/QuickContactBadge;->mOverlay:Landroid/graphics/drawable/Drawable;
-Landroid/widget/RadioGroup;->mChildOnCheckedChangeListener:Landroid/widget/CompoundButton$OnCheckedChangeListener;
-Landroid/widget/RadioGroup;->mOnCheckedChangeListener:Landroid/widget/RadioGroup$OnCheckedChangeListener;
-Landroid/widget/RatingBar;->mOnRatingBarChangeListener:Landroid/widget/RatingBar$OnRatingBarChangeListener;
 Landroid/widget/RelativeLayout$DependencyGraph$Node;-><init>()V
-Landroid/widget/RelativeLayout$LayoutParams;->mBottom:I
-Landroid/widget/RelativeLayout$LayoutParams;->mLeft:I
-Landroid/widget/RelativeLayout$LayoutParams;->mRight:I
-Landroid/widget/RelativeLayout$LayoutParams;->mTop:I
-Landroid/widget/RelativeLayout;->mGravity:I
-Landroid/widget/RemoteViews$Action;->mergeBehavior()I
-Landroid/widget/RemoteViews$Action;->viewId:I
-Landroid/widget/RemoteViews$BitmapCache;->mBitmaps:Ljava/util/ArrayList;
-Landroid/widget/RemoteViews$BitmapReflectionAction;->bitmap:Landroid/graphics/Bitmap;
-Landroid/widget/RemoteViews$BitmapReflectionAction;->methodName:Ljava/lang/String;
 Landroid/widget/RemoteViews$OnClickHandler;-><init>()V
-Landroid/widget/RemoteViews$OnClickHandler;->onClickHandler(Landroid/view/View;Landroid/app/PendingIntent;Landroid/content/Intent;)Z
-Landroid/widget/RemoteViews$ReflectionAction;->methodName:Ljava/lang/String;
-Landroid/widget/RemoteViews$ReflectionAction;->value:Ljava/lang/Object;
-Landroid/widget/RemoteViews$SetOnClickPendingIntent;->pendingIntent:Landroid/app/PendingIntent;
-Landroid/widget/RemoteViews$SetPendingIntentTemplate;->pendingIntentTemplate:Landroid/app/PendingIntent;
-Landroid/widget/RemoteViews$ViewGroupActionAdd;->mNestedViews:Landroid/widget/RemoteViews;
-Landroid/widget/RemoteViews;->addView(ILandroid/widget/RemoteViews;I)V
-Landroid/widget/RemoteViews;->estimateMemoryUsage()I
-Landroid/widget/RemoteViews;->mActions:Ljava/util/ArrayList;
-Landroid/widget/RemoteViews;->mApplication:Landroid/content/pm/ApplicationInfo;
-Landroid/widget/RemoteViews;->mBitmapCache:Landroid/widget/RemoteViews$BitmapCache;
-Landroid/widget/RemoteViews;->mergeRemoteViews(Landroid/widget/RemoteViews;)V
-Landroid/widget/RemoteViews;->mLayoutId:I
-Landroid/widget/RemoteViews;->mPortrait:Landroid/widget/RemoteViews;
-Landroid/widget/RemoteViews;->setIsWidgetCollectionChild(Z)V
-Landroid/widget/RemoteViews;->setRemoteAdapter(ILjava/util/ArrayList;I)V
-Landroid/widget/RemoteViewsAdapter;->getRemoteViewsServiceIntent()Landroid/content/Intent;
-Landroid/widget/RemoteViewsAdapter;->isDataReady()Z
-Landroid/widget/RemoteViewsAdapter;->mCache:Landroid/widget/RemoteViewsAdapter$FixedSizeRemoteViewsCache;
-Landroid/widget/RemoteViewsAdapter;->mWorkerThread:Landroid/os/HandlerThread;
-Landroid/widget/RemoteViewsAdapter;->saveRemoteViewsCache()V
-Landroid/widget/RemoteViewsAdapter;->setRemoteViewsOnClickHandler(Landroid/widget/RemoteViews$OnClickHandler;)V
-Landroid/widget/RemoteViewsAdapter;->setVisibleRangeHint(II)V
 Landroid/widget/ScrollBarDrawable;-><init>()V
-Landroid/widget/ScrollBarDrawable;->mVerticalThumb:Landroid/graphics/drawable/Drawable;
-Landroid/widget/ScrollBarDrawable;->setHorizontalThumbDrawable(Landroid/graphics/drawable/Drawable;)V
-Landroid/widget/ScrollBarDrawable;->setVerticalThumbDrawable(Landroid/graphics/drawable/Drawable;)V
-Landroid/widget/Scroller;->DECELERATION_RATE:F
-Landroid/widget/Scroller;->INFLEXION:F
-Landroid/widget/Scroller;->mDeceleration:F
-Landroid/widget/Scroller;->mDuration:I
-Landroid/widget/Scroller;->mInterpolator:Landroid/view/animation/Interpolator;
-Landroid/widget/Scroller;->mPhysicalCoeff:F
-Landroid/widget/ScrollView;->canScroll()Z
-Landroid/widget/ScrollView;->endDrag()V
-Landroid/widget/ScrollView;->mChildToScrollTo:Landroid/view/View;
-Landroid/widget/ScrollView;->mEdgeGlowBottom:Landroid/widget/EdgeEffect;
-Landroid/widget/ScrollView;->mEdgeGlowTop:Landroid/widget/EdgeEffect;
-Landroid/widget/ScrollView;->mFlingStrictSpan:Landroid/os/StrictMode$Span;
-Landroid/widget/ScrollView;->mIsBeingDragged:Z
-Landroid/widget/ScrollView;->mLastMotionY:I
-Landroid/widget/ScrollView;->mLastScroll:J
-Landroid/widget/ScrollView;->mMinimumVelocity:I
-Landroid/widget/ScrollView;->mOverflingDistance:I
-Landroid/widget/ScrollView;->mOverscrollDistance:I
-Landroid/widget/ScrollView;->mScroller:Landroid/widget/OverScroller;
-Landroid/widget/ScrollView;->mVelocityTracker:Landroid/view/VelocityTracker;
-Landroid/widget/SearchView$SearchAutoComplete;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
-Landroid/widget/SearchView;->mClearingFocus:Z
-Landroid/widget/SearchView;->mCloseButton:Landroid/widget/ImageView;
-Landroid/widget/SearchView;->mCollapsedImeOptions:I
-Landroid/widget/SearchView;->mExpandedInActionView:Z
-Landroid/widget/SearchView;->mIconified:Z
-Landroid/widget/SearchView;->mIconifiedByDefault:Z
-Landroid/widget/SearchView;->mOnClickListener:Landroid/view/View$OnClickListener;
-Landroid/widget/SearchView;->mOnItemClickListener:Landroid/widget/AdapterView$OnItemClickListener;
-Landroid/widget/SearchView;->mOnQueryChangeListener:Landroid/widget/SearchView$OnQueryTextListener;
-Landroid/widget/SearchView;->mSearchButton:Landroid/widget/ImageView;
-Landroid/widget/SearchView;->mSearchEditFrame:Landroid/view/View;
-Landroid/widget/SearchView;->mSearchHintIcon:Landroid/graphics/drawable/Drawable;
-Landroid/widget/SearchView;->mSearchPlate:Landroid/view/View;
-Landroid/widget/SearchView;->mSearchSrcTextView:Landroid/widget/SearchView$SearchAutoComplete;
-Landroid/widget/SearchView;->mSubmitArea:Landroid/view/View;
-Landroid/widget/SearchView;->mSuggestionsAdapter:Landroid/widget/CursorAdapter;
-Landroid/widget/SearchView;->mUserQuery:Ljava/lang/CharSequence;
-Landroid/widget/SearchView;->mVoiceButton:Landroid/widget/ImageView;
-Landroid/widget/SearchView;->mVoiceButtonEnabled:Z
-Landroid/widget/SearchView;->onCloseClicked()V
-Landroid/widget/SearchView;->setQuery(Ljava/lang/CharSequence;)V
-Landroid/widget/SearchView;->updateSubmitArea()V
-Landroid/widget/SearchView;->updateSubmitButton(Z)V
-Landroid/widget/SearchView;->updateViewsVisibility(Z)V
-Landroid/widget/SeekBar;->mOnSeekBarChangeListener:Landroid/widget/SeekBar$OnSeekBarChangeListener;
-Landroid/widget/SeekBar;->onProgressRefresh(FZI)V
-Landroid/widget/SimpleAdapter;->mData:Ljava/util/List;
-Landroid/widget/SimpleCursorAdapter;->mFrom:[I
-Landroid/widget/SimpleCursorAdapter;->mTo:[I
-Landroid/widget/SlidingDrawer;->mTopOffset:I
-Landroid/widget/SlidingDrawer;->mTouchDelta:I
-Landroid/widget/SlidingDrawer;->mTracking:Z
-Landroid/widget/SlidingDrawer;->mVelocityTracker:Landroid/view/VelocityTracker;
-Landroid/widget/SlidingDrawer;->prepareContent()V
-Landroid/widget/SlidingDrawer;->prepareTracking(I)V
-Landroid/widget/Spinner$DialogPopup;->isShowing()Z
-Landroid/widget/Spinner$SpinnerPopup;->isShowing()Z
-Landroid/widget/Spinner;->mForwardingListener:Landroid/widget/ForwardingListener;
-Landroid/widget/Spinner;->mPopup:Landroid/widget/Spinner$SpinnerPopup;
-Landroid/widget/Spinner;->setOnItemClickListenerInt(Landroid/widget/AdapterView$OnItemClickListener;)V
-Landroid/widget/Switch;->cancelPositionAnimator()V
-Landroid/widget/Switch;->mOffLayout:Landroid/text/Layout;
-Landroid/widget/Switch;->mOnLayout:Landroid/text/Layout;
-Landroid/widget/Switch;->mSwitchHeight:I
-Landroid/widget/Switch;->mSwitchMinWidth:I
-Landroid/widget/Switch;->mSwitchWidth:I
-Landroid/widget/Switch;->mThumbDrawable:Landroid/graphics/drawable/Drawable;
-Landroid/widget/Switch;->mThumbWidth:I
-Landroid/widget/Switch;->mTrackDrawable:Landroid/graphics/drawable/Drawable;
-Landroid/widget/Switch;->setThumbPosition(F)V
-Landroid/widget/TabHost$IntentContentStrategy;->getContentView()Landroid/view/View;
-Landroid/widget/TabHost$IntentContentStrategy;->tabClosed()V
-Landroid/widget/TabHost$TabSpec;->mContentStrategy:Landroid/widget/TabHost$ContentStrategy;
-Landroid/widget/TabHost$TabSpec;->mIndicatorStrategy:Landroid/widget/TabHost$IndicatorStrategy;
-Landroid/widget/TabHost;->mCurrentTab:I
-Landroid/widget/TabHost;->mOnTabChangeListener:Landroid/widget/TabHost$OnTabChangeListener;
-Landroid/widget/TabHost;->mTabSpecs:Ljava/util/List;
-Landroid/widget/TabWidget;->mDrawBottomStrips:Z
-Landroid/widget/TabWidget;->mSelectedTab:I
-Landroid/widget/TabWidget;->setTabSelectionListener(Landroid/widget/TabWidget$OnTabSelectionChanged;)V
-Landroid/widget/TextClock;->getFormat()Ljava/lang/CharSequence;
-Landroid/widget/TextClock;->onTimeChanged()V
-Landroid/widget/TextView$SavedState;->text:Ljava/lang/CharSequence;
-Landroid/widget/TextView;->assumeLayout()V
-Landroid/widget/TextView;->bringTextIntoView()Z
-Landroid/widget/TextView;->canPaste()Z
-Landroid/widget/TextView;->checkForRelayout()V
-Landroid/widget/TextView;->compressText(F)Z
-Landroid/widget/TextView;->createEditorIfNeeded()V
-Landroid/widget/TextView;->deleteText_internal(II)V
-Landroid/widget/TextView;->getHintLayout()Landroid/text/Layout;
-Landroid/widget/TextView;->getHorizontallyScrolling()Z
-Landroid/widget/TextView;->getIterableTextForAccessibility()Ljava/lang/CharSequence;
-Landroid/widget/TextView;->getLayoutAlignment()Landroid/text/Layout$Alignment;
-Landroid/widget/TextView;->getLineAtCoordinate(F)I
-Landroid/widget/TextView;->getTextDirectionHeuristic()Landroid/text/TextDirectionHeuristic;
-Landroid/widget/TextView;->getTextForAccessibility()Ljava/lang/CharSequence;
-Landroid/widget/TextView;->getTextServicesLocale(Z)Ljava/util/Locale;
-Landroid/widget/TextView;->getTransformedText(II)Ljava/lang/CharSequence;
-Landroid/widget/TextView;->getUpdatedHighlightPath()Landroid/graphics/Path;
-Landroid/widget/TextView;->getVerticalOffset(Z)I
-Landroid/widget/TextView;->isSingleLine()Z
-Landroid/widget/TextView;->isTextEditable()Z
-Landroid/widget/TextView;->LINES:I
-Landroid/widget/TextView;->makeNewLayout(IILandroid/text/BoringLayout$Metrics;Landroid/text/BoringLayout$Metrics;IZ)V
-Landroid/widget/TextView;->mAllowTransformationLengthChange:Z
-Landroid/widget/TextView;->mBoring:Landroid/text/BoringLayout$Metrics;
-Landroid/widget/TextView;->mBufferType:Landroid/widget/TextView$BufferType;
-Landroid/widget/TextView;->mChangeWatcher:Landroid/widget/TextView$ChangeWatcher;
-Landroid/widget/TextView;->mCharWrapper:Landroid/widget/TextView$CharWrapper;
-Landroid/widget/TextView;->mCurHintTextColor:I
-Landroid/widget/TextView;->mCursorDrawableRes:I
-Landroid/widget/TextView;->mCurTextColor:I
-Landroid/widget/TextView;->mDesiredHeightAtMeasure:I
-Landroid/widget/TextView;->mDrawables:Landroid/widget/TextView$Drawables;
-Landroid/widget/TextView;->mEditableFactory:Landroid/text/Editable$Factory;
-Landroid/widget/TextView;->mEditor:Landroid/widget/Editor;
-Landroid/widget/TextView;->mGravity:I
-Landroid/widget/TextView;->mHighlightColor:I
-Landroid/widget/TextView;->mHighlightPaint:Landroid/graphics/Paint;
-Landroid/widget/TextView;->mHighlightPathBogus:Z
-Landroid/widget/TextView;->mHintBoring:Landroid/text/BoringLayout$Metrics;
-Landroid/widget/TextView;->mHintLayout:Landroid/text/Layout;
-Landroid/widget/TextView;->mHorizontallyScrolling:Z
-Landroid/widget/TextView;->mIncludePad:Z
-Landroid/widget/TextView;->mLayout:Landroid/text/Layout;
-Landroid/widget/TextView;->mListeners:Ljava/util/ArrayList;
-Landroid/widget/TextView;->mMarquee:Landroid/widget/TextView$Marquee;
-Landroid/widget/TextView;->mMarqueeFadeMode:I
-Landroid/widget/TextView;->mMaximum:I
-Landroid/widget/TextView;->mMaxMode:I
-Landroid/widget/TextView;->mMaxWidth:I
-Landroid/widget/TextView;->mMaxWidthMode:I
-Landroid/widget/TextView;->mMinimum:I
-Landroid/widget/TextView;->mMinMode:I
-Landroid/widget/TextView;->mMinWidth:I
-Landroid/widget/TextView;->mMinWidthMode:I
-Landroid/widget/TextView;->mOldMaximum:I
-Landroid/widget/TextView;->mOldMaxMode:I
-Landroid/widget/TextView;->mRestartMarquee:Z
-Landroid/widget/TextView;->mSavedHintLayout:Landroid/text/BoringLayout;
-Landroid/widget/TextView;->mSavedLayout:Landroid/text/BoringLayout;
-Landroid/widget/TextView;->mSavedMarqueeModeLayout:Landroid/text/Layout;
-Landroid/widget/TextView;->mShadowDx:F
-Landroid/widget/TextView;->mShadowDy:F
-Landroid/widget/TextView;->mShadowRadius:F
-Landroid/widget/TextView;->mSingleLine:Z
-Landroid/widget/TextView;->mSpacingAdd:F
-Landroid/widget/TextView;->mSpacingMult:F
-Landroid/widget/TextView;->mSpannableFactory:Landroid/text/Spannable$Factory;
-Landroid/widget/TextView;->mText:Ljava/lang/CharSequence;
-Landroid/widget/TextView;->mTextDir:Landroid/text/TextDirectionHeuristic;
-Landroid/widget/TextView;->mTextPaint:Landroid/text/TextPaint;
-Landroid/widget/TextView;->mTextSelectHandleLeftRes:I
-Landroid/widget/TextView;->mTextSelectHandleRes:I
-Landroid/widget/TextView;->mTextSelectHandleRightRes:I
-Landroid/widget/TextView;->mTransformed:Ljava/lang/CharSequence;
-Landroid/widget/TextView;->mUserSetTextScaleX:Z
-Landroid/widget/TextView;->nullLayouts()V
-Landroid/widget/TextView;->setInputType(IZ)V
-Landroid/widget/TextView;->setRawTextSize(FZ)V
-Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;Landroid/widget/TextView$BufferType;ZI)V
-Landroid/widget/TextView;->startMarquee()V
-Landroid/widget/TextView;->startStopMarquee(Z)V
-Landroid/widget/TextView;->stopTextActionMode()V
-Landroid/widget/TextView;->updateTextServicesLocaleLocked()V
-Landroid/widget/TextView;->viewportToContentVerticalOffset()I
-Landroid/widget/TimePicker;->mDelegate:Landroid/widget/TimePicker$TimePickerDelegate;
-Landroid/widget/Toast$TN;->handleHide()V
-Landroid/widget/Toast$TN;->mGravity:I
-Landroid/widget/Toast$TN;->mNextView:Landroid/view/View;
-Landroid/widget/Toast$TN;->mParams:Landroid/view/WindowManager$LayoutParams;
-Landroid/widget/Toast$TN;->mView:Landroid/view/View;
-Landroid/widget/Toast$TN;->mY:I
-Landroid/widget/Toast$TN;->show(Landroid/os/IBinder;)V
-Landroid/widget/Toast;->getService()Landroid/app/INotificationManager;
-Landroid/widget/Toast;->getWindowParams()Landroid/view/WindowManager$LayoutParams;
-Landroid/widget/Toast;->mDuration:I
-Landroid/widget/Toast;->mTN:Landroid/widget/Toast$TN;
-Landroid/widget/Toast;->sService:Landroid/app/INotificationManager;
-Landroid/widget/Toolbar;->mNavButtonView:Landroid/widget/ImageButton;
-Landroid/widget/Toolbar;->mTitleMarginBottom:I
-Landroid/widget/Toolbar;->mTitleMarginEnd:I
-Landroid/widget/Toolbar;->mTitleMarginStart:I
-Landroid/widget/Toolbar;->mTitleMarginTop:I
-Landroid/widget/Toolbar;->mTitleTextView:Landroid/widget/TextView;
-Landroid/widget/VideoView2$OnViewTypeChangedListener;->onViewTypeChanged(Landroid/view/View;I)V
-Landroid/widget/VideoView2;->getMediaController()Landroid/media/session/MediaController;
-Landroid/widget/VideoView2;->setOnViewTypeChangedListener(Landroid/widget/VideoView2$OnViewTypeChangedListener;)V
-Landroid/widget/VideoView2;->setVideoPath(Ljava/lang/String;)V
-Landroid/widget/VideoView;->mCurrentBufferPercentage:I
-Landroid/widget/VideoView;->mCurrentState:I
-Landroid/widget/VideoView;->mErrorListener:Landroid/media/MediaPlayer$OnErrorListener;
-Landroid/widget/VideoView;->mHeaders:Ljava/util/Map;
-Landroid/widget/VideoView;->mMediaController:Landroid/widget/MediaController;
-Landroid/widget/VideoView;->mMediaPlayer:Landroid/media/MediaPlayer;
-Landroid/widget/VideoView;->mPreparedListener:Landroid/media/MediaPlayer$OnPreparedListener;
-Landroid/widget/VideoView;->mSHCallback:Landroid/view/SurfaceHolder$Callback;
-Landroid/widget/VideoView;->mSurfaceHolder:Landroid/view/SurfaceHolder;
-Landroid/widget/VideoView;->mTargetState:I
-Landroid/widget/VideoView;->mUri:Landroid/net/Uri;
-Landroid/widget/VideoView;->mVideoHeight:I
-Landroid/widget/VideoView;->mVideoWidth:I
-Landroid/widget/VideoView;->release(Z)V
-Landroid/widget/VideoView;->STATE_IDLE:I
-Landroid/widget/ViewAnimator;->mFirstTime:Z
-Landroid/widget/ViewAnimator;->mWhichChild:I
-Landroid/widget/ViewAnimator;->showOnly(IZ)V
-Landroid/widget/ViewFlipper;->mUserPresent:Z
-Landroid/widget/ViewFlipper;->updateRunning(Z)V
-Landroid/widget/ZoomControls;->mZoomIn:Landroid/widget/ZoomButton;
-Landroid/widget/ZoomControls;->mZoomOut:Landroid/widget/ZoomButton;
 Lcom/android/ims/ImsConfigListener$Stub;-><init>()V
 Lcom/android/ims/internal/IImsCallSession$Stub;-><init>()V
 Lcom/android/ims/internal/IImsCallSession$Stub;->asInterface(Landroid/os/IBinder;)Lcom/android/ims/internal/IImsCallSession;
@@ -2311,48 +1745,6 @@
 Lcom/android/ims/internal/IImsVideoCallProvider$Stub;-><init>()V
 Lcom/android/ims/internal/IImsVideoCallProvider;->setCallback(Lcom/android/ims/internal/IImsVideoCallCallback;)V
 Lcom/android/ims/internal/uce/uceservice/IUceListener$Stub;-><init>()V
-Lcom/android/internal/app/AlertController$AlertParams;-><init>(Landroid/content/Context;)V
-Lcom/android/internal/app/AlertController$AlertParams;->apply(Lcom/android/internal/app/AlertController;)V
-Lcom/android/internal/app/AlertController$AlertParams;->mAdapter:Landroid/widget/ListAdapter;
-Lcom/android/internal/app/AlertController$AlertParams;->mCancelable:Z
-Lcom/android/internal/app/AlertController$AlertParams;->mCheckedItem:I
-Lcom/android/internal/app/AlertController$AlertParams;->mCheckedItems:[Z
-Lcom/android/internal/app/AlertController$AlertParams;->mContext:Landroid/content/Context;
-Lcom/android/internal/app/AlertController$AlertParams;->mCursor:Landroid/database/Cursor;
-Lcom/android/internal/app/AlertController$AlertParams;->mCustomTitleView:Landroid/view/View;
-Lcom/android/internal/app/AlertController$AlertParams;->mIcon:Landroid/graphics/drawable/Drawable;
-Lcom/android/internal/app/AlertController$AlertParams;->mInflater:Landroid/view/LayoutInflater;
-Lcom/android/internal/app/AlertController$AlertParams;->mIsCheckedColumn:Ljava/lang/String;
-Lcom/android/internal/app/AlertController$AlertParams;->mIsMultiChoice:Z
-Lcom/android/internal/app/AlertController$AlertParams;->mIsSingleChoice:Z
-Lcom/android/internal/app/AlertController$AlertParams;->mItems:[Ljava/lang/CharSequence;
-Lcom/android/internal/app/AlertController$AlertParams;->mLabelColumn:Ljava/lang/String;
-Lcom/android/internal/app/AlertController$AlertParams;->mNeutralButtonListener:Landroid/content/DialogInterface$OnClickListener;
-Lcom/android/internal/app/AlertController$AlertParams;->mNeutralButtonText:Ljava/lang/CharSequence;
-Lcom/android/internal/app/AlertController$AlertParams;->mOnCancelListener:Landroid/content/DialogInterface$OnCancelListener;
-Lcom/android/internal/app/AlertController$AlertParams;->mOnCheckboxClickListener:Landroid/content/DialogInterface$OnMultiChoiceClickListener;
-Lcom/android/internal/app/AlertController$AlertParams;->mOnClickListener:Landroid/content/DialogInterface$OnClickListener;
-Lcom/android/internal/app/AlertController$AlertParams;->mOnDismissListener:Landroid/content/DialogInterface$OnDismissListener;
-Lcom/android/internal/app/AlertController$AlertParams;->mOnItemSelectedListener:Landroid/widget/AdapterView$OnItemSelectedListener;
-Lcom/android/internal/app/AlertController$AlertParams;->mOnKeyListener:Landroid/content/DialogInterface$OnKeyListener;
-Lcom/android/internal/app/AlertController$RecycleListView;-><init>(Landroid/content/Context;)V
-Lcom/android/internal/app/AlertController$RecycleListView;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
-Lcom/android/internal/app/AlertController;-><init>(Landroid/content/Context;Landroid/content/DialogInterface;Landroid/view/Window;)V
-Lcom/android/internal/app/AlertController;->getListView()Landroid/widget/ListView;
-Lcom/android/internal/app/AlertController;->installContent()V
-Lcom/android/internal/app/AlertController;->mCustomTitleView:Landroid/view/View;
-Lcom/android/internal/app/AlertController;->mForceInverseBackground:Z
-Lcom/android/internal/app/AlertController;->mTitle:Ljava/lang/CharSequence;
-Lcom/android/internal/app/AlertController;->mView:Landroid/view/View;
-Lcom/android/internal/app/AlertController;->onKeyDown(ILandroid/view/KeyEvent;)Z
-Lcom/android/internal/app/AlertController;->onKeyUp(ILandroid/view/KeyEvent;)Z
-Lcom/android/internal/app/AlertController;->setButton(ILjava/lang/CharSequence;Landroid/content/DialogInterface$OnClickListener;Landroid/os/Message;)V
-Lcom/android/internal/app/AlertController;->setCustomTitle(Landroid/view/View;)V
-Lcom/android/internal/app/AlertController;->setIcon(I)V
-Lcom/android/internal/app/AlertController;->setIcon(Landroid/graphics/drawable/Drawable;)V
-Lcom/android/internal/app/AlertController;->setMessage(Ljava/lang/CharSequence;)V
-Lcom/android/internal/app/AlertController;->setTitle(Ljava/lang/CharSequence;)V
-Lcom/android/internal/app/AlertController;->setView(Landroid/view/View;)V
 Lcom/android/internal/app/IAppOpsCallback$Stub;-><init>()V
 Lcom/android/internal/app/IAppOpsService$Stub$Proxy;-><init>(Landroid/os/IBinder;)V
 Lcom/android/internal/app/IAppOpsService$Stub$Proxy;->checkOperation(IILjava/lang/String;)I
@@ -2423,181 +1815,13 @@
 Lcom/android/internal/backup/IBackupTransport;->requestBackupTime()J
 Lcom/android/internal/backup/IBackupTransport;->startRestore(J[Landroid/content/pm/PackageInfo;)I
 Lcom/android/internal/backup/IBackupTransport;->transportDirName()Ljava/lang/String;
-Lcom/android/internal/content/PackageMonitor;->isPackageDisappearing(Ljava/lang/String;)I
-Lcom/android/internal/content/PackageMonitor;->isPackageModified(Ljava/lang/String;)Z
-Lcom/android/internal/content/PackageMonitor;->onPackageChanged(Ljava/lang/String;I[Ljava/lang/String;)Z
-Lcom/android/internal/content/PackageMonitor;->onPackageRemoved(Ljava/lang/String;I)V
-Lcom/android/internal/content/PackageMonitor;->register(Landroid/content/Context;Landroid/os/Looper;Z)V
-Lcom/android/internal/content/ReferrerIntent;-><init>(Landroid/content/Intent;Ljava/lang/String;)V
-Lcom/android/internal/content/ReferrerIntent;->mReferrer:Ljava/lang/String;
 Lcom/android/internal/location/ILocationProvider$Stub;-><init>()V
 Lcom/android/internal/logging/MetricsLogger;-><init>()V
-Lcom/android/internal/logging/MetricsLogger;->write(Landroid/metrics/LogMaker;)V
 Lcom/android/internal/net/LegacyVpnInfo;-><init>()V
-Lcom/android/internal/net/LegacyVpnInfo;->CREATOR:Landroid/os/Parcelable$Creator;
-Lcom/android/internal/net/LegacyVpnInfo;->key:Ljava/lang/String;
-Lcom/android/internal/net/LegacyVpnInfo;->state:I
 Lcom/android/internal/net/VpnConfig;-><init>()V
-Lcom/android/internal/net/VpnProfile;-><init>(Landroid/os/Parcel;)V
-Lcom/android/internal/net/VpnProfile;->decode(Ljava/lang/String;[B)Lcom/android/internal/net/VpnProfile;
-Lcom/android/internal/net/VpnProfile;->key:Ljava/lang/String;
-Lcom/android/internal/net/VpnProfile;->name:Ljava/lang/String;
-Lcom/android/internal/net/VpnProfile;->saveLogin:Z
-Lcom/android/internal/net/VpnProfile;->server:Ljava/lang/String;
-Lcom/android/internal/net/VpnProfile;->type:I
-Lcom/android/internal/net/VpnProfile;->username:Ljava/lang/String;
-Lcom/android/internal/os/AtomicFile;-><init>(Ljava/io/File;)V
-Lcom/android/internal/os/AtomicFile;->failWrite(Ljava/io/FileOutputStream;)V
-Lcom/android/internal/os/AtomicFile;->finishWrite(Ljava/io/FileOutputStream;)V
-Lcom/android/internal/os/AtomicFile;->getBaseFile()Ljava/io/File;
-Lcom/android/internal/os/AtomicFile;->openAppend()Ljava/io/FileOutputStream;
-Lcom/android/internal/os/AtomicFile;->openRead()Ljava/io/FileInputStream;
-Lcom/android/internal/os/AtomicFile;->readFully()[B
-Lcom/android/internal/os/AtomicFile;->startWrite()Ljava/io/FileOutputStream;
-Lcom/android/internal/os/AtomicFile;->truncate()V
-Lcom/android/internal/os/BatterySipper$DrainType;->APP:Lcom/android/internal/os/BatterySipper$DrainType;
 Lcom/android/internal/os/BatterySipper$DrainType;->values()[Lcom/android/internal/os/BatterySipper$DrainType;
-Lcom/android/internal/os/BatterySipper;-><init>(Lcom/android/internal/os/BatterySipper$DrainType;Landroid/os/BatteryStats$Uid;D)V
-Lcom/android/internal/os/BatterySipper;->add(Lcom/android/internal/os/BatterySipper;)V
-Lcom/android/internal/os/BatterySipper;->cpuFgTimeMs:J
-Lcom/android/internal/os/BatterySipper;->cpuPowerMah:D
-Lcom/android/internal/os/BatterySipper;->cpuTimeMs:J
-Lcom/android/internal/os/BatterySipper;->drainType:Lcom/android/internal/os/BatterySipper$DrainType;
-Lcom/android/internal/os/BatterySipper;->getPackages()[Ljava/lang/String;
-Lcom/android/internal/os/BatterySipper;->getUid()I
-Lcom/android/internal/os/BatterySipper;->gpsTimeMs:J
-Lcom/android/internal/os/BatterySipper;->mPackages:[Ljava/lang/String;
-Lcom/android/internal/os/BatterySipper;->packageWithHighestDrain:Ljava/lang/String;
-Lcom/android/internal/os/BatterySipper;->totalPowerMah:D
-Lcom/android/internal/os/BatterySipper;->uidObj:Landroid/os/BatteryStats$Uid;
-Lcom/android/internal/os/BatterySipper;->usageTimeMs:J
-Lcom/android/internal/os/BatterySipper;->userId:I
-Lcom/android/internal/os/BatterySipper;->wakeLockTimeMs:J
-Lcom/android/internal/os/BatterySipper;->wifiRunningTimeMs:J
-Lcom/android/internal/os/BatteryStatsHelper;-><init>(Landroid/content/Context;)V
-Lcom/android/internal/os/BatteryStatsHelper;-><init>(Landroid/content/Context;Z)V
-Lcom/android/internal/os/BatteryStatsHelper;-><init>(Landroid/content/Context;ZZ)V
-Lcom/android/internal/os/BatteryStatsHelper;->clearStats()V
-Lcom/android/internal/os/BatteryStatsHelper;->create(Landroid/os/Bundle;)V
-Lcom/android/internal/os/BatteryStatsHelper;->dropFile(Landroid/content/Context;Ljava/lang/String;)V
-Lcom/android/internal/os/BatteryStatsHelper;->getBatteryBroadcast()Landroid/content/Intent;
-Lcom/android/internal/os/BatteryStatsHelper;->getMaxPower()D
-Lcom/android/internal/os/BatteryStatsHelper;->getStats()Landroid/os/BatteryStats;
-Lcom/android/internal/os/BatteryStatsHelper;->getTotalPower()D
-Lcom/android/internal/os/BatteryStatsHelper;->getUsageList()Ljava/util/List;
-Lcom/android/internal/os/BatteryStatsHelper;->load()V
-Lcom/android/internal/os/BatteryStatsHelper;->mBatteryInfo:Lcom/android/internal/app/IBatteryStats;
-Lcom/android/internal/os/BatteryStatsHelper;->mPowerProfile:Lcom/android/internal/os/PowerProfile;
-Lcom/android/internal/os/BatteryStatsHelper;->mUsageList:Ljava/util/List;
-Lcom/android/internal/os/BatteryStatsHelper;->refreshStats(II)V
-Lcom/android/internal/os/BatteryStatsHelper;->refreshStats(ILandroid/util/SparseArray;)V
-Lcom/android/internal/os/BatteryStatsHelper;->refreshStats(ILjava/util/List;)V
-Lcom/android/internal/os/BatteryStatsHelper;->storeState()V
-Lcom/android/internal/os/BatteryStatsImpl$Counter;->mCount:Ljava/util/concurrent/atomic/AtomicInteger;
-Lcom/android/internal/os/BatteryStatsImpl$StopwatchTimer;->detach()V
-Lcom/android/internal/os/BatteryStatsImpl$Timer;->getCountLocked(I)I
-Lcom/android/internal/os/BatteryStatsImpl$Timer;->getTotalTimeLocked(JI)J
-Lcom/android/internal/os/BatteryStatsImpl$Timer;->writeTimerToParcel(Landroid/os/Parcel;Lcom/android/internal/os/BatteryStatsImpl$Timer;J)V
-Lcom/android/internal/os/BatteryStatsImpl$Uid$Pkg$Serv;->getBatteryStats()Lcom/android/internal/os/BatteryStatsImpl;
-Lcom/android/internal/os/BatteryStatsImpl$Uid$Pkg$Serv;->startLaunchedLocked()V
-Lcom/android/internal/os/BatteryStatsImpl$Uid$Pkg$Serv;->startRunningLocked()V
-Lcom/android/internal/os/BatteryStatsImpl$Uid$Pkg$Serv;->stopLaunchedLocked()V
-Lcom/android/internal/os/BatteryStatsImpl$Uid$Pkg$Serv;->stopRunningLocked()V
-Lcom/android/internal/os/BatteryStatsImpl$Uid$Proc;->addCpuTimeLocked(II)V
-Lcom/android/internal/os/BatteryStatsImpl$Uid$Proc;->addForegroundTimeLocked(J)V
-Lcom/android/internal/os/BatteryStatsImpl$Uid$Proc;->getForegroundTime(I)J
-Lcom/android/internal/os/BatteryStatsImpl$Uid$Proc;->getStarts(I)I
-Lcom/android/internal/os/BatteryStatsImpl$Uid$Proc;->getSystemTime(I)J
-Lcom/android/internal/os/BatteryStatsImpl$Uid$Proc;->getUserTime(I)J
-Lcom/android/internal/os/BatteryStatsImpl$Uid$Proc;->incStartsLocked()V
-Lcom/android/internal/os/BatteryStatsImpl$Uid$Sensor;->getHandle()I
-Lcom/android/internal/os/BatteryStatsImpl$Uid$Sensor;->getSensorTime()Lcom/android/internal/os/BatteryStatsImpl$Timer;
-Lcom/android/internal/os/BatteryStatsImpl$Uid$Wakelock;->getWakeTime(I)Lcom/android/internal/os/BatteryStatsImpl$Timer;
-Lcom/android/internal/os/BatteryStatsImpl$Uid;->getProcessStats()Landroid/util/ArrayMap;
-Lcom/android/internal/os/BatteryStatsImpl$Uid;->getSensorStats()Landroid/util/SparseArray;
-Lcom/android/internal/os/BatteryStatsImpl$Uid;->getUid()I
-Lcom/android/internal/os/BatteryStatsImpl$Uid;->getWakelockStats()Landroid/util/ArrayMap;
-Lcom/android/internal/os/BatteryStatsImpl$Uid;->getWifiRunningTime(JI)J
-Lcom/android/internal/os/BatteryStatsImpl$Uid;->getWifiScanTime(JI)J
-Lcom/android/internal/os/BatteryStatsImpl;-><init>(Landroid/os/Parcel;)V
-Lcom/android/internal/os/BatteryStatsImpl;->computeBatteryRealtime(JI)J
-Lcom/android/internal/os/BatteryStatsImpl;->computeBatteryTimeRemaining(J)J
-Lcom/android/internal/os/BatteryStatsImpl;->computeBatteryUptime(JI)J
-Lcom/android/internal/os/BatteryStatsImpl;->CREATOR:Landroid/os/Parcelable$Creator;
-Lcom/android/internal/os/BatteryStatsImpl;->getAwakeTimeBattery()J
-Lcom/android/internal/os/BatteryStatsImpl;->getAwakeTimePlugged()J
-Lcom/android/internal/os/BatteryStatsImpl;->getBatteryRealtime(J)J
-Lcom/android/internal/os/BatteryStatsImpl;->getDischargeAmount(I)I
-Lcom/android/internal/os/BatteryStatsImpl;->getDischargeAmountScreenOff()I
-Lcom/android/internal/os/BatteryStatsImpl;->getDischargeAmountScreenOn()I
-Lcom/android/internal/os/BatteryStatsImpl;->getGlobalWifiRunningTime(JI)J
-Lcom/android/internal/os/BatteryStatsImpl;->getKernelWakelockStats()Ljava/util/Map;
-Lcom/android/internal/os/BatteryStatsImpl;->getMobileRadioActiveTime(JI)J
-Lcom/android/internal/os/BatteryStatsImpl;->getNetworkActivityBytes(II)J
-Lcom/android/internal/os/BatteryStatsImpl;->getNextHistoryLocked(Landroid/os/BatteryStats$HistoryItem;)Z
-Lcom/android/internal/os/BatteryStatsImpl;->getPackageStatsLocked(ILjava/lang/String;)Lcom/android/internal/os/BatteryStatsImpl$Uid$Pkg;
-Lcom/android/internal/os/BatteryStatsImpl;->getPhoneDataConnectionCount(II)I
-Lcom/android/internal/os/BatteryStatsImpl;->getPhoneDataConnectionTime(IJI)J
-Lcom/android/internal/os/BatteryStatsImpl;->getPhoneSignalStrengthCount(II)I
-Lcom/android/internal/os/BatteryStatsImpl;->getProcessStatsLocked(ILjava/lang/String;)Lcom/android/internal/os/BatteryStatsImpl$Uid$Proc;
-Lcom/android/internal/os/BatteryStatsImpl;->getScreenOnTime(JI)J
-Lcom/android/internal/os/BatteryStatsImpl;->getServiceStatsLocked(ILjava/lang/String;Ljava/lang/String;)Lcom/android/internal/os/BatteryStatsImpl$Uid$Pkg$Serv;
-Lcom/android/internal/os/BatteryStatsImpl;->getUidStats()Landroid/util/SparseArray;
-Lcom/android/internal/os/BatteryStatsImpl;->getUidStatsLocked(I)Lcom/android/internal/os/BatteryStatsImpl$Uid;
-Lcom/android/internal/os/BatteryStatsImpl;->isOnBattery()Z
-Lcom/android/internal/os/BatteryStatsImpl;->mFullTimers:Ljava/util/ArrayList;
-Lcom/android/internal/os/BatteryStatsImpl;->mPartialTimers:Ljava/util/ArrayList;
-Lcom/android/internal/os/BatteryStatsImpl;->mWindowTimers:Ljava/util/ArrayList;
-Lcom/android/internal/os/BatteryStatsImpl;->noteAudioOffLocked(I)V
-Lcom/android/internal/os/BatteryStatsImpl;->noteAudioOnLocked(I)V
-Lcom/android/internal/os/BatteryStatsImpl;->noteFullWifiLockAcquiredLocked(I)V
-Lcom/android/internal/os/BatteryStatsImpl;->noteFullWifiLockReleasedLocked(I)V
-Lcom/android/internal/os/BatteryStatsImpl;->notePhoneDataConnectionStateLocked(IZ)V
-Lcom/android/internal/os/BatteryStatsImpl;->notePhoneOffLocked()V
-Lcom/android/internal/os/BatteryStatsImpl;->notePhoneOnLocked()V
-Lcom/android/internal/os/BatteryStatsImpl;->notePhoneSignalStrengthLocked(Landroid/telephony/SignalStrength;)V
-Lcom/android/internal/os/BatteryStatsImpl;->noteScreenBrightnessLocked(I)V
-Lcom/android/internal/os/BatteryStatsImpl;->noteUserActivityLocked(II)V
-Lcom/android/internal/os/BatteryStatsImpl;->noteVideoOffLocked(I)V
-Lcom/android/internal/os/BatteryStatsImpl;->noteVideoOnLocked(I)V
-Lcom/android/internal/os/BatteryStatsImpl;->noteWifiMulticastDisabledLocked(I)V
-Lcom/android/internal/os/BatteryStatsImpl;->noteWifiMulticastEnabledLocked(I)V
-Lcom/android/internal/os/BatteryStatsImpl;->readLocked()V
-Lcom/android/internal/os/BatteryStatsImpl;->removeUidStatsLocked(I)V
-Lcom/android/internal/os/BatteryStatsImpl;->startIteratingHistoryLocked()Z
-Lcom/android/internal/os/FuseAppLoop;->onCommand(IJJJI[B)V
-Lcom/android/internal/os/FuseAppLoop;->onOpen(JJ)[B
-Lcom/android/internal/os/HandlerCaller;->obtainMessage(I)Landroid/os/Message;
-Lcom/android/internal/os/HandlerCaller;->obtainMessageIO(IILjava/lang/Object;)Landroid/os/Message;
-Lcom/android/internal/os/HandlerCaller;->obtainMessageIOO(IILjava/lang/Object;Ljava/lang/Object;)Landroid/os/Message;
-Lcom/android/internal/os/HandlerCaller;->obtainMessageO(ILjava/lang/Object;)Landroid/os/Message;
-Lcom/android/internal/os/HandlerCaller;->obtainMessageOO(ILjava/lang/Object;Ljava/lang/Object;)Landroid/os/Message;
-Lcom/android/internal/os/HandlerCaller;->obtainMessageOOO(ILjava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Landroid/os/Message;
-Lcom/android/internal/os/HandlerCaller;->sendMessage(Landroid/os/Message;)V
 Lcom/android/internal/os/IDropBoxManagerService$Stub;->asInterface(Landroid/os/IBinder;)Lcom/android/internal/os/IDropBoxManagerService;
 Lcom/android/internal/os/IDropBoxManagerService;->getNextEntry(Ljava/lang/String;JLjava/lang/String;)Landroid/os/DropBoxManager$Entry;
-Lcom/android/internal/os/PowerProfile;-><init>(Landroid/content/Context;)V
-Lcom/android/internal/os/PowerProfile;->getAveragePower(Ljava/lang/String;)D
-Lcom/android/internal/os/PowerProfile;->getAveragePower(Ljava/lang/String;I)D
-Lcom/android/internal/os/PowerProfile;->getBatteryCapacity()D
-Lcom/android/internal/os/PowerProfile;->getNumCpuClusters()I
-Lcom/android/internal/os/PowerProfile;->getNumSpeedStepsInCpuCluster(I)I
-Lcom/android/internal/os/PowerProfile;->POWER_BLUETOOTH_AT_CMD:Ljava/lang/String;
-Lcom/android/internal/os/PowerProfile;->POWER_BLUETOOTH_ON:Ljava/lang/String;
-Lcom/android/internal/os/PowerProfile;->POWER_CPU_ACTIVE:Ljava/lang/String;
-Lcom/android/internal/os/PowerProfile;->POWER_CPU_IDLE:Ljava/lang/String;
-Lcom/android/internal/os/PowerProfile;->POWER_GPS_ON:Ljava/lang/String;
-Lcom/android/internal/os/PowerProfile;->POWER_RADIO_ACTIVE:Ljava/lang/String;
-Lcom/android/internal/os/PowerProfile;->POWER_RADIO_ON:Ljava/lang/String;
-Lcom/android/internal/os/PowerProfile;->POWER_RADIO_SCANNING:Ljava/lang/String;
-Lcom/android/internal/os/PowerProfile;->POWER_SCREEN_FULL:Ljava/lang/String;
-Lcom/android/internal/os/PowerProfile;->POWER_SCREEN_ON:Ljava/lang/String;
-Lcom/android/internal/os/PowerProfile;->POWER_WIFI_ACTIVE:Ljava/lang/String;
-Lcom/android/internal/os/PowerProfile;->POWER_WIFI_ON:Ljava/lang/String;
-Lcom/android/internal/os/PowerProfile;->POWER_WIFI_SCAN:Ljava/lang/String;
-Lcom/android/internal/os/SomeArgs;->arg1:Ljava/lang/Object;
-Lcom/android/internal/os/SomeArgs;->argi2:I
-Lcom/android/internal/os/SomeArgs;->argi3:I
 Lcom/android/internal/policy/IKeyguardService$Stub;->asInterface(Landroid/os/IBinder;)Lcom/android/internal/policy/IKeyguardService;
 Lcom/android/internal/policy/IKeyguardService;->doKeyguardTimeout(Landroid/os/Bundle;)V
 Lcom/android/internal/policy/IKeyguardService;->setKeyguardEnabled(Z)V
@@ -3253,34 +2477,8 @@
 Lcom/android/internal/telephony/SmsRawData;->CREATOR:Landroid/os/Parcelable$Creator;
 Lcom/android/internal/telephony/SmsRawData;->getBytes()[B
 Lcom/android/internal/textservice/ITextServicesManager$Stub$Proxy;-><init>(Landroid/os/IBinder;)V
-Lcom/android/internal/util/AsyncChannel;->cmdToString(I)Ljava/lang/String;
-Lcom/android/internal/util/AsyncChannel;->CMD_CHANNEL_FULL_CONNECTION:I
-Lcom/android/internal/util/AsyncChannel;->CMD_CHANNEL_HALF_CONNECTED:I
-Lcom/android/internal/util/AsyncChannel;->connected(Landroid/content/Context;Landroid/os/Handler;Landroid/os/Messenger;)V
-Lcom/android/internal/util/AsyncChannel;->connectSync(Landroid/content/Context;Landroid/os/Handler;Landroid/os/Messenger;)I
-Lcom/android/internal/util/AsyncChannel;->disconnect()V
-Lcom/android/internal/util/AsyncChannel;->replyToMessage(Landroid/os/Message;I)V
-Lcom/android/internal/util/AsyncChannel;->replyToMessage(Landroid/os/Message;II)V
-Lcom/android/internal/util/AsyncChannel;->replyToMessage(Landroid/os/Message;IIILjava/lang/Object;)V
-Lcom/android/internal/util/AsyncChannel;->replyToMessage(Landroid/os/Message;ILjava/lang/Object;)V
-Lcom/android/internal/util/AsyncChannel;->replyToMessage(Landroid/os/Message;Landroid/os/Message;)V
-Lcom/android/internal/util/AsyncChannel;->sendMessage(I)V
-Lcom/android/internal/util/AsyncChannel;->sendMessage(II)V
-Lcom/android/internal/util/AsyncChannel;->sendMessage(III)V
-Lcom/android/internal/util/AsyncChannel;->sendMessage(IIILjava/lang/Object;)V
-Lcom/android/internal/util/AsyncChannel;->sendMessageSynchronously(III)Landroid/os/Message;
-Lcom/android/internal/util/AsyncChannel;->sendMessageSynchronously(Landroid/os/Message;)Landroid/os/Message;
-Lcom/android/internal/util/AsyncChannel;->STATUS_SUCCESSFUL:I
-Lcom/android/internal/util/FastPrintWriter;-><init>(Ljava/io/OutputStream;)V
 Lcom/android/internal/util/HexDump;->toHexString([BZ)Ljava/lang/String;
-Lcom/android/internal/util/XmlUtils;->convertValueToBoolean(Ljava/lang/CharSequence;Z)Z
-Lcom/android/internal/util/XmlUtils;->convertValueToInt(Ljava/lang/CharSequence;I)I
-Lcom/android/internal/util/XmlUtils;->readMapXml(Ljava/io/InputStream;)Ljava/util/HashMap;
-Lcom/android/internal/util/XmlUtils;->skipCurrentTag(Lorg/xmlpull/v1/XmlPullParser;)V
-Lcom/android/internal/util/XmlUtils;->writeMapXml(Ljava/util/Map;Ljava/io/OutputStream;)V
 Lcom/android/internal/view/BaseIWindow;-><init>()V
-Lcom/android/internal/view/IInputConnectionWrapper;->mInputConnection:Landroid/view/inputmethod/InputConnection;
-Lcom/android/internal/view/IInputConnectionWrapper;->mLock:Ljava/lang/Object;
 Lcom/android/internal/view/IInputMethod$Stub;->asInterface(Landroid/os/IBinder;)Lcom/android/internal/view/IInputMethod;
 Lcom/android/internal/view/IInputMethod;->attachToken(Landroid/os/IBinder;)V
 Lcom/android/internal/view/IInputMethod;->bindInput(Landroid/view/inputmethod/InputBinding;)V
@@ -3297,53 +2495,6 @@
 Lcom/android/internal/view/IInputMethodManager;->addClient(Lcom/android/internal/view/IInputMethodClient;Lcom/android/internal/view/IInputContext;II)V
 Lcom/android/internal/view/IInputMethodManager;->removeClient(Lcom/android/internal/view/IInputMethodClient;)V
 Lcom/android/internal/view/IInputMethodSession$Stub;->asInterface(Landroid/os/IBinder;)Lcom/android/internal/view/IInputMethodSession;
-Lcom/android/internal/view/InputBindResult;->CREATOR:Landroid/os/Parcelable$Creator;
-Lcom/android/internal/view/InputBindResult;->method:Lcom/android/internal/view/IInputMethodSession;
-Lcom/android/internal/view/menu/ActionMenuItemView;->hasText()Z
-Lcom/android/internal/view/menu/MenuBuilder$Callback;->onMenuItemSelected(Lcom/android/internal/view/menu/MenuBuilder;Landroid/view/MenuItem;)Z
-Lcom/android/internal/view/menu/MenuBuilder$Callback;->onMenuModeChange(Lcom/android/internal/view/menu/MenuBuilder;)V
-Lcom/android/internal/view/menu/MenuBuilder;-><init>(Landroid/content/Context;)V
-Lcom/android/internal/view/menu/MenuBuilder;->addMenuPresenter(Lcom/android/internal/view/menu/MenuPresenter;)V
-Lcom/android/internal/view/menu/MenuBuilder;->addMenuPresenter(Lcom/android/internal/view/menu/MenuPresenter;Landroid/content/Context;)V
-Lcom/android/internal/view/menu/MenuBuilder;->collapseItemActionView(Lcom/android/internal/view/menu/MenuItemImpl;)Z
-Lcom/android/internal/view/menu/MenuBuilder;->getContext()Landroid/content/Context;
-Lcom/android/internal/view/menu/MenuBuilder;->getHeaderIcon()Landroid/graphics/drawable/Drawable;
-Lcom/android/internal/view/menu/MenuBuilder;->getHeaderTitle()Ljava/lang/CharSequence;
-Lcom/android/internal/view/menu/MenuBuilder;->getNonActionItems()Ljava/util/ArrayList;
-Lcom/android/internal/view/menu/MenuBuilder;->getRootMenu()Lcom/android/internal/view/menu/MenuBuilder;
-Lcom/android/internal/view/menu/MenuBuilder;->getVisibleItems()Ljava/util/ArrayList;
-Lcom/android/internal/view/menu/MenuBuilder;->mContext:Landroid/content/Context;
-Lcom/android/internal/view/menu/MenuBuilder;->removeMenuPresenter(Lcom/android/internal/view/menu/MenuPresenter;)V
-Lcom/android/internal/view/menu/MenuBuilder;->setCallback(Lcom/android/internal/view/menu/MenuBuilder$Callback;)V
-Lcom/android/internal/view/menu/MenuBuilder;->setCurrentMenuInfo(Landroid/view/ContextMenu$ContextMenuInfo;)V
-Lcom/android/internal/view/menu/MenuBuilder;->setDefaultShowAsAction(I)Lcom/android/internal/view/menu/MenuBuilder;
-Lcom/android/internal/view/menu/MenuBuilder;->setOptionalIconsVisible(Z)V
-Lcom/android/internal/view/menu/MenuBuilder;->startDispatchingItemsChanged()V
-Lcom/android/internal/view/menu/MenuBuilder;->stopDispatchingItemsChanged()V
-Lcom/android/internal/view/menu/MenuItemImpl;->invoke()Z
-Lcom/android/internal/view/menu/MenuItemImpl;->isActionButton()Z
-Lcom/android/internal/view/menu/MenuItemImpl;->mIconResId:I
-Lcom/android/internal/view/menu/MenuItemImpl;->requestsActionButton()Z
-Lcom/android/internal/view/menu/MenuItemImpl;->requiresActionButton()Z
-Lcom/android/internal/view/menu/MenuItemImpl;->setActionViewExpanded(Z)V
-Lcom/android/internal/view/menu/MenuItemImpl;->setExclusiveCheckable(Z)V
-Lcom/android/internal/view/menu/MenuItemImpl;->setMenuInfo(Landroid/view/ContextMenu$ContextMenuInfo;)V
-Lcom/android/internal/view/menu/MenuPopupHelper;-><init>(Landroid/content/Context;Lcom/android/internal/view/menu/MenuBuilder;)V
-Lcom/android/internal/view/menu/MenuPopupHelper;-><init>(Landroid/content/Context;Lcom/android/internal/view/menu/MenuBuilder;Landroid/view/View;)V
-Lcom/android/internal/view/menu/MenuPopupHelper;->dismiss()V
-Lcom/android/internal/view/menu/MenuPopupHelper;->getPopup()Lcom/android/internal/view/menu/MenuPopup;
-Lcom/android/internal/view/menu/MenuPopupHelper;->mForceShowIcon:Z
-Lcom/android/internal/view/menu/MenuPopupHelper;->setAnchorView(Landroid/view/View;)V
-Lcom/android/internal/view/menu/MenuPopupHelper;->setForceShowIcon(Z)V
-Lcom/android/internal/view/menu/MenuPopupHelper;->setGravity(I)V
-Lcom/android/internal/view/menu/MenuPopupHelper;->show()V
-Lcom/android/internal/view/menu/MenuPopupHelper;->tryShow()Z
-Lcom/android/internal/view/menu/MenuPresenter$Callback;->onOpenSubMenu(Lcom/android/internal/view/menu/MenuBuilder;)Z
-Lcom/android/internal/view/menu/MenuView$ItemView;->getItemData()Lcom/android/internal/view/menu/MenuItemImpl;
-Lcom/android/internal/view/menu/MenuView;->getWindowAnimations()I
-Lcom/android/internal/view/menu/SubMenuBuilder;->getRootMenu()Lcom/android/internal/view/menu/MenuBuilder;
-Lcom/android/internal/view/menu/SubMenuBuilder;->setCallback(Lcom/android/internal/view/menu/MenuBuilder$Callback;)V
-Lcom/android/internal/widget/CachingIconView;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
 Lcom/android/internal/widget/ILockSettings$Stub;->asInterface(Landroid/os/IBinder;)Lcom/android/internal/widget/ILockSettings;
 Lcom/android/internal/widget/ILockSettings;->getBoolean(Ljava/lang/String;ZI)Z
 Lcom/android/internal/widget/ILockSettings;->getLong(Ljava/lang/String;JI)J
@@ -3363,16 +2514,6 @@
 Lcom/android/internal/widget/IRemoteViewsFactory;->isCreated()Z
 Lcom/android/internal/widget/IRemoteViewsFactory;->onDataSetChanged()V
 Lcom/android/internal/widget/ScrollBarUtils;->getThumbLength(IIII)I
-Lcom/android/internal/widget/ScrollingTabContainerView;-><init>(Landroid/content/Context;)V
-Lcom/android/internal/widget/ScrollingTabContainerView;->addTab(Landroid/app/ActionBar$Tab;IZ)V
-Lcom/android/internal/widget/ScrollingTabContainerView;->addTab(Landroid/app/ActionBar$Tab;Z)V
-Lcom/android/internal/widget/ScrollingTabContainerView;->animateToTab(I)V
-Lcom/android/internal/widget/ScrollingTabContainerView;->animateToVisibility(I)V
-Lcom/android/internal/widget/ScrollingTabContainerView;->removeAllTabs()V
-Lcom/android/internal/widget/ScrollingTabContainerView;->removeTabAt(I)V
-Lcom/android/internal/widget/ScrollingTabContainerView;->setAllowCollapse(Z)V
-Lcom/android/internal/widget/ScrollingTabContainerView;->setTabSelected(I)V
-Lcom/android/internal/widget/ScrollingTabContainerView;->updateTab(I)V
 Lcom/android/okhttp/Connection;->getSocket()Ljava/net/Socket;
 Lcom/android/okhttp/ConnectionPool;->connections:Ljava/util/Deque;
 Lcom/android/okhttp/ConnectionPool;->keepAliveDurationNs:J
diff --git a/config/hiddenapi-vendor-list.txt b/config/hiddenapi-vendor-list.txt
index 435f9bb..9e6abe4 100644
--- a/config/hiddenapi-vendor-list.txt
+++ b/config/hiddenapi-vendor-list.txt
@@ -166,7 +166,6 @@
 Landroid/view/IWindowManager;->overridePendingAppTransitionMultiThumbFuture(Landroid/view/IAppTransitionAnimationSpecsFuture;Landroid/os/IRemoteCallback;Z)V
 Landroid/view/IWindowManager;->overridePendingAppTransitionRemote(Landroid/view/RemoteAnimationAdapter;)V
 Landroid/view/IWindowManager;->setNavBarVirtualKeyHapticFeedbackEnabled(Z)V
-Landroid/widget/ListView;->lookForSelectablePosition(IZ)I
 Lcom/android/ims/ImsConfigListener;->onSetFeatureResponse(IIII)V
 Lcom/android/ims/internal/IImsCallSessionListener;->callSessionConferenceStateUpdated(Lcom/android/ims/internal/IImsCallSession;Landroid/telephony/ims/ImsConferenceState;)V
 Lcom/android/ims/internal/IImsCallSessionListener;->callSessionHandover(Lcom/android/ims/internal/IImsCallSession;IILandroid/telephony/ims/ImsReasonInfo;)V
@@ -249,19 +248,8 @@
 Lcom/android/ims/internal/uce/uceservice/IUceService;->isServiceStarted()Z
 Lcom/android/ims/internal/uce/uceservice/IUceService;->startService(Lcom/android/ims/internal/uce/uceservice/IUceListener;)Z
 Lcom/android/ims/internal/uce/uceservice/IUceService;->stopService()Z
-Lcom/android/internal/app/AlertController$AlertParams;->mIconId:I
-Lcom/android/internal/app/AlertController$AlertParams;->mMessage:Ljava/lang/CharSequence;
-Lcom/android/internal/app/AlertController$AlertParams;->mNegativeButtonListener:Landroid/content/DialogInterface$OnClickListener;
-Lcom/android/internal/app/AlertController$AlertParams;->mNegativeButtonText:Ljava/lang/CharSequence;
-Lcom/android/internal/app/AlertController$AlertParams;->mPositiveButtonListener:Landroid/content/DialogInterface$OnClickListener;
-Lcom/android/internal/app/AlertController$AlertParams;->mPositiveButtonText:Ljava/lang/CharSequence;
-Lcom/android/internal/app/AlertController$AlertParams;->mTitle:Ljava/lang/CharSequence;
-Lcom/android/internal/app/AlertController$AlertParams;->mView:Landroid/view/View;
-Lcom/android/internal/app/AlertController;->getButton(I)Landroid/widget/Button;
 Lcom/android/internal/app/IAppOpsService;->finishOperation(Landroid/os/IBinder;IILjava/lang/String;)V
 Lcom/android/internal/content/PackageMonitor;-><init>()V
-Lcom/android/internal/content/PackageMonitor;->register(Landroid/content/Context;Landroid/os/Looper;Landroid/os/UserHandle;Z)V
-Lcom/android/internal/content/PackageMonitor;->unregister()V
 Lcom/android/internal/location/ILocationProvider$Stub;->asInterface(Landroid/os/IBinder;)Lcom/android/internal/location/ILocationProvider;
 Lcom/android/internal/location/ILocationProvider;->disable()V
 Lcom/android/internal/location/ILocationProvider;->enable()V
@@ -270,21 +258,6 @@
 Lcom/android/internal/location/ILocationProvider;->getStatusUpdateTime()J
 Lcom/android/internal/location/ILocationProvider;->sendExtraCommand(Ljava/lang/String;Landroid/os/Bundle;)Z
 Lcom/android/internal/location/ILocationProvider;->setRequest(Lcom/android/internal/location/ProviderRequest;Landroid/os/WorkSource;)V
-Lcom/android/internal/location/ProviderRequest;-><init>()V
-Lcom/android/internal/location/ProviderRequest;->interval:J
-Lcom/android/internal/location/ProviderRequest;->locationRequests:Ljava/util/List;
-Lcom/android/internal/location/ProviderRequest;->reportLocation:Z
-Lcom/android/internal/os/BatteryStatsImpl;->getDischargeCurrentLevel()I
-Lcom/android/internal/os/BatteryStatsImpl;->getDischargeStartLevel()I
-Lcom/android/internal/os/BatteryStatsImpl;->getPhoneOnTime(JI)J
-Lcom/android/internal/os/BatteryStatsImpl;->getPhoneSignalScanningTime(JI)J
-Lcom/android/internal/os/BatteryStatsImpl;->getPhoneSignalStrengthTime(IJI)J
-Lcom/android/internal/os/BatteryStatsImpl;->getScreenBrightnessTime(IJI)J
-Lcom/android/internal/os/BatteryStatsImpl;->getWifiOnTime(JI)J
-Lcom/android/internal/os/SomeArgs;->arg2:Ljava/lang/Object;
-Lcom/android/internal/os/SomeArgs;->arg3:Ljava/lang/Object;
-Lcom/android/internal/os/SomeArgs;->obtain()Lcom/android/internal/os/SomeArgs;
-Lcom/android/internal/os/SomeArgs;->recycle()V
 Lcom/android/internal/R$styleable;->NumberPicker:[I
 Lcom/android/internal/R$styleable;->TwoLineListItem:[I
 Lcom/android/internal/telephony/GsmAlphabet;->gsm7BitPackedToString([BII)Ljava/lang/String;
@@ -298,14 +271,6 @@
 Lcom/android/internal/telephony/OperatorInfo;->getOperatorAlphaShort()Ljava/lang/String;
 Lcom/android/internal/telephony/OperatorInfo;->getOperatorNumeric()Ljava/lang/String;
 Lcom/android/internal/telephony/OperatorInfo;->getState()Lcom/android/internal/telephony/OperatorInfo$State;
-Lcom/android/internal/util/AsyncChannel;-><init>()V
-Lcom/android/internal/util/AsyncChannel;->connect(Landroid/content/Context;Landroid/os/Handler;Landroid/os/Messenger;)V
-Lcom/android/internal/util/AsyncChannel;->sendMessage(Landroid/os/Message;)V
-Lcom/android/internal/util/IndentingPrintWriter;-><init>(Ljava/io/Writer;Ljava/lang/String;)V
-Lcom/android/internal/util/IndentingPrintWriter;->decreaseIndent()Lcom/android/internal/util/IndentingPrintWriter;
-Lcom/android/internal/util/IndentingPrintWriter;->increaseIndent()Lcom/android/internal/util/IndentingPrintWriter;
-Lcom/android/internal/util/XmlUtils;->beginDocument(Lorg/xmlpull/v1/XmlPullParser;Ljava/lang/String;)V
-Lcom/android/internal/util/XmlUtils;->nextElement(Lorg/xmlpull/v1/XmlPullParser;)V
 Ljava/lang/System;->arraycopy([BI[BII)V
 Ljava/net/Inet4Address;->ALL:Ljava/net/InetAddress;
 Ljava/net/Inet4Address;->ANY:Ljava/net/InetAddress;
diff --git a/config/preloaded-classes b/config/preloaded-classes
index 0014793..63c583f 100644
--- a/config/preloaded-classes
+++ b/config/preloaded-classes
@@ -6236,9 +6236,9 @@
 org.json.JSONStringer
 org.json.JSONStringer$Scope
 org.json.JSONTokener
-org.kxml2.io.KXmlParser
-org.kxml2.io.KXmlParser$ValueContext
-org.kxml2.io.KXmlSerializer
+com.android.org.kxml2.io.KXmlParser
+com.android.org.kxml2.io.KXmlParser$ValueContext
+com.android.org.kxml2.io.KXmlSerializer
 org.w3c.dom.CharacterData
 org.w3c.dom.DOMImplementation
 org.w3c.dom.Document
diff --git a/core/java/android/app/job/JobSnapshot.java b/core/java/android/app/job/JobSnapshot.java
index d6cc70d..ceeaab7 100644
--- a/core/java/android/app/job/JobSnapshot.java
+++ b/core/java/android/app/job/JobSnapshot.java
@@ -50,6 +50,14 @@
     }
 
     /**
+     * Returning JobInfo bound to this snapshot
+     * @return JobInfo of this snapshot
+     */
+    public JobInfo getJobInfo() {
+        return mJob;
+    }
+
+    /**
      * Is this job actually runnable at this moment?
      */
     public boolean isRunnable() {
@@ -77,7 +85,7 @@
      */
     public boolean isRequireDeviceIdleSatisfied() {
         return !mJob.isRequireDeviceIdle()
-                || satisfied(JobInfo.CONSTRAINT_FLAG_BATTERY_NOT_LOW);
+                || satisfied(JobInfo.CONSTRAINT_FLAG_DEVICE_IDLE);
     }
 
     public boolean isRequireStorageNotLowSatisfied() {
diff --git a/core/java/android/bluetooth/BluetoothAdapter.java b/core/java/android/bluetooth/BluetoothAdapter.java
index 3c22905..4c655b5 100644
--- a/core/java/android/bluetooth/BluetoothAdapter.java
+++ b/core/java/android/bluetooth/BluetoothAdapter.java
@@ -446,6 +446,12 @@
      */
     public static final int IO_CAPABILITY_UNKNOWN = 255;
 
+    /** @hide */
+    @IntDef({IO_CAPABILITY_OUT, IO_CAPABILITY_IO, IO_CAPABILITY_IN, IO_CAPABILITY_NONE,
+            IO_CAPABILITY_KBDISP})
+    @Retention(RetentionPolicy.SOURCE)
+    public @interface IoCapability {}
+
     /**
      * Broadcast Action: The local Bluetooth adapter has started the remote
      * device discovery process.
@@ -1292,6 +1298,7 @@
      * @hide
      */
     @RequiresPermission(Manifest.permission.BLUETOOTH_ADMIN)
+    @IoCapability
     public int getIoCapability() {
         if (getState() != STATE_ON) return BluetoothAdapter.IO_CAPABILITY_UNKNOWN;
         try {
@@ -1319,7 +1326,7 @@
      * @hide
      */
     @RequiresPermission(Manifest.permission.BLUETOOTH_PRIVILEGED)
-    public boolean setIoCapability(int capability) {
+    public boolean setIoCapability(@IoCapability int capability) {
         if (getState() != STATE_ON) return false;
         try {
             mServiceLock.readLock().lock();
@@ -1342,6 +1349,7 @@
      * @hide
      */
     @RequiresPermission(Manifest.permission.BLUETOOTH_ADMIN)
+    @IoCapability
     public int getLeIoCapability() {
         if (getState() != STATE_ON) return BluetoothAdapter.IO_CAPABILITY_UNKNOWN;
         try {
@@ -1369,7 +1377,7 @@
      * @hide
      */
     @RequiresPermission(Manifest.permission.BLUETOOTH_PRIVILEGED)
-    public boolean setLeIoCapability(int capability) {
+    public boolean setLeIoCapability(@IoCapability int capability) {
         if (getState() != STATE_ON) return false;
         try {
             mServiceLock.readLock().lock();
diff --git a/core/java/android/bluetooth/le/BluetoothLeScanner.java b/core/java/android/bluetooth/le/BluetoothLeScanner.java
index f5e2a09..ac126ae 100644
--- a/core/java/android/bluetooth/le/BluetoothLeScanner.java
+++ b/core/java/android/bluetooth/le/BluetoothLeScanner.java
@@ -275,7 +275,9 @@
     }
 
     /**
-     * Stops an ongoing Bluetooth LE scan started using a PendingIntent.
+     * Stops an ongoing Bluetooth LE scan started using a PendingIntent. When creating the
+     * PendingIntent parameter, please do not use the FLAG_CANCEL_CURRENT flag. Otherwise, the stop
+     * scan may have no effect.
      *
      * @param callbackIntent The PendingIntent that was used to start the scan.
      * @see #startScan(List, ScanSettings, PendingIntent)
diff --git a/core/java/android/content/Intent.java b/core/java/android/content/Intent.java
index a6b81b5..8c2b76f 100644
--- a/core/java/android/content/Intent.java
+++ b/core/java/android/content/Intent.java
@@ -2250,6 +2250,7 @@
      * <p>Includes the following extras:
      * <ul>
      * <li> {@link #EXTRA_CHANGED_PACKAGE_LIST} is the set of packages which have been suspended
+     * <li> {@link #EXTRA_CHANGED_UID_LIST} is the set of uids which have been suspended
      * </ul>
      *
      * <p class="note">This is a protected intent that can only be sent
@@ -2262,6 +2263,7 @@
      * <p>Includes the following extras:
      * <ul>
      * <li> {@link #EXTRA_CHANGED_PACKAGE_LIST} is the set of packages which have been unsuspended
+     * <li> {@link #EXTRA_CHANGED_UID_LIST} is the set of uids which have been unsuspended
      * </ul>
      *
      * <p class="note">This is a protected intent that can only be sent
diff --git a/core/java/android/hardware/biometrics/BiometricPrompt.java b/core/java/android/hardware/biometrics/BiometricPrompt.java
index bad418a..02bcff5 100644
--- a/core/java/android/hardware/biometrics/BiometricPrompt.java
+++ b/core/java/android/hardware/biometrics/BiometricPrompt.java
@@ -69,6 +69,7 @@
      * @hide
      */
     public static final int HIDE_DIALOG_DELAY = 2000; // ms
+
     /**
      * @hide
      */
diff --git a/core/java/android/hardware/camera2/CameraCharacteristics.java b/core/java/android/hardware/camera2/CameraCharacteristics.java
index f7d1b8d..35584ae 100644
--- a/core/java/android/hardware/camera2/CameraCharacteristics.java
+++ b/core/java/android/hardware/camera2/CameraCharacteristics.java
@@ -773,7 +773,6 @@
      * @see CaptureRequest#CONTROL_AWB_REGIONS
      * @hide
      */
-    @UnsupportedAppUsage
     public static final Key<int[]> CONTROL_MAX_REGIONS =
             new Key<int[]>("android.control.maxRegions", int[].class);
 
@@ -879,7 +878,6 @@
      * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
      * @hide
      */
-    @UnsupportedAppUsage
     public static final Key<android.hardware.camera2.params.HighSpeedVideoConfiguration[]> CONTROL_AVAILABLE_HIGH_SPEED_VIDEO_CONFIGURATIONS =
             new Key<android.hardware.camera2.params.HighSpeedVideoConfiguration[]>("android.control.availableHighSpeedVideoConfigurations", android.hardware.camera2.params.HighSpeedVideoConfiguration[].class);
 
@@ -1148,7 +1146,6 @@
      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
      * @hide
      */
-    @UnsupportedAppUsage
     public static final Key<android.util.Size> LENS_INFO_SHADING_MAP_SIZE =
             new Key<android.util.Size>("android.lens.info.shadingMapSize", android.util.Size.class);
 
@@ -1500,7 +1497,6 @@
      * @hide
      */
     @Deprecated
-    @UnsupportedAppUsage
     public static final Key<Byte> QUIRKS_USE_PARTIAL_RESULT =
             new Key<Byte>("android.quirks.usePartialResult", byte.class);
 
@@ -1538,7 +1534,6 @@
      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
      * @hide
      */
-    @UnsupportedAppUsage
     public static final Key<int[]> REQUEST_MAX_NUM_OUTPUT_STREAMS =
             new Key<int[]>("android.request.maxNumOutputStreams", int[].class);
 
@@ -1778,7 +1773,6 @@
      * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
      * @hide
      */
-    @UnsupportedAppUsage
     public static final Key<int[]> REQUEST_AVAILABLE_REQUEST_KEYS =
             new Key<int[]>("android.request.availableRequestKeys", int[].class);
 
@@ -1804,7 +1798,6 @@
      * @see CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE
      * @hide
      */
-    @UnsupportedAppUsage
     public static final Key<int[]> REQUEST_AVAILABLE_RESULT_KEYS =
             new Key<int[]>("android.request.availableResultKeys", int[].class);
 
@@ -1817,7 +1810,6 @@
      * <p>This key is available on all devices.</p>
      * @hide
      */
-    @UnsupportedAppUsage
     public static final Key<int[]> REQUEST_AVAILABLE_CHARACTERISTICS_KEYS =
             new Key<int[]>("android.request.availableCharacteristicsKeys", int[].class);
 
@@ -1864,7 +1856,6 @@
      * <p>This key is available on all devices.</p>
      * @hide
      */
-    @UnsupportedAppUsage
     public static final Key<int[]> REQUEST_AVAILABLE_SESSION_KEYS =
             new Key<int[]>("android.request.availableSessionKeys", int[].class);
 
@@ -1885,7 +1876,6 @@
      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
      * @hide
      */
-    @UnsupportedAppUsage
     public static final Key<int[]> REQUEST_AVAILABLE_PHYSICAL_CAMERA_REQUEST_KEYS =
             new Key<int[]>("android.request.availablePhysicalCameraRequestKeys", int[].class);
 
@@ -1901,7 +1891,6 @@
      * @hide
      */
     @Deprecated
-    @UnsupportedAppUsage
     public static final Key<int[]> SCALER_AVAILABLE_FORMATS =
             new Key<int[]>("android.scaler.availableFormats", int[].class);
 
@@ -1924,7 +1913,6 @@
      * @hide
      */
     @Deprecated
-    @UnsupportedAppUsage
     public static final Key<long[]> SCALER_AVAILABLE_JPEG_MIN_DURATIONS =
             new Key<long[]>("android.scaler.availableJpegMinDurations", long[].class);
 
@@ -1943,7 +1931,6 @@
      * @hide
      */
     @Deprecated
-    @UnsupportedAppUsage
     public static final Key<android.util.Size[]> SCALER_AVAILABLE_JPEG_SIZES =
             new Key<android.util.Size[]>("android.scaler.availableJpegSizes", android.util.Size[].class);
 
@@ -1985,7 +1972,6 @@
      * @hide
      */
     @Deprecated
-    @UnsupportedAppUsage
     public static final Key<long[]> SCALER_AVAILABLE_PROCESSED_MIN_DURATIONS =
             new Key<long[]>("android.scaler.availableProcessedMinDurations", long[].class);
 
@@ -2010,7 +1996,6 @@
      * @hide
      */
     @Deprecated
-    @UnsupportedAppUsage
     public static final Key<android.util.Size[]> SCALER_AVAILABLE_PROCESSED_SIZES =
             new Key<android.util.Size[]>("android.scaler.availableProcessedSizes", android.util.Size[].class);
 
@@ -2066,7 +2051,6 @@
      * @see CameraCharacteristics#REQUEST_MAX_NUM_INPUT_STREAMS
      * @hide
      */
-    @UnsupportedAppUsage
     public static final Key<android.hardware.camera2.params.ReprocessFormatsMap> SCALER_AVAILABLE_INPUT_OUTPUT_FORMATS_MAP =
             new Key<android.hardware.camera2.params.ReprocessFormatsMap>("android.scaler.availableInputOutputFormatsMap", android.hardware.camera2.params.ReprocessFormatsMap.class);
 
@@ -2159,7 +2143,6 @@
      * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
      * @hide
      */
-    @UnsupportedAppUsage
     public static final Key<android.hardware.camera2.params.StreamConfiguration[]> SCALER_AVAILABLE_STREAM_CONFIGURATIONS =
             new Key<android.hardware.camera2.params.StreamConfiguration[]>("android.scaler.availableStreamConfigurations", android.hardware.camera2.params.StreamConfiguration[].class);
 
@@ -2182,7 +2165,6 @@
      * @see CaptureRequest#SENSOR_FRAME_DURATION
      * @hide
      */
-    @UnsupportedAppUsage
     public static final Key<android.hardware.camera2.params.StreamConfigurationDuration[]> SCALER_AVAILABLE_MIN_FRAME_DURATIONS =
             new Key<android.hardware.camera2.params.StreamConfigurationDuration[]>("android.scaler.availableMinFrameDurations", android.hardware.camera2.params.StreamConfigurationDuration[].class);
 
@@ -2251,7 +2233,6 @@
      * @see CaptureRequest#SENSOR_FRAME_DURATION
      * @hide
      */
-    @UnsupportedAppUsage
     public static final Key<android.hardware.camera2.params.StreamConfigurationDuration[]> SCALER_AVAILABLE_STALL_DURATIONS =
             new Key<android.hardware.camera2.params.StreamConfigurationDuration[]>("android.scaler.availableStallDurations", android.hardware.camera2.params.StreamConfigurationDuration[].class);
 
@@ -3159,7 +3140,6 @@
      * @see #LED_AVAILABLE_LEDS_TRANSMIT
      * @hide
      */
-    @UnsupportedAppUsage
     public static final Key<int[]> LED_AVAILABLE_LEDS =
             new Key<int[]>("android.led.availableLeds", int[].class);
 
@@ -3346,7 +3326,6 @@
      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
      * @hide
      */
-    @UnsupportedAppUsage
     public static final Key<android.hardware.camera2.params.StreamConfiguration[]> DEPTH_AVAILABLE_DEPTH_STREAM_CONFIGURATIONS =
             new Key<android.hardware.camera2.params.StreamConfiguration[]>("android.depth.availableDepthStreamConfigurations", android.hardware.camera2.params.StreamConfiguration[].class);
 
@@ -3373,7 +3352,6 @@
      * @see CaptureRequest#SENSOR_FRAME_DURATION
      * @hide
      */
-    @UnsupportedAppUsage
     public static final Key<android.hardware.camera2.params.StreamConfigurationDuration[]> DEPTH_AVAILABLE_DEPTH_MIN_FRAME_DURATIONS =
             new Key<android.hardware.camera2.params.StreamConfigurationDuration[]>("android.depth.availableDepthMinFrameDurations", android.hardware.camera2.params.StreamConfigurationDuration[].class);
 
@@ -3397,7 +3375,6 @@
      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
      * @hide
      */
-    @UnsupportedAppUsage
     public static final Key<android.hardware.camera2.params.StreamConfigurationDuration[]> DEPTH_AVAILABLE_DEPTH_STALL_DURATIONS =
             new Key<android.hardware.camera2.params.StreamConfigurationDuration[]>("android.depth.availableDepthStallDurations", android.hardware.camera2.params.StreamConfigurationDuration[].class);
 
@@ -3441,7 +3418,6 @@
      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
      * @hide
      */
-    @UnsupportedAppUsage
     public static final Key<byte[]> LOGICAL_MULTI_CAMERA_PHYSICAL_IDS =
             new Key<byte[]>("android.logicalMultiCamera.physicalIds", byte[].class);
 
diff --git a/core/java/android/hardware/camera2/CaptureRequest.java b/core/java/android/hardware/camera2/CaptureRequest.java
index 47bef12..4a20468 100644
--- a/core/java/android/hardware/camera2/CaptureRequest.java
+++ b/core/java/android/hardware/camera2/CaptureRequest.java
@@ -2140,7 +2140,6 @@
      * <p>This key is available on all devices.</p>
      * @hide
      */
-    @UnsupportedAppUsage
     public static final Key<double[]> JPEG_GPS_COORDINATES =
             new Key<double[]>("android.jpeg.gpsCoordinates", double[].class);
 
@@ -2151,7 +2150,6 @@
      * <p>This key is available on all devices.</p>
      * @hide
      */
-    @UnsupportedAppUsage
     public static final Key<String> JPEG_GPS_PROCESSING_METHOD =
             new Key<String>("android.jpeg.gpsProcessingMethod", String.class);
 
@@ -2162,7 +2160,6 @@
      * <p>This key is available on all devices.</p>
      * @hide
      */
-    @UnsupportedAppUsage
     public static final Key<Long> JPEG_GPS_TIMESTAMP =
             new Key<Long>("android.jpeg.gpsTimestamp", long.class);
 
@@ -2498,7 +2495,6 @@
      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
      * @hide
      */
-    @UnsupportedAppUsage
     public static final Key<Integer> REQUEST_ID =
             new Key<Integer>("android.request.id", int.class);
 
@@ -2914,7 +2910,6 @@
      * @see CaptureRequest#TONEMAP_MODE
      * @hide
      */
-    @UnsupportedAppUsage
     public static final Key<float[]> TONEMAP_CURVE_BLUE =
             new Key<float[]>("android.tonemap.curveBlue", float[].class);
 
@@ -2932,7 +2927,6 @@
      * @see CaptureRequest#TONEMAP_MODE
      * @hide
      */
-    @UnsupportedAppUsage
     public static final Key<float[]> TONEMAP_CURVE_GREEN =
             new Key<float[]>("android.tonemap.curveGreen", float[].class);
 
@@ -2995,7 +2989,6 @@
      * @see CaptureRequest#TONEMAP_MODE
      * @hide
      */
-    @UnsupportedAppUsage
     public static final Key<float[]> TONEMAP_CURVE_RED =
             new Key<float[]>("android.tonemap.curveRed", float[].class);
 
@@ -3170,7 +3163,6 @@
      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
      * @hide
      */
-    @UnsupportedAppUsage
     public static final Key<Boolean> LED_TRANSMIT =
             new Key<Boolean>("android.led.transmit", boolean.class);
 
diff --git a/core/java/android/hardware/camera2/CaptureResult.java b/core/java/android/hardware/camera2/CaptureResult.java
index 007794f..3c6c11d 100644
--- a/core/java/android/hardware/camera2/CaptureResult.java
+++ b/core/java/android/hardware/camera2/CaptureResult.java
@@ -2464,7 +2464,6 @@
      * <p>This key is available on all devices.</p>
      * @hide
      */
-    @UnsupportedAppUsage
     public static final Key<double[]> JPEG_GPS_COORDINATES =
             new Key<double[]>("android.jpeg.gpsCoordinates", double[].class);
 
@@ -2475,7 +2474,6 @@
      * <p>This key is available on all devices.</p>
      * @hide
      */
-    @UnsupportedAppUsage
     public static final Key<String> JPEG_GPS_PROCESSING_METHOD =
             new Key<String>("android.jpeg.gpsProcessingMethod", String.class);
 
@@ -2486,7 +2484,6 @@
      * <p>This key is available on all devices.</p>
      * @hide
      */
-    @UnsupportedAppUsage
     public static final Key<Long> JPEG_GPS_TIMESTAMP =
             new Key<Long>("android.jpeg.gpsTimestamp", long.class);
 
@@ -3125,7 +3122,6 @@
      * @hide
      */
     @Deprecated
-    @UnsupportedAppUsage
     public static final Key<Boolean> QUIRKS_PARTIAL_RESULT =
             new Key<Boolean>("android.quirks.partialResult", boolean.class);
 
@@ -3144,7 +3140,6 @@
      * @hide
      */
     @Deprecated
-    @UnsupportedAppUsage
     public static final Key<Integer> REQUEST_FRAME_COUNT =
             new Key<Integer>("android.request.frameCount", int.class);
 
@@ -3158,7 +3153,6 @@
      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
      * @hide
      */
-    @UnsupportedAppUsage
     public static final Key<Integer> REQUEST_ID =
             new Key<Integer>("android.request.id", int.class);
 
@@ -3720,7 +3714,6 @@
      * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
      * @hide
      */
-    @UnsupportedAppUsage
     public static final Key<int[]> STATISTICS_FACE_IDS =
             new Key<int[]>("android.statistics.faceIds", int[].class);
 
@@ -3747,7 +3740,6 @@
      * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
      * @hide
      */
-    @UnsupportedAppUsage
     public static final Key<int[]> STATISTICS_FACE_LANDMARKS =
             new Key<int[]>("android.statistics.faceLandmarks", int[].class);
 
@@ -3774,7 +3766,6 @@
      * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
      * @hide
      */
-    @UnsupportedAppUsage
     public static final Key<android.graphics.Rect[]> STATISTICS_FACE_RECTANGLES =
             new Key<android.graphics.Rect[]>("android.statistics.faceRectangles", android.graphics.Rect[].class);
 
@@ -3789,7 +3780,6 @@
      * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
      * @hide
      */
-    @UnsupportedAppUsage
     public static final Key<byte[]> STATISTICS_FACE_SCORES =
             new Key<byte[]>("android.statistics.faceScores", byte[].class);
 
@@ -3949,7 +3939,6 @@
      * @see CameraCharacteristics#SENSOR_INFO_LENS_SHADING_APPLIED
      * @hide
      */
-    @UnsupportedAppUsage
     public static final Key<float[]> STATISTICS_LENS_SHADING_MAP =
             new Key<float[]>("android.statistics.lensShadingMap", float[].class);
 
@@ -3973,7 +3962,6 @@
      * @hide
      */
     @Deprecated
-    @UnsupportedAppUsage
     public static final Key<float[]> STATISTICS_PREDICTED_COLOR_GAINS =
             new Key<float[]>("android.statistics.predictedColorGains", float[].class);
 
@@ -4000,7 +3988,6 @@
      * @hide
      */
     @Deprecated
-    @UnsupportedAppUsage
     public static final Key<Rational[]> STATISTICS_PREDICTED_COLOR_TRANSFORM =
             new Key<Rational[]>("android.statistics.predictedColorTransform", Rational[].class);
 
@@ -4143,7 +4130,6 @@
      * @see CaptureResult#SENSOR_TIMESTAMP
      * @hide
      */
-    @UnsupportedAppUsage
     public static final Key<long[]> STATISTICS_OIS_TIMESTAMPS =
             new Key<long[]>("android.statistics.oisTimestamps", long[].class);
 
@@ -4163,7 +4149,6 @@
      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
      * @hide
      */
-    @UnsupportedAppUsage
     public static final Key<float[]> STATISTICS_OIS_X_SHIFTS =
             new Key<float[]>("android.statistics.oisXShifts", float[].class);
 
@@ -4183,7 +4168,6 @@
      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
      * @hide
      */
-    @UnsupportedAppUsage
     public static final Key<float[]> STATISTICS_OIS_Y_SHIFTS =
             new Key<float[]>("android.statistics.oisYShifts", float[].class);
 
@@ -4224,7 +4208,6 @@
      * @see CaptureRequest#TONEMAP_MODE
      * @hide
      */
-    @UnsupportedAppUsage
     public static final Key<float[]> TONEMAP_CURVE_BLUE =
             new Key<float[]>("android.tonemap.curveBlue", float[].class);
 
@@ -4242,7 +4225,6 @@
      * @see CaptureRequest#TONEMAP_MODE
      * @hide
      */
-    @UnsupportedAppUsage
     public static final Key<float[]> TONEMAP_CURVE_GREEN =
             new Key<float[]>("android.tonemap.curveGreen", float[].class);
 
@@ -4305,7 +4287,6 @@
      * @see CaptureRequest#TONEMAP_MODE
      * @hide
      */
-    @UnsupportedAppUsage
     public static final Key<float[]> TONEMAP_CURVE_RED =
             new Key<float[]>("android.tonemap.curveRed", float[].class);
 
@@ -4480,7 +4461,6 @@
      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
      * @hide
      */
-    @UnsupportedAppUsage
     public static final Key<Boolean> LED_TRANSMIT =
             new Key<Boolean>("android.led.transmit", boolean.class);
 
@@ -4570,7 +4550,6 @@
      * @see #SYNC_FRAME_NUMBER_UNKNOWN
      * @hide
      */
-    @UnsupportedAppUsage
     public static final Key<Long> SYNC_FRAME_NUMBER =
             new Key<Long>("android.sync.frameNumber", long.class);
 
diff --git a/core/java/android/hardware/fingerprint/FingerprintManager.java b/core/java/android/hardware/fingerprint/FingerprintManager.java
index bf5ab90..15868f1 100644
--- a/core/java/android/hardware/fingerprint/FingerprintManager.java
+++ b/core/java/android/hardware/fingerprint/FingerprintManager.java
@@ -1162,24 +1162,9 @@
         @Override // binder call
         public void onError(long deviceId, int error, int vendorCode) {
             if (mExecutor != null) {
-                // BiometricPrompt case
-                if (error == FingerprintManager.FINGERPRINT_ERROR_USER_CANCELED
-                        || error == FingerprintManager.FINGERPRINT_ERROR_CANCELED) {
-                    // User tapped somewhere to cancel, or authentication was cancelled by the app
-                    // or got kicked out. The prompt is already gone, so send the error immediately.
-                    mExecutor.execute(() -> {
-                        sendErrorResult(deviceId, error, vendorCode);
-                    });
-                } else {
-                    // User got an error that needs to be displayed on the dialog, post a delayed
-                    // runnable on the FingerprintManager handler that sends the error message after
-                    // FingerprintDialog.HIDE_DIALOG_DELAY to send the error to the application.
-                    mHandler.postDelayed(() -> {
-                        mExecutor.execute(() -> {
-                            sendErrorResult(deviceId, error, vendorCode);
-                        });
-                    }, BiometricPrompt.HIDE_DIALOG_DELAY);
-                }
+                mExecutor.execute(() -> {
+                    sendErrorResult(deviceId, error, vendorCode);
+                });
             } else {
                 mHandler.obtainMessage(MSG_ERROR, error, vendorCode, deviceId).sendToTarget();
             }
diff --git a/core/java/android/os/Debug.java b/core/java/android/os/Debug.java
index e606964..6ddcbe0 100644
--- a/core/java/android/os/Debug.java
+++ b/core/java/android/os/Debug.java
@@ -1752,13 +1752,13 @@
     public static native long getPss();
 
     /**
-     * Retrieves the PSS memory used by the process as given by the
-     * smaps.  Optionally supply a long array of 2 entries to also
-     * receive the Uss and SwapPss of the process, and another array to also
-     * retrieve the separate memtrack size.
+     * Retrieves the PSS memory used by the process as given by the smaps. Optionally supply a long
+     * array of up to 3 entries to also receive (up to 3 values in order): the Uss and SwapPss and
+     * Rss (only filled in as of {@link android.os.Build.VERSION_CODES#P}) of the process, and
+     * another array to also retrieve the separate memtrack size.
      * @hide
      */
-    public static native long getPss(int pid, long[] outUssSwapPss, long[] outMemtrack);
+    public static native long getPss(int pid, long[] outUssSwapPssRss, long[] outMemtrack);
 
     /** @hide */
     public static final int MEMINFO_TOTAL = 0;
diff --git a/core/java/android/os/IPowerManager.aidl b/core/java/android/os/IPowerManager.aidl
index 13e4e38..7ceeb52 100644
--- a/core/java/android/os/IPowerManager.aidl
+++ b/core/java/android/os/IPowerManager.aidl
@@ -56,6 +56,7 @@
     void shutdown(boolean confirm, String reason, boolean wait);
     void crash(String message);
     int getLastShutdownReason();
+    int getLastSleepReason();
 
     void setStayOnSetting(int val);
     void boostScreenBrightness(long time);
diff --git a/core/java/android/os/PowerManager.java b/core/java/android/os/PowerManager.java
index 463a6aa..89a5def 100644
--- a/core/java/android/os/PowerManager.java
+++ b/core/java/android/os/PowerManager.java
@@ -397,6 +397,23 @@
     public static final int GO_TO_SLEEP_REASON_ACCESSIBILITY = 7;
 
     /**
+     * @hide
+     */
+    public static String sleepReasonToString(int sleepReason) {
+        switch (sleepReason) {
+            case GO_TO_SLEEP_REASON_APPLICATION: return "application";
+            case GO_TO_SLEEP_REASON_DEVICE_ADMIN: return "device_admin";
+            case GO_TO_SLEEP_REASON_TIMEOUT: return "timeout";
+            case GO_TO_SLEEP_REASON_LID_SWITCH: return "lid_switch";
+            case GO_TO_SLEEP_REASON_POWER_BUTTON: return "power_button";
+            case GO_TO_SLEEP_REASON_HDMI: return "hdmi";
+            case GO_TO_SLEEP_REASON_SLEEP_BUTTON: return "sleep_button";
+            case GO_TO_SLEEP_REASON_ACCESSIBILITY: return "accessibility";
+            default: return Integer.toString(sleepReason);
+        }
+    }
+
+    /**
      * Go to sleep flag: Skip dozing state and directly go to full sleep.
      * @hide
      */
@@ -1310,6 +1327,22 @@
     }
 
     /**
+     * Returns the reason the device last went to sleep (i.e. the last value of
+     * the second argument of {@link #goToSleep(long, int, int) goToSleep}).
+     *
+     * @return One of the {@code GO_TO_SLEEP_REASON_*} constants.
+     *
+     * @hide
+     */
+    public int getLastSleepReason() {
+        try {
+            return mService.getLastSleepReason();
+        } catch (RemoteException e) {
+            throw e.rethrowFromSystemServer();
+        }
+    }
+
+    /**
      * Intent that is broadcast when the state of {@link #isPowerSaveMode()} changes.
      * This broadcast is only sent to registered receivers.
      */
diff --git a/core/java/android/service/autofill/CustomDescription.java b/core/java/android/service/autofill/CustomDescription.java
index fb468a8..b1ae7a5 100644
--- a/core/java/android/service/autofill/CustomDescription.java
+++ b/core/java/android/service/autofill/CustomDescription.java
@@ -20,11 +20,13 @@
 
 import android.annotation.NonNull;
 import android.annotation.Nullable;
+import android.annotation.TestApi;
 import android.app.Activity;
 import android.app.PendingIntent;
 import android.os.Parcel;
 import android.os.Parcelable;
 import android.util.Pair;
+import android.util.SparseArray;
 import android.widget.RemoteViews;
 
 import com.android.internal.util.Preconditions;
@@ -90,11 +92,13 @@
     private final RemoteViews mPresentation;
     private final ArrayList<Pair<Integer, InternalTransformation>> mTransformations;
     private final ArrayList<Pair<InternalValidator, BatchUpdates>> mUpdates;
+    private final SparseArray<InternalOnClickAction> mActions;
 
     private CustomDescription(Builder builder) {
         mPresentation = builder.mPresentation;
         mTransformations = builder.mTransformations;
         mUpdates = builder.mUpdates;
+        mActions = builder.mActions;
     }
 
     /** @hide */
@@ -115,6 +119,13 @@
         return mUpdates;
     }
 
+    /** @hide */
+    @Nullable
+    @TestApi
+    public SparseArray<InternalOnClickAction> getActions() {
+        return mActions;
+    }
+
     /**
      * Builder for {@link CustomDescription} objects.
      */
@@ -124,6 +135,7 @@
         private boolean mDestroyed;
         private ArrayList<Pair<Integer, InternalTransformation>> mTransformations;
         private ArrayList<Pair<InternalValidator, BatchUpdates>> mUpdates;
+        private SparseArray<InternalOnClickAction> mActions;
 
         /**
          * Default constructor.
@@ -157,9 +169,12 @@
          *
          * @param id view id of the children view.
          * @param transformation an implementation provided by the Android System.
+         *
          * @return this builder.
+         *
          * @throws IllegalArgumentException if {@code transformation} is not a class provided
          * by the Android System.
+         * @throws IllegalStateException if {@link #build()} was already called.
          */
         public Builder addChild(int id, @NonNull Transformation transformation) {
             throwIfDestroyed();
@@ -250,8 +265,10 @@
          * is satisfied.
          *
          * @return this builder
+         *
          * @throws IllegalArgumentException if {@code condition} is not a class provided
          * by the Android System.
+         * @throws IllegalStateException if {@link #build()} was already called.
          */
         public Builder batchUpdate(@NonNull Validator condition, @NonNull BatchUpdates updates) {
             throwIfDestroyed();
@@ -266,6 +283,58 @@
         }
 
         /**
+         * Sets an action to be applied to the {@link RemoteViews presentation template} when the
+         * child view with the given {@code id} is clicked.
+         *
+         * <p>Typically used when the presentation uses a masked field (like {@code ****}) for
+         * sensitive fields like passwords or credit cards numbers, but offers a an icon that the
+         * user can tap to show the value for that field.
+         *
+         * <p>Example:
+         *
+         * <pre class="prettyprint">
+         * customDescriptionBuilder
+         *   .addChild(R.id.password_plain, new CharSequenceTransformation
+         *      .Builder(passwordId, Pattern.compile("^(.*)$"), "$1").build())
+         *   .addOnClickAction(R.id.showIcon, new VisibilitySetterAction
+         *     .Builder(R.id.hideIcon, View.VISIBLE)
+         *     .setVisibility(R.id.showIcon, View.GONE)
+         *     .setVisibility(R.id.password_plain, View.VISIBLE)
+         *     .setVisibility(R.id.password_masked, View.GONE)
+         *     .build())
+         *   .addOnClickAction(R.id.hideIcon, new VisibilitySetterAction
+         *     .Builder(R.id.showIcon, View.VISIBLE)
+         *     .setVisibility(R.id.hideIcon, View.GONE)
+         *     .setVisibility(R.id.password_masked, View.VISIBLE)
+         *     .setVisibility(R.id.password_plain, View.GONE)
+         *     .build());
+         * </pre>
+         *
+         * <p><b>Note:</b> Currently only one action can be applied to a child; if this method
+         * is called multiple times passing the same {@code id}, only the last call will be used.
+         *
+         * @param id resource id of the child view.
+         * @param action action to be performed.
+         *
+         * @return this builder
+         *
+         * @throws IllegalArgumentException if {@code action} is not a class provided
+         * by the Android System.
+         * @throws IllegalStateException if {@link #build()} was already called.
+         */
+        public Builder addOnClickAction(int id, @NonNull OnClickAction action) {
+            throwIfDestroyed();
+            Preconditions.checkArgument((action instanceof InternalOnClickAction),
+                    "not provided by Android System: " + action);
+            if (mActions == null) {
+                mActions = new SparseArray<InternalOnClickAction>();
+            }
+            mActions.put(id, (InternalOnClickAction) action);
+
+            return this;
+        }
+
+        /**
          * Creates a new {@link CustomDescription} instance.
          */
         public CustomDescription build() {
@@ -294,6 +363,8 @@
                     .append(mTransformations == null ? "N/A" : mTransformations.size())
                 .append(", updates=")
                     .append(mUpdates == null ? "N/A" : mUpdates.size())
+                .append(", actions=")
+                    .append(mActions == null ? "N/A" : mActions.size())
                 .append("]").toString();
     }
 
@@ -339,6 +410,19 @@
             dest.writeParcelableArray(conditions, flags);
             dest.writeParcelableArray(updates, flags);
         }
+        if (mActions == null) {
+            dest.writeIntArray(null);
+        } else {
+            final int size = mActions.size();
+            final int[] ids = new int[size];
+            final InternalOnClickAction[] values = new InternalOnClickAction[size];
+            for (int i = 0; i < size; i++) {
+                ids[i] = mActions.keyAt(i);
+                values[i] = mActions.valueAt(i);
+            }
+            dest.writeIntArray(ids);
+            dest.writeParcelableArray(values, flags);
+        }
     }
     public static final Parcelable.Creator<CustomDescription> CREATOR =
             new Parcelable.Creator<CustomDescription>() {
@@ -351,13 +435,13 @@
             if (parentPresentation == null) return null;
 
             final Builder builder = new Builder(parentPresentation);
-            final int[] ids = parcel.createIntArray();
-            if (ids != null) {
+            final int[] transformationIds = parcel.createIntArray();
+            if (transformationIds != null) {
                 final InternalTransformation[] values =
                     parcel.readParcelableArray(null, InternalTransformation.class);
-                final int size = ids.length;
+                final int size = transformationIds.length;
                 for (int i = 0; i < size; i++) {
-                    builder.addChild(ids[i], values[i]);
+                    builder.addChild(transformationIds[i], values[i]);
                 }
             }
             final InternalValidator[] conditions =
@@ -369,6 +453,15 @@
                     builder.batchUpdate(conditions[i], updates[i]);
                 }
             }
+            final int[] actionIds = parcel.createIntArray();
+            if (actionIds != null) {
+                final InternalOnClickAction[] values =
+                    parcel.readParcelableArray(null, InternalOnClickAction.class);
+                final int size = actionIds.length;
+                for (int i = 0; i < size; i++) {
+                    builder.addOnClickAction(actionIds[i], values[i]);
+                }
+            }
             return builder.build();
         }
 
diff --git a/core/java/android/service/autofill/InternalOnClickAction.java b/core/java/android/service/autofill/InternalOnClickAction.java
new file mode 100644
index 0000000..6602f2d
--- /dev/null
+++ b/core/java/android/service/autofill/InternalOnClickAction.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package android.service.autofill;
+
+import android.annotation.NonNull;
+import android.annotation.TestApi;
+import android.os.Parcelable;
+import android.view.ViewGroup;
+
+/**
+ * Superclass of all {@link OnClickAction} the system understands. As this is not public, all public
+ * subclasses have to implement {@link OnClickAction} again.
+ *
+ * @hide
+ */
+@TestApi
+public abstract class InternalOnClickAction implements OnClickAction, Parcelable {
+
+    /**
+     * Applies the action to the children of the {@code rootView} when clicked.
+     */
+    public abstract void onClick(@NonNull ViewGroup rootView);
+}
diff --git a/core/java/android/service/autofill/InternalSanitizer.java b/core/java/android/service/autofill/InternalSanitizer.java
index d77e41e..ccffc70 100644
--- a/core/java/android/service/autofill/InternalSanitizer.java
+++ b/core/java/android/service/autofill/InternalSanitizer.java
@@ -35,8 +35,6 @@
      *
      * @return sanitized value or {@code null} if value could not be sanitized (for example: didn't
      * match regex, it's an invalid type, regex failed, etc).
-     *
-     * @hide
      */
     @Nullable
     public abstract AutofillValue sanitize(@NonNull AutofillValue value);
diff --git a/core/java/android/service/autofill/InternalTransformation.java b/core/java/android/service/autofill/InternalTransformation.java
index c9864a0..0dba2b9 100644
--- a/core/java/android/service/autofill/InternalTransformation.java
+++ b/core/java/android/service/autofill/InternalTransformation.java
@@ -44,8 +44,6 @@
      * @param finder object used to find the value of a field in the screen.
      * @param template the {@link RemoteViews presentation template}.
      * @param childViewId resource id of the child view inside the template.
-     *
-     * @hide
      */
     abstract void apply(@NonNull ValueFinder finder, @NonNull RemoteViews template,
             int childViewId) throws Exception;
@@ -58,8 +56,6 @@
      * @param template the {@link RemoteViews presentation template}.
      * @param transformations map of resource id of the child view inside the template to
      * transformation.
-     *
-     * @hide
      */
     public static boolean batchApply(@NonNull ValueFinder finder, @NonNull RemoteViews template,
             @NonNull ArrayList<Pair<Integer, InternalTransformation>> transformations) {
diff --git a/core/java/android/service/autofill/InternalValidator.java b/core/java/android/service/autofill/InternalValidator.java
index e08bb6c..4bea98d 100644
--- a/core/java/android/service/autofill/InternalValidator.java
+++ b/core/java/android/service/autofill/InternalValidator.java
@@ -33,9 +33,6 @@
      *
      * @param finder object used to find the value of a field in the screen.
      * @return {@code true} if the contents are valid, {@code false} otherwise.
-     *
-     * @hide
      */
-    @TestApi
     public abstract boolean isValid(@NonNull ValueFinder finder);
 }
diff --git a/core/java/android/service/autofill/OnClickAction.java b/core/java/android/service/autofill/OnClickAction.java
new file mode 100644
index 0000000..7439b00
--- /dev/null
+++ b/core/java/android/service/autofill/OnClickAction.java
@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package android.service.autofill;
+
+/**
+ * Class used to define an action to be performed when a child view in a
+ * {@link android.widget.RemoteViews presentation} is clicked.
+ *
+ * <p>Typically used to switch the visibility of other views in a
+ * {@link CustomDescription custom save UI}.
+ */
+public interface OnClickAction {
+}
diff --git a/core/java/android/service/autofill/UserData.java b/core/java/android/service/autofill/UserData.java
index 55aecdd..fccb85b 100644
--- a/core/java/android/service/autofill/UserData.java
+++ b/core/java/android/service/autofill/UserData.java
@@ -145,6 +145,9 @@
 
         // Non-persistent array used to limit the number of unique ids.
         private final ArraySet<String> mUniqueCategoryIds;
+        // Non-persistent array used to ignore duplaicated value/category pairs.
+        private final ArraySet<String> mUniqueValueCategoryPairs;
+
 
         /**
          * Creates a new builder for the user data used for <a href="#FieldClassification">field
@@ -185,6 +188,7 @@
             final int maxUserDataSize = getMaxUserDataSize();
             mCategoryIds = new ArrayList<>(maxUserDataSize);
             mValues = new ArrayList<>(maxUserDataSize);
+            mUniqueValueCategoryPairs = new ArraySet<>(maxUserDataSize);
             mUniqueCategoryIds = new ArraySet<>(getMaxCategoryCount());
 
             addMapping(value, categoryId);
@@ -222,7 +226,8 @@
          * @throws IllegalStateException if:
          * <ul>
          *   <li>{@link #build()} already called</li>
-         *   <li>the {@code value} has already been added</li>
+         *   <li>the {@code value} has already been added (<b>Note: </b> this restriction was
+         *   lifted on Android {@link android.os.Build.VERSION_CODES#Q} and later)</li>
          *   <li>the number of unique {@code categoryId} values added so far is more than
          *       {@link UserData#getMaxCategoryCount()}</li>
          *   <li>the number of {@code values} added so far is is more than
@@ -248,12 +253,8 @@
                 // New category - check size
                 Preconditions.checkState(mUniqueCategoryIds.size() < getMaxCategoryCount(),
                         "already added " + mUniqueCategoryIds.size() + " unique category ids");
-
             }
 
-            Preconditions.checkState(!mValues.contains(value),
-                    // Don't include value on message because it could contain PII
-                    "already has entry with same value");
             Preconditions.checkState(mValues.size() < getMaxUserDataSize(),
                     "already added " + mValues.size() + " elements");
             addMapping(value, categoryId);
@@ -262,9 +263,16 @@
         }
 
         private void addMapping(@NonNull String value, @NonNull String categoryId) {
+            final String pair = value + ":" + categoryId;
+            if (mUniqueValueCategoryPairs.contains(pair)) {
+                // Don't include value on message because it could contain PII
+                Log.w(TAG, "Ignoring entry with same value / category");
+                return;
+            }
             mCategoryIds.add(categoryId);
             mValues.add(value);
             mUniqueCategoryIds.add(categoryId);
+            mUniqueValueCategoryPairs.add(pair);
         }
 
         private String checkNotEmpty(@NonNull String name, @Nullable String value) {
diff --git a/core/java/android/service/autofill/VisibilitySetterAction.java b/core/java/android/service/autofill/VisibilitySetterAction.java
new file mode 100644
index 0000000..9f977d7
--- /dev/null
+++ b/core/java/android/service/autofill/VisibilitySetterAction.java
@@ -0,0 +1,173 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.service.autofill;
+
+import static android.view.autofill.Helper.sDebug;
+import static android.view.autofill.Helper.sVerbose;
+
+import android.annotation.IdRes;
+import android.annotation.NonNull;
+import android.os.Parcel;
+import android.os.Parcelable;
+import android.util.Slog;
+import android.util.SparseIntArray;
+import android.view.View;
+import android.view.View.Visibility;
+import android.view.ViewGroup;
+import android.widget.RemoteViews;
+
+import com.android.internal.util.Preconditions;
+
+/**
+ * Action used to change the visibility of other child view in a {@link CustomDescription}
+ * {@link RemoteViews presentation template}.
+ *
+ * <p>See {@link CustomDescription.Builder#addOnClickAction(int, OnClickAction)} for more details.
+ */
+public final class VisibilitySetterAction extends InternalOnClickAction implements
+        OnClickAction, Parcelable {
+    private static final String TAG = "VisibilitySetterAction";
+
+    @NonNull private final SparseIntArray mVisibilities;
+
+    private VisibilitySetterAction(@NonNull Builder builder) {
+        mVisibilities = builder.mVisibilities;
+    }
+
+    /** @hide */
+    @Override
+    public void onClick(@NonNull ViewGroup rootView) {
+        for (int i = 0; i < mVisibilities.size(); i++) {
+            final int id = mVisibilities.keyAt(i);
+            final View child = rootView.findViewById(id);
+            if (child == null) {
+                Slog.w(TAG, "Skipping view id " + id + " because it's not found on " + rootView);
+                continue;
+            }
+            final int visibility = mVisibilities.valueAt(i);
+            if (sVerbose) {
+                Slog.v(TAG, "Changing visibility of view " + child + " from "
+                        + child.getVisibility() + " to  " + visibility);
+            }
+            child.setVisibility(visibility);
+        }
+    }
+
+    /**
+     * Builder for {@link VisibilitySetterAction} objects.
+     */
+    public static class Builder {
+        private final SparseIntArray mVisibilities = new SparseIntArray();
+        private boolean mDestroyed;
+
+        /**
+         * Creates a new builder for an action that change the visibility of one child view.
+         *
+         * @param id view resource id of the children view.
+         * @param visibility one of {@link View#VISIBLE}, {@link View#INVISIBLE}, or
+         *            {@link View#GONE}.
+         * @throws IllegalArgumentException if visibility is not one of {@link View#VISIBLE},
+         * {@link View#INVISIBLE}, or {@link View#GONE}.
+         */
+        public Builder(@IdRes int id, @Visibility int visibility) {
+            setVisibility(id, visibility);
+        }
+
+        /**
+         * Sets the action to changes the visibility of a child view.
+         *
+         * @param id view resource id of the children view.
+         * @param visibility one of {@link View#VISIBLE}, {@link View#INVISIBLE}, or
+         *            {@link View#GONE}.
+         * @throws IllegalArgumentException if visibility is not one of {@link View#VISIBLE},
+         * {@link View#INVISIBLE}, or {@link View#GONE}.
+         */
+        public Builder setVisibility(@IdRes int id, @Visibility int visibility) {
+            throwIfDestroyed();
+            switch (visibility) {
+                case View.VISIBLE:
+                case View.INVISIBLE:
+                case View.GONE:
+                    mVisibilities.put(id, visibility);
+                    return this;
+            }
+            throw new IllegalArgumentException("Invalid visibility: " + visibility);
+        }
+
+        /**
+         * Creates a new {@link VisibilitySetterAction} instance.
+         */
+        public VisibilitySetterAction build() {
+            throwIfDestroyed();
+            mDestroyed = true;
+            return new VisibilitySetterAction(this);
+        }
+
+        private void throwIfDestroyed() {
+            Preconditions.checkState(!mDestroyed, "Already called build()");
+        }
+    }
+
+    /////////////////////////////////////
+    // Object "contract" methods. //
+    /////////////////////////////////////
+    @Override
+    public String toString() {
+        if (!sDebug) return super.toString();
+
+        return "VisibilitySetterAction: [" + mVisibilities + "]";
+    }
+
+    /////////////////////////////////////
+    // Parcelable "contract" methods. //
+    /////////////////////////////////////
+    @Override
+    public int describeContents() {
+        return 0;
+    }
+
+    @Override
+    public void writeToParcel(Parcel parcel, int flags) {
+        parcel.writeSparseIntArray(mVisibilities);
+    }
+
+    public static final Parcelable.Creator<VisibilitySetterAction> CREATOR =
+            new Parcelable.Creator<VisibilitySetterAction>() {
+        @Override
+        public VisibilitySetterAction createFromParcel(Parcel parcel) {
+            // Always go through the builder to ensure the data ingested by
+            // the system obeys the contract of the builder to avoid attacks
+            final SparseIntArray visibilities = parcel.readSparseIntArray();
+            Builder builder = null;
+            for (int i = 0; i < visibilities.size(); i++) {
+                final int id = visibilities.keyAt(i);
+                final int visibility = visibilities.valueAt(i);
+                if (builder == null) {
+                    builder = new Builder(id, visibility);
+                } else {
+                    builder.setVisibility(id, visibility);
+                }
+            }
+            return builder == null ? null : builder.build();
+        }
+
+        @Override
+        public VisibilitySetterAction[] newArray(int size) {
+            return new VisibilitySetterAction[size];
+        }
+    };
+}
diff --git a/core/java/android/service/notification/INotificationListener.aidl b/core/java/android/service/notification/INotificationListener.aidl
index 2dff716..d8bd002 100644
--- a/core/java/android/service/notification/INotificationListener.aidl
+++ b/core/java/android/service/notification/INotificationListener.aidl
@@ -18,6 +18,7 @@
 
 import android.app.NotificationChannel;
 import android.app.NotificationChannelGroup;
+import android.content.pm.ParceledListSlice;
 import android.os.UserHandle;
 import android.service.notification.NotificationStats;
 import android.service.notification.IStatusBarNotificationHolder;
@@ -45,4 +46,5 @@
     // assistants only
     void onNotificationEnqueuedWithChannel(in IStatusBarNotificationHolder notificationHolder, in NotificationChannel channel);
     void onNotificationSnoozedUntilContext(in IStatusBarNotificationHolder notificationHolder, String snoozeCriterionId);
+    void onNotificationsSeen(in List<String> keys);
 }
diff --git a/core/java/android/service/notification/NotificationAssistantService.java b/core/java/android/service/notification/NotificationAssistantService.java
index 3853fc5..3b820ca 100644
--- a/core/java/android/service/notification/NotificationAssistantService.java
+++ b/core/java/android/service/notification/NotificationAssistantService.java
@@ -149,6 +149,14 @@
     }
 
     /**
+     * Implement this to know when a user has seen notifications, as triggered by
+     * {@link #setNotificationsShown(String[])}.
+     */
+    public void onNotificationsSeen(List<String> keys) {
+
+    }
+
+    /**
      * Updates a notification.  N.B. this won’t cause
      * an existing notification to alert, but might allow a future update to
      * this notification to alert.
@@ -236,11 +244,20 @@
             mHandler.obtainMessage(MyHandler.MSG_ON_NOTIFICATION_SNOOZED,
                     args).sendToTarget();
         }
+
+        @Override
+        public void onNotificationsSeen(List<String> keys) {
+            SomeArgs args = SomeArgs.obtain();
+            args.arg1 = keys;
+            mHandler.obtainMessage(MyHandler.MSG_ON_NOTIFICATIONS_SEEN,
+                    args).sendToTarget();
+        }
     }
 
     private final class MyHandler extends Handler {
         public static final int MSG_ON_NOTIFICATION_ENQUEUED = 1;
         public static final int MSG_ON_NOTIFICATION_SNOOZED = 2;
+        public static final int MSG_ON_NOTIFICATIONS_SEEN = 3;
 
         public MyHandler(Looper looper) {
             super(looper, null, false);
@@ -275,6 +292,13 @@
                     onNotificationSnoozedUntilContext(sbn, snoozeCriterionId);
                     break;
                 }
+                case MSG_ON_NOTIFICATIONS_SEEN: {
+                    SomeArgs args = (SomeArgs) msg.obj;
+                    List<String> keys = (List<String>) args.arg1;
+                    args.recycle();
+                    onNotificationsSeen(keys);
+                    break;
+                }
             }
         }
     }
diff --git a/core/java/android/service/notification/NotificationListenerService.java b/core/java/android/service/notification/NotificationListenerService.java
index 98da569..1b588f4 100644
--- a/core/java/android/service/notification/NotificationListenerService.java
+++ b/core/java/android/service/notification/NotificationListenerService.java
@@ -1332,6 +1332,12 @@
         }
 
         @Override
+        public void onNotificationsSeen(List<String> keys)
+                throws RemoteException {
+            // no-op in the listener
+        }
+
+        @Override
         public void onNotificationSnoozedUntilContext(
                 IStatusBarNotificationHolder notificationHolder, String snoozeCriterionId)
                 throws RemoteException {
diff --git a/core/java/android/service/notification/NotificationStats.java b/core/java/android/service/notification/NotificationStats.java
index 76d5328..9e23de1 100644
--- a/core/java/android/service/notification/NotificationStats.java
+++ b/core/java/android/service/notification/NotificationStats.java
@@ -52,7 +52,7 @@
     /**
      * Notification has not been dismissed yet.
      */
-    public static final int DISMISSAL_NOT_DISMISSED = -1;
+    public static final int DISMISSAL_NOT_DISMISSED = -1000;
     /**
      * Notification has been dismissed from a {@link NotificationListenerService} or the app
      * itself.
@@ -71,6 +71,37 @@
      */
     public static final int DISMISSAL_SHADE = 3;
 
+    /** @hide */
+    @IntDef(prefix = { "DISMISS_SENTIMENT_" }, value = {
+            DISMISS_SENTIMENT_UNKNOWN, DISMISS_SENTIMENT_NEGATIVE, DISMISS_SENTIMENT_NEUTRAL,
+            DISMISS_SENTIMENT_POSITIVE
+    })
+    @Retention(RetentionPolicy.SOURCE)
+    public @interface DismissalSentiment {}
+
+    /**
+     * No information is available about why this notification was dismissed, or the notification
+     * isn't dismissed yet.
+     */
+    public static final int DISMISS_SENTIMENT_UNKNOWN = -1000;
+    /**
+     * The user indicated while dismissing that they did not like the notification.
+     */
+    public static final int DISMISS_SENTIMENT_NEGATIVE = 0;
+    /**
+     * The user didn't indicate one way or another how they felt about the notification while
+     * dismissing it.
+     */
+    public static final int DISMISS_SENTIMENT_NEUTRAL = 1;
+    /**
+     * The user indicated while dismissing that they did like the notification.
+     */
+    public static final int DISMISS_SENTIMENT_POSITIVE = 2;
+
+
+    private @DismissalSentiment
+    int mDismissalSentiment = DISMISS_SENTIMENT_UNKNOWN;
+
     public NotificationStats() {
     }
 
@@ -82,6 +113,7 @@
         mViewedSettings = in.readByte() != 0;
         mInteracted = in.readByte() != 0;
         mDismissalSurface = in.readInt();
+        mDismissalSentiment = in.readInt();
     }
 
     @Override
@@ -93,6 +125,7 @@
         dest.writeByte((byte) (mViewedSettings ? 1 : 0));
         dest.writeByte((byte) (mInteracted ? 1 : 0));
         dest.writeInt(mDismissalSurface);
+        dest.writeInt(mDismissalSentiment);
     }
 
     @Override
@@ -212,6 +245,21 @@
         mDismissalSurface = dismissalSurface;
     }
 
+    /**
+     * Records whether the user indicated how they felt about a notification before or
+     * during dismissal.
+     */
+    public void setDismissalSentiment(@DismissalSentiment int dismissalSentiment) {
+        mDismissalSentiment = dismissalSentiment;
+    }
+
+    /**
+     * Returns how the user indicated they felt about a notification before or during dismissal.
+     */
+    public @DismissalSentiment int getDismissalSentiment() {
+        return mDismissalSentiment;
+    }
+
     @Override
     public boolean equals(Object o) {
         if (this == o) return true;
diff --git a/core/java/android/transition/Scene.java b/core/java/android/transition/Scene.java
index 15ad7de..2c858cd 100644
--- a/core/java/android/transition/Scene.java
+++ b/core/java/android/transition/Scene.java
@@ -35,7 +35,8 @@
     private int mLayoutId = -1;
     private ViewGroup mSceneRoot;
     private View mLayout; // alternative to layoutId
-    Runnable mEnterAction, mExitAction;
+    Runnable mEnterAction;
+    Runnable mExitAction;
 
     /**
      * Returns a Scene described by the resource file associated with the given
@@ -265,4 +266,4 @@
     boolean isCreatedFromLayoutResource() {
         return (mLayoutId > 0);
     }
-}
\ No newline at end of file
+}
diff --git a/core/java/android/util/FeatureFlagUtils.java b/core/java/android/util/FeatureFlagUtils.java
index 0f8ca44..c037cd0 100644
--- a/core/java/android/util/FeatureFlagUtils.java
+++ b/core/java/android/util/FeatureFlagUtils.java
@@ -40,7 +40,6 @@
     static {
         DEFAULT_FLAGS = new HashMap<>();
         DEFAULT_FLAGS.put("settings_battery_display_app_list", "false");
-        DEFAULT_FLAGS.put("settings_condition_manager_v2", "true");
         DEFAULT_FLAGS.put("settings_bluetooth_while_driving", "false");
         DEFAULT_FLAGS.put("settings_audio_switcher", "true");
         DEFAULT_FLAGS.put("settings_systemui_theme", "true");
diff --git a/core/java/android/view/DisplayCutout.java b/core/java/android/view/DisplayCutout.java
index 496bc9f..5f80d31 100644
--- a/core/java/android/view/DisplayCutout.java
+++ b/core/java/android/view/DisplayCutout.java
@@ -325,6 +325,7 @@
      *
      * @hide
      */
+    @VisibleForTesting
     public static DisplayCutout fromBoundingRect(int left, int top, int right, int bottom) {
         Region r = Region.obtain();
         r.set(left, top, right, bottom);
@@ -422,8 +423,11 @@
         m.postTranslate(offsetX, 0);
         p.transform(m);
 
-        addToRegion(p, r);
+        final Rect tmpRect = new Rect();
+        toRectAndAddToRegion(p, r, tmpRect);
+        final int topInset = tmpRect.bottom;
 
+        final int bottomInset;
         if (bottomSpec != null) {
             final Path bottomPath;
             try {
@@ -436,10 +440,17 @@
             m.postTranslate(0, displayHeight);
             bottomPath.transform(m);
             p.addPath(bottomPath);
-            addToRegion(bottomPath, r);
+            toRectAndAddToRegion(bottomPath, r, tmpRect);
+            bottomInset = displayHeight - tmpRect.top;
+        } else {
+            bottomInset = 0;
         }
 
-        final Pair<Path, DisplayCutout> result = new Pair<>(p, fromBounds(r));
+        // Reuse tmpRect as the inset rect we store into the DisplayCutout instance.
+        tmpRect.set(0, topInset, 0, bottomInset);
+        final DisplayCutout cutout = new DisplayCutout(tmpRect, r, false /* copyArguments */);
+
+        final Pair<Path, DisplayCutout> result = new Pair<>(p, cutout);
         synchronized (CACHE_LOCK) {
             sCachedSpec = spec;
             sCachedDisplayWidth = displayWidth;
@@ -450,12 +461,11 @@
         return result;
     }
 
-    private static void addToRegion(Path p, Region r) {
+    private static void toRectAndAddToRegion(Path p, Region inoutRegion, Rect inoutRect) {
         final RectF rectF = new RectF();
-        final Rect rect = new Rect();
         p.computeBounds(rectF, false /* unused */);
-        rectF.round(rect);
-        r.op(rect, Op.UNION);
+        rectF.round(inoutRect);
+        inoutRegion.op(inoutRect, Op.UNION);
     }
 
     private static Region boundingRectsToRegion(List<Rect> rects) {
diff --git a/core/java/android/view/DisplayListCanvas.java b/core/java/android/view/DisplayListCanvas.java
index a7755a2..4b946d7 100644
--- a/core/java/android/view/DisplayListCanvas.java
+++ b/core/java/android/view/DisplayListCanvas.java
@@ -40,7 +40,7 @@
     // view hierarchy because display lists are generated recursively.
     private static final int POOL_LIMIT = 25;
 
-    private static final int MAX_BITMAP_SIZE = 100 * 1024 * 1024; // 100 MB
+    public static final int MAX_BITMAP_SIZE = 100 * 1024 * 1024; // 100 MB
 
     private static final SynchronizedPool<DisplayListCanvas> sPool =
             new SynchronizedPool<>(POOL_LIMIT);
diff --git a/core/java/android/widget/AbsListView.java b/core/java/android/widget/AbsListView.java
index 1475cc9..07096e8 100644
--- a/core/java/android/widget/AbsListView.java
+++ b/core/java/android/widget/AbsListView.java
@@ -20,6 +20,7 @@
 import android.annotation.DrawableRes;
 import android.annotation.NonNull;
 import android.annotation.TestApi;
+import android.annotation.UnsupportedAppUsage;
 import android.content.Context;
 import android.content.Intent;
 import android.content.res.Configuration;
@@ -248,6 +249,7 @@
     /**
      * Controls CHOICE_MODE_MULTIPLE_MODAL. null when inactive.
      */
+    @UnsupportedAppUsage
     ActionMode mChoiceActionMode;
 
     /**
@@ -276,16 +278,19 @@
     /**
      * Controls how the next layout will happen
      */
+    @UnsupportedAppUsage
     int mLayoutMode = LAYOUT_NORMAL;
 
     /**
      * Should be used by subclasses to listen to changes in the dataset
      */
+    @UnsupportedAppUsage
     AdapterDataSetObserver mDataSetObserver;
 
     /**
      * The adapter containing the data to be displayed by this view
      */
+    @UnsupportedAppUsage
     ListAdapter mAdapter;
 
     /**
@@ -311,22 +316,26 @@
     /**
      * The drawable used to draw the selector
      */
+    @UnsupportedAppUsage
     Drawable mSelector;
 
     /**
      * The current position of the selector in the list.
      */
+    @UnsupportedAppUsage
     int mSelectorPosition = INVALID_POSITION;
 
     /**
      * Defines the selector's location and dimension at drawing time
      */
+    @UnsupportedAppUsage
     Rect mSelectorRect = new Rect();
 
     /**
      * The data set used to store unused views that should be reused during the next layout
      * to avoid creating new ones
      */
+    @UnsupportedAppUsage
     final RecycleBin mRecycler = new RecycleBin();
 
     /**
@@ -337,6 +346,7 @@
     /**
      * The selection's top padding
      */
+    @UnsupportedAppUsage
     int mSelectionTopPadding = 0;
 
     /**
@@ -347,6 +357,7 @@
     /**
      * The selection's bottom padding
      */
+    @UnsupportedAppUsage
     int mSelectionBottomPadding = 0;
 
     /**
@@ -379,6 +390,7 @@
     /**
      * The position of the view that received the down motion event
      */
+    @UnsupportedAppUsage
     int mMotionPosition;
 
     /**
@@ -399,12 +411,14 @@
     /**
      * The Y value associated with the the down motion event
      */
+    @UnsupportedAppUsage
     int mMotionY;
 
     /**
      * One of TOUCH_MODE_REST, TOUCH_MODE_DOWN, TOUCH_MODE_TAP, TOUCH_MODE_SCROLL, or
      * TOUCH_MODE_DONE_WAITING
      */
+    @UnsupportedAppUsage
     int mTouchMode = TOUCH_MODE_REST;
 
     /**
@@ -420,16 +434,19 @@
     /**
      * Determines speed during touch scrolling
      */
+    @UnsupportedAppUsage
     private VelocityTracker mVelocityTracker;
 
     /**
      * Handles one frame of a fling
      */
+    @UnsupportedAppUsage
     private FlingRunnable mFlingRunnable;
 
     /**
      * Handles scrolling between positions within the list.
      */
+    @UnsupportedAppUsage
     AbsPositionScroller mPositionScroller;
 
     /**
@@ -463,11 +480,13 @@
     /**
      * Optional callback to notify client when scroll position has changed
      */
+    @UnsupportedAppUsage
     private OnScrollListener mOnScrollListener;
 
     /**
      * Keeps track of our accessory window
      */
+    @UnsupportedAppUsage
     PopupWindow mPopup;
 
     /**
@@ -501,6 +520,7 @@
      */
     int mResurrectToPosition = INVALID_POSITION;
 
+    @UnsupportedAppUsage
     private ContextMenuInfo mContextMenuInfo = null;
 
     /**
@@ -547,11 +567,13 @@
     /**
      * The last CheckForLongPress runnable we posted, if any
      */
+    @UnsupportedAppUsage
     private CheckForLongPress mPendingCheckForLongPress;
 
     /**
      * The last CheckForTap runnable we posted, if any
      */
+    @UnsupportedAppUsage
     private CheckForTap mPendingCheckForTap;
 
     /**
@@ -590,6 +612,7 @@
     /**
      * The select child's view (from the adapter's getView) is enabled.
      */
+    @UnsupportedAppUsage
     private boolean mIsChildViewEnabled;
 
     /**
@@ -606,6 +629,7 @@
     /**
      * Helper object that renders and controls the fast scroll thumb.
      */
+    @UnsupportedAppUsage
     private FastScroller mFastScroll;
 
     /**
@@ -616,6 +640,7 @@
 
     private boolean mGlobalLayoutListenerAddedFilter;
 
+    @UnsupportedAppUsage
     private int mTouchSlop;
     private float mDensityScale;
 
@@ -627,6 +652,7 @@
     private Runnable mClearScrollingCache;
     Runnable mPositionScrollAfterLayout;
     private int mMinimumVelocity;
+    @UnsupportedAppUsage
     private int mMaximumVelocity;
     private float mVelocityScale = 1.0f;
 
@@ -651,6 +677,7 @@
      * ID of the active pointer. This is used to retain consistency during
      * drags/flings if multiple pointers are used.
      */
+    @UnsupportedAppUsage
     private int mActivePointerId = INVALID_POINTER;
 
     /**
@@ -662,11 +689,13 @@
     /**
      * Maximum distance to overscroll by during edge effects
      */
+    @UnsupportedAppUsage
     int mOverscrollDistance;
 
     /**
      * Maximum distance to overfling during edge effects
      */
+    @UnsupportedAppUsage
     int mOverflingDistance;
 
     // These two EdgeGlows are always set and used together.
@@ -675,11 +704,13 @@
     /**
      * Tracks the state of the top edge glow.
      */
+    @UnsupportedAppUsage
     private EdgeEffect mEdgeGlowTop;
 
     /**
      * Tracks the state of the bottom edge glow.
      */
+    @UnsupportedAppUsage
     private EdgeEffect mEdgeGlowBottom;
 
     /**
@@ -1418,6 +1449,7 @@
      * @hide
      */
     @Override
+    @UnsupportedAppUsage
     protected boolean isVerticalScrollBarHidden() {
         return isFastScrollEnabled();
     }
@@ -1469,6 +1501,7 @@
     /**
      * Notify our scroll listener (if there is one) of a change in scroll state
      */
+    @UnsupportedAppUsage
     void invokeOnItemScrollListener() {
         if (mFastScroll != null) {
             mFastScroll.onScroll(mFirstPosition, getChildCount(), mItemCount);
@@ -1691,7 +1724,9 @@
 
     static class SavedState extends BaseSavedState {
         long selectedId;
+        @UnsupportedAppUsage
         long firstId;
+        @UnsupportedAppUsage
         int viewTop;
         int position;
         int height;
@@ -2228,6 +2263,7 @@
         }
     }
 
+    @UnsupportedAppUsage
     private boolean canScrollUp() {
         boolean canScrollUp;
         // 0th element is not visible
@@ -2244,6 +2280,7 @@
         return canScrollUp;
     }
 
+    @UnsupportedAppUsage
     private boolean canScrollDown() {
         boolean canScrollDown;
         int count = getChildCount();
@@ -2571,6 +2608,7 @@
         positionSelector(position, sel, false, -1, -1);
     }
 
+    @UnsupportedAppUsage
     private void positionSelector(int position, View sel, boolean manageHotspot, float x, float y) {
         final boolean positionChanged = position != mSelectorPosition;
         if (position != INVALID_POSITION) {
@@ -2857,6 +2895,7 @@
         mScrollDown = down;
     }
 
+    @UnsupportedAppUsage
     void updateSelectorState() {
         final Drawable selector = mSelector;
         if (selector != null && selector.isStateful()) {
@@ -3219,6 +3258,7 @@
         return false;
     }
 
+    @UnsupportedAppUsage
     boolean performLongPress(final View child,
             final int longPressPosition, final long longPressId) {
         return performLongPress(
@@ -3229,6 +3269,7 @@
                 CheckForLongPress.INVALID_COORD);
     }
 
+    @UnsupportedAppUsage
     boolean performLongPress(final View child,
             final int longPressPosition, final long longPressId, float x, float y) {
         // CHOICE_MODE_MULTIPLE_MODAL takes over long press.
@@ -4555,6 +4596,7 @@
      *
      * @param newState The new scroll state.
      */
+    @UnsupportedAppUsage
     void reportScrollStateChange(int newState) {
         if (newState != mLastScrollState) {
             if (mOnScrollListener != null) {
@@ -4574,6 +4616,7 @@
         /**
          * Tracks the decay of a fling scroll
          */
+        @UnsupportedAppUsage
         private final OverScroller mScroller;
 
         /**
@@ -4618,6 +4661,7 @@
             mScroller = new OverScroller(getContext());
         }
 
+        @UnsupportedAppUsage
         void start(int initialVelocity) {
             int initialY = initialVelocity < 0 ? Integer.MAX_VALUE : 0;
             mLastFlingY = initialY;
@@ -4695,6 +4739,7 @@
             postOnAnimation(this);
         }
 
+        @UnsupportedAppUsage
         void endFling() {
             mTouchMode = TOUCH_MODE_REST;
 
@@ -4949,6 +4994,7 @@
         smoothScrollBy(distance, duration, false, false);
     }
 
+    @UnsupportedAppUsage
     void smoothScrollBy(int distance, int duration, boolean linear,
             boolean suppressEndFlingStateChangeCall) {
         if (mFlingRunnable == null) {
@@ -5091,6 +5137,7 @@
      * @param incrementalDeltaY Change in deltaY from the previous event.
      * @return true if we're already at the beginning/end of the list and have nothing to do.
      */
+    @UnsupportedAppUsage
     boolean trackMotionScroll(int deltaY, int incrementalDeltaY) {
         final int childCount = getChildCount();
         if (childCount == 0) {
@@ -5326,6 +5373,7 @@
      * @param y Where the user touched
      * @return The position of the first (or only) item in the row containing y
      */
+    @UnsupportedAppUsage
     abstract int findMotionRow(int y);
 
     /**
@@ -5358,6 +5406,7 @@
      * If there is a selection returns false.
      * Otherwise resurrects the selection and returns true if resurrected.
      */
+    @UnsupportedAppUsage
     boolean resurrectSelectionIfNeeded() {
         if (mSelectedPosition < 0 && resurrectSelection()) {
             updateSelectorState();
@@ -6522,6 +6571,7 @@
             @ViewDebug.IntToString(from = ITEM_VIEW_TYPE_IGNORE, to = "ITEM_VIEW_TYPE_IGNORE"),
             @ViewDebug.IntToString(from = ITEM_VIEW_TYPE_HEADER_OR_FOOTER, to = "ITEM_VIEW_TYPE_HEADER_OR_FOOTER")
         })
+        @UnsupportedAppUsage
         int viewType;
 
         /**
@@ -6549,6 +6599,7 @@
          * scrap heap.
          * @hide
          */
+        @UnsupportedAppUsage
         int scrappedFromPosition;
 
         /**
@@ -6617,6 +6668,7 @@
      * @see android.widget.AbsListView.RecyclerListener
      */
     class RecycleBin {
+        @UnsupportedAppUsage
         private RecyclerListener mRecyclerListener;
 
         /**
@@ -6698,6 +6750,7 @@
         /**
          * Clears the scrap heap.
          */
+        @UnsupportedAppUsage
         void clear() {
             if (mViewTypeCount == 1) {
                 final ArrayList<View> scrap = mCurrentScrap;
diff --git a/core/java/android/widget/AbsSeekBar.java b/core/java/android/widget/AbsSeekBar.java
index 61a5873..a85c585 100644
--- a/core/java/android/widget/AbsSeekBar.java
+++ b/core/java/android/widget/AbsSeekBar.java
@@ -18,6 +18,7 @@
 
 import android.annotation.NonNull;
 import android.annotation.Nullable;
+import android.annotation.UnsupportedAppUsage;
 import android.content.Context;
 import android.content.res.ColorStateList;
 import android.content.res.TypedArray;
@@ -43,6 +44,7 @@
 public abstract class AbsSeekBar extends ProgressBar {
     private final Rect mTempRect = new Rect();
 
+    @UnsupportedAppUsage
     private Drawable mThumb;
     private ColorStateList mThumbTintList = null;
     private PorterDuff.Mode mThumbTintMode = null;
@@ -56,17 +58,20 @@
     private boolean mHasTickMarkTintMode = false;
 
     private int mThumbOffset;
+    @UnsupportedAppUsage
     private boolean mSplitTrack;
 
     /**
      * On touch, this offset plus the scaled value from the position of the
      * touch will form the progress value. Usually 0.
      */
+    @UnsupportedAppUsage
     float mTouchProgressOffset;
 
     /**
      * Whether this is user seekable.
      */
+    @UnsupportedAppUsage
     boolean mIsUserSeekable = true;
 
     /**
@@ -76,10 +81,12 @@
     private int mKeyProgressIncrement = 1;
 
     private static final int NO_ALPHA = 0xFF;
+    @UnsupportedAppUsage
     private float mDisabledAlpha;
 
     private int mScaledTouchSlop;
     private float mTouchDownX;
+    @UnsupportedAppUsage
     private boolean mIsDragging;
 
     public AbsSeekBar(Context context) {
@@ -729,6 +736,7 @@
     /**
      * Draw the thumb.
      */
+    @UnsupportedAppUsage
     void drawThumb(Canvas canvas) {
         if (mThumb != null) {
             final int saveCount = canvas.save();
@@ -834,6 +842,7 @@
         }
     }
 
+    @UnsupportedAppUsage
     private void trackTouchEvent(MotionEvent event) {
         final int x = Math.round(event.getX());
         final int y = Math.round(event.getY());
diff --git a/core/java/android/widget/ActionMenuPresenter.java b/core/java/android/widget/ActionMenuPresenter.java
index 46269c6..eb20a76 100644
--- a/core/java/android/widget/ActionMenuPresenter.java
+++ b/core/java/android/widget/ActionMenuPresenter.java
@@ -22,6 +22,7 @@
 import android.animation.PropertyValuesHolder;
 import android.annotation.NonNull;
 import android.annotation.Nullable;
+import android.annotation.UnsupportedAppUsage;
 import android.content.Context;
 import android.content.res.Configuration;
 import android.content.res.Resources;
@@ -586,6 +587,7 @@
      * Dismiss all popup menus - overflow and submenus.
      * @return true if popups were dismissed, false otherwise. (This can be because none were open.)
      */
+    @UnsupportedAppUsage
     public boolean dismissPopupMenus() {
         boolean result = hideOverflowMenu();
         result |= hideSubMenus();
@@ -608,6 +610,7 @@
     /**
      * @return true if the overflow menu is currently showing
      */
+    @UnsupportedAppUsage
     public boolean isOverflowMenuShowing() {
         return mOverflowPopup != null && mOverflowPopup.isShowing();
     }
@@ -766,6 +769,7 @@
     }
 
     @Override
+    @UnsupportedAppUsage
     public Parcelable onSaveInstanceState() {
         SavedState state = new SavedState();
         state.openSubMenuId = mOpenSubMenuId;
@@ -773,6 +777,7 @@
     }
 
     @Override
+    @UnsupportedAppUsage
     public void onRestoreInstanceState(Parcelable state) {
         SavedState saved = (SavedState) state;
         if (saved.openSubMenuId > 0) {
diff --git a/core/java/android/widget/ActionMenuView.java b/core/java/android/widget/ActionMenuView.java
index c4bbdb0..7e58622 100644
--- a/core/java/android/widget/ActionMenuView.java
+++ b/core/java/android/widget/ActionMenuView.java
@@ -18,6 +18,7 @@
 import android.annotation.NonNull;
 import android.annotation.Nullable;
 import android.annotation.StyleRes;
+import android.annotation.UnsupportedAppUsage;
 import android.content.Context;
 import android.content.res.Configuration;
 import android.graphics.drawable.Drawable;
@@ -564,6 +565,7 @@
     }
 
     /** @hide */
+    @UnsupportedAppUsage
     public boolean isOverflowReserved() {
         return mReserveOverflow;
     }
@@ -655,6 +657,7 @@
      * Must be called before the first call to getMenu()
      * @hide
      */
+    @UnsupportedAppUsage
     public void setMenuCallbacks(MenuPresenter.Callback pcb, MenuBuilder.Callback mcb) {
         mActionMenuPresenterCallback = pcb;
         mMenuBuilderCallback = mcb;
@@ -664,6 +667,7 @@
      * Returns the current menu or null if one has not yet been configured.
      * @hide Internal use only for action bar integration
      */
+    @UnsupportedAppUsage
     public MenuBuilder peekMenu() {
         return mMenu;
     }
@@ -697,6 +701,7 @@
     }
 
     /** @hide */
+    @UnsupportedAppUsage
     public boolean isOverflowMenuShowPending() {
         return mPresenter != null && mPresenter.isOverflowMenuShowPending();
     }
@@ -714,6 +719,7 @@
      * @hide Private LinearLayout (superclass) API. Un-hide if LinearLayout API is made public.
      */
     @Override
+    @UnsupportedAppUsage
     protected boolean hasDividerBeforeChildAt(int childIndex) {
         if (childIndex == 0) {
             return false;
@@ -736,6 +742,7 @@
     }
 
     /** @hide */
+    @UnsupportedAppUsage
     public void setExpandedActionViewsExclusive(boolean exclusive) {
         mPresenter.setExpandedActionViewsExclusive(exclusive);
     }
@@ -783,6 +790,7 @@
 
     /** @hide */
     public interface ActionMenuChildView {
+        @UnsupportedAppUsage
         public boolean needsDividerBefore();
         public boolean needsDividerAfter();
     }
@@ -790,25 +798,31 @@
     public static class LayoutParams extends LinearLayout.LayoutParams {
         /** @hide */
         @ViewDebug.ExportedProperty(category = "layout")
+        @UnsupportedAppUsage
         public boolean isOverflowButton;
 
         /** @hide */
         @ViewDebug.ExportedProperty(category = "layout")
+        @UnsupportedAppUsage
         public int cellsUsed;
 
         /** @hide */
         @ViewDebug.ExportedProperty(category = "layout")
+        @UnsupportedAppUsage
         public int extraPixels;
 
         /** @hide */
         @ViewDebug.ExportedProperty(category = "layout")
+        @UnsupportedAppUsage
         public boolean expandable;
 
         /** @hide */
         @ViewDebug.ExportedProperty(category = "layout")
+        @UnsupportedAppUsage
         public boolean preventEdgeOffset;
 
         /** @hide */
+        @UnsupportedAppUsage
         public boolean expanded;
 
         public LayoutParams(Context c, AttributeSet attrs) {
diff --git a/core/java/android/widget/ActivityChooserModel.java b/core/java/android/widget/ActivityChooserModel.java
index 75c857c..f5bf759 100644
--- a/core/java/android/widget/ActivityChooserModel.java
+++ b/core/java/android/widget/ActivityChooserModel.java
@@ -16,6 +16,7 @@
 
 package android.widget;
 
+import android.annotation.UnsupportedAppUsage;
 import android.app.ActivityManager;
 import android.content.ComponentName;
 import android.content.Context;
@@ -339,6 +340,7 @@
      *
      * @return The model.
      */
+    @UnsupportedAppUsage
     public static ActivityChooserModel get(Context context, String historyFileName) {
         synchronized (sRegistryLock) {
             ActivityChooserModel dataModel = sDataModelRegistry.get(historyFileName);
@@ -376,6 +378,7 @@
      *
      * @param intent The intent.
      */
+    @UnsupportedAppUsage
     public void setIntent(Intent intent) {
         synchronized (mInstanceLock) {
             if (mIntent == intent) {
@@ -405,6 +408,7 @@
      *
      * @see #setIntent(Intent)
      */
+    @UnsupportedAppUsage
     public int getActivityCount() {
         synchronized (mInstanceLock) {
             ensureConsistentState();
@@ -420,6 +424,7 @@
      * @see ActivityResolveInfo
      * @see #setIntent(Intent)
      */
+    @UnsupportedAppUsage
     public ResolveInfo getActivity(int index) {
         synchronized (mInstanceLock) {
             ensureConsistentState();
@@ -467,6 +472,7 @@
      * @see HistoricalRecord
      * @see OnChooseActivityListener
      */
+    @UnsupportedAppUsage
     public Intent chooseActivity(int index) {
         synchronized (mInstanceLock) {
             if (mIntent == null) {
@@ -507,6 +513,7 @@
      *
      * @param listener The listener.
      */
+    @UnsupportedAppUsage
     public void setOnChooseActivityListener(OnChooseActivityListener listener) {
         synchronized (mInstanceLock) {
             mActivityChoserModelPolicy = listener;
diff --git a/core/java/android/widget/ActivityChooserView.java b/core/java/android/widget/ActivityChooserView.java
index 121a8c5..58715ee 100644
--- a/core/java/android/widget/ActivityChooserView.java
+++ b/core/java/android/widget/ActivityChooserView.java
@@ -17,6 +17,7 @@
 package android.widget;
 
 import android.annotation.StringRes;
+import android.annotation.UnsupportedAppUsage;
 import android.content.Context;
 import android.content.Intent;
 import android.content.pm.PackageManager;
@@ -323,6 +324,7 @@
      *
      * @param drawable The drawable.
      */
+    @UnsupportedAppUsage
     public void setExpandActivityOverflowButtonDrawable(Drawable drawable) {
         mExpandActivityOverflowButtonImage.setImageDrawable(drawable);
     }
diff --git a/core/java/android/widget/AdapterView.java b/core/java/android/widget/AdapterView.java
index 4e77f0b..dd6c923 100644
--- a/core/java/android/widget/AdapterView.java
+++ b/core/java/android/widget/AdapterView.java
@@ -18,6 +18,7 @@
 
 import android.annotation.NonNull;
 import android.annotation.Nullable;
+import android.annotation.UnsupportedAppUsage;
 import android.content.Context;
 import android.database.DataSetObserver;
 import android.os.Parcelable;
@@ -68,6 +69,7 @@
      * The position of the first child displayed
      */
     @ViewDebug.ExportedProperty(category = "scrolling")
+    @UnsupportedAppUsage
     int mFirstPosition = 0;
 
     /**
@@ -79,6 +81,7 @@
     /**
      * Position from which to start looking for mSyncRowId
      */
+    @UnsupportedAppUsage
     int mSyncPosition;
 
     /**
@@ -94,6 +97,7 @@
     /**
      * True if we need to sync to mSyncRowId
      */
+    @UnsupportedAppUsage
     boolean mNeedSync = false;
 
     /**
@@ -131,11 +135,13 @@
     /**
      * The listener that receives notifications when an item is selected.
      */
+    @UnsupportedAppUsage
     OnItemSelectedListener mOnItemSelectedListener;
 
     /**
      * The listener that receives notifications when an item is clicked.
      */
+    @UnsupportedAppUsage
     OnItemClickListener mOnItemClickListener;
 
     /**
@@ -146,6 +152,7 @@
     /**
      * True if the data has changed since the last layout
      */
+    @UnsupportedAppUsage
     boolean mDataChanged;
 
     /**
@@ -153,17 +160,20 @@
      * during the next layout.
      */
     @ViewDebug.ExportedProperty(category = "list")
+    @UnsupportedAppUsage
     int mNextSelectedPosition = INVALID_POSITION;
 
     /**
      * The item id of the item to select during the next layout.
      */
+    @UnsupportedAppUsage
     long mNextSelectedRowId = INVALID_ROW_ID;
 
     /**
      * The position within the adapter's data set of the currently selected item.
      */
     @ViewDebug.ExportedProperty(category = "list")
+    @UnsupportedAppUsage
     int mSelectedPosition = INVALID_POSITION;
 
     /**
@@ -201,6 +211,7 @@
     /**
      * The last selected position we used when notifying
      */
+    @UnsupportedAppUsage
     int mOldSelectedPosition = INVALID_POSITION;
 
     /**
@@ -900,6 +911,7 @@
         }
     }
 
+    @UnsupportedAppUsage
     void selectionChanged() {
         // We're about to post or run the selection notifier, so we don't need
         // a pending notifier.
@@ -1217,6 +1229,7 @@
      * Utility to keep mSelectedPosition and mSelectedRowId in sync
      * @param position Our current position
      */
+    @UnsupportedAppUsage
     void setSelectedPositionInt(int position) {
         mSelectedPosition = position;
         mSelectedRowId = getItemIdAtPosition(position);
@@ -1227,6 +1240,7 @@
      * @param position Intended value for mSelectedPosition the next time we go
      * through layout
      */
+    @UnsupportedAppUsage
     void setNextSelectedPositionInt(int position) {
         mNextSelectedPosition = position;
         mNextSelectedRowId = getItemIdAtPosition(position);
diff --git a/core/java/android/widget/AnalogClock.java b/core/java/android/widget/AnalogClock.java
index bde5f7f..795b034 100644
--- a/core/java/android/widget/AnalogClock.java
+++ b/core/java/android/widget/AnalogClock.java
@@ -16,6 +16,7 @@
 
 package android.widget;
 
+import android.annotation.UnsupportedAppUsage;
 import android.content.BroadcastReceiver;
 import android.content.Context;
 import android.content.Intent;
@@ -46,8 +47,11 @@
 public class AnalogClock extends View {
     private Time mCalendar;
 
+    @UnsupportedAppUsage
     private Drawable mHourHand;
+    @UnsupportedAppUsage
     private Drawable mMinuteHand;
+    @UnsupportedAppUsage
     private Drawable mDial;
 
     private int mDialWidth;
diff --git a/core/java/android/widget/AppSecurityPermissions.java b/core/java/android/widget/AppSecurityPermissions.java
index e6f948f..b754d84 100644
--- a/core/java/android/widget/AppSecurityPermissions.java
+++ b/core/java/android/widget/AppSecurityPermissions.java
@@ -16,6 +16,7 @@
 */
 package android.widget;
 
+import android.annotation.UnsupportedAppUsage;
 import android.app.AlertDialog;
 import android.content.Context;
 import android.content.DialogInterface;
@@ -257,6 +258,7 @@
         mNewPermPrefix = mContext.getText(R.string.perms_new_perm_prefix);
     }
 
+    @UnsupportedAppUsage
     public AppSecurityPermissions(Context context, String packageName) {
         this(context);
         mPackageName = packageName;
@@ -418,6 +420,7 @@
         }
     }
 
+    @UnsupportedAppUsage
     public int getPermissionCount() {
         return getPermissionCount(WHICH_ALL);
     }
@@ -438,6 +441,7 @@
         return N;
     }
 
+    @UnsupportedAppUsage
     public View getPermissionsView() {
         return getPermissionsView(WHICH_ALL, false);
     }
diff --git a/core/java/android/widget/ArrayAdapter.java b/core/java/android/widget/ArrayAdapter.java
index f18f217..c3c2c0d 100644
--- a/core/java/android/widget/ArrayAdapter.java
+++ b/core/java/android/widget/ArrayAdapter.java
@@ -21,6 +21,7 @@
 import android.annotation.LayoutRes;
 import android.annotation.NonNull;
 import android.annotation.Nullable;
+import android.annotation.UnsupportedAppUsage;
 import android.content.Context;
 import android.content.res.Resources;
 import android.util.Log;
@@ -77,6 +78,7 @@
      * used by the filter (see {@link #getFilter()} to make a synchronized copy of
      * the original array of data.
      */
+    @UnsupportedAppUsage
     private final Object mLock = new Object();
 
     private final LayoutInflater mInflater;
@@ -99,6 +101,7 @@
      * Contains the list of objects that represent the data of this ArrayAdapter.
      * The content of this list is referred to as "the array" in the documentation.
      */
+    @UnsupportedAppUsage
     private List<T> mObjects;
 
     /**
@@ -121,6 +124,7 @@
 
     // A copy of the original mObjects array, initialized from and then used instead as soon as
     // the mFilter ArrayFilter is used. mObjects will then only contain the filtered values.
+    @UnsupportedAppUsage
     private ArrayList<T> mOriginalValues;
     private ArrayFilter mFilter;
 
diff --git a/core/java/android/widget/AutoCompleteTextView.java b/core/java/android/widget/AutoCompleteTextView.java
index 49741d4..71d13a9 100644
--- a/core/java/android/widget/AutoCompleteTextView.java
+++ b/core/java/android/widget/AutoCompleteTextView.java
@@ -17,6 +17,7 @@
 package android.widget;
 
 import android.annotation.DrawableRes;
+import android.annotation.UnsupportedAppUsage;
 import android.content.Context;
 import android.content.res.Resources.Theme;
 import android.content.res.TypedArray;
@@ -102,10 +103,13 @@
     /** Context used to inflate the popup window or dialog. */
     private final Context mPopupContext;
 
+    @UnsupportedAppUsage
     private final ListPopupWindow mPopup;
+    @UnsupportedAppUsage
     private final PassThroughClickListener mPassThroughClickListener;
 
     private CharSequence mHintText;
+    @UnsupportedAppUsage
     private TextView mHintView;
     private int mHintResource;
 
@@ -132,6 +136,7 @@
     // Set to false when the list is hidden to prevent asynchronous updates to popup the list again.
     private boolean mPopupCanBeUpdated = true;
 
+    @UnsupportedAppUsage
     private PopupDataSetObserver mObserver;
 
     /**
@@ -528,6 +533,7 @@
      *
      * @hide Pending API council approval
      */
+    @UnsupportedAppUsage
     public void setDropDownAnimationStyle(int animationStyle) {
         mPopup.setAnimationStyle(animationStyle);
     }
@@ -566,6 +572,7 @@
      *
      * @hide Pending API council approval
      */
+    @UnsupportedAppUsage
     public void setDropDownAlwaysVisible(boolean dropDownAlwaysVisible) {
         mPopup.setDropDownAlwaysVisible(dropDownAlwaysVisible);
     }
@@ -587,6 +594,7 @@
      *
      * @hide Pending API council approval
      */
+    @UnsupportedAppUsage
     public void setDropDownDismissedOnCompletion(boolean dropDownDismissedOnCompletion) {
         mDropDownDismissedOnCompletion = dropDownDismissedOnCompletion;
     }
@@ -866,6 +874,7 @@
         }
     }
 
+    @UnsupportedAppUsage
     void doBeforeTextChanged() {
         if (mBlockCompletion) return;
 
@@ -875,6 +884,7 @@
         if (DEBUG) Log.v(TAG, "before text changed: open=" + mOpenBefore);
     }
 
+    @UnsupportedAppUsage
     void doAfterTextChanged() {
         if (mBlockCompletion) return;
 
@@ -1171,6 +1181,7 @@
      *
      * @hide internal used only by SearchDialog
      */
+    @UnsupportedAppUsage
     public void showDropDownAfterLayout() {
         mPopup.postShow();
     }
@@ -1181,6 +1192,7 @@
      * the background.
      * @hide internal used only here and SearchDialog
      */
+    @UnsupportedAppUsage
     public void ensureImeVisible(boolean visible) {
         mPopup.setInputMethodMode(visible
                 ? ListPopupWindow.INPUT_METHOD_NEEDED : ListPopupWindow.INPUT_METHOD_NOT_NEEDED);
@@ -1192,6 +1204,7 @@
     /**
      * @hide internal used only here and SearchDialog
      */
+    @UnsupportedAppUsage
     public boolean isInputMethodNotNeeded() {
         return mPopup.getInputMethodMode() == ListPopupWindow.INPUT_METHOD_NOT_NEEDED;
     }
@@ -1225,6 +1238,7 @@
      *
      * @hide used only by SearchDialog
      */
+    @UnsupportedAppUsage
     public void setForceIgnoreOutsideTouch(boolean forceIgnoreOutsideTouch) {
         mPopup.setForceIgnoreOutsideTouch(forceIgnoreOutsideTouch);
     }
diff --git a/core/java/android/widget/BaseAdapter.java b/core/java/android/widget/BaseAdapter.java
index 5838cc1..7b9365b 100644
--- a/core/java/android/widget/BaseAdapter.java
+++ b/core/java/android/widget/BaseAdapter.java
@@ -17,6 +17,7 @@
 package android.widget;
 
 import android.annotation.Nullable;
+import android.annotation.UnsupportedAppUsage;
 import android.database.DataSetObservable;
 import android.database.DataSetObserver;
 import android.view.View;
@@ -29,6 +30,7 @@
  * specialized {@link SpinnerAdapter} interface).
  */
 public abstract class BaseAdapter implements ListAdapter, SpinnerAdapter {
+    @UnsupportedAppUsage
     private final DataSetObservable mDataSetObservable = new DataSetObservable();
     private CharSequence[] mAutofillOptions;
 
diff --git a/core/java/android/widget/CalendarView.java b/core/java/android/widget/CalendarView.java
index db50e34..2ff815d 100644
--- a/core/java/android/widget/CalendarView.java
+++ b/core/java/android/widget/CalendarView.java
@@ -23,6 +23,7 @@
 import android.annotation.Nullable;
 import android.annotation.StyleRes;
 import android.annotation.TestApi;
+import android.annotation.UnsupportedAppUsage;
 import android.annotation.Widget;
 import android.content.Context;
 import android.content.res.Configuration;
@@ -72,6 +73,7 @@
     private static final int MODE_HOLO = 0;
     private static final int MODE_MATERIAL = 1;
 
+    @UnsupportedAppUsage
     private final CalendarViewDelegate mDelegate;
 
     /**
diff --git a/core/java/android/widget/CheckedTextView.java b/core/java/android/widget/CheckedTextView.java
index 92bfd56..1472b01 100644
--- a/core/java/android/widget/CheckedTextView.java
+++ b/core/java/android/widget/CheckedTextView.java
@@ -19,6 +19,7 @@
 import android.annotation.DrawableRes;
 import android.annotation.NonNull;
 import android.annotation.Nullable;
+import android.annotation.UnsupportedAppUsage;
 import android.content.Context;
 import android.content.res.ColorStateList;
 import android.content.res.TypedArray;
@@ -53,6 +54,7 @@
     private boolean mChecked;
 
     private int mCheckMarkResource;
+    @UnsupportedAppUsage
     private Drawable mCheckMarkDrawable;
     private ColorStateList mCheckMarkTintList = null;
     private PorterDuff.Mode mCheckMarkTintMode = null;
@@ -61,6 +63,7 @@
 
     private int mBasePadding;
     private int mCheckMarkWidth;
+    @UnsupportedAppUsage
     private int mCheckMarkGravity = Gravity.END;
 
     private boolean mNeedRequestlayout;
diff --git a/core/java/android/widget/CompoundButton.java b/core/java/android/widget/CompoundButton.java
index 0762b15..8d09489 100644
--- a/core/java/android/widget/CompoundButton.java
+++ b/core/java/android/widget/CompoundButton.java
@@ -19,6 +19,7 @@
 import android.annotation.DrawableRes;
 import android.annotation.NonNull;
 import android.annotation.Nullable;
+import android.annotation.UnsupportedAppUsage;
 import android.content.Context;
 import android.content.res.ColorStateList;
 import android.content.res.TypedArray;
@@ -59,14 +60,17 @@
     private static final String LOG_TAG = CompoundButton.class.getSimpleName();
 
     private boolean mChecked;
+    @UnsupportedAppUsage
     private boolean mBroadcasting;
 
+    @UnsupportedAppUsage
     private Drawable mButtonDrawable;
     private ColorStateList mButtonTintList = null;
     private PorterDuff.Mode mButtonTintMode = null;
     private boolean mHasButtonTint = false;
     private boolean mHasButtonTintMode = false;
 
+    @UnsupportedAppUsage
     private OnCheckedChangeListener mOnCheckedChangeListener;
     private OnCheckedChangeListener mOnCheckedChangeWidgetListener;
 
diff --git a/core/java/android/widget/CursorAdapter.java b/core/java/android/widget/CursorAdapter.java
index 9fb98db..cc8b550 100644
--- a/core/java/android/widget/CursorAdapter.java
+++ b/core/java/android/widget/CursorAdapter.java
@@ -16,6 +16,7 @@
 
 package android.widget;
 
+import android.annotation.UnsupportedAppUsage;
 import android.annotation.WorkerThread;
 import android.content.Context;
 import android.content.res.Resources;
@@ -43,6 +44,7 @@
      * This field should be made private, so it is hidden from the SDK.
      * {@hide}
      */
+    @UnsupportedAppUsage
     protected boolean mDataValid;
     /**
      * This field should be made private, so it is hidden from the SDK.
@@ -53,11 +55,13 @@
      * This field should be made private, so it is hidden from the SDK.
      * {@hide}
      */
+    @UnsupportedAppUsage
     protected Cursor mCursor;
     /**
      * This field should be made private, so it is hidden from the SDK.
      * {@hide}
      */
+    @UnsupportedAppUsage
     protected Context mContext;
     /**
      * Context used for {@link #getDropDownView(int, View, ViewGroup)}.
@@ -68,16 +72,19 @@
      * This field should be made private, so it is hidden from the SDK.
      * {@hide}
      */
+    @UnsupportedAppUsage
     protected int mRowIDColumn;
     /**
      * This field should be made private, so it is hidden from the SDK.
      * {@hide}
      */
+    @UnsupportedAppUsage
     protected ChangeObserver mChangeObserver;
     /**
      * This field should be made private, so it is hidden from the SDK.
      * {@hide}
      */
+    @UnsupportedAppUsage
     protected DataSetObserver mDataSetObserver;
     /**
      * This field should be made private, so it is hidden from the SDK.
diff --git a/core/java/android/widget/DatePicker.java b/core/java/android/widget/DatePicker.java
index b2b93fa..df53795 100644
--- a/core/java/android/widget/DatePicker.java
+++ b/core/java/android/widget/DatePicker.java
@@ -19,6 +19,7 @@
 import android.annotation.IntDef;
 import android.annotation.Nullable;
 import android.annotation.TestApi;
+import android.annotation.UnsupportedAppUsage;
 import android.annotation.Widget;
 import android.content.Context;
 import android.content.res.Configuration;
@@ -114,6 +115,7 @@
     @Retention(RetentionPolicy.SOURCE)
     public @interface DatePickerMode {}
 
+    @UnsupportedAppUsage
     private final DatePickerDelegate mDelegate;
 
     @DatePickerMode
@@ -329,6 +331,7 @@
      * @param callback the callback, may be null
      * @hide
      */
+    @UnsupportedAppUsage
     public void setValidationCallback(@Nullable ValidationCallback callback) {
         mDelegate.setValidationCallback(callback);
     }
diff --git a/core/java/android/widget/DateTimeView.java b/core/java/android/widget/DateTimeView.java
index 2b1e900..bf2762a 100644
--- a/core/java/android/widget/DateTimeView.java
+++ b/core/java/android/widget/DateTimeView.java
@@ -22,6 +22,7 @@
 import static android.text.format.DateUtils.YEAR_IN_MILLIS;
 import static android.text.format.Time.getJulianDay;
 
+import android.annotation.UnsupportedAppUsage;
 import android.app.ActivityThread;
 import android.content.BroadcastReceiver;
 import android.content.Context;
@@ -76,6 +77,7 @@
         this(context, null);
     }
 
+    @UnsupportedAppUsage
     public DateTimeView(Context context, AttributeSet attrs) {
         super(context, attrs);
         final TypedArray a = context.obtainStyledAttributes(attrs,
@@ -124,6 +126,7 @@
     }
 
     @android.view.RemotableViewMethod
+    @UnsupportedAppUsage
     public void setTime(long time) {
         Time t = new Time();
         t.set(time);
@@ -149,6 +152,7 @@
         }
     }
 
+    @UnsupportedAppUsage
     void update() {
         if (mTime == null || getVisibility() == GONE) {
             return;
diff --git a/core/java/android/widget/EdgeEffect.java b/core/java/android/widget/EdgeEffect.java
index f9f5901..7e42862 100644
--- a/core/java/android/widget/EdgeEffect.java
+++ b/core/java/android/widget/EdgeEffect.java
@@ -17,6 +17,7 @@
 package android.widget;
 
 import android.annotation.ColorInt;
+import android.annotation.UnsupportedAppUsage;
 import android.content.Context;
 import android.content.res.TypedArray;
 import android.graphics.Canvas;
@@ -79,6 +80,7 @@
     private static final float RADIUS_FACTOR = 0.6f;
 
     private float mGlowAlpha;
+    @UnsupportedAppUsage
     private float mGlowScaleY;
 
     private float mGlowAlphaStart;
@@ -106,6 +108,7 @@
     private float mPullDistance;
 
     private final Rect mBounds = new Rect();
+    @UnsupportedAppUsage
     private final Paint mPaint = new Paint();
     private float mRadius;
     private float mBaseGlowScale;
diff --git a/core/java/android/widget/Editor.java b/core/java/android/widget/Editor.java
index 058736a..47ce90b 100644
--- a/core/java/android/widget/Editor.java
+++ b/core/java/android/widget/Editor.java
@@ -21,6 +21,7 @@
 import android.annotation.IntDef;
 import android.annotation.NonNull;
 import android.annotation.Nullable;
+import android.annotation.UnsupportedAppUsage;
 import android.app.PendingIntent;
 import android.app.PendingIntent.CanceledException;
 import android.app.RemoteAction;
@@ -201,7 +202,9 @@
     SelectionModifierCursorController mSelectionModifierCursorController;
     // Action mode used when text is selected or when actions on an insertion cursor are triggered.
     private ActionMode mTextActionMode;
+    @UnsupportedAppUsage
     private boolean mInsertionControllerEnabled;
+    @UnsupportedAppUsage
     private boolean mSelectionControllerEnabled;
 
     private final boolean mHapticTextHandleEnabled;
@@ -268,6 +271,7 @@
     boolean mDiscardNextActionUp;
     boolean mIgnoreActionUpEvent;
 
+    @UnsupportedAppUsage
     private long mShowCursor;
     private boolean mRenderCursorRegardlessTiming;
     private Blink mBlink;
@@ -289,6 +293,7 @@
     private boolean mShowErrorAfterAttach;
 
     boolean mInBatchEditControllers;
+    @UnsupportedAppUsage
     boolean mShowSoftInputOnFocus = true;
     private boolean mPreserveSelection;
     private boolean mRestartActionModeOnNextRefresh;
@@ -304,8 +309,11 @@
 
     Drawable mDrawableForCursor = null;
 
+    @UnsupportedAppUsage
     private Drawable mSelectHandleLeft;
+    @UnsupportedAppUsage
     private Drawable mSelectHandleRight;
+    @UnsupportedAppUsage
     private Drawable mSelectHandleCenter;
 
     // Global listener that detects changes in the global position of the TextView
@@ -318,6 +326,7 @@
     Callback mCustomInsertionActionModeCallback;
 
     // Set when this TextView gained focus with some text selected. Will start selection mode.
+    @UnsupportedAppUsage
     boolean mCreatedWithASelection;
 
     // Indicates the current tap state (first tap, double tap, or triple click).
@@ -2024,6 +2033,7 @@
         }
     }
 
+    @UnsupportedAppUsage
     void invalidateTextDisplayList() {
         if (mTextRenderNodes != null) {
             for (int i = 0; i < mTextRenderNodes.length; i++) {
@@ -6299,6 +6309,7 @@
 
     static class InputContentType {
         int imeOptions = EditorInfo.IME_NULL;
+        @UnsupportedAppUsage
         String privateImeOptions;
         CharSequence imeActionLabel;
         int imeActionId;
diff --git a/core/java/android/widget/ExpandableListView.java b/core/java/android/widget/ExpandableListView.java
index 8d9848d..33d1539 100644
--- a/core/java/android/widget/ExpandableListView.java
+++ b/core/java/android/widget/ExpandableListView.java
@@ -18,6 +18,7 @@
 
 import static android.os.Build.VERSION_CODES.JELLY_BEAN_MR1;
 
+import android.annotation.UnsupportedAppUsage;
 import android.content.Context;
 import android.content.res.TypedArray;
 import android.graphics.Canvas;
@@ -127,15 +128,18 @@
     private static final long PACKED_POSITION_INT_MASK_GROUP = 0x7FFFFFFF;
 
     /** Serves as the glue/translator between a ListView and an ExpandableListView */
+    @UnsupportedAppUsage
     private ExpandableListConnector mConnector;
 
     /** Gives us Views through group+child positions */
     private ExpandableListAdapter mAdapter;
 
     /** Left bound for drawing the indicator. */
+    @UnsupportedAppUsage
     private int mIndicatorLeft;
 
     /** Right bound for drawing the indicator. */
+    @UnsupportedAppUsage
     private int mIndicatorRight;
 
     /** Start bound for drawing the indicator. */
@@ -180,6 +184,7 @@
     private static final int INDICATOR_UNDEFINED = -2;
 
     /** The indicator drawn next to a group. */
+    @UnsupportedAppUsage
     private Drawable mGroupIndicator;
 
     /** The indicator drawn next to a child. */
@@ -200,6 +205,7 @@
             {R.attr.state_expanded, R.attr.state_empty};
 
     /** States for the group where the 0th bit is expanded and 1st bit is empty. */
+    @UnsupportedAppUsage
     private static final int[][] GROUP_STATE_SETS = {
          EMPTY_STATE_SET, // 00
          GROUP_EXPANDED_STATE_SET, // 01
@@ -212,6 +218,7 @@
             {R.attr.state_last};
 
     /** Drawable to be used as a divider when it is adjacent to any children */
+    @UnsupportedAppUsage
     private Drawable mChildDivider;
 
     // Bounds of the indicator to be drawn
@@ -793,6 +800,7 @@
         void onGroupCollapse(int groupPosition);
     }
 
+    @UnsupportedAppUsage
     private OnGroupCollapseListener mOnGroupCollapseListener;
 
     public void setOnGroupCollapseListener(
@@ -811,6 +819,7 @@
         void onGroupExpand(int groupPosition);
     }
 
+    @UnsupportedAppUsage
     private OnGroupExpandListener mOnGroupExpandListener;
 
     public void setOnGroupExpandListener(
@@ -837,6 +846,7 @@
                 long id);
     }
 
+    @UnsupportedAppUsage
     private OnGroupClickListener mOnGroupClickListener;
 
     public void setOnGroupClickListener(OnGroupClickListener onGroupClickListener) {
@@ -864,6 +874,7 @@
                 int childPosition, long id);
     }
 
+    @UnsupportedAppUsage
     private OnChildClickListener mOnChildClickListener;
 
     public void setOnChildClickListener(OnChildClickListener onChildClickListener) {
diff --git a/core/java/android/widget/FastScroller.java b/core/java/android/widget/FastScroller.java
index 198bf27..2c09185 100644
--- a/core/java/android/widget/FastScroller.java
+++ b/core/java/android/widget/FastScroller.java
@@ -23,6 +23,7 @@
 import android.animation.ObjectAnimator;
 import android.animation.PropertyValuesHolder;
 import android.annotation.StyleRes;
+import android.annotation.UnsupportedAppUsage;
 import android.content.Context;
 import android.content.res.ColorStateList;
 import android.content.res.TypedArray;
@@ -98,13 +99,16 @@
 
     private final Rect mTempBounds = new Rect();
     private final Rect mTempMargins = new Rect();
+    @UnsupportedAppUsage
     private final Rect mContainerRect = new Rect();
 
     private final AbsListView mList;
     private final ViewGroupOverlay mOverlay;
     private final TextView mPrimaryText;
     private final TextView mSecondaryText;
+    @UnsupportedAppUsage
     private final ImageView mThumbImage;
+    @UnsupportedAppUsage
     private final ImageView mTrackImage;
     private final View mPreviewImage;
     /**
@@ -114,6 +118,7 @@
     private final int[] mPreviewResId = new int[2];
 
     /** The minimum touch target size in pixels. */
+    @UnsupportedAppUsage
     private final int mMinimumTouchTarget;
 
     /**
@@ -133,7 +138,9 @@
     /** Theme-specified text color. Used only if text appearance is not set. */
     private ColorStateList mTextColor;
 
+    @UnsupportedAppUsage
     private Drawable mThumbDrawable;
+    @UnsupportedAppUsage
     private Drawable mTrackDrawable;
     private int mTextAppearance;
     private int mThumbPosition;
@@ -161,6 +168,7 @@
     private int mFirstVisibleItem;
 
     /** The number of headers at the top of the view. */
+    @UnsupportedAppUsage
     private int mHeaderCount;
 
     /** The index of the current section. */
@@ -170,6 +178,7 @@
     private int mScrollbarPosition = -1;
 
     /** Whether the list is long enough to need a fast scroller. */
+    @UnsupportedAppUsage
     private boolean mLongList;
 
     private Object[] mSections;
@@ -245,6 +254,7 @@
         }
     };
 
+    @UnsupportedAppUsage
     public FastScroller(AbsListView listView, int styleResId) {
         mList = listView;
         mOldItemCount = listView.getCount();
@@ -392,6 +402,7 @@
     /**
      * Removes this FastScroller overlay from the host view.
      */
+    @UnsupportedAppUsage
     public void remove() {
         mOverlay.remove(mTrackImage);
         mOverlay.remove(mThumbImage);
@@ -507,6 +518,7 @@
         return mWidth;
     }
 
+    @UnsupportedAppUsage
     public void onSizeChanged(int w, int h, int oldw, int oldh) {
         updateLayout();
     }
@@ -816,6 +828,7 @@
         mThumbRange = max - min;
     }
 
+    @UnsupportedAppUsage
     private void setState(int state) {
         mList.removeCallbacks(mDeferHide);
 
@@ -1380,6 +1393,7 @@
         cancelFling();
     }
 
+    @UnsupportedAppUsage
     public boolean onInterceptTouchEvent(MotionEvent ev) {
         if (!isEnabled()) {
             return false;
@@ -1449,6 +1463,7 @@
         return null;
     }
 
+    @UnsupportedAppUsage
     public boolean onTouchEvent(MotionEvent me) {
         if (!isEnabled()) {
             return false;
diff --git a/core/java/android/widget/Filter.java b/core/java/android/widget/Filter.java
index d901540..16f4ee2 100644
--- a/core/java/android/widget/Filter.java
+++ b/core/java/android/widget/Filter.java
@@ -16,6 +16,7 @@
 
 package android.widget;
 
+import android.annotation.UnsupportedAppUsage;
 import android.os.Handler;
 import android.os.HandlerThread;
 import android.os.Looper;
@@ -65,6 +66,7 @@
      * @param delayer The delayer.
      * @hide
      */
+    @UnsupportedAppUsage
     public void setDelayer(Delayer delayer) {
         synchronized (mLock) {
             mDelayer = delayer;
diff --git a/core/java/android/widget/FrameLayout.java b/core/java/android/widget/FrameLayout.java
index dc8ee01..865f520 100644
--- a/core/java/android/widget/FrameLayout.java
+++ b/core/java/android/widget/FrameLayout.java
@@ -20,6 +20,7 @@
 import android.annotation.NonNull;
 import android.annotation.Nullable;
 import android.annotation.StyleRes;
+import android.annotation.UnsupportedAppUsage;
 import android.content.Context;
 import android.content.res.TypedArray;
 import android.graphics.Rect;
@@ -58,18 +59,23 @@
     private static final int DEFAULT_CHILD_GRAVITY = Gravity.TOP | Gravity.START;
 
     @ViewDebug.ExportedProperty(category = "measurement")
+    @UnsupportedAppUsage
     boolean mMeasureAllChildren = false;
 
     @ViewDebug.ExportedProperty(category = "padding")
+    @UnsupportedAppUsage
     private int mForegroundPaddingLeft = 0;
 
     @ViewDebug.ExportedProperty(category = "padding")
+    @UnsupportedAppUsage
     private int mForegroundPaddingTop = 0;
 
     @ViewDebug.ExportedProperty(category = "padding")
+    @UnsupportedAppUsage
     private int mForegroundPaddingRight = 0;
 
     @ViewDebug.ExportedProperty(category = "padding")
+    @UnsupportedAppUsage
     private int mForegroundPaddingBottom = 0;
 
     private final ArrayList<View> mMatchParentChildren = new ArrayList<>(1);
diff --git a/core/java/android/widget/Gallery.java b/core/java/android/widget/Gallery.java
index 7655f3d..ea1bfc2 100644
--- a/core/java/android/widget/Gallery.java
+++ b/core/java/android/widget/Gallery.java
@@ -17,6 +17,7 @@
 package android.widget;
 
 import android.annotation.NonNull;
+import android.annotation.UnsupportedAppUsage;
 import android.annotation.Widget;
 import android.content.Context;
 import android.content.res.TypedArray;
@@ -75,6 +76,7 @@
     /**
      * Horizontal spacing between items.
      */
+    @UnsupportedAppUsage
     private int mSpacing = 0;
 
     /**
@@ -103,21 +105,25 @@
     /**
      * Helper for detecting touch gestures.
      */
+    @UnsupportedAppUsage
     private GestureDetector mGestureDetector;
 
     /**
      * The position of the item that received the user's down touch.
      */
+    @UnsupportedAppUsage
     private int mDownTouchPosition;
 
     /**
      * The view of the item that received the user's down touch.
      */
+    @UnsupportedAppUsage
     private View mDownTouchView;
     
     /**
      * Executes the delta scrolls from a fling or scroll movement. 
      */
+    @UnsupportedAppUsage
     private FlingRunnable mFlingRunnable = new FlingRunnable();
 
     /**
@@ -143,6 +149,7 @@
     /**
      * The currently selected item's child.
      */
+    @UnsupportedAppUsage
     private View mSelectedChild;
     
     /**
@@ -380,6 +387,7 @@
      * 
      * @param deltaX Change in X from the previous event.
      */
+    @UnsupportedAppUsage
     void trackMotionScroll(int deltaX) {
 
         if (getChildCount() == 0) {
@@ -472,6 +480,7 @@
     /**
      * @return The center of this Gallery.
      */
+    @UnsupportedAppUsage
     private int getCenterOfGallery() {
         return (getWidth() - mPaddingLeft - mPaddingRight) / 2 + mPaddingLeft;
     }
@@ -479,6 +488,7 @@
     /**
      * @return The center of the given view.
      */
+    @UnsupportedAppUsage
     private static int getCenterOfView(View view) {
         return view.getLeft() + view.getWidth() / 2;
     }
@@ -696,6 +706,7 @@
         updateSelectedItemMetadata();
     }
 
+    @UnsupportedAppUsage
     private void fillToGalleryLeft() {
         if (mIsRtl) {
             fillToGalleryLeftRtl();
@@ -767,6 +778,7 @@
         }
     }
     
+    @UnsupportedAppUsage
     private void fillToGalleryRight() {
         if (mIsRtl) {
             fillToGalleryRightRtl();
@@ -851,6 +863,7 @@
      *        building from left to right)?
      * @return A view that has been added to the gallery
      */
+    @UnsupportedAppUsage
     private View makeAndAddView(int position, int offset, int x, boolean fromLeft) {
 
         View child;
@@ -1289,6 +1302,7 @@
         return super.onKeyUp(keyCode, event);
     }
     
+    @UnsupportedAppUsage
     boolean moveDirection(int direction) {
         direction = isLayoutRtl() ? -direction : direction;
         int targetPosition = mSelectedPosition + direction;
@@ -1468,6 +1482,7 @@
             removeCallbacks(this);
         }
         
+        @UnsupportedAppUsage
         public void startUsingVelocity(int initialVelocity) {
             if (initialVelocity == 0) return;
             
diff --git a/core/java/android/widget/GridLayout.java b/core/java/android/widget/GridLayout.java
index 4b76c18..13c086c 100644
--- a/core/java/android/widget/GridLayout.java
+++ b/core/java/android/widget/GridLayout.java
@@ -31,6 +31,7 @@
 import static java.lang.Math.min;
 
 import android.annotation.IntDef;
+import android.annotation.UnsupportedAppUsage;
 import android.content.Context;
 import android.content.res.TypedArray;
 import android.graphics.Canvas;
@@ -2797,6 +2798,7 @@
         }
     }
 
+    @UnsupportedAppUsage
     static final Alignment UNDEFINED_ALIGNMENT = new Alignment() {
         @Override
         int getGravityOffset(View view, int cellDelta) {
diff --git a/core/java/android/widget/GridView.java b/core/java/android/widget/GridView.java
index 1ec9b2f..9ccd321 100644
--- a/core/java/android/widget/GridView.java
+++ b/core/java/android/widget/GridView.java
@@ -18,6 +18,7 @@
 
 import android.annotation.IntDef;
 import android.annotation.NonNull;
+import android.annotation.UnsupportedAppUsage;
 import android.content.Context;
 import android.content.Intent;
 import android.content.res.TypedArray;
@@ -106,14 +107,21 @@
      */
     public static final int AUTO_FIT = -1;
 
+    @UnsupportedAppUsage
     private int mNumColumns = AUTO_FIT;
 
+    @UnsupportedAppUsage
     private int mHorizontalSpacing = 0;
+    @UnsupportedAppUsage
     private int mRequestedHorizontalSpacing;
+    @UnsupportedAppUsage
     private int mVerticalSpacing = 0;
     private int mStretchMode = STRETCH_COLUMN_WIDTH;
+    @UnsupportedAppUsage
     private int mColumnWidth;
+    @UnsupportedAppUsage
     private int mRequestedColumnWidth;
+    @UnsupportedAppUsage
     private int mRequestedNumColumns;
 
     private View mReferenceView = null;
@@ -300,6 +308,7 @@
      * @return The view that is currently selected, if it happens to be in the
      *         range that we draw.
      */
+    @UnsupportedAppUsage
     private View fillDown(int pos, int nextTop) {
         View selectedView = null;
 
@@ -399,6 +408,7 @@
      *
      * @return The view that is currently selected
      */
+    @UnsupportedAppUsage
     private View fillUp(int pos, int nextBottom) {
         View selectedView = null;
 
@@ -965,6 +975,7 @@
         return sel;
     }
 
+    @UnsupportedAppUsage
     private boolean determineColumns(int availableSpace) {
         final int requestedHorizontalSpacing = mRequestedHorizontalSpacing;
         final int stretchMode = mStretchMode;
@@ -1884,6 +1895,7 @@
      * Goes to the next or previous item according to the order set by the
      * adapter.
      */
+    @UnsupportedAppUsage
     boolean sequenceScroll(int direction) {
         int selectedPosition = mSelectedPosition;
         int numColumns = mNumColumns;
diff --git a/core/java/android/widget/HeaderViewListAdapter.java b/core/java/android/widget/HeaderViewListAdapter.java
index f9d8f92..10d50b8 100644
--- a/core/java/android/widget/HeaderViewListAdapter.java
+++ b/core/java/android/widget/HeaderViewListAdapter.java
@@ -16,6 +16,7 @@
 
 package android.widget;
 
+import android.annotation.UnsupportedAppUsage;
 import android.database.DataSetObserver;
 import android.view.View;
 import android.view.ViewGroup;
@@ -31,11 +32,14 @@
  */
 public class HeaderViewListAdapter implements WrapperListAdapter, Filterable {
 
+    @UnsupportedAppUsage
     private final ListAdapter mAdapter;
 
     // These two ArrayList are assumed to NOT be null.
     // They are indeed created when declared in ListView and then shared.
+    @UnsupportedAppUsage
     ArrayList<ListView.FixedViewInfo> mHeaderViewInfos;
+    @UnsupportedAppUsage
     ArrayList<ListView.FixedViewInfo> mFooterViewInfos;
 
     // Used as a placeholder in case the provided info views are indeed null.
diff --git a/core/java/android/widget/HorizontalScrollView.java b/core/java/android/widget/HorizontalScrollView.java
index 0bf2460..bf9dffd 100644
--- a/core/java/android/widget/HorizontalScrollView.java
+++ b/core/java/android/widget/HorizontalScrollView.java
@@ -17,6 +17,7 @@
 package android.widget;
 
 import android.annotation.NonNull;
+import android.annotation.UnsupportedAppUsage;
 import android.content.Context;
 import android.content.res.Configuration;
 import android.content.res.TypedArray;
@@ -76,13 +77,17 @@
     private long mLastScroll;
 
     private final Rect mTempRect = new Rect();
+    @UnsupportedAppUsage
     private OverScroller mScroller;
+    @UnsupportedAppUsage
     private EdgeEffect mEdgeGlowLeft;
+    @UnsupportedAppUsage
     private EdgeEffect mEdgeGlowRight;
 
     /**
      * Position of the last motion event.
      */
+    @UnsupportedAppUsage
     private int mLastMotionX;
 
     /**
@@ -96,6 +101,7 @@
      * layout is dirty. This prevents the scroll from being wrong if the child has not been
      * laid out before requesting focus.
      */
+    @UnsupportedAppUsage
     private View mChildToScrollTo = null;
 
     /**
@@ -103,11 +109,13 @@
      * not the same as 'is being flinged', which can be checked by
      * mScroller.isFinished() (flinging begins when the user lifts his finger).
      */
+    @UnsupportedAppUsage
     private boolean mIsBeingDragged = false;
 
     /**
      * Determines speed during touch scrolling
      */
+    @UnsupportedAppUsage
     private VelocityTracker mVelocityTracker;
 
     /**
@@ -126,7 +134,9 @@
     private int mMinimumVelocity;
     private int mMaximumVelocity;
 
+    @UnsupportedAppUsage
     private int mOverscrollDistance;
+    @UnsupportedAppUsage
     private int mOverflingDistance;
 
     private float mHorizontalScrollFactor;
@@ -437,6 +447,7 @@
         }
     }
 
+    @UnsupportedAppUsage
     private void recycleVelocityTracker() {
         if (mVelocityTracker != null) {
             mVelocityTracker.recycle();
diff --git a/core/java/android/widget/ImageView.java b/core/java/android/widget/ImageView.java
index 51e481d..0fef9a5 100644
--- a/core/java/android/widget/ImageView.java
+++ b/core/java/android/widget/ImageView.java
@@ -20,6 +20,7 @@
 import android.annotation.NonNull;
 import android.annotation.Nullable;
 import android.annotation.TestApi;
+import android.annotation.UnsupportedAppUsage;
 import android.content.ContentResolver;
 import android.content.Context;
 import android.content.res.ColorStateList;
@@ -96,13 +97,18 @@
     private static final String LOG_TAG = "ImageView";
 
     // settable by the client
+    @UnsupportedAppUsage
     private Uri mUri;
+    @UnsupportedAppUsage
     private int mResource = 0;
     private Matrix mMatrix;
     private ScaleType mScaleType;
     private boolean mHaveFrame = false;
+    @UnsupportedAppUsage
     private boolean mAdjustViewBounds = false;
+    @UnsupportedAppUsage
     private int mMaxWidth = Integer.MAX_VALUE;
+    @UnsupportedAppUsage
     private int mMaxHeight = Integer.MAX_VALUE;
 
     // these are applied to the drawable
@@ -110,11 +116,14 @@
     private boolean mHasColorFilter = false;
     private Xfermode mXfermode;
     private boolean mHasXfermode = false;
+    @UnsupportedAppUsage
     private int mAlpha = 255;
     private boolean mHasAlpha = false;
     private final int mViewAlphaScale = 256;
 
+    @UnsupportedAppUsage
     private Drawable mDrawable = null;
+    @UnsupportedAppUsage
     private BitmapDrawable mRecycleableBitmapDrawable = null;
     private ColorStateList mDrawableTintList = null;
     private PorterDuff.Mode mDrawableTintMode = null;
@@ -124,14 +133,18 @@
     private int[] mState = null;
     private boolean mMergeState = false;
     private int mLevel = 0;
+    @UnsupportedAppUsage
     private int mDrawableWidth;
+    @UnsupportedAppUsage
     private int mDrawableHeight;
+    @UnsupportedAppUsage
     private Matrix mDrawMatrix = null;
 
     // Avoid allocations...
     private final RectF mTempSrc = new RectF();
     private final RectF mTempDst = new RectF();
 
+    @UnsupportedAppUsage
     private boolean mCropToPadding;
 
     private int mBaseline = -1;
@@ -485,6 +498,7 @@
     }
 
     /** @hide **/
+    @UnsupportedAppUsage
     public Runnable setImageResourceAsync(@DrawableRes int resId) {
         Drawable d = null;
         if (resId != 0) {
@@ -540,6 +554,7 @@
     }
 
     /** @hide **/
+    @UnsupportedAppUsage
     public Runnable setImageURIAsync(@Nullable Uri uri) {
         if (mResource != 0 || (mUri != uri && (uri == null || mUri == null || !uri.equals(mUri)))) {
             Drawable d = uri == null ? null : getDrawableFromUri(uri);
@@ -899,6 +914,7 @@
         }
     }
 
+    @UnsupportedAppUsage
     private void resolveUri() {
         if (mDrawable != null) {
             return;
@@ -974,6 +990,7 @@
         }
     }
 
+    @UnsupportedAppUsage
     private void updateDrawable(Drawable d) {
         if (d != mRecycleableBitmapDrawable && mRecycleableBitmapDrawable != null) {
             mRecycleableBitmapDrawable.setBitmap(null);
@@ -1018,6 +1035,7 @@
         }
     }
 
+    @UnsupportedAppUsage
     private void resizeFromDrawable() {
         final Drawable d = mDrawable;
         if (d != null) {
@@ -1049,6 +1067,7 @@
         Matrix.ScaleToFit.END
     };
 
+    @UnsupportedAppUsage
     private static Matrix.ScaleToFit scaleTypeToScaleToFit(ScaleType st)  {
         // ScaleToFit enum to their corresponding Matrix.ScaleToFit values
         return sS2FArray[st.nativeInt - 1];
@@ -1313,6 +1332,7 @@
     }
 
     /** @hide */
+    @UnsupportedAppUsage
     public void animateTransform(Matrix matrix) {
         if (mDrawable == null) {
             return;
diff --git a/core/java/android/widget/LinearLayout.java b/core/java/android/widget/LinearLayout.java
index 40f9652..452e903 100644
--- a/core/java/android/widget/LinearLayout.java
+++ b/core/java/android/widget/LinearLayout.java
@@ -19,6 +19,7 @@
 import android.annotation.IntDef;
 import android.annotation.NonNull;
 import android.annotation.Nullable;
+import android.annotation.UnsupportedAppUsage;
 import android.content.Context;
 import android.content.res.TypedArray;
 import android.graphics.Canvas;
@@ -188,27 +189,35 @@
             @ViewDebug.FlagToString(mask = Gravity.RELATIVE_LAYOUT_DIRECTION,
                 equals = Gravity.RELATIVE_LAYOUT_DIRECTION, name = "RELATIVE")
         }, formatToHexString = true)
+    @UnsupportedAppUsage
     private int mGravity = Gravity.START | Gravity.TOP;
 
     @ViewDebug.ExportedProperty(category = "measurement")
+    @UnsupportedAppUsage
     private int mTotalLength;
 
     @ViewDebug.ExportedProperty(category = "layout")
     private float mWeightSum;
 
     @ViewDebug.ExportedProperty(category = "layout")
+    @UnsupportedAppUsage
     private boolean mUseLargestChild;
 
+    @UnsupportedAppUsage
     private int[] mMaxAscent;
+    @UnsupportedAppUsage
     private int[] mMaxDescent;
 
     private static final int VERTICAL_GRAVITY_COUNT = 4;
 
     private static final int INDEX_CENTER_VERTICAL = 0;
+    @UnsupportedAppUsage
     private static final int INDEX_TOP = 1;
+    @UnsupportedAppUsage
     private static final int INDEX_BOTTOM = 2;
     private static final int INDEX_FILL = 3;
 
+    @UnsupportedAppUsage
     private Drawable mDivider;
     private int mDividerWidth;
     private int mDividerHeight;
@@ -2062,6 +2071,7 @@
 
         /** @hide */
         @Override
+        @UnsupportedAppUsage
         protected void encodeProperties(@NonNull ViewHierarchyEncoder encoder) {
             super.encodeProperties(encoder);
 
diff --git a/core/java/android/widget/ListPopupWindow.java b/core/java/android/widget/ListPopupWindow.java
index adf366a..f9564b4 100644
--- a/core/java/android/widget/ListPopupWindow.java
+++ b/core/java/android/widget/ListPopupWindow.java
@@ -20,6 +20,7 @@
 import android.annotation.NonNull;
 import android.annotation.Nullable;
 import android.annotation.StyleRes;
+import android.annotation.UnsupportedAppUsage;
 import android.content.Context;
 import android.content.res.TypedArray;
 import android.database.DataSetObserver;
@@ -67,6 +68,7 @@
 
     private Context mContext;
     private ListAdapter mAdapter;
+    @UnsupportedAppUsage
     private DropDownListView mDropDownList;
 
     private int mDropDownHeight = ViewGroup.LayoutParams.WRAP_CONTENT;
@@ -115,6 +117,7 @@
 
     private boolean mModal;
 
+    @UnsupportedAppUsage
     PopupWindow mPopup;
 
     /**
@@ -310,6 +313,7 @@
      *
      * @hide Used only by AutoCompleteTextView to handle some internal special cases.
      */
+    @UnsupportedAppUsage
     public void setForceIgnoreOutsideTouch(boolean forceIgnoreOutsideTouch) {
         mForceIgnoreOutsideTouch = forceIgnoreOutsideTouch;
     }
@@ -325,6 +329,7 @@
      *
      * @hide Only used by AutoCompleteTextView under special conditions.
      */
+    @UnsupportedAppUsage
     public void setDropDownAlwaysVisible(boolean dropDownAlwaysVisible) {
         mDropDownAlwaysVisible = dropDownAlwaysVisible;
     }
@@ -334,6 +339,7 @@
      *
      * @hide Only used by AutoCompleteTextView under special conditions.
      */
+    @UnsupportedAppUsage
     public boolean isDropDownAlwaysVisible() {
         return mDropDownAlwaysVisible;
     }
@@ -898,6 +904,7 @@
      *
      * @param max Max number of items that can be visible and still allow the list to expand.
      */
+    @UnsupportedAppUsage
     void setListItemExpandMax(int max) {
         mListItemExpandMaximum = max;
     }
@@ -1093,6 +1100,7 @@
      *
      * @return the content's height or -1 if content already exists
      */
+    @UnsupportedAppUsage
     private int buildDropDown() {
         ViewGroup dropDownView;
         int otherHeights = 0;
diff --git a/core/java/android/widget/ListView.java b/core/java/android/widget/ListView.java
index fc9e8e7..ee04bcf 100644
--- a/core/java/android/widget/ListView.java
+++ b/core/java/android/widget/ListView.java
@@ -19,6 +19,7 @@
 import android.annotation.IdRes;
 import android.annotation.NonNull;
 import android.annotation.Nullable;
+import android.annotation.UnsupportedAppUsage;
 import android.content.Context;
 import android.content.Intent;
 import android.content.res.TypedArray;
@@ -181,10 +182,14 @@
         public boolean isSelectable;
     }
 
+    @UnsupportedAppUsage
     ArrayList<FixedViewInfo> mHeaderViewInfos = Lists.newArrayList();
+    @UnsupportedAppUsage
     ArrayList<FixedViewInfo> mFooterViewInfos = Lists.newArrayList();
 
+    @UnsupportedAppUsage
     Drawable mDivider;
+    @UnsupportedAppUsage
     int mDividerHeight;
 
     Drawable mOverScrollHeader;
@@ -196,6 +201,7 @@
     private boolean mHeaderDividersEnabled;
     private boolean mFooterDividersEnabled;
 
+    @UnsupportedAppUsage
     private boolean mAreAllItemsSelectable = true;
 
     private boolean mItemsCanFocus = false;
@@ -772,6 +778,7 @@
      * @return The view that is currently selected, if it happens to be in the
      *         range that we draw.
      */
+    @UnsupportedAppUsage
     private View fillDown(int pos, int nextTop) {
         View selectedView = null;
 
@@ -806,6 +813,7 @@
      *
      * @return The view that is currently selected
      */
+    @UnsupportedAppUsage
     private View fillUp(int pos, int nextBottom) {
         View selectedView = null;
 
@@ -1382,6 +1390,7 @@
      *            startPosition is 0).
      * @return The height of this ListView with the given children.
      */
+    @UnsupportedAppUsage
     final int measureHeightOfChildren(int widthMeasureSpec, int startPosition, int endPosition,
             int maxHeight, int disallowPartialChildPosition) {
         final ListAdapter adapter = mAdapter;
@@ -1477,6 +1486,7 @@
      * @return The selected view, or null if the selected view is outside the
      *         visible area.
      */
+    @UnsupportedAppUsage
     private View fillSpecific(int position, int top) {
         boolean tempIsSelected = position == mSelectedPosition;
         View temp = makeAndAddView(position, top, true, mListPadding.left, tempIsSelected);
@@ -1523,6 +1533,7 @@
      *
      * @param childCount Number of children
      */
+    @UnsupportedAppUsage
     private void correctTooHigh(int childCount) {
         // First see if the last item is visible. If it is not, it is OK for the
         // top of the list to be pushed up.
@@ -1572,6 +1583,7 @@
      *
      * @param childCount Number of children
      */
+    @UnsupportedAppUsage
     private void correctTooLow(int childCount) {
         // First see if the first item is visible. If it is not, it is OK for the
         // bottom of the list to be pushed down.
@@ -1967,6 +1979,7 @@
     }
 
     @Override
+    @UnsupportedAppUsage
     boolean trackMotionScroll(int deltaY, int incrementalDeltaY) {
         final boolean result = super.trackMotionScroll(deltaY, incrementalDeltaY);
         removeUnusedFixedViews(mHeaderViewInfos);
@@ -2000,6 +2013,7 @@
      * @param child a direct child of this list.
      * @return Whether child is a header or footer view.
      */
+    @UnsupportedAppUsage
     private boolean isDirectChildHeaderOrFooter(View child) {
         final ArrayList<FixedViewInfo> headers = mHeaderViewInfos;
         final int numHeaders = headers.size();
@@ -2034,6 +2048,7 @@
      *                 otherwise
      * @return the view that was added
      */
+    @UnsupportedAppUsage
     private View makeAndAddView(int position, int y, boolean flow, int childrenLeft,
             boolean selected) {
         if (!mDataChanged) {
@@ -2195,6 +2210,7 @@
      * @param position the position of the item to select
      */
     @Override
+    @UnsupportedAppUsage
     void setSelectionInt(int position) {
         setNextSelectedPositionInt(position);
         boolean awakeScrollbars = false;
@@ -2229,6 +2245,7 @@
      *         down. Returns {@link #INVALID_POSITION} if nothing can be found.
      */
     @Override
+    @UnsupportedAppUsage
     int lookForSelectablePosition(int position, boolean lookDown) {
         final ListAdapter adapter = mAdapter;
         if (adapter == null || isInTouchMode()) {
@@ -2636,6 +2653,7 @@
      *
      * @return whether selection was moved
      */
+    @UnsupportedAppUsage
     boolean arrowScroll(int direction) {
         try {
             mInLayout = true;
@@ -3235,6 +3253,7 @@
      *
      * @param amount The amount (positive or negative) to scroll.
      */
+    @UnsupportedAppUsage
     private void scrollListItemsBy(int amount) {
         offsetChildrenTopAndBottom(amount);
 
@@ -4001,6 +4020,7 @@
     }
 
     @Override
+    @UnsupportedAppUsage
     int getHeightForPosition(int position) {
         final int height = super.getHeightForPosition(position);
         if (shouldAdjustHeightForDivider(position)) {
diff --git a/core/java/android/widget/MediaController.java b/core/java/android/widget/MediaController.java
index 8e04f1c..82d77c5 100644
--- a/core/java/android/widget/MediaController.java
+++ b/core/java/android/widget/MediaController.java
@@ -16,6 +16,7 @@
 
 package android.widget;
 
+import android.annotation.UnsupportedAppUsage;
 import android.content.Context;
 import android.content.res.Resources;
 import android.graphics.PixelFormat;
@@ -68,16 +69,29 @@
  */
 public class MediaController extends FrameLayout {
 
+    @UnsupportedAppUsage
     private MediaPlayerControl mPlayer;
+    @UnsupportedAppUsage
     private final Context mContext;
+    @UnsupportedAppUsage
     private View mAnchor;
+    @UnsupportedAppUsage
     private View mRoot;
+    @UnsupportedAppUsage
     private WindowManager mWindowManager;
+    @UnsupportedAppUsage
     private Window mWindow;
+    @UnsupportedAppUsage
     private View mDecor;
+    @UnsupportedAppUsage
     private WindowManager.LayoutParams mDecorLayoutParams;
+    @UnsupportedAppUsage
     private ProgressBar mProgress;
-    private TextView mEndTime, mCurrentTime;
+    @UnsupportedAppUsage
+    private TextView mEndTime;
+    @UnsupportedAppUsage
+    private TextView mCurrentTime;
+    @UnsupportedAppUsage
     private boolean mShowing;
     private boolean mDragging;
     private static final int sDefaultTimeout = 3000;
@@ -87,10 +101,15 @@
     private View.OnClickListener mNextListener, mPrevListener;
     StringBuilder mFormatBuilder;
     Formatter mFormatter;
+    @UnsupportedAppUsage
     private ImageButton mPauseButton;
+    @UnsupportedAppUsage
     private ImageButton mFfwdButton;
+    @UnsupportedAppUsage
     private ImageButton mRewButton;
+    @UnsupportedAppUsage
     private ImageButton mNextButton;
+    @UnsupportedAppUsage
     private ImageButton mPrevButton;
     private CharSequence mPlayDescription;
     private CharSequence mPauseDescription;
@@ -535,6 +554,7 @@
         }
     };
 
+    @UnsupportedAppUsage
     private void updatePausePlay() {
         if (mRoot == null || mPauseButton == null)
             return;
@@ -568,6 +588,7 @@
     // The second scenario involves the user operating the scroll ball, in this
     // case there WON'T BE onStartTrackingTouch/onStopTrackingTouch notifications,
     // we will simply apply the updated position without suspending regular updates.
+    @UnsupportedAppUsage
     private final OnSeekBarChangeListener mSeekListener = new OnSeekBarChangeListener() {
         @Override
         public void onStartTrackingTouch(SeekBar bar) {
@@ -641,6 +662,7 @@
         return MediaController.class.getName();
     }
 
+    @UnsupportedAppUsage
     private final View.OnClickListener mRewListener = new View.OnClickListener() {
         @Override
         public void onClick(View v) {
@@ -653,6 +675,7 @@
         }
     };
 
+    @UnsupportedAppUsage
     private final View.OnClickListener mFfwdListener = new View.OnClickListener() {
         @Override
         public void onClick(View v) {
diff --git a/core/java/android/widget/NumberPicker.java b/core/java/android/widget/NumberPicker.java
index d98b865..b6ed22c 100644
--- a/core/java/android/widget/NumberPicker.java
+++ b/core/java/android/widget/NumberPicker.java
@@ -19,6 +19,7 @@
 import android.annotation.CallSuper;
 import android.annotation.IntDef;
 import android.annotation.TestApi;
+import android.annotation.UnsupportedAppUsage;
 import android.annotation.Widget;
 import android.content.Context;
 import android.content.res.ColorStateList;
@@ -98,6 +99,7 @@
     /**
      * The number of items show in the selector wheel.
      */
+    @UnsupportedAppUsage
     private static final int SELECTOR_WHEEL_ITEM_COUNT = 3;
 
     /**
@@ -108,6 +110,7 @@
     /**
      * The index of the middle selector item.
      */
+    @UnsupportedAppUsage
     private static final int SELECTOR_MIDDLE_ITEM_INDEX = SELECTOR_WHEEL_ITEM_COUNT / 2;
 
     /**
@@ -204,6 +207,7 @@
     /**
      * @hide
      */
+    @UnsupportedAppUsage
     public static final Formatter getTwoDigitFormatter() {
         return sTwoDigitFormatter;
     }
@@ -221,6 +225,7 @@
     /**
      * The text for showing the current value.
      */
+    @UnsupportedAppUsage
     private final EditText mInputText;
 
     /**
@@ -231,6 +236,7 @@
     /**
      * The min height of this widget.
      */
+    @UnsupportedAppUsage
     private final int mMinHeight;
 
     /**
@@ -241,6 +247,7 @@
     /**
      * The max width of this widget.
      */
+    @UnsupportedAppUsage
     private final int mMinWidth;
 
     /**
@@ -256,6 +263,7 @@
     /**
      * The height of the text.
      */
+    @UnsupportedAppUsage
     private final int mTextSize;
 
     /**
@@ -276,6 +284,7 @@
     /**
      * Upper value of the range of numbers allowed for the NumberPicker
      */
+    @UnsupportedAppUsage
     private int mMaxValue;
 
     /**
@@ -286,6 +295,7 @@
     /**
      * Listener to be notified upon current value change.
      */
+    @UnsupportedAppUsage
     private OnValueChangeListener mOnValueChangeListener;
 
     /**
@@ -311,11 +321,13 @@
     /**
      * The selector indices whose value are show by the selector.
      */
+    @UnsupportedAppUsage
     private final int[] mSelectorIndices = new int[SELECTOR_WHEEL_ITEM_COUNT];
 
     /**
      * The {@link Paint} for drawing the selector.
      */
+    @UnsupportedAppUsage
     private final Paint mSelectorWheelPaint;
 
     /**
@@ -341,6 +353,7 @@
     /**
      * The {@link Scroller} responsible for flinging the selector.
      */
+    @UnsupportedAppUsage
     private final Scroller mFlingScroller;
 
     /**
@@ -402,6 +415,7 @@
     /**
      * @see ViewConfiguration#getScaledMaximumFlingVelocity()
      */
+    @UnsupportedAppUsage
     private int mMaximumFlingVelocity;
 
     /**
@@ -422,11 +436,13 @@
     /**
      * Divider for showing item to be selected while scrolling
      */
+    @UnsupportedAppUsage
     private final Drawable mSelectionDivider;
 
     /**
      * The height of the selection divider.
      */
+    @UnsupportedAppUsage
     private final int mSelectionDividerHeight;
 
     /**
@@ -1715,6 +1731,7 @@
      * Resets the selector indices and clear the cached string representation of
      * these indices.
      */
+    @UnsupportedAppUsage
     private void initializeSelectorWheelIndices() {
         mSelectorIndexToStringCache.clear();
         int[] selectorIndices = mSelectorIndices;
@@ -1766,6 +1783,7 @@
      *
      * @param increment True to increment, false to decrement.
      */
+     @UnsupportedAppUsage
      private void changeValueByOne(boolean increment) {
         if (mHasSelectorWheel) {
             hideSoftInput();
diff --git a/core/java/android/widget/OverScroller.java b/core/java/android/widget/OverScroller.java
index 9938789..e7a96be 100644
--- a/core/java/android/widget/OverScroller.java
+++ b/core/java/android/widget/OverScroller.java
@@ -16,6 +16,7 @@
 
 package android.widget;
 
+import android.annotation.UnsupportedAppUsage;
 import android.content.Context;
 import android.hardware.SensorManager;
 import android.util.Log;
@@ -32,8 +33,10 @@
     private int mMode;
 
     private final SplineOverScroller mScrollerX;
+    @UnsupportedAppUsage
     private final SplineOverScroller mScrollerY;
 
+    @UnsupportedAppUsage
     private Interpolator mInterpolator;
 
     private final boolean mFlywheel;
@@ -68,6 +71,7 @@
      * @param flywheel If true, successive fling motions will keep on increasing scroll speed.
      * @hide
      */
+    @UnsupportedAppUsage
     public OverScroller(Context context, Interpolator interpolator, boolean flywheel) {
         if (interpolator == null) {
             mInterpolator = new Scroller.ViscousFluidInterpolator();
@@ -116,6 +120,7 @@
         this(context, interpolator, flywheel);
     }
 
+    @UnsupportedAppUsage
     void setInterpolator(Interpolator interpolator) {
         if (interpolator == null) {
             mInterpolator = new Scroller.ViscousFluidInterpolator();
@@ -250,6 +255,7 @@
      *             to begin a new animation.
      */
     @Deprecated
+    @UnsupportedAppUsage
     public void extendDuration(int extend) {
         mScrollerX.extendDuration(extend);
         mScrollerY.extendDuration(extend);
@@ -530,6 +536,7 @@
     /**
      * @hide
      */
+    @UnsupportedAppUsage
     public boolean isScrollingInDirection(float xvel, float yvel) {
         final int dx = mScrollerX.mFinal - mScrollerX.mStart;
         final int dy = mScrollerY.mFinal - mScrollerY.mStart;
@@ -551,6 +558,7 @@
         private int mVelocity;
 
         // Current velocity
+        @UnsupportedAppUsage
         private float mCurrVelocity;
 
         // Constant current deceleration
diff --git a/core/java/android/widget/PopupMenu.java b/core/java/android/widget/PopupMenu.java
index 59bbc3b..d82e56c 100644
--- a/core/java/android/widget/PopupMenu.java
+++ b/core/java/android/widget/PopupMenu.java
@@ -18,6 +18,7 @@
 
 import android.annotation.MenuRes;
 import android.annotation.TestApi;
+import android.annotation.UnsupportedAppUsage;
 import android.content.Context;
 import android.view.Gravity;
 import android.view.Menu;
@@ -39,9 +40,11 @@
  * it.
  */
 public class PopupMenu {
+    @UnsupportedAppUsage
     private final Context mContext;
     private final MenuBuilder mMenu;
     private final View mAnchor;
+    @UnsupportedAppUsage
     private final MenuPopupHelper mPopup;
 
     private OnMenuItemClickListener mMenuItemClickListener;
diff --git a/core/java/android/widget/PopupWindow.java b/core/java/android/widget/PopupWindow.java
index 9553cf5..0da47fd 100644
--- a/core/java/android/widget/PopupWindow.java
+++ b/core/java/android/widget/PopupWindow.java
@@ -24,6 +24,7 @@
 
 import android.annotation.NonNull;
 import android.annotation.Nullable;
+import android.annotation.UnsupportedAppUsage;
 import android.content.Context;
 import android.content.res.TypedArray;
 import android.graphics.PixelFormat;
@@ -141,7 +142,9 @@
     private final int[] mTmpAppLocation = new int[2];
     private final Rect mTempRect = new Rect();
 
+    @UnsupportedAppUsage
     private Context mContext;
+    @UnsupportedAppUsage
     private WindowManager mWindowManager;
 
     /**
@@ -150,17 +153,22 @@
      */
     private WeakReference<View> mParentRootView;
 
+    @UnsupportedAppUsage
     private boolean mIsShowing;
     private boolean mIsTransitioningToDismiss;
+    @UnsupportedAppUsage
     private boolean mIsDropdown;
 
     /** View that handles event dispatch and content transitions. */
+    @UnsupportedAppUsage
     private PopupDecorView mDecorView;
 
     /** View that holds the background and may animate during a transition. */
+    @UnsupportedAppUsage
     private View mBackgroundView;
 
     /** The contents of the popup. May be identical to the background view. */
+    @UnsupportedAppUsage
     private View mContentView;
 
     private boolean mFocusable;
@@ -171,39 +179,52 @@
     private boolean mOutsideTouchable = false;
     private boolean mClippingEnabled = true;
     private int mSplitTouchEnabled = -1;
+    @UnsupportedAppUsage
     private boolean mLayoutInScreen;
     private boolean mClipToScreen;
     private boolean mAllowScrollingAnchorParent = true;
     private boolean mLayoutInsetDecor = false;
+    @UnsupportedAppUsage
     private boolean mNotTouchModal;
     private boolean mAttachedInDecor = true;
     private boolean mAttachedInDecorSet = false;
 
+    @UnsupportedAppUsage
     private OnTouchListener mTouchInterceptor;
 
+    @UnsupportedAppUsage
     private int mWidthMode;
     private int mWidth = LayoutParams.WRAP_CONTENT;
+    @UnsupportedAppUsage
     private int mLastWidth;
+    @UnsupportedAppUsage
     private int mHeightMode;
     private int mHeight = LayoutParams.WRAP_CONTENT;
+    @UnsupportedAppUsage
     private int mLastHeight;
 
     private float mElevation;
 
     private Drawable mBackground;
+    @UnsupportedAppUsage
     private Drawable mAboveAnchorBackgroundDrawable;
+    @UnsupportedAppUsage
     private Drawable mBelowAnchorBackgroundDrawable;
 
     private Transition mEnterTransition;
     private Transition mExitTransition;
     private Rect mEpicenterBounds;
 
+    @UnsupportedAppUsage
     private boolean mAboveAnchor;
+    @UnsupportedAppUsage
     private int mWindowLayoutType = WindowManager.LayoutParams.TYPE_APPLICATION_PANEL;
 
+    @UnsupportedAppUsage
     private OnDismissListener mOnDismissListener;
     private boolean mIgnoreCheekPress = false;
 
+    @UnsupportedAppUsage
     private int mAnimationStyle = ANIMATION_STYLE_DEFAULT;
 
     private int mGravity = Gravity.NO_GRAVITY;
@@ -238,10 +259,12 @@
                 }
             };
 
+    @UnsupportedAppUsage
     private WeakReference<View> mAnchor;
     private WeakReference<View> mAnchorRoot;
     private boolean mIsAnchorRootAttached;
 
+    @UnsupportedAppUsage
     private final OnScrollChangedListener mOnScrollChangedListener = this::alignToAnchor;
 
     private final View.OnLayoutChangeListener mOnLayoutChangeListener =
@@ -250,6 +273,7 @@
     private int mAnchorXoff;
     private int mAnchorYoff;
     private int mAnchoredGravity;
+    @UnsupportedAppUsage
     private boolean mOverlapAnchor;
 
     private boolean mPopupViewInitialLayoutDirectionInherited;
@@ -466,6 +490,7 @@
      * @see #getTransitionEpicenter()
      * @hide
      */
+    @UnsupportedAppUsage
     public void setEpicenterBounds(Rect bounds) {
         mEpicenterBounds = bounds;
     }
@@ -845,6 +870,7 @@
      * @param enabled True to clip to the screen.
      * @hide
      */
+    @UnsupportedAppUsage
     public void setClipToScreenEnabled(boolean enabled) {
         mClipToScreen = enabled;
     }
@@ -855,6 +881,7 @@
      *
      * @param enabled True to scroll the anchor's parent when more room is desired by the popup.
      */
+    @UnsupportedAppUsage
     void setAllowScrollingAnchorParent(boolean enabled) {
         mAllowScrollingAnchorParent = enabled;
     }
@@ -914,6 +941,7 @@
      * @param enabled true if the popup should always be positioned in screen coordinates
      * @hide
      */
+    @UnsupportedAppUsage
     public void setLayoutInScreenEnabled(boolean enabled) {
         mLayoutInScreen = enabled;
     }
@@ -960,6 +988,7 @@
      *                the way that decor views behave for full-screen windows.
      * @hide
      */
+    @UnsupportedAppUsage
     public void setLayoutInsetDecor(boolean enabled) {
         mLayoutInsetDecor = enabled;
     }
@@ -996,6 +1025,7 @@
      * other windows behind it.
      * @hide
      */
+    @UnsupportedAppUsage
     public void setTouchModal(boolean touchModal) {
         mNotTouchModal = !touchModal;
     }
@@ -1181,6 +1211,7 @@
      * @hide Internal use only. Applications should use
      *       {@link #showAtLocation(View, int, int, int)} instead.
      */
+    @UnsupportedAppUsage
     public void showAtLocation(IBinder token, int gravity, int x, int y) {
         if (isShowing() || mContentView == null) {
             return;
@@ -1285,6 +1316,7 @@
     }
 
     /** @hide */
+    @UnsupportedAppUsage
     protected final void updateAboveAnchor(boolean aboveAnchor) {
         if (aboveAnchor != mAboveAnchor) {
             mAboveAnchor = aboveAnchor;
@@ -1328,6 +1360,7 @@
      *
      * @param p the layout parameters of the popup's content view
      */
+    @UnsupportedAppUsage
     private void preparePopup(WindowManager.LayoutParams p) {
         if (mContentView == null || mContext == null || mWindowManager == null) {
             throw new IllegalStateException("You must specify a valid content view by "
@@ -1421,6 +1454,7 @@
      *
      * @param p the layout parameters of the popup's content view
      */
+    @UnsupportedAppUsage
     private void invokePopup(WindowManager.LayoutParams p) {
         if (mContext != null) {
             p.packageName = mContext.getPackageName();
@@ -1464,6 +1498,7 @@
      *
      * @hide
      */
+    @UnsupportedAppUsage
     protected final WindowManager.LayoutParams createPopupLayoutParams(IBinder token) {
         final WindowManager.LayoutParams p = new WindowManager.LayoutParams();
 
@@ -1552,6 +1587,7 @@
         return curFlags;
     }
 
+    @UnsupportedAppUsage
     private int computeAnimationResource() {
         if (mAnimationStyle == ANIMATION_STYLE_DEFAULT) {
             if (mIsDropdown) {
diff --git a/core/java/android/widget/ProgressBar.java b/core/java/android/widget/ProgressBar.java
index e7c3a47..1fc72f5 100644
--- a/core/java/android/widget/ProgressBar.java
+++ b/core/java/android/widget/ProgressBar.java
@@ -20,6 +20,7 @@
 import android.annotation.InterpolatorRes;
 import android.annotation.NonNull;
 import android.annotation.Nullable;
+import android.annotation.UnsupportedAppUsage;
 import android.content.Context;
 import android.content.res.ColorStateList;
 import android.content.res.TypedArray;
@@ -167,9 +168,12 @@
     /** Duration of smooth progress animations. */
     private static final int PROGRESS_ANIM_DURATION = 80;
 
+    @UnsupportedAppUsage
     int mMinWidth;
     int mMaxWidth;
+    @UnsupportedAppUsage
     int mMinHeight;
+    @UnsupportedAppUsage
     int mMaxHeight;
 
     private int mProgress;
@@ -180,8 +184,11 @@
     private boolean mMaxInitialized;
 
     private int mBehavior;
+    @UnsupportedAppUsage
     private int mDuration;
+    @UnsupportedAppUsage
     private boolean mIndeterminate;
+    @UnsupportedAppUsage
     private boolean mOnlyIndeterminate;
     private Transformation mTransformation;
     private AlphaAnimation mAnimation;
@@ -189,6 +196,7 @@
 
     private Drawable mIndeterminateDrawable;
     private Drawable mProgressDrawable;
+    @UnsupportedAppUsage
     private Drawable mCurrentDrawable;
     private ProgressTintInfo mProgressTintInfo;
 
@@ -206,6 +214,7 @@
     /** Value used to track progress animation, in the range [0...1]. */
     private float mVisualProgress;
 
+    @UnsupportedAppUsage
     boolean mMirrorForRtl = false;
 
     private boolean mAggregatedIsVisible;
@@ -424,6 +433,7 @@
      * Converts a drawable to a tiled version of itself. It will recursively
      * traverse layer and state list drawables.
      */
+    @UnsupportedAppUsage
     private Drawable tileify(Drawable drawable, boolean clip) {
         // TODO: This is a terrible idea that potentially destroys any drawable
         // that extends any of these classes. We *really* need to remove this.
@@ -1347,6 +1357,7 @@
         // Stub method.
     }
 
+    @UnsupportedAppUsage
     private synchronized void refreshProgress(int id, int progress, boolean fromUser,
             boolean animate) {
         if (mUiThreadId == Thread.currentThread().getId()) {
@@ -1401,6 +1412,7 @@
     }
 
     @android.view.RemotableViewMethod
+    @UnsupportedAppUsage
     synchronized boolean setProgressInternal(int progress, boolean fromUser, boolean animate) {
         if (mIndeterminate) {
             // Not applicable.
@@ -1599,6 +1611,7 @@
     /**
      * <p>Start the indeterminate progress animation.</p>
      */
+    @UnsupportedAppUsage
     void startAnimation() {
         if (getVisibility() != VISIBLE || getWindowVisibility() != VISIBLE) {
             return;
@@ -1638,6 +1651,7 @@
     /**
      * <p>Stop the indeterminate progress animation.</p>
      */
+    @UnsupportedAppUsage
     void stopAnimation() {
         mHasAnimation = false;
         if (mIndeterminateDrawable instanceof Animatable) {
diff --git a/core/java/android/widget/QuickContactBadge.java b/core/java/android/widget/QuickContactBadge.java
index 8f6b0d5..c1a217c 100644
--- a/core/java/android/widget/QuickContactBadge.java
+++ b/core/java/android/widget/QuickContactBadge.java
@@ -16,6 +16,7 @@
 
 package android.widget;
 
+import android.annotation.UnsupportedAppUsage;
 import android.content.AsyncQueryHandler;
 import android.content.ContentResolver;
 import android.content.Context;
@@ -46,6 +47,7 @@
     private Uri mContactUri;
     private String mContactEmail;
     private String mContactPhone;
+    @UnsupportedAppUsage
     private Drawable mOverlay;
     private QueryHandler mQueryHandler;
     private Drawable mDefaultAvatar;
diff --git a/core/java/android/widget/RadioGroup.java b/core/java/android/widget/RadioGroup.java
index c987147..327a5c1 100644
--- a/core/java/android/widget/RadioGroup.java
+++ b/core/java/android/widget/RadioGroup.java
@@ -17,6 +17,7 @@
 package android.widget;
 
 import android.annotation.IdRes;
+import android.annotation.UnsupportedAppUsage;
 import android.content.Context;
 import android.content.res.TypedArray;
 import android.util.AttributeSet;
@@ -60,9 +61,11 @@
     // holds the checked id; the selection is empty by default
     private int mCheckedId = -1;
     // tracks children radio buttons checked state
+    @UnsupportedAppUsage
     private CompoundButton.OnCheckedChangeListener mChildOnCheckedChangeListener;
     // when true, mOnCheckedChangeListener discards events
     private boolean mProtectFromCheckedChange = false;
+    @UnsupportedAppUsage
     private OnCheckedChangeListener mOnCheckedChangeListener;
     private PassThroughHierarchyChangeListener mPassThroughListener;
 
diff --git a/core/java/android/widget/RatingBar.java b/core/java/android/widget/RatingBar.java
index 70b70bc..d343d49 100644
--- a/core/java/android/widget/RatingBar.java
+++ b/core/java/android/widget/RatingBar.java
@@ -16,6 +16,7 @@
 
 package android.widget;
 
+import android.annotation.UnsupportedAppUsage;
 import android.content.Context;
 import android.content.res.TypedArray;
 import android.graphics.drawable.shapes.RectShape;
@@ -79,6 +80,7 @@
 
     private int mProgressOnStartTracking;
 
+    @UnsupportedAppUsage
     private OnRatingBarChangeListener mOnRatingBarChangeListener;
 
     public RatingBar(Context context, AttributeSet attrs, int defStyleAttr) {
diff --git a/core/java/android/widget/RelativeLayout.java b/core/java/android/widget/RelativeLayout.java
index d1de498..74051e2 100644
--- a/core/java/android/widget/RelativeLayout.java
+++ b/core/java/android/widget/RelativeLayout.java
@@ -19,6 +19,7 @@
 import static android.os.Build.VERSION_CODES.JELLY_BEAN_MR1;
 
 import android.annotation.NonNull;
+import android.annotation.UnsupportedAppUsage;
 import android.content.Context;
 import android.content.res.TypedArray;
 import android.graphics.Rect;
@@ -203,6 +204,7 @@
 
     private View mBaselineView = null;
 
+    @UnsupportedAppUsage
     private int mGravity = Gravity.START | Gravity.TOP;
     private final Rect mContentBounds = new Rect();
     private final Rect mSelfBounds = new Rect();
@@ -1247,9 +1249,13 @@
         private int[] mRules = new int[VERB_COUNT];
         private int[] mInitialRules = new int[VERB_COUNT];
 
+        @UnsupportedAppUsage
         private int mLeft;
+        @UnsupportedAppUsage
         private int mTop;
+        @UnsupportedAppUsage
         private int mRight;
+        @UnsupportedAppUsage
         private int mBottom;
 
         /**
diff --git a/core/java/android/widget/RemoteViews.java b/core/java/android/widget/RemoteViews.java
index 22c840b..8fa8ef8 100644
--- a/core/java/android/widget/RemoteViews.java
+++ b/core/java/android/widget/RemoteViews.java
@@ -22,6 +22,7 @@
 import android.annotation.DimenRes;
 import android.annotation.NonNull;
 import android.annotation.StyleRes;
+import android.annotation.UnsupportedAppUsage;
 import android.app.ActivityOptions;
 import android.app.ActivityThread;
 import android.app.Application;
@@ -159,22 +160,26 @@
      *
      * @hide
      */
+    @UnsupportedAppUsage
     public ApplicationInfo mApplication;
 
     /**
      * The resource ID of the layout file. (Added to the parcel)
      */
+    @UnsupportedAppUsage
     private final int mLayoutId;
 
     /**
      * An array of actions to perform on the view tree once it has been
      * inflated
      */
+    @UnsupportedAppUsage
     private ArrayList<Action> mActions;
 
     /**
      * Maps bitmaps to unique indicies to avoid Bitmap duplication.
      */
+    @UnsupportedAppUsage
     private BitmapCache mBitmapCache;
 
     /**
@@ -208,6 +213,7 @@
      * RemoteViews.
      */
     private RemoteViews mLandscape = null;
+    @UnsupportedAppUsage
     private RemoteViews mPortrait = null;
 
     /**
@@ -360,6 +366,7 @@
 
         private int mEnterAnimationId;
 
+        @UnsupportedAppUsage
         public boolean onClickHandler(View view, PendingIntent pendingIntent,
                 Intent fillInIntent) {
             return onClickHandler(view, pendingIntent, fillInIntent, WINDOWING_MODE_UNDEFINED);
@@ -422,6 +429,7 @@
             // Do nothing
         }
 
+        @UnsupportedAppUsage
         public int mergeBehavior() {
             return MERGE_REPLACE;
         }
@@ -457,6 +465,7 @@
             // Nothing to visit by default
         }
 
+        @UnsupportedAppUsage
         int viewId;
     }
 
@@ -489,6 +498,7 @@
      *
      * @hide
      */
+    @UnsupportedAppUsage
     public void mergeRemoteViews(RemoteViews newRv) {
         if (newRv == null) return;
         // We first copy the new RemoteViews, as the process of merging modifies the way the actions
@@ -764,6 +774,7 @@
             return SET_PENDING_INTENT_TEMPLATE_TAG;
         }
 
+        @UnsupportedAppUsage
         PendingIntent pendingIntentTemplate;
     }
 
@@ -963,6 +974,7 @@
             return SET_ON_CLICK_PENDING_INTENT_TAG;
         }
 
+        @UnsupportedAppUsage
         PendingIntent pendingIntent;
     }
 
@@ -1154,6 +1166,7 @@
 
     private static class BitmapCache {
 
+        @UnsupportedAppUsage
         ArrayList<Bitmap> mBitmaps;
         int mBitmapMemory = -1;
 
@@ -1205,7 +1218,9 @@
 
     private class BitmapReflectionAction extends Action {
         int bitmapId;
+        @UnsupportedAppUsage
         Bitmap bitmap;
+        @UnsupportedAppUsage
         String methodName;
 
         BitmapReflectionAction(int viewId, String methodName, Bitmap bitmap) {
@@ -1271,8 +1286,10 @@
         static final int COLOR_STATE_LIST = 15;
         static final int ICON = 16;
 
+        @UnsupportedAppUsage
         String methodName;
         int type;
+        @UnsupportedAppUsage
         Object value;
 
         ReflectionAction(int viewId, String methodName, int type, Object value) {
@@ -1565,6 +1582,7 @@
      * ViewGroup methods that are related to adding Views.
      */
     private class ViewGroupActionAdd extends Action {
+        @UnsupportedAppUsage
         private RemoteViews mNestedViews;
         private int mIndex;
 
@@ -2421,6 +2439,7 @@
      * setting on click extras and setting on click pending intents. The former is enabled,
      * and the latter disabled when this flag is true.
      */
+    @UnsupportedAppUsage
     void setIsWidgetCollectionChild(boolean isWidgetCollectionChild) {
         mIsWidgetCollectionChild = isWidgetCollectionChild;
     }
@@ -2447,6 +2466,7 @@
      * Returns an estimate of the bitmap heap memory usage for this RemoteViews.
      */
     /** @hide */
+    @UnsupportedAppUsage
     public int estimateMemoryUsage() {
         return mBitmapCache.getBitmapMemory();
     }
@@ -2494,6 +2514,7 @@
      *
      * @hide
      */
+    @UnsupportedAppUsage
     public void addView(int viewId, RemoteViews nestedView, int index) {
         addAction(new ViewGroupActionAdd(viewId, nestedView, index));
     }
@@ -2941,6 +2962,7 @@
      *
      * @hide
      */
+    @UnsupportedAppUsage
     public void setRemoteAdapter(int viewId, ArrayList<RemoteViews> list, int viewTypeCount) {
         addAction(new SetRemoteViewsAdapterList(viewId, list, viewTypeCount));
     }
diff --git a/core/java/android/widget/RemoteViewsAdapter.java b/core/java/android/widget/RemoteViewsAdapter.java
index e5ae0ca..d17c7c5 100644
--- a/core/java/android/widget/RemoteViewsAdapter.java
+++ b/core/java/android/widget/RemoteViewsAdapter.java
@@ -16,6 +16,7 @@
 
 package android.widget;
 
+import android.annotation.UnsupportedAppUsage;
 import android.annotation.WorkerThread;
 import android.app.IServiceConnection;
 import android.appwidget.AppWidgetHostView;
@@ -99,6 +100,7 @@
     private final Executor mAsyncViewLoadExecutor;
 
     private OnClickHandler mRemoteViewsOnClickHandler;
+    @UnsupportedAppUsage
     private final FixedSizeRemoteViewsCache mCache;
     private int mVisibleWindowLowerBound;
     private int mVisibleWindowUpperBound;
@@ -107,6 +109,7 @@
     // loaded.
     private RemoteViewsFrameLayoutRefSet mRequestedViews;
 
+    @UnsupportedAppUsage
     private final HandlerThread mWorkerThread;
     // items may be interrupted within the normally processed queues
     private final Handler mMainHandler;
@@ -869,14 +872,17 @@
         }
     }
 
+    @UnsupportedAppUsage
     public boolean isDataReady() {
         return mDataReady;
     }
 
+    @UnsupportedAppUsage
     public void setRemoteViewsOnClickHandler(OnClickHandler handler) {
         mRemoteViewsOnClickHandler = handler;
     }
 
+    @UnsupportedAppUsage
     public void saveRemoteViewsCache() {
         final RemoteViewsCacheKey key = new RemoteViewsCacheKey(
                 new Intent.FilterComparison(mIntent), mAppWidgetId);
@@ -1021,6 +1027,7 @@
         }
     }
 
+    @UnsupportedAppUsage
     public Intent getRemoteViewsServiceIntent() {
         return mIntent;
     }
@@ -1067,6 +1074,7 @@
      * views are currently being displayed. This allows for certain optimizations and preloading
      * which  wouldn't otherwise be possible.
      */
+    @UnsupportedAppUsage
     public void setVisibleRangeHint(int lowerBound, int upperBound) {
         mVisibleWindowLowerBound = lowerBound;
         mVisibleWindowUpperBound = upperBound;
diff --git a/core/java/android/widget/ScrollBarDrawable.java b/core/java/android/widget/ScrollBarDrawable.java
index 2ae38c9..e91f87e 100644
--- a/core/java/android/widget/ScrollBarDrawable.java
+++ b/core/java/android/widget/ScrollBarDrawable.java
@@ -17,6 +17,7 @@
 package android.widget;
 
 import android.annotation.NonNull;
+import android.annotation.UnsupportedAppUsage;
 import android.graphics.Canvas;
 import android.graphics.ColorFilter;
 import android.graphics.PixelFormat;
@@ -35,6 +36,7 @@
 public class ScrollBarDrawable extends Drawable implements Drawable.Callback {
     private Drawable mVerticalTrack;
     private Drawable mHorizontalTrack;
+    @UnsupportedAppUsage
     private Drawable mVerticalThumb;
     private Drawable mHorizontalThumb;
 
@@ -224,6 +226,7 @@
         }
     }
 
+    @UnsupportedAppUsage
     public void setVerticalThumbDrawable(Drawable thumb) {
         if (mVerticalThumb != null) {
             mVerticalThumb.setCallback(null);
@@ -242,6 +245,7 @@
         mVerticalTrack = track;
     }
 
+    @UnsupportedAppUsage
     public void setHorizontalThumbDrawable(Drawable thumb) {
         if (mHorizontalThumb != null) {
             mHorizontalThumb.setCallback(null);
diff --git a/core/java/android/widget/ScrollView.java b/core/java/android/widget/ScrollView.java
index 97d32f1..4658d73 100644
--- a/core/java/android/widget/ScrollView.java
+++ b/core/java/android/widget/ScrollView.java
@@ -17,6 +17,7 @@
 package android.widget;
 
 import android.annotation.NonNull;
+import android.annotation.UnsupportedAppUsage;
 import android.content.Context;
 import android.content.res.Configuration;
 import android.content.res.TypedArray;
@@ -81,16 +82,21 @@
 
     private static final String TAG = "ScrollView";
 
+    @UnsupportedAppUsage
     private long mLastScroll;
 
     private final Rect mTempRect = new Rect();
+    @UnsupportedAppUsage
     private OverScroller mScroller;
+    @UnsupportedAppUsage
     private EdgeEffect mEdgeGlowTop;
+    @UnsupportedAppUsage
     private EdgeEffect mEdgeGlowBottom;
 
     /**
      * Position of the last motion event.
      */
+    @UnsupportedAppUsage
     private int mLastMotionY;
 
     /**
@@ -104,6 +110,7 @@
      * layout is dirty. This prevents the scroll from being wrong if the child has not been
      * laid out before requesting focus.
      */
+    @UnsupportedAppUsage
     private View mChildToScrollTo = null;
 
     /**
@@ -111,11 +118,13 @@
      * not the same as 'is being flinged', which can be checked by
      * mScroller.isFinished() (flinging begins when the user lifts his finger).
      */
+    @UnsupportedAppUsage
     private boolean mIsBeingDragged = false;
 
     /**
      * Determines speed during touch scrolling
      */
+    @UnsupportedAppUsage
     private VelocityTracker mVelocityTracker;
 
     /**
@@ -131,10 +140,13 @@
     private boolean mSmoothScrollingEnabled = true;
 
     private int mTouchSlop;
+    @UnsupportedAppUsage
     private int mMinimumVelocity;
     private int mMaximumVelocity;
 
+    @UnsupportedAppUsage
     private int mOverscrollDistance;
+    @UnsupportedAppUsage
     private int mOverflingDistance;
 
     private float mVerticalScrollFactor;
@@ -159,6 +171,7 @@
      * These are no-ops on user builds.
      */
     private StrictMode.Span mScrollStrictSpan = null;  // aka "drag"
+    @UnsupportedAppUsage
     private StrictMode.Span mFlingStrictSpan = null;
 
     /**
@@ -294,6 +307,7 @@
     /**
      * @return Returns true this ScrollView can be scrolled
      */
+    @UnsupportedAppUsage
     private boolean canScroll() {
         View child = getChildAt(0);
         if (child != null) {
@@ -1644,6 +1658,7 @@
         }
     }
 
+    @UnsupportedAppUsage
     private void endDrag() {
         mIsBeingDragged = false;
 
diff --git a/core/java/android/widget/Scroller.java b/core/java/android/widget/Scroller.java
index 357c9c3..229eaf0 100644
--- a/core/java/android/widget/Scroller.java
+++ b/core/java/android/widget/Scroller.java
@@ -16,6 +16,7 @@
 
 package android.widget;
 
+import android.annotation.UnsupportedAppUsage;
 import android.content.Context;
 import android.hardware.SensorManager;
 import android.os.Build;
@@ -60,6 +61,7 @@
  * }</pre>
  */
 public class Scroller  {
+    @UnsupportedAppUsage
     private final Interpolator mInterpolator;
 
     private int mMode;
@@ -77,6 +79,7 @@
     private int mCurrX;
     private int mCurrY;
     private long mStartTime;
+    @UnsupportedAppUsage
     private int mDuration;
     private float mDurationReciprocal;
     private float mDeltaX;
@@ -94,7 +97,9 @@
     private static final int SCROLL_MODE = 0;
     private static final int FLING_MODE = 1;
 
+    @UnsupportedAppUsage
     private static float DECELERATION_RATE = (float) (Math.log(0.78) / Math.log(0.9));
+    @UnsupportedAppUsage
     private static final float INFLEXION = 0.35f; // Tension lines cross at (INFLEXION, 1)
     private static final float START_TENSION = 0.5f;
     private static final float END_TENSION = 1.0f;
@@ -105,10 +110,12 @@
     private static final float[] SPLINE_POSITION = new float[NB_SAMPLES + 1];
     private static final float[] SPLINE_TIME = new float[NB_SAMPLES + 1];
 
+    @UnsupportedAppUsage
     private float mDeceleration;
     private final float mPpi;
 
     // A context-specific coefficient adjusted to physical values.
+    @UnsupportedAppUsage
     private float mPhysicalCoeff;
 
     static {
diff --git a/core/java/android/widget/SearchView.java b/core/java/android/widget/SearchView.java
index 225497b..5b5950d 100644
--- a/core/java/android/widget/SearchView.java
+++ b/core/java/android/widget/SearchView.java
@@ -19,6 +19,7 @@
 import static android.widget.SuggestionsAdapter.getColumnString;
 
 import android.annotation.Nullable;
+import android.annotation.UnsupportedAppUsage;
 import android.app.PendingIntent;
 import android.app.SearchManager;
 import android.app.SearchableInfo;
@@ -105,13 +106,20 @@
      */
     private static final String IME_OPTION_NO_MICROPHONE = "nm";
 
+    @UnsupportedAppUsage
     private final SearchAutoComplete mSearchSrcTextView;
+    @UnsupportedAppUsage
     private final View mSearchEditFrame;
+    @UnsupportedAppUsage
     private final View mSearchPlate;
+    @UnsupportedAppUsage
     private final View mSubmitArea;
+    @UnsupportedAppUsage
     private final ImageView mSearchButton;
     private final ImageView mGoButton;
+    @UnsupportedAppUsage
     private final ImageView mCloseButton;
+    @UnsupportedAppUsage
     private final ImageView mVoiceButton;
     private final View mDropDownAnchor;
 
@@ -125,6 +133,7 @@
     private final ImageView mCollapsedIcon;
 
     /** Drawable used as an EditText hint. */
+    @UnsupportedAppUsage
     private final Drawable mSearchHintIcon;
 
     // Resources used by SuggestionsAdapter to display suggestions.
@@ -137,24 +146,33 @@
 
     private final CharSequence mDefaultQueryHint;
 
+    @UnsupportedAppUsage
     private OnQueryTextListener mOnQueryChangeListener;
     private OnCloseListener mOnCloseListener;
     private OnFocusChangeListener mOnQueryTextFocusChangeListener;
     private OnSuggestionListener mOnSuggestionListener;
     private OnClickListener mOnSearchClickListener;
 
+    @UnsupportedAppUsage
     private boolean mIconifiedByDefault;
+    @UnsupportedAppUsage
     private boolean mIconified;
+    @UnsupportedAppUsage
     private CursorAdapter mSuggestionsAdapter;
     private boolean mSubmitButtonEnabled;
     private CharSequence mQueryHint;
     private boolean mQueryRefinement;
+    @UnsupportedAppUsage
     private boolean mClearingFocus;
     private int mMaxWidth;
+    @UnsupportedAppUsage
     private boolean mVoiceButtonEnabled;
     private CharSequence mOldQueryText;
+    @UnsupportedAppUsage
     private CharSequence mUserQuery;
+    @UnsupportedAppUsage
     private boolean mExpandedInActionView;
+    @UnsupportedAppUsage
     private int mCollapsedImeOptions;
 
     private SearchableInfo mSearchable;
@@ -853,6 +871,7 @@
                 .getDimensionPixelSize(R.dimen.search_view_preferred_height);
     }
 
+    @UnsupportedAppUsage
     private void updateViewsVisibility(final boolean collapsed) {
         mIconified = collapsed;
         // Visibility of views that are visible when collapsed
@@ -898,6 +917,7 @@
         return (mSubmitButtonEnabled || mVoiceButtonEnabled) && !isIconified();
     }
 
+    @UnsupportedAppUsage
     private void updateSubmitButton(boolean hasText) {
         int visibility = GONE;
         if (mSubmitButtonEnabled && isSubmitAreaEnabled() && hasFocus()
@@ -907,6 +927,7 @@
         mGoButton.setVisibility(visibility);
     }
 
+    @UnsupportedAppUsage
     private void updateSubmitArea() {
         int visibility = GONE;
         if (isSubmitAreaEnabled()
@@ -962,6 +983,7 @@
         setQuery(queryText);
     }
 
+    @UnsupportedAppUsage
     private final OnClickListener mOnClickListener = new OnClickListener() {
 
         public void onClick(View v) {
@@ -1270,6 +1292,7 @@
         mSearchSrcTextView.dismissDropDown();
     }
 
+    @UnsupportedAppUsage
     private void onCloseClicked() {
         CharSequence text = mSearchSrcTextView.getText();
         if (TextUtils.isEmpty(text)) {
@@ -1467,6 +1490,7 @@
         return false;
     }
 
+    @UnsupportedAppUsage
     private final OnItemClickListener mOnItemClickListener = new OnItemClickListener() {
 
         /**
@@ -1566,6 +1590,7 @@
     /**
      * Sets the text in the query box, without updating the suggestions.
      */
+    @UnsupportedAppUsage
     private void setQuery(CharSequence query) {
         mSearchSrcTextView.setText(query, true);
         // Move the cursor to the end
@@ -1892,6 +1917,7 @@
             mThreshold = getThreshold();
         }
 
+        @UnsupportedAppUsage
         public SearchAutoComplete(Context context, AttributeSet attrs) {
             super(context, attrs);
             mThreshold = getThreshold();
diff --git a/core/java/android/widget/SeekBar.java b/core/java/android/widget/SeekBar.java
index f9aced0..e8cf1e8 100644
--- a/core/java/android/widget/SeekBar.java
+++ b/core/java/android/widget/SeekBar.java
@@ -16,6 +16,7 @@
 
 package android.widget;
 
+import android.annotation.UnsupportedAppUsage;
 import android.content.Context;
 import android.util.AttributeSet;
 import android.view.accessibility.AccessibilityNodeInfo;
@@ -69,6 +70,7 @@
         void onStopTrackingTouch(SeekBar seekBar);
     }
 
+    @UnsupportedAppUsage
     private OnSeekBarChangeListener mOnSeekBarChangeListener;
 
     public SeekBar(Context context) {
@@ -88,6 +90,7 @@
     }
 
     @Override
+    @UnsupportedAppUsage
     void onProgressRefresh(float scale, boolean fromUser, int progress) {
         super.onProgressRefresh(scale, fromUser, progress);
 
diff --git a/core/java/android/widget/SimpleAdapter.java b/core/java/android/widget/SimpleAdapter.java
index 9190117..a27354d 100644
--- a/core/java/android/widget/SimpleAdapter.java
+++ b/core/java/android/widget/SimpleAdapter.java
@@ -18,6 +18,7 @@
 
 import android.annotation.IdRes;
 import android.annotation.LayoutRes;
+import android.annotation.UnsupportedAppUsage;
 import android.content.Context;
 import android.content.res.Resources;
 import android.net.Uri;
@@ -58,6 +59,7 @@
     private String[] mFrom;
     private ViewBinder mViewBinder;
 
+    @UnsupportedAppUsage
     private List<? extends Map<String, ?>> mData;
 
     private int mResource;
diff --git a/core/java/android/widget/SimpleCursorAdapter.java b/core/java/android/widget/SimpleCursorAdapter.java
index 3dd0a95..b670e6c 100644
--- a/core/java/android/widget/SimpleCursorAdapter.java
+++ b/core/java/android/widget/SimpleCursorAdapter.java
@@ -16,6 +16,7 @@
 
 package android.widget;
 
+import android.annotation.UnsupportedAppUsage;
 import android.content.Context;
 import android.database.Cursor;
 import android.net.Uri;
@@ -51,12 +52,14 @@
      * This field should be made private, so it is hidden from the SDK.
      * {@hide}
      */
+    @UnsupportedAppUsage
     protected int[] mFrom;
     /**
      * A list of View ids representing the views to which the data must be bound.
      * This field should be made private, so it is hidden from the SDK.
      * {@hide}
      */
+    @UnsupportedAppUsage
     protected int[] mTo;
 
     private int mStringConversionColumn = -1;
diff --git a/core/java/android/widget/SlidingDrawer.java b/core/java/android/widget/SlidingDrawer.java
index 9f48397..8011c3a 100644
--- a/core/java/android/widget/SlidingDrawer.java
+++ b/core/java/android/widget/SlidingDrawer.java
@@ -17,6 +17,7 @@
 package android.widget;
 
 import android.R;
+import android.annotation.UnsupportedAppUsage;
 import android.content.Context;
 import android.content.res.TypedArray;
 import android.graphics.Bitmap;
@@ -104,14 +105,17 @@
 
     private final Rect mFrame = new Rect();
     private final Rect mInvalidate = new Rect();
+    @UnsupportedAppUsage
     private boolean mTracking;
     private boolean mLocked;
 
+    @UnsupportedAppUsage
     private VelocityTracker mVelocityTracker;
 
     private boolean mVertical;
     private boolean mExpanded;
     private int mBottomOffset;
+    @UnsupportedAppUsage
     private int mTopOffset;
     private int mHandleHeight;
     private int mHandleWidth;
@@ -125,6 +129,7 @@
     private float mAnimationPosition;
     private long mAnimationLastTime;
     private long mCurrentAnimationTime;
+    @UnsupportedAppUsage
     private int mTouchDelta;
     private boolean mAnimating;
     private boolean mAllowSingleTap;
@@ -555,6 +560,7 @@
         stopTracking(notifyScrollListener);
     }
 
+    @UnsupportedAppUsage
     private void prepareTracking(int position) {
         mTracking = true;
         mVelocityTracker = VelocityTracker.obtain();
@@ -646,6 +652,7 @@
         }
     }
 
+    @UnsupportedAppUsage
     private void prepareContent() {
         if (mAnimating) {
             return;
diff --git a/core/java/android/widget/Spinner.java b/core/java/android/widget/Spinner.java
index ddf0e74..1705ba8 100644
--- a/core/java/android/widget/Spinner.java
+++ b/core/java/android/widget/Spinner.java
@@ -19,6 +19,7 @@
 import android.annotation.DrawableRes;
 import android.annotation.Nullable;
 import android.annotation.TestApi;
+import android.annotation.UnsupportedAppUsage;
 import android.annotation.Widget;
 import android.app.AlertDialog;
 import android.content.Context;
@@ -93,11 +94,13 @@
     private final Context mPopupContext;
 
     /** Forwarding listener used to implement drag-to-open. */
+    @UnsupportedAppUsage
     private ForwardingListener mForwardingListener;
 
     /** Temporary holder for setAdapter() calls from the super constructor. */
     private SpinnerAdapter mTempAdapter;
 
+    @UnsupportedAppUsage
     private SpinnerPopup mPopup;
     int mDropDownWidth;
 
@@ -584,6 +587,7 @@
     /**
      * @hide internal use only
      */
+    @UnsupportedAppUsage
     public void setOnItemClickListenerInt(OnItemClickListener l) {
         super.setOnItemClickListener(l);
     }
@@ -1069,6 +1073,7 @@
         /**
          * @return true if the popup is showing, false otherwise.
          */
+        @UnsupportedAppUsage
         public boolean isShowing();
 
         /**
@@ -1099,6 +1104,7 @@
             }
         }
 
+        @UnsupportedAppUsage
         public boolean isShowing() {
             return mPopup != null ? mPopup.isShowing() : false;
         }
diff --git a/core/java/android/widget/Switch.java b/core/java/android/widget/Switch.java
index 604575f..8bfc151 100644
--- a/core/java/android/widget/Switch.java
+++ b/core/java/android/widget/Switch.java
@@ -21,6 +21,7 @@
 import android.annotation.NonNull;
 import android.annotation.Nullable;
 import android.annotation.StyleRes;
+import android.annotation.UnsupportedAppUsage;
 import android.content.Context;
 import android.content.res.ColorStateList;
 import android.content.res.Resources;
@@ -93,12 +94,14 @@
     private static final int SERIF = 2;
     private static final int MONOSPACE = 3;
 
+    @UnsupportedAppUsage
     private Drawable mThumbDrawable;
     private ColorStateList mThumbTintList = null;
     private PorterDuff.Mode mThumbTintMode = null;
     private boolean mHasThumbTint = false;
     private boolean mHasThumbTintMode = false;
 
+    @UnsupportedAppUsage
     private Drawable mTrackDrawable;
     private ColorStateList mTrackTintList = null;
     private PorterDuff.Mode mTrackTintMode = null;
@@ -106,6 +109,7 @@
     private boolean mHasTrackTintMode = false;
 
     private int mThumbTextPadding;
+    @UnsupportedAppUsage
     private int mSwitchMinWidth;
     private int mSwitchPadding;
     private boolean mSplitTrack;
@@ -127,18 +131,21 @@
      * Width required to draw the switch track and thumb. Includes padding and
      * optical bounds for both the track and thumb.
      */
+    @UnsupportedAppUsage
     private int mSwitchWidth;
 
     /**
      * Height required to draw the switch track and thumb. Includes padding and
      * optical bounds for both the track and thumb.
      */
+    @UnsupportedAppUsage
     private int mSwitchHeight;
 
     /**
      * Width of the thumb's content region. Does not include padding or
      * optical bounds.
      */
+    @UnsupportedAppUsage
     private int mThumbWidth;
 
     /** Left bound for drawing the switch track and thumb. */
@@ -155,7 +162,9 @@
 
     private TextPaint mTextPaint;
     private ColorStateList mTextColors;
+    @UnsupportedAppUsage
     private Layout mOnLayout;
+    @UnsupportedAppUsage
     private Layout mOffLayout;
     private TransformationMethod2 mSwitchTransformationMethod;
     private ObjectAnimator mPositionAnimator;
@@ -1050,6 +1059,7 @@
         mPositionAnimator.start();
     }
 
+    @UnsupportedAppUsage
     private void cancelPositionAnimator() {
         if (mPositionAnimator != null) {
             mPositionAnimator.cancel();
@@ -1065,6 +1075,7 @@
      *
      * @param position new position between [0,1]
      */
+    @UnsupportedAppUsage
     private void setThumbPosition(float position) {
         mThumbPosition = position;
         invalidate();
diff --git a/core/java/android/widget/TabHost.java b/core/java/android/widget/TabHost.java
index 8696d0d..b1fcbc3 100644
--- a/core/java/android/widget/TabHost.java
+++ b/core/java/android/widget/TabHost.java
@@ -18,6 +18,7 @@
 
 import android.annotation.NonNull;
 import android.annotation.Nullable;
+import android.annotation.UnsupportedAppUsage;
 import android.app.LocalActivityManager;
 import android.content.Context;
 import android.content.Intent;
@@ -54,11 +55,13 @@
     private static final int TABWIDGET_LOCATION_BOTTOM = 3;
     private TabWidget mTabWidget;
     private FrameLayout mTabContent;
+    @UnsupportedAppUsage
     private List<TabSpec> mTabSpecs = new ArrayList<TabSpec>(2);
     /**
      * This field should be made private, so it is hidden from the SDK.
      * {@hide}
      */
+    @UnsupportedAppUsage
     protected int mCurrentTab = -1;
     private View mCurrentView = null;
     /**
@@ -66,6 +69,7 @@
      * {@hide}
      */
     protected LocalActivityManager mLocalActivityManager = null;
+    @UnsupportedAppUsage
     private OnTabChangeListener mOnTabChangeListener;
     private OnKeyListener mTabKeyListener;
 
@@ -504,7 +508,9 @@
 
         private final @NonNull String mTag;
 
+        @UnsupportedAppUsage
         private IndicatorStrategy mIndicatorStrategy;
+        @UnsupportedAppUsage
         private ContentStrategy mContentStrategy;
 
         /**
@@ -767,6 +773,7 @@
             mIntent = intent;
         }
 
+        @UnsupportedAppUsage
         public View getContentView() {
             if (mLocalActivityManager == null) {
                 throw new IllegalStateException("Did you forget to call 'public void setup(LocalActivityManager activityGroup)'?");
@@ -796,6 +803,7 @@
             return mLaunchedView;
         }
 
+        @UnsupportedAppUsage
         public void tabClosed() {
             if (mLaunchedView != null) {
                 mLaunchedView.setVisibility(View.GONE);
diff --git a/core/java/android/widget/TabWidget.java b/core/java/android/widget/TabWidget.java
index f8b6837..a90741b4 100644
--- a/core/java/android/widget/TabWidget.java
+++ b/core/java/android/widget/TabWidget.java
@@ -18,6 +18,7 @@
 
 import android.annotation.DrawableRes;
 import android.annotation.Nullable;
+import android.annotation.UnsupportedAppUsage;
 import android.content.Context;
 import android.content.res.TypedArray;
 import android.graphics.Canvas;
@@ -59,6 +60,7 @@
     private OnTabSelectionChanged mSelectionChangedListener;
 
     // This value will be set to 0 as soon as the first tab is added to TabHost.
+    @UnsupportedAppUsage
     private int mSelectedTab = -1;
 
     @Nullable
@@ -67,6 +69,7 @@
     @Nullable
     private Drawable mRightStrip;
 
+    @UnsupportedAppUsage
     private boolean mDrawBottomStrips = true;
     private boolean mStripMoved;
 
@@ -541,6 +544,7 @@
      * Provides a way for {@link TabHost} to be notified that the user clicked
      * on a tab indicator.
      */
+    @UnsupportedAppUsage
     void setTabSelectionListener(OnTabSelectionChanged listener) {
         mSelectionChangedListener = listener;
     }
diff --git a/core/java/android/widget/TextClock.java b/core/java/android/widget/TextClock.java
index d8a9cca..4865808 100644
--- a/core/java/android/widget/TextClock.java
+++ b/core/java/android/widget/TextClock.java
@@ -21,6 +21,7 @@
 
 import android.annotation.NonNull;
 import android.annotation.TestApi;
+import android.annotation.UnsupportedAppUsage;
 import android.app.ActivityManager;
 import android.content.BroadcastReceiver;
 import android.content.ContentResolver;
@@ -485,6 +486,7 @@
      *
      * @hide
      */
+    @UnsupportedAppUsage
     public CharSequence getFormat() {
         return mFormat;
     }
@@ -623,6 +625,7 @@
     /**
      * Update the displayed time if this view and its ancestors and window is visible
      */
+    @UnsupportedAppUsage
     private void onTimeChanged() {
         // mShouldRunTicker always equals the last value passed into onVisibilityAggregated
         if (mShouldRunTicker) {
diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java
index 3941d6a..31b1d99 100644
--- a/core/java/android/widget/TextView.java
+++ b/core/java/android/widget/TextView.java
@@ -34,6 +34,7 @@
 import android.annotation.Size;
 import android.annotation.StringRes;
 import android.annotation.StyleRes;
+import android.annotation.UnsupportedAppUsage;
 import android.annotation.XmlRes;
 import android.app.Activity;
 import android.app.PendingIntent;
@@ -365,6 +366,7 @@
      */
     private static final int MARQUEE_FADE_SWITCH_SHOW_FADE = 2;
 
+    @UnsupportedAppUsage
     private static final int LINES = 1;
     private static final int EMS = LINES;
     private static final int PIXELS = 2;
@@ -414,15 +416,22 @@
     private ColorStateList mHintTextColor;
     private ColorStateList mLinkTextColor;
     @ViewDebug.ExportedProperty(category = "text")
+    @UnsupportedAppUsage
     private int mCurTextColor;
+    @UnsupportedAppUsage
     private int mCurHintTextColor;
     private boolean mFreezesText;
 
+    @UnsupportedAppUsage
     private Editable.Factory mEditableFactory = Editable.Factory.getInstance();
+    @UnsupportedAppUsage
     private Spannable.Factory mSpannableFactory = Spannable.Factory.getInstance();
 
+    @UnsupportedAppUsage
     private float mShadowRadius;
+    @UnsupportedAppUsage
     private float mShadowDx;
+    @UnsupportedAppUsage
     private float mShadowDy;
     private int mShadowColor;
 
@@ -624,11 +633,15 @@
         }
     }
 
+    @UnsupportedAppUsage
     Drawables mDrawables;
 
+    @UnsupportedAppUsage
     private CharWrapper mCharWrapper;
 
+    @UnsupportedAppUsage
     private Marquee mMarquee;
+    @UnsupportedAppUsage
     private boolean mRestartMarquee;
 
     private int mMarqueeRepeatLimit = 3;
@@ -640,37 +653,49 @@
      * extensively in the same layout. This mode indicates how the marquee
      * is currently being shown, if applicable. (mEllipsize will == MARQUEE)
      */
+    @UnsupportedAppUsage
     private int mMarqueeFadeMode = MARQUEE_FADE_NORMAL;
 
     /**
      * When mMarqueeFadeMode is not MARQUEE_FADE_NORMAL, this stores
      * the layout that should be used when the mode switches.
      */
+    @UnsupportedAppUsage
     private Layout mSavedMarqueeModeLayout;
 
     // Do not update following mText/mSpannable/mPrecomputed except for setTextInternal()
     @ViewDebug.ExportedProperty(category = "text")
+    @UnsupportedAppUsage
     private @Nullable CharSequence mText;
     private @Nullable Spannable mSpannable;
     private @Nullable PrecomputedText mPrecomputed;
 
+    @UnsupportedAppUsage
     private CharSequence mTransformed;
+    @UnsupportedAppUsage
     private BufferType mBufferType = BufferType.NORMAL;
 
     private CharSequence mHint;
+    @UnsupportedAppUsage
     private Layout mHintLayout;
 
     private MovementMethod mMovement;
 
     private TransformationMethod mTransformation;
+    @UnsupportedAppUsage
     private boolean mAllowTransformationLengthChange;
+    @UnsupportedAppUsage
     private ChangeWatcher mChangeWatcher;
 
+    @UnsupportedAppUsage
     private ArrayList<TextWatcher> mListeners;
 
     // display attributes
+    @UnsupportedAppUsage
     private final TextPaint mTextPaint;
+    @UnsupportedAppUsage
     private boolean mUserSetTextScaleX;
+    @UnsupportedAppUsage
     private Layout mLayout;
     private boolean mLocalesChanged = false;
 
@@ -682,34 +707,51 @@
     /* package */ boolean mUseFallbackLineSpacing;
 
     @ViewDebug.ExportedProperty(category = "text")
+    @UnsupportedAppUsage
     private int mGravity = Gravity.TOP | Gravity.START;
+    @UnsupportedAppUsage
     private boolean mHorizontallyScrolling;
 
     private int mAutoLinkMask;
     private boolean mLinksClickable = true;
 
+    @UnsupportedAppUsage
     private float mSpacingMult = 1.0f;
+    @UnsupportedAppUsage
     private float mSpacingAdd = 0.0f;
 
     private int mBreakStrategy;
     private int mHyphenationFrequency;
     private int mJustificationMode;
 
+    @UnsupportedAppUsage
     private int mMaximum = Integer.MAX_VALUE;
+    @UnsupportedAppUsage
     private int mMaxMode = LINES;
+    @UnsupportedAppUsage
     private int mMinimum = 0;
+    @UnsupportedAppUsage
     private int mMinMode = LINES;
 
+    @UnsupportedAppUsage
     private int mOldMaximum = mMaximum;
+    @UnsupportedAppUsage
     private int mOldMaxMode = mMaxMode;
 
+    @UnsupportedAppUsage
     private int mMaxWidth = Integer.MAX_VALUE;
+    @UnsupportedAppUsage
     private int mMaxWidthMode = PIXELS;
+    @UnsupportedAppUsage
     private int mMinWidth = 0;
+    @UnsupportedAppUsage
     private int mMinWidthMode = PIXELS;
 
+    @UnsupportedAppUsage
     private boolean mSingleLine;
+    @UnsupportedAppUsage
     private int mDesiredHeightAtMeasure = -1;
+    @UnsupportedAppUsage
     private boolean mIncludePad = true;
     private int mDeferScroll = -1;
 
@@ -719,11 +761,16 @@
     private Scroller mScroller;
     private TextPaint mTempTextPaint;
 
+    @UnsupportedAppUsage
     private BoringLayout.Metrics mBoring;
+    @UnsupportedAppUsage
     private BoringLayout.Metrics mHintBoring;
+    @UnsupportedAppUsage
     private BoringLayout mSavedLayout;
+    @UnsupportedAppUsage
     private BoringLayout mSavedHintLayout;
 
+    @UnsupportedAppUsage
     private TextDirectionHeuristic mTextDir;
 
     private InputFilter[] mFilters = NO_FILTERS;
@@ -732,21 +779,28 @@
 
     // It is possible to have a selection even when mEditor is null (programmatically set, like when
     // a link is pressed). These highlight-related fields do not go in mEditor.
+    @UnsupportedAppUsage
     int mHighlightColor = 0x6633B5E5;
     private Path mHighlightPath;
+    @UnsupportedAppUsage
     private final Paint mHighlightPaint;
+    @UnsupportedAppUsage
     private boolean mHighlightPathBogus = true;
 
     // Although these fields are specific to editable text, they are not added to Editor because
     // they are defined by the TextView's style and are theme-dependent.
+    @UnsupportedAppUsage
     int mCursorDrawableRes;
     // These six fields, could be moved to Editor, since we know their default values and we
     // could condition the creation of the Editor to a non standard value. This is however
     // brittle since the hardcoded values here (such as
     // com.android.internal.R.drawable.text_select_handle_left) would have to be updated if the
     // default style is modified.
+    @UnsupportedAppUsage
     int mTextSelectHandleLeftRes;
+    @UnsupportedAppUsage
     int mTextSelectHandleRightRes;
+    @UnsupportedAppUsage
     int mTextSelectHandleRes;
     int mTextEditSuggestionItemLayout;
     int mTextEditSuggestionContainerLayout;
@@ -756,6 +810,7 @@
      * {@link EditText} specific data, created on demand when one of the Editor fields is used.
      * See {@link #createEditorIfNeeded()}.
      */
+    @UnsupportedAppUsage
     private Editor mEditor;
 
     private static final int DEVICE_PROVISIONED_UNKNOWN = 0;
@@ -2235,6 +2290,7 @@
      * @return the {@link android.text.Layout} that is currently being used to
      * display the hint text. This can be null.
      */
+    @UnsupportedAppUsage
     final Layout getHintLayout() {
         return mHintLayout;
     }
@@ -3884,6 +3940,7 @@
                 shouldRequestLayout);
     }
 
+    @UnsupportedAppUsage
     private void setRawTextSize(float size, boolean shouldRequestLayout) {
         if (size != mTextPaint.getTextSize()) {
             mTextPaint.setTextSize(size);
@@ -4776,6 +4833,7 @@
      * @attr ref android.R.styleable#TextView_scrollHorizontally
      * @hide
      */
+    @UnsupportedAppUsage
     public boolean getHorizontallyScrolling() {
         return mHorizontallyScrolling;
     }
@@ -5637,6 +5695,7 @@
         }
     }
 
+    @UnsupportedAppUsage
     private void setText(CharSequence text, BufferType type,
                          boolean notifyBefore, int oldlen) {
         mTextSetFromXmlOrResourceId = false;
@@ -5982,6 +6041,7 @@
         return mHint;
     }
 
+    @UnsupportedAppUsage
     boolean isSingleLine() {
         return mSingleLine;
     }
@@ -6150,6 +6210,7 @@
         return locales.get(0);
     }
 
+    @UnsupportedAppUsage
     private void setInputType(int type, boolean direct) {
         final int cls = type & EditorInfo.TYPE_MASK_CLASS;
         KeyListener input;
@@ -6626,6 +6687,7 @@
         return getMeasuredHeight() - padding + opticalInsets.top + opticalInsets.bottom;
     }
 
+    @UnsupportedAppUsage
     int getVerticalOffset(boolean forceNormal) {
         int voffset = 0;
         final int gravity = mGravity & Gravity.VERTICAL_GRAVITY_MASK;
@@ -7093,6 +7155,7 @@
         return drawableState;
     }
 
+    @UnsupportedAppUsage
     private Path getUpdatedHighlightPath() {
         Path highlight = null;
         Paint highlightPaint = mHighlightPaint;
@@ -8135,6 +8198,7 @@
 
     /** @hide */
     @VisibleForTesting
+    @UnsupportedAppUsage
     public void nullLayouts() {
         if (mLayout instanceof BoringLayout && mSavedLayout == null) {
             mSavedLayout = (BoringLayout) mLayout;
@@ -8155,6 +8219,7 @@
      * Make a new Layout based on the already-measured size of the view,
      * on the assumption that it was measured correctly at some point.
      */
+    @UnsupportedAppUsage
     private void assumeLayout() {
         int width = mRight - mLeft - getCompoundPaddingLeft() - getCompoundPaddingRight();
 
@@ -8172,6 +8237,7 @@
                       physicalWidth, false);
     }
 
+    @UnsupportedAppUsage
     private Layout.Alignment getLayoutAlignment() {
         Layout.Alignment alignment;
         switch (getTextAlignment()) {
@@ -8230,6 +8296,7 @@
      * {@hide}
      */
     @VisibleForTesting
+    @UnsupportedAppUsage
     public void makeNewLayout(int wantWidth, int hintWidth,
                                  BoringLayout.Metrics boring,
                                  BoringLayout.Metrics hintBoring,
@@ -8454,6 +8521,7 @@
         return result;
     }
 
+    @UnsupportedAppUsage
     private boolean compressText(float width) {
         if (isHardwareAccelerated()) return false;
 
@@ -8922,6 +8990,7 @@
      * Check whether entirely new text requires a new view layout
      * or merely a new text layout.
      */
+    @UnsupportedAppUsage
     private void checkForRelayout() {
         // If we have a fixed width, we can just swap in a new text layout
         // if the text height stays the same or if the view height is fixed.
@@ -8996,6 +9065,7 @@
     /**
      * Returns true if anything changed.
      */
+    @UnsupportedAppUsage
     private boolean bringTextIntoView() {
         Layout layout = isShowingHint() ? mHintLayout : mLayout;
         int line = 0;
@@ -9364,6 +9434,7 @@
         return getCompoundPaddingLeft() - mScrollX;
     }
 
+    @UnsupportedAppUsage
     int viewportToContentVerticalOffset() {
         int offset = getExtendedPaddingTop() - mScrollY;
         if ((mGravity & Gravity.VERTICAL_GRAVITY_MASK) != Gravity.TOP) {
@@ -9649,6 +9720,7 @@
                         && mSavedMarqueeModeLayout.getLineWidth(0) > width));
     }
 
+    @UnsupportedAppUsage
     private void startMarquee() {
         // Do not ellipsize EditText
         if (getKeyListener() != null) return;
@@ -9691,6 +9763,7 @@
         }
     }
 
+    @UnsupportedAppUsage
     private void startStopMarquee(boolean start) {
         if (mEllipsize == TextUtils.TruncateAt.MARQUEE) {
             if (start) {
@@ -10235,6 +10308,7 @@
      * @return True iff this TextView contains a text that can be edited, or if this is
      * a selectable TextView.
      */
+    @UnsupportedAppUsage
     boolean isTextEditable() {
         return mText instanceof Editable && onCheckIsTextEditor() && isEnabled();
     }
@@ -10497,6 +10571,7 @@
                 || (isTextSelectable() && mText instanceof Spannable && isEnabled());
     }
 
+    @UnsupportedAppUsage
     private Locale getTextServicesLocale(boolean allowNullLocale) {
         // Start fetching the text services locale asynchronously.
         updateTextServicesLocaleAsync();
@@ -10576,6 +10651,7 @@
         });
     }
 
+    @UnsupportedAppUsage
     private void updateTextServicesLocaleLocked() {
         final TextServicesManager textServicesManager = (TextServicesManager)
                 mContext.getSystemService(Context.TEXT_SERVICES_MANAGER_SERVICE);
@@ -11254,6 +11330,7 @@
      *         be {@code null} if no text is set
      */
     @Nullable
+    @UnsupportedAppUsage
     private CharSequence getTextForAccessibility() {
         // If the text is empty, we must be showing the hint text.
         if (TextUtils.isEmpty(mText)) {
@@ -11391,6 +11468,7 @@
         return false;
     }
 
+    @UnsupportedAppUsage
     CharSequence getTransformedText(int start, int end) {
         return removeSuggestionSpans(mTransformed.subSequence(start, end));
     }
@@ -11692,6 +11770,7 @@
     /**
      * @hide
      */
+    @UnsupportedAppUsage
     protected void stopTextActionMode() {
         if (mEditor != null) {
             mEditor.stopTextActionMode();
@@ -11755,6 +11834,7 @@
         return mDeviceProvisionedState == DEVICE_PROVISIONED_YES;
     }
 
+    @UnsupportedAppUsage
     boolean canPaste() {
         return (mText instanceof Editable
                 && mEditor != null && mEditor.mKeyListener != null
@@ -11894,6 +11974,7 @@
         return x;
     }
 
+    @UnsupportedAppUsage
     int getLineAtCoordinate(float y) {
         y -= getTotalPaddingTop();
         // Clamp the position to inside of the view.
@@ -11970,6 +12051,7 @@
      * @return the current {@link TextDirectionHeuristic}.
      * @hide
      */
+    @UnsupportedAppUsage
     protected TextDirectionHeuristic getTextDirectionHeuristic() {
         if (hasPasswordTransformationMethod()) {
             // passwords fields should be LTR
@@ -12081,6 +12163,7 @@
      * Deletes the range of text [start, end[.
      * @hide
      */
+    @UnsupportedAppUsage
     protected void deleteText_internal(int start, int end) {
         ((Editable) mText).delete(start, end);
     }
@@ -12121,6 +12204,7 @@
      * Also note that for performance reasons, the mEditor is created when needed, but not
      * reset when no more edit-specific fields are needed.
      */
+    @UnsupportedAppUsage
     private void createEditorIfNeeded() {
         if (mEditor == null) {
             mEditor = new Editor(this);
@@ -12131,6 +12215,7 @@
      * @hide
      */
     @Override
+    @UnsupportedAppUsage
     public CharSequence getIterableTextForAccessibility() {
         return mText;
     }
@@ -12240,6 +12325,7 @@
     public static class SavedState extends BaseSavedState {
         int selStart = -1;
         int selEnd = -1;
+        @UnsupportedAppUsage
         CharSequence text;
         boolean frozenWithFocus;
         CharSequence error;
diff --git a/core/java/android/widget/TimePicker.java b/core/java/android/widget/TimePicker.java
index cfec3f2..6a5c8cc 100644
--- a/core/java/android/widget/TimePicker.java
+++ b/core/java/android/widget/TimePicker.java
@@ -20,6 +20,7 @@
 import android.annotation.IntRange;
 import android.annotation.NonNull;
 import android.annotation.TestApi;
+import android.annotation.UnsupportedAppUsage;
 import android.annotation.Widget;
 import android.content.Context;
 import android.content.res.TypedArray;
@@ -84,6 +85,7 @@
     @Retention(RetentionPolicy.SOURCE)
     public @interface TimePickerMode {}
 
+    @UnsupportedAppUsage
     private final TimePickerDelegate mDelegate;
 
     @TimePickerMode
diff --git a/core/java/android/widget/Toast.java b/core/java/android/widget/Toast.java
index f6071d8..3fbc819 100644
--- a/core/java/android/widget/Toast.java
+++ b/core/java/android/widget/Toast.java
@@ -20,6 +20,7 @@
 import android.annotation.NonNull;
 import android.annotation.Nullable;
 import android.annotation.StringRes;
+import android.annotation.UnsupportedAppUsage;
 import android.app.INotificationManager;
 import android.app.ITransientNotification;
 import android.content.Context;
@@ -93,7 +94,9 @@
     public static final int LENGTH_LONG = 1;
 
     final Context mContext;
+    @UnsupportedAppUsage
     final TN mTN;
+    @UnsupportedAppUsage
     int mDuration;
     View mNextView;
 
@@ -253,6 +256,7 @@
      * Gets the LayoutParams for the Toast window.
      * @hide
      */
+    @UnsupportedAppUsage
     public WindowManager.LayoutParams getWindowParams() {
         return mTN.mParams;
     }
@@ -336,8 +340,10 @@
     // the proper ordering of these system-wide.
     // =======================================================================================
 
+    @UnsupportedAppUsage
     private static INotificationManager sService;
 
+    @UnsupportedAppUsage
     static private INotificationManager getService() {
         if (sService != null) {
             return sService;
@@ -347,6 +353,7 @@
     }
 
     private static class TN extends ITransientNotification.Stub {
+        @UnsupportedAppUsage
         private final WindowManager.LayoutParams mParams = new WindowManager.LayoutParams();
 
         private static final int SHOW = 0;
@@ -354,14 +361,18 @@
         private static final int CANCEL = 2;
         final Handler mHandler;
 
+        @UnsupportedAppUsage
         int mGravity;
         int mX;
+        @UnsupportedAppUsage
         int mY;
         float mHorizontalMargin;
         float mVerticalMargin;
 
 
+        @UnsupportedAppUsage
         View mView;
+        @UnsupportedAppUsage
         View mNextView;
         int mDuration;
 
@@ -432,6 +443,7 @@
          * schedule handleShow into the right thread
          */
         @Override
+        @UnsupportedAppUsage
         public void show(IBinder windowToken) {
             if (localLOGV) Log.v(TAG, "SHOW: " + this);
             mHandler.obtainMessage(SHOW, windowToken).sendToTarget();
@@ -522,6 +534,7 @@
             accessibilityManager.sendAccessibilityEvent(event);
         }
 
+        @UnsupportedAppUsage
         public void handleHide() {
             if (localLOGV) Log.v(TAG, "HANDLE HIDE: " + this + " mView=" + mView);
             if (mView != null) {
diff --git a/core/java/android/widget/Toolbar.java b/core/java/android/widget/Toolbar.java
index 79c1902..1bbd7e8 100644
--- a/core/java/android/widget/Toolbar.java
+++ b/core/java/android/widget/Toolbar.java
@@ -24,6 +24,7 @@
 import android.annotation.StringRes;
 import android.annotation.StyleRes;
 import android.annotation.TestApi;
+import android.annotation.UnsupportedAppUsage;
 import android.app.ActionBar;
 import android.content.Context;
 import android.content.res.TypedArray;
@@ -133,8 +134,10 @@
     private static final String TAG = "Toolbar";
 
     private ActionMenuView mMenuView;
+    @UnsupportedAppUsage
     private TextView mTitleTextView;
     private TextView mSubtitleTextView;
+    @UnsupportedAppUsage
     private ImageButton mNavButtonView;
     private ImageView mLogoView;
 
@@ -157,9 +160,13 @@
 
     private int mMaxButtonHeight;
 
+    @UnsupportedAppUsage
     private int mTitleMarginStart;
+    @UnsupportedAppUsage
     private int mTitleMarginEnd;
+    @UnsupportedAppUsage
     private int mTitleMarginTop;
+    @UnsupportedAppUsage
     private int mTitleMarginBottom;
 
     private RtlSpacingHelper mContentInsets;
diff --git a/core/java/android/widget/VideoView.java b/core/java/android/widget/VideoView.java
index 58a2b0f..14881eb 100644
--- a/core/java/android/widget/VideoView.java
+++ b/core/java/android/widget/VideoView.java
@@ -17,6 +17,7 @@
 package android.widget;
 
 import android.annotation.NonNull;
+import android.annotation.UnsupportedAppUsage;
 import android.app.AlertDialog;
 import android.content.Context;
 import android.content.DialogInterface;
@@ -84,6 +85,7 @@
 
     // all possible internal states
     private static final int STATE_ERROR = -1;
+    @UnsupportedAppUsage
     private static final int STATE_IDLE = 0;
     private static final int STATE_PREPARING = 1;
     private static final int STATE_PREPARED = 2;
@@ -94,7 +96,9 @@
     private final Vector<Pair<InputStream, MediaFormat>> mPendingSubtitleTracks = new Vector<>();
 
     // settable by the client
+    @UnsupportedAppUsage
     private Uri mUri;
+    @UnsupportedAppUsage
     private Map<String, String> mHeaders;
 
     // mCurrentState is a VideoView object's current state.
@@ -102,20 +106,28 @@
     // For instance, regardless the VideoView object's current state,
     // calling pause() intends to bring the object to a target state
     // of STATE_PAUSED.
+    @UnsupportedAppUsage
     private int mCurrentState = STATE_IDLE;
+    @UnsupportedAppUsage
     private int mTargetState = STATE_IDLE;
 
     // All the stuff we need for playing and showing a video
+    @UnsupportedAppUsage
     private SurfaceHolder mSurfaceHolder = null;
+    @UnsupportedAppUsage
     private MediaPlayer mMediaPlayer = null;
     private int mAudioSession;
+    @UnsupportedAppUsage
     private int mVideoWidth;
+    @UnsupportedAppUsage
     private int mVideoHeight;
     private int mSurfaceWidth;
     private int mSurfaceHeight;
+    @UnsupportedAppUsage
     private MediaController mMediaController;
     private OnCompletionListener mOnCompletionListener;
     private MediaPlayer.OnPreparedListener mOnPreparedListener;
+    @UnsupportedAppUsage
     private int mCurrentBufferPercentage;
     private OnErrorListener mOnErrorListener;
     private OnInfoListener mOnInfoListener;
@@ -462,6 +474,7 @@
             }
     };
 
+    @UnsupportedAppUsage
     MediaPlayer.OnPreparedListener mPreparedListener = new MediaPlayer.OnPreparedListener() {
         public void onPrepared(MediaPlayer mp) {
             mCurrentState = STATE_PREPARED;
@@ -551,6 +564,7 @@
         }
     };
 
+    @UnsupportedAppUsage
     private MediaPlayer.OnErrorListener mErrorListener =
         new MediaPlayer.OnErrorListener() {
         public boolean onError(MediaPlayer mp, int framework_err, int impl_err) {
@@ -655,6 +669,7 @@
         mOnInfoListener = l;
     }
 
+    @UnsupportedAppUsage
     SurfaceHolder.Callback mSHCallback = new SurfaceHolder.Callback()
     {
         public void surfaceChanged(SurfaceHolder holder, int format,
@@ -690,6 +705,7 @@
     /*
      * release the media player in any state
      */
+    @UnsupportedAppUsage
     private void release(boolean cleartargetstate) {
         if (mMediaPlayer != null) {
             mMediaPlayer.reset();
diff --git a/core/java/android/widget/VideoView2.java b/core/java/android/widget/VideoView2.java
index 388eae2..0724294a 100644
--- a/core/java/android/widget/VideoView2.java
+++ b/core/java/android/widget/VideoView2.java
@@ -19,6 +19,7 @@
 import android.annotation.IntDef;
 import android.annotation.NonNull;
 import android.annotation.Nullable;
+import android.annotation.UnsupportedAppUsage;
 import android.content.Context;
 import android.media.AudioAttributes;
 import android.media.AudioManager;
@@ -202,6 +203,7 @@
      * @throws IllegalStateException if interal MediaSession is not created yet.
      * @hide  TODO: remove
      */
+    @UnsupportedAppUsage
     public MediaController getMediaController() {
         return mProvider.getMediaController_impl();
     }
@@ -285,6 +287,7 @@
      *
      * @hide TODO remove
      */
+    @UnsupportedAppUsage
     public void setVideoPath(String path) {
         mProvider.setVideoPath_impl(path);
     }
@@ -380,6 +383,7 @@
      * @hide
      */
     @VisibleForTesting
+    @UnsupportedAppUsage
     public void setOnViewTypeChangedListener(OnViewTypeChangedListener l) {
         mProvider.setOnViewTypeChangedListener_impl(l);
     }
@@ -410,6 +414,7 @@
          * <li>{@link #VIEW_TYPE_TEXTUREVIEW}
          * </ul>
          */
+        @UnsupportedAppUsage
         void onViewTypeChanged(View view, @ViewType int viewType);
     }
 
diff --git a/core/java/android/widget/ViewAnimator.java b/core/java/android/widget/ViewAnimator.java
index 1580f51..598a407 100644
--- a/core/java/android/widget/ViewAnimator.java
+++ b/core/java/android/widget/ViewAnimator.java
@@ -18,6 +18,7 @@
 
 
 import android.annotation.AnimRes;
+import android.annotation.UnsupportedAppUsage;
 import android.content.Context;
 import android.content.res.TypedArray;
 import android.util.AttributeSet;
@@ -36,7 +37,9 @@
  */
 public class ViewAnimator extends FrameLayout {
 
+    @UnsupportedAppUsage
     int mWhichChild = 0;
+    @UnsupportedAppUsage
     boolean mFirstTime = true;
 
     boolean mAnimateFirstTime = true;
@@ -147,6 +150,7 @@
      * @param animate Whether or not to use the in and out animations, defaults
      *            to true.
      */
+    @UnsupportedAppUsage
     void showOnly(int childIndex, boolean animate) {
         final int count = getChildCount();
         for (int i = 0; i < count; i++) {
diff --git a/core/java/android/widget/ViewFlipper.java b/core/java/android/widget/ViewFlipper.java
index e769d71..5e72b2e 100644
--- a/core/java/android/widget/ViewFlipper.java
+++ b/core/java/android/widget/ViewFlipper.java
@@ -16,6 +16,7 @@
 
 package android.widget;
 
+import android.annotation.UnsupportedAppUsage;
 import android.content.BroadcastReceiver;
 import android.content.Context;
 import android.content.Intent;
@@ -47,6 +48,7 @@
     private boolean mRunning = false;
     private boolean mStarted = false;
     private boolean mVisible = false;
+    @UnsupportedAppUsage
     private boolean mUserPresent = true;
 
     public ViewFlipper(Context context) {
@@ -168,6 +170,7 @@
      *            addition to queuing future flips. If omitted, defaults to
      *            true.
      */
+    @UnsupportedAppUsage
     private void updateRunning(boolean flipNow) {
         boolean running = mVisible && mStarted && mUserPresent;
         if (running != mRunning) {
diff --git a/core/java/android/widget/ZoomControls.java b/core/java/android/widget/ZoomControls.java
index 66c052b..dd6a27b8f 100644
--- a/core/java/android/widget/ZoomControls.java
+++ b/core/java/android/widget/ZoomControls.java
@@ -16,6 +16,7 @@
 
 package android.widget;
 
+import android.annotation.UnsupportedAppUsage;
 import android.annotation.Widget;
 import android.content.Context;
 import android.util.AttributeSet;
@@ -33,7 +34,9 @@
 @Widget
 public class ZoomControls extends LinearLayout {
 
+    @UnsupportedAppUsage
     private final ZoomButton mZoomIn;
+    @UnsupportedAppUsage
     private final ZoomButton mZoomOut;
         
     public ZoomControls(Context context) {
diff --git a/core/java/com/android/internal/app/AlertController.java b/core/java/com/android/internal/app/AlertController.java
index 7321721..d7031ea 100644
--- a/core/java/com/android/internal/app/AlertController.java
+++ b/core/java/com/android/internal/app/AlertController.java
@@ -21,6 +21,7 @@
 import com.android.internal.R;
 
 import android.annotation.Nullable;
+import android.annotation.UnsupportedAppUsage;
 import android.app.AlertDialog;
 import android.content.Context;
 import android.content.DialogInterface;
@@ -71,9 +72,11 @@
     private final DialogInterface mDialogInterface;
     protected final Window mWindow;
 
+    @UnsupportedAppUsage
     private CharSequence mTitle;
     protected CharSequence mMessage;
     protected ListView mListView;
+    @UnsupportedAppUsage
     private View mView;
 
     private int mViewLayoutResId;
@@ -107,8 +110,10 @@
     private MovementMethod mMessageMovementMethod;
     @Layout.HyphenationFrequency
     private Integer mMessageHyphenationFrequency;
+    @UnsupportedAppUsage
     private View mCustomTitleView;
 
+    @UnsupportedAppUsage
     private boolean mForceInverseBackground;
 
     private ListAdapter mAdapter;
@@ -198,6 +203,7 @@
         }
     }
 
+    @UnsupportedAppUsage
     protected AlertController(Context context, DialogInterface di, Window window) {
         mContext = context;
         mDialogInterface = di;
@@ -258,6 +264,7 @@
         installContent();
     }
 
+    @UnsupportedAppUsage
     public void installContent() {
         int contentView = selectContentView();
         mWindow.setContentView(contentView);
@@ -275,6 +282,7 @@
         return mAlertDialogLayout;
     }
 
+    @UnsupportedAppUsage
     public void setTitle(CharSequence title) {
         mTitle = title;
         if (mTitleView != null) {
@@ -285,10 +293,12 @@
     /**
      * @see AlertDialog.Builder#setCustomTitle(View)
      */
+    @UnsupportedAppUsage
     public void setCustomTitle(View customTitleView) {
         mCustomTitleView = customTitleView;
     }
 
+    @UnsupportedAppUsage
     public void setMessage(CharSequence message) {
         mMessage = message;
         if (mMessageView != null) {
@@ -323,6 +333,7 @@
     /**
      * Set the view to display in the dialog.
      */
+    @UnsupportedAppUsage
     public void setView(View view) {
         mView = view;
         mViewLayoutResId = 0;
@@ -362,6 +373,7 @@
      * @param listener The {@link DialogInterface.OnClickListener} to use.
      * @param msg The {@link Message} to be sent when clicked.
      */
+    @UnsupportedAppUsage
     public void setButton(int whichButton, CharSequence text,
             DialogInterface.OnClickListener listener, Message msg) {
 
@@ -397,6 +409,7 @@
      * @param resId the resource identifier of the drawable to use as the icon,
      *            or 0 for no icon
      */
+    @UnsupportedAppUsage
     public void setIcon(int resId) {
         mIcon = null;
         mIconId = resId;
@@ -416,6 +429,7 @@
      *
      * @param icon the drawable to use as the icon or null for no icon
      */
+    @UnsupportedAppUsage
     public void setIcon(Drawable icon) {
         mIcon = icon;
         mIconId = 0;
@@ -446,10 +460,12 @@
         mForceInverseBackground = forceInverseBackground;
     }
 
+    @UnsupportedAppUsage
     public ListView getListView() {
         return mListView;
     }
 
+    @UnsupportedAppUsage
     public Button getButton(int whichButton) {
         switch (whichButton) {
             case DialogInterface.BUTTON_POSITIVE:
@@ -464,11 +480,13 @@
     }
 
     @SuppressWarnings({"UnusedDeclaration"})
+    @UnsupportedAppUsage
     public boolean onKeyDown(int keyCode, KeyEvent event) {
         return mScrollView != null && mScrollView.executeKeyEvent(event);
     }
 
     @SuppressWarnings({"UnusedDeclaration"})
+    @UnsupportedAppUsage
     public boolean onKeyUp(int keyCode, KeyEvent event) {
         return mScrollView != null && mScrollView.executeKeyEvent(event);
     }
@@ -932,10 +950,12 @@
 
         boolean mRecycleOnMeasure = true;
 
+        @UnsupportedAppUsage
         public RecycleListView(Context context) {
             this(context, null);
         }
 
+        @UnsupportedAppUsage
         public RecycleListView(Context context, AttributeSet attrs) {
             super(context, attrs);
 
@@ -964,44 +984,74 @@
     }
 
     public static class AlertParams {
+        @UnsupportedAppUsage
         public final Context mContext;
+        @UnsupportedAppUsage
         public final LayoutInflater mInflater;
 
+        @UnsupportedAppUsage
         public int mIconId = 0;
+        @UnsupportedAppUsage
         public Drawable mIcon;
         public int mIconAttrId = 0;
+        @UnsupportedAppUsage
         public CharSequence mTitle;
+        @UnsupportedAppUsage
         public View mCustomTitleView;
+        @UnsupportedAppUsage
         public CharSequence mMessage;
+        @UnsupportedAppUsage
         public CharSequence mPositiveButtonText;
+        @UnsupportedAppUsage
         public DialogInterface.OnClickListener mPositiveButtonListener;
+        @UnsupportedAppUsage
         public CharSequence mNegativeButtonText;
+        @UnsupportedAppUsage
         public DialogInterface.OnClickListener mNegativeButtonListener;
+        @UnsupportedAppUsage
         public CharSequence mNeutralButtonText;
+        @UnsupportedAppUsage
         public DialogInterface.OnClickListener mNeutralButtonListener;
+        @UnsupportedAppUsage
         public boolean mCancelable;
+        @UnsupportedAppUsage
         public DialogInterface.OnCancelListener mOnCancelListener;
+        @UnsupportedAppUsage
         public DialogInterface.OnDismissListener mOnDismissListener;
+        @UnsupportedAppUsage
         public DialogInterface.OnKeyListener mOnKeyListener;
+        @UnsupportedAppUsage
         public CharSequence[] mItems;
+        @UnsupportedAppUsage
         public ListAdapter mAdapter;
+        @UnsupportedAppUsage
         public DialogInterface.OnClickListener mOnClickListener;
         public int mViewLayoutResId;
+        @UnsupportedAppUsage
         public View mView;
         public int mViewSpacingLeft;
         public int mViewSpacingTop;
         public int mViewSpacingRight;
         public int mViewSpacingBottom;
         public boolean mViewSpacingSpecified = false;
+        @UnsupportedAppUsage
         public boolean[] mCheckedItems;
+        @UnsupportedAppUsage
         public boolean mIsMultiChoice;
+        @UnsupportedAppUsage
         public boolean mIsSingleChoice;
+        @UnsupportedAppUsage
         public int mCheckedItem = -1;
+        @UnsupportedAppUsage
         public DialogInterface.OnMultiChoiceClickListener mOnCheckboxClickListener;
+        @UnsupportedAppUsage
         public Cursor mCursor;
+        @UnsupportedAppUsage
         public String mLabelColumn;
+        @UnsupportedAppUsage
         public String mIsCheckedColumn;
         public boolean mForceInverseBackground;
+        @UnsupportedAppUsage
         public AdapterView.OnItemSelectedListener mOnItemSelectedListener;
         public OnPrepareListViewListener mOnPrepareListViewListener;
         public boolean mRecycleOnMeasure = true;
@@ -1019,12 +1069,14 @@
             void onPrepareListView(ListView listView);
         }
 
+        @UnsupportedAppUsage
         public AlertParams(Context context) {
             mContext = context;
             mCancelable = true;
             mInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
         }
 
+        @UnsupportedAppUsage
         public void apply(AlertController dialog) {
             if (mCustomTitleView != null) {
                 dialog.setCustomTitle(mCustomTitleView);
diff --git a/core/java/com/android/internal/content/PackageMonitor.java b/core/java/com/android/internal/content/PackageMonitor.java
index 3f8fd9b..c928f3f 100644
--- a/core/java/com/android/internal/content/PackageMonitor.java
+++ b/core/java/com/android/internal/content/PackageMonitor.java
@@ -16,6 +16,7 @@
 
 package com.android.internal.content;
 
+import android.annotation.UnsupportedAppUsage;
 import android.app.Activity;
 import android.content.Context;
 import android.content.Intent;
@@ -70,10 +71,12 @@
 
     String[] mTempArray = new String[1];
 
+    @UnsupportedAppUsage
     public void register(Context context, Looper thread, boolean externalStorage) {
         register(context, thread, null, externalStorage);
     }
 
+    @UnsupportedAppUsage
     public void register(Context context, Looper thread, UserHandle user,
             boolean externalStorage) {
         register(context, user, externalStorage,
@@ -107,6 +110,7 @@
         return mRegisteredHandler;
     }
 
+    @UnsupportedAppUsage
     public void unregister() {
         if (mRegisteredContext == null) {
             throw new IllegalStateException("Not registered");
@@ -134,6 +138,7 @@
     /**
      * Called when a package is really removed (and not replaced).
      */
+    @UnsupportedAppUsage
     public void onPackageRemoved(String packageName, int uid) {
     }
 
@@ -167,6 +172,7 @@
      * default implementation returns true if this is a change to the entire
      * package.
      */
+    @UnsupportedAppUsage
     public boolean onPackageChanged(String packageName, int uid, String[] components) {
         if (components != null) {
             for (String name : components) {
@@ -246,6 +252,7 @@
         return mAppearingPackages != null;
     }
     
+    @UnsupportedAppUsage
     public int isPackageDisappearing(String packageName) {
         if (mDisappearingPackages != null) {
             for (int i=mDisappearingPackages.length-1; i>=0; i--) {
@@ -265,6 +272,7 @@
         return mChangeType == PACKAGE_UPDATING;
     }
 
+    @UnsupportedAppUsage
     public boolean isPackageModified(String packageName) {
         if (mModifiedPackages != null) {
             for (int i=mModifiedPackages.length-1; i>=0; i--) {
diff --git a/core/java/com/android/internal/content/ReferrerIntent.java b/core/java/com/android/internal/content/ReferrerIntent.java
index 76dcc9b..6d05f7e 100644
--- a/core/java/com/android/internal/content/ReferrerIntent.java
+++ b/core/java/com/android/internal/content/ReferrerIntent.java
@@ -16,6 +16,7 @@
 
 package com.android.internal.content;
 
+import android.annotation.UnsupportedAppUsage;
 import android.content.Intent;
 import android.os.Parcel;
 
@@ -25,8 +26,10 @@
  * Subclass of Intent that also contains referrer (as a package name) information.
  */
 public class ReferrerIntent extends Intent {
+    @UnsupportedAppUsage
     public final String mReferrer;
 
+    @UnsupportedAppUsage
     public ReferrerIntent(Intent baseIntent, String referrer) {
         super(baseIntent);
         mReferrer = referrer;
diff --git a/core/java/com/android/internal/logging/MetricsLogger.java b/core/java/com/android/internal/logging/MetricsLogger.java
index a482929..e99e39e 100644
--- a/core/java/com/android/internal/logging/MetricsLogger.java
+++ b/core/java/com/android/internal/logging/MetricsLogger.java
@@ -15,6 +15,7 @@
  */
 package com.android.internal.logging;
 
+import android.annotation.UnsupportedAppUsage;
 import android.content.Context;
 import android.metrics.LogMaker;
 import android.os.Build;
@@ -47,6 +48,7 @@
     public static final int VIEW_UNKNOWN = MetricsEvent.VIEW_UNKNOWN;
     public static final int LOGTAG = EventLogTags.SYSUI_MULTI_ACTION;
 
+    @UnsupportedAppUsage
     public void write(LogMaker content) {
         if (content.getType() == MetricsEvent.TYPE_UNKNOWN) {
             content.setType(MetricsEvent.TYPE_ACTION);
diff --git a/core/java/com/android/internal/net/LegacyVpnInfo.java b/core/java/com/android/internal/net/LegacyVpnInfo.java
index d6f6d0b..9ee9710 100644
--- a/core/java/com/android/internal/net/LegacyVpnInfo.java
+++ b/core/java/com/android/internal/net/LegacyVpnInfo.java
@@ -16,6 +16,7 @@
 
 package com.android.internal.net;
 
+import android.annotation.UnsupportedAppUsage;
 import android.app.PendingIntent;
 import android.net.NetworkInfo;
 import android.os.Parcel;
@@ -38,7 +39,9 @@
     public static final int STATE_TIMEOUT = 4;
     public static final int STATE_FAILED = 5;
 
+    @UnsupportedAppUsage
     public String key;
+    @UnsupportedAppUsage
     public int state = -1;
     public PendingIntent intent;
 
@@ -54,6 +57,7 @@
         out.writeParcelable(intent, flags);
     }
 
+    @UnsupportedAppUsage
     public static final Parcelable.Creator<LegacyVpnInfo> CREATOR =
             new Parcelable.Creator<LegacyVpnInfo>() {
         @Override
diff --git a/core/java/com/android/internal/net/VpnConfig.java b/core/java/com/android/internal/net/VpnConfig.java
index 5ce5bcd..fd03b3f 100644
--- a/core/java/com/android/internal/net/VpnConfig.java
+++ b/core/java/com/android/internal/net/VpnConfig.java
@@ -16,6 +16,7 @@
 
 package com.android.internal.net;
 
+import android.annotation.UnsupportedAppUsage;
 import android.app.PendingIntent;
 import android.content.ComponentName;
 import android.content.Context;
diff --git a/core/java/com/android/internal/net/VpnProfile.java b/core/java/com/android/internal/net/VpnProfile.java
index b46bfef..bc4b5fe 100644
--- a/core/java/com/android/internal/net/VpnProfile.java
+++ b/core/java/com/android/internal/net/VpnProfile.java
@@ -16,6 +16,7 @@
 
 package com.android.internal.net;
 
+import android.annotation.UnsupportedAppUsage;
 import android.os.Parcel;
 import android.os.Parcelable;
 import android.text.TextUtils;
@@ -45,10 +46,15 @@
     public static final int TYPE_MAX = 5;
 
     // Entity fields.
+    @UnsupportedAppUsage
     public final String key;           // -1
+    @UnsupportedAppUsage
     public String name = "";           // 0
+    @UnsupportedAppUsage
     public int type = TYPE_PPTP;       // 1
+    @UnsupportedAppUsage
     public String server = "";         // 2
+    @UnsupportedAppUsage
     public String username = "";       // 3
     public String password = "";       // 4
     public String dnsServers = "";     // 5
@@ -63,12 +69,14 @@
     public String ipsecServerCert = "";// 14
 
     // Helper fields.
+    @UnsupportedAppUsage
     public boolean saveLogin = false;
 
     public VpnProfile(String key) {
         this.key = key;
     }
 
+    @UnsupportedAppUsage
     public VpnProfile(Parcel in) {
         key = in.readString();
         name = in.readString();
@@ -110,6 +118,7 @@
         out.writeInt(saveLogin ? 1 : 0);
     }
 
+    @UnsupportedAppUsage
     public static VpnProfile decode(String key, byte[] value) {
         try {
             if (key == null) {
diff --git a/core/java/com/android/internal/os/AtomicFile.java b/core/java/com/android/internal/os/AtomicFile.java
index 5a83f33..e177fe3 100644
--- a/core/java/com/android/internal/os/AtomicFile.java
+++ b/core/java/com/android/internal/os/AtomicFile.java
@@ -16,6 +16,7 @@
 
 package com.android.internal.os;
 
+import android.annotation.UnsupportedAppUsage;
 import android.os.FileUtils;
 import android.util.Log;
 
@@ -44,15 +45,18 @@
     private final File mBaseName;
     private final File mBackupName;
     
+    @UnsupportedAppUsage
     public AtomicFile(File baseName) {
         mBaseName = baseName;
         mBackupName = new File(baseName.getPath() + ".bak");
     }
     
+    @UnsupportedAppUsage
     public File getBaseFile() {
         return mBaseName;
     }
     
+    @UnsupportedAppUsage
     public FileOutputStream startWrite() throws IOException {
         // Rename the current file so it may be used as a backup during the next read
         if (mBaseName.exists()) {
@@ -86,6 +90,7 @@
         return str;
     }
     
+    @UnsupportedAppUsage
     public void finishWrite(FileOutputStream str) {
         if (str != null) {
             FileUtils.sync(str);
@@ -98,6 +103,7 @@
         }
     }
     
+    @UnsupportedAppUsage
     public void failWrite(FileOutputStream str) {
         if (str != null) {
             FileUtils.sync(str);
@@ -111,6 +117,7 @@
         }
     }
     
+    @UnsupportedAppUsage
     public FileOutputStream openAppend() throws IOException {
         try {
             return new FileOutputStream(mBaseName, true);
@@ -119,6 +126,7 @@
         }
     }
     
+    @UnsupportedAppUsage
     public void truncate() throws IOException {
         try {
             FileOutputStream fos = new FileOutputStream(mBaseName);
@@ -139,6 +147,7 @@
         mBackupName.delete();
     }
 
+    @UnsupportedAppUsage
     public FileInputStream openRead() throws FileNotFoundException {
         if (mBackupName.exists()) {
             mBaseName.delete();
@@ -147,6 +156,7 @@
         return new FileInputStream(mBaseName);
     }
     
+    @UnsupportedAppUsage
     public byte[] readFully() throws IOException {
         FileInputStream stream = openRead();
         try {
diff --git a/core/java/com/android/internal/os/BatterySipper.java b/core/java/com/android/internal/os/BatterySipper.java
index 5abc6d4..0baf73c 100644
--- a/core/java/com/android/internal/os/BatterySipper.java
+++ b/core/java/com/android/internal/os/BatterySipper.java
@@ -15,6 +15,7 @@
  */
 package com.android.internal.os;
 
+import android.annotation.UnsupportedAppUsage;
 import android.os.BatteryStats.Uid;
 
 import java.util.List;
@@ -23,8 +24,11 @@
  * Contains power usage of an application, system service, or hardware type.
  */
 public class BatterySipper implements Comparable<BatterySipper> {
+    @UnsupportedAppUsage
     public int userId;
+    @UnsupportedAppUsage
     public Uid uidObj;
+    @UnsupportedAppUsage
     public DrainType drainType;
 
     /**
@@ -53,6 +57,7 @@
     /**
      * Total power before smearing
      */
+    @UnsupportedAppUsage
     public double totalPowerMah;
 
     /**
@@ -65,6 +70,7 @@
     /**
      * Generic usage time in milliseconds.
      */
+    @UnsupportedAppUsage
     public long usageTimeMs;
 
     /**
@@ -76,12 +82,17 @@
     public long audioTimeMs;
     public long bluetoothRunningTimeMs;
     public long cameraTimeMs;
+    @UnsupportedAppUsage
     public long cpuFgTimeMs;
+    @UnsupportedAppUsage
     public long cpuTimeMs;
     public long flashlightTimeMs;
+    @UnsupportedAppUsage
     public long gpsTimeMs;
     public long videoTimeMs;
+    @UnsupportedAppUsage
     public long wakeLockTimeMs;
+    @UnsupportedAppUsage
     public long wifiRunningTimeMs;
 
     public long mobileRxPackets;
@@ -99,7 +110,9 @@
     public long btTxBytes;
     public double percent;
     public double noCoveragePercent;
+    @UnsupportedAppUsage
     public String[] mPackages;
+    @UnsupportedAppUsage
     public String packageWithHighestDrain;
 
     // Measured in mAh (milli-ampere per hour).
@@ -107,6 +120,7 @@
     public double audioPowerMah;
     public double bluetoothPowerMah;
     public double cameraPowerMah;
+    @UnsupportedAppUsage
     public double cpuPowerMah;
     public double flashlightPowerMah;
     public double gpsPowerMah;
@@ -118,6 +132,7 @@
 
     public enum DrainType {
         AMBIENT_DISPLAY,
+        @UnsupportedAppUsage
         APP,
         BLUETOOTH,
         CAMERA,
@@ -133,6 +148,7 @@
         WIFI,
     }
 
+    @UnsupportedAppUsage
     public BatterySipper(DrainType drainType, Uid uid, double value) {
         this.totalPowerMah = value;
         this.drainType = drainType;
@@ -162,10 +178,12 @@
     /**
      * Gets a list of packages associated with the current user
      */
+    @UnsupportedAppUsage
     public String[] getPackages() {
         return mPackages;
     }
 
+    @UnsupportedAppUsage
     public int getUid() {
         // Bail out if the current sipper is not an App sipper.
         if (uidObj == null) {
@@ -177,6 +195,7 @@
     /**
      * Add stats from other to this BatterySipper.
      */
+    @UnsupportedAppUsage
     public void add(BatterySipper other) {
         totalPowerMah += other.totalPowerMah;
         usageTimeMs += other.usageTimeMs;
diff --git a/core/java/com/android/internal/os/BatteryStatsHelper.java b/core/java/com/android/internal/os/BatteryStatsHelper.java
index 061011b..ead98e7 100644
--- a/core/java/com/android/internal/os/BatteryStatsHelper.java
+++ b/core/java/com/android/internal/os/BatteryStatsHelper.java
@@ -16,6 +16,7 @@
 
 package com.android.internal.os;
 
+import android.annotation.UnsupportedAppUsage;
 import android.content.Context;
 import android.content.Intent;
 import android.content.IntentFilter;
@@ -75,9 +76,11 @@
     final private boolean mCollectBatteryBroadcast;
     final private boolean mWifiOnly;
 
+    @UnsupportedAppUsage
     private IBatteryStats mBatteryInfo;
     private BatteryStats mStats;
     private Intent mBatteryBroadcast;
+    @UnsupportedAppUsage
     private PowerProfile mPowerProfile;
 
     private String[] mSystemPackageArray;
@@ -87,6 +90,7 @@
     /**
      * List of apps using power.
      */
+    @UnsupportedAppUsage
     private final List<BatterySipper> mUsageList = new ArrayList<>();
 
     /**
@@ -166,14 +170,17 @@
                 profile.getAveragePower(PowerProfile.POWER_BLUETOOTH_CONTROLLER_TX) != 0;
     }
 
+    @UnsupportedAppUsage
     public BatteryStatsHelper(Context context) {
         this(context, true);
     }
 
+    @UnsupportedAppUsage
     public BatteryStatsHelper(Context context, boolean collectBatteryBroadcast) {
         this(context, collectBatteryBroadcast, checkWifiOnly(context));
     }
 
+    @UnsupportedAppUsage
     public BatteryStatsHelper(Context context, boolean collectBatteryBroadcast, boolean wifiOnly) {
         mContext = context;
         mCollectBatteryBroadcast = collectBatteryBroadcast;
@@ -241,6 +248,7 @@
                 ServiceManager.getService(BatteryStats.SERVICE_NAME)));
     }
 
+    @UnsupportedAppUsage
     public static void dropFile(Context context, String fname) {
         makeFilePath(context, fname).delete();
     }
@@ -250,10 +258,12 @@
     }
 
     /** Clears the current stats and forces recreating for future use. */
+    @UnsupportedAppUsage
     public void clearStats() {
         mStats = null;
     }
 
+    @UnsupportedAppUsage
     public BatteryStats getStats() {
         if (mStats == null) {
             load();
@@ -261,6 +271,7 @@
         return mStats;
     }
 
+    @UnsupportedAppUsage
     public Intent getBatteryBroadcast() {
         if (mBatteryBroadcast == null && mCollectBatteryBroadcast) {
             load();
@@ -277,6 +288,7 @@
         mStats = stats;
     }
 
+    @UnsupportedAppUsage
     public void create(Bundle icicle) {
         if (icicle != null) {
             mStats = sStatsXfer;
@@ -287,6 +299,7 @@
         mPowerProfile = new PowerProfile(mContext);
     }
 
+    @UnsupportedAppUsage
     public void storeState() {
         sStatsXfer = mStats;
         sBatteryBroadcastXfer = mBatteryBroadcast;
@@ -323,6 +336,7 @@
     /**
      * Refreshes the power usage list.
      */
+    @UnsupportedAppUsage
     public void refreshStats(int statsType, int asUser) {
         SparseArray<UserHandle> users = new SparseArray<>(1);
         users.put(asUser, new UserHandle(asUser));
@@ -332,6 +346,7 @@
     /**
      * Refreshes the power usage list.
      */
+    @UnsupportedAppUsage
     public void refreshStats(int statsType, List<UserHandle> asUsers) {
         final int n = asUsers.size();
         SparseArray<UserHandle> users = new SparseArray<>(n);
@@ -345,6 +360,7 @@
     /**
      * Refreshes the power usage list.
      */
+    @UnsupportedAppUsage
     public void refreshStats(int statsType, SparseArray<UserHandle> asUsers) {
         refreshStats(statsType, asUsers, SystemClock.elapsedRealtime() * 1000,
                 SystemClock.uptimeMillis() * 1000);
@@ -783,6 +799,7 @@
         return bs;
     }
 
+    @UnsupportedAppUsage
     public List<BatterySipper> getUsageList() {
         return mUsageList;
     }
@@ -799,6 +816,7 @@
         return mStatsType;
     }
 
+    @UnsupportedAppUsage
     public double getMaxPower() {
         return mMaxPower;
     }
@@ -807,6 +825,7 @@
         return mMaxRealPower;
     }
 
+    @UnsupportedAppUsage
     public double getTotalPower() {
         return mTotalPower;
     }
@@ -1017,6 +1036,7 @@
         mServicepackageArray = array;
     }
 
+    @UnsupportedAppUsage
     private void load() {
         if (mBatteryInfo == null) {
             return;
diff --git a/core/java/com/android/internal/os/BatteryStatsImpl.java b/core/java/com/android/internal/os/BatteryStatsImpl.java
index f314872..c65dd6f 100644
--- a/core/java/com/android/internal/os/BatteryStatsImpl.java
+++ b/core/java/com/android/internal/os/BatteryStatsImpl.java
@@ -18,6 +18,7 @@
 
 import android.annotation.NonNull;
 import android.annotation.Nullable;
+import android.annotation.UnsupportedAppUsage;
 import android.app.ActivityManager;
 import android.bluetooth.BluetoothActivityEnergyInfo;
 import android.bluetooth.UidTraffic;
@@ -602,8 +603,11 @@
     // In order to do this, we must refresh each timer whenever the number of active timers
     // changes.
     @VisibleForTesting
+    @UnsupportedAppUsage
     protected ArrayList<StopwatchTimer> mPartialTimers = new ArrayList<>();
+    @UnsupportedAppUsage
     final ArrayList<StopwatchTimer> mFullTimers = new ArrayList<>();
+    @UnsupportedAppUsage
     final ArrayList<StopwatchTimer> mWindowTimers = new ArrayList<>();
     final ArrayList<StopwatchTimer> mDrawTimers = new ArrayList<>();
     final SparseArray<ArrayList<StopwatchTimer>> mSensorTimers = new SparseArray<>();
@@ -982,6 +986,7 @@
      */
     private final HashMap<String, SamplingTimer> mKernelWakelockStats = new HashMap<>();
 
+    @UnsupportedAppUsage
     public Map<String, ? extends Timer> getKernelWakelockStats() {
         return mKernelWakelockStats;
     }
@@ -1298,6 +1303,7 @@
      * State for keeping track of counting information.
      */
     public static class Counter extends BatteryStats.Counter implements TimeBaseObs {
+        @UnsupportedAppUsage
         final AtomicInteger mCount = new AtomicInteger();
         final TimeBase mTimeBase;
         int mLoadedCount;
@@ -1853,6 +1859,7 @@
          * @param out the Parcel to be written to.
          * @param timer a Timer, or null.
          */
+        @UnsupportedAppUsage
         public static void writeTimerToParcel(Parcel out, Timer timer, long elapsedRealtimeUs) {
             if (timer == null) {
                 out.writeInt(0); // indicates null
@@ -1864,6 +1871,7 @@
         }
 
         @Override
+        @UnsupportedAppUsage
         public long getTotalTimeLocked(long elapsedRealtimeUs, int which) {
             long val = computeRunTimeLocked(mTimeBase.getRealtime(elapsedRealtimeUs));
             if (which == STATS_SINCE_UNPLUGGED) {
@@ -1876,6 +1884,7 @@
         }
 
         @Override
+        @UnsupportedAppUsage
         public int getCountLocked(int which) {
             int val = computeCurrentCountLocked();
             if (which == STATS_SINCE_UNPLUGGED) {
@@ -2651,6 +2660,7 @@
         }
 
         @Override
+        @UnsupportedAppUsage
         public void detach() {
             super.detach();
             if (mTimerPool != null) {
@@ -4931,6 +4941,7 @@
         }
     }
 
+    @UnsupportedAppUsage
     public void noteScreenBrightnessLocked(int brightness) {
         // Bin the brightness.
         int bin = brightness / (256/NUM_SCREEN_BRIGHTNESS_BINS);
@@ -4954,6 +4965,7 @@
         }
     }
 
+    @UnsupportedAppUsage
     public void noteUserActivityLocked(int uid, int event) {
         if (mOnBatteryInternal) {
             uid = mapUid(uid);
@@ -5188,6 +5200,7 @@
         }
     }
 
+    @UnsupportedAppUsage
     public void notePhoneOnLocked() {
         if (!mPhoneOn) {
             final long elapsedRealtime = mClocks.elapsedRealtime();
@@ -5201,6 +5214,7 @@
         }
     }
 
+    @UnsupportedAppUsage
     public void notePhoneOffLocked() {
         if (mPhoneOn) {
             final long elapsedRealtime = mClocks.elapsedRealtime();
@@ -5370,12 +5384,14 @@
         updateAllPhoneStateLocked(state, simState, mPhoneSignalStrengthBinRaw);
     }
 
+    @UnsupportedAppUsage
     public void notePhoneSignalStrengthLocked(SignalStrength signalStrength) {
         // Bin the strength.
         int bin = signalStrength.getLevel();
         updateAllPhoneStateLocked(mPhoneServiceStateRaw, mPhoneSimStateRaw, bin);
     }
 
+    @UnsupportedAppUsage
     public void notePhoneDataConnectionStateLocked(int dataType, boolean hasData) {
         // BatteryStats uses 0 to represent no network type.
         // Telephony does not have a concept of no network type, and uses 0 to represent unknown.
@@ -5434,6 +5450,7 @@
         }
     }
 
+    @UnsupportedAppUsage
     public void noteAudioOnLocked(int uid) {
         uid = mapUid(uid);
         final long elapsedRealtime = mClocks.elapsedRealtime();
@@ -5449,6 +5466,7 @@
         getUidStatsLocked(uid).noteAudioTurnedOnLocked(elapsedRealtime);
     }
 
+    @UnsupportedAppUsage
     public void noteAudioOffLocked(int uid) {
         if (mAudioOnNesting == 0) {
             return;
@@ -5466,6 +5484,7 @@
         getUidStatsLocked(uid).noteAudioTurnedOffLocked(elapsedRealtime);
     }
 
+    @UnsupportedAppUsage
     public void noteVideoOnLocked(int uid) {
         uid = mapUid(uid);
         final long elapsedRealtime = mClocks.elapsedRealtime();
@@ -5481,6 +5500,7 @@
         getUidStatsLocked(uid).noteVideoTurnedOnLocked(elapsedRealtime);
     }
 
+    @UnsupportedAppUsage
     public void noteVideoOffLocked(int uid) {
         if (mVideoOnNesting == 0) {
             return;
@@ -5956,6 +5976,7 @@
 
     int mWifiFullLockNesting = 0;
 
+    @UnsupportedAppUsage
     public void noteFullWifiLockAcquiredLocked(int uid) {
         final long elapsedRealtime = mClocks.elapsedRealtime();
         final long uptime = mClocks.uptimeMillis();
@@ -5969,6 +5990,7 @@
         getUidStatsLocked(uid).noteFullWifiLockAcquiredLocked(elapsedRealtime);
     }
 
+    @UnsupportedAppUsage
     public void noteFullWifiLockReleasedLocked(int uid) {
         final long elapsedRealtime = mClocks.elapsedRealtime();
         final long uptime = mClocks.uptimeMillis();
@@ -6024,6 +6046,7 @@
 
     int mWifiMulticastNesting = 0;
 
+    @UnsupportedAppUsage
     public void noteWifiMulticastEnabledLocked(int uid) {
         uid = mapUid(uid);
         final long elapsedRealtime = mClocks.elapsedRealtime();
@@ -6044,6 +6067,7 @@
         getUidStatsLocked(uid).noteWifiMulticastEnabledLocked(elapsedRealtime);
     }
 
+    @UnsupportedAppUsage
     public void noteWifiMulticastDisabledLocked(int uid) {
         uid = mapUid(uid);
         final long elapsedRealtime = mClocks.elapsedRealtime();
@@ -6240,6 +6264,7 @@
         }
     }
 
+    @UnsupportedAppUsage
     @Override public long getScreenOnTime(long elapsedRealtimeUs, int which) {
         return mScreenOnTimer.getTotalTimeLocked(elapsedRealtimeUs, which);
     }
@@ -6256,6 +6281,7 @@
         return mScreenDozeTimer.getCountLocked(which);
     }
 
+    @UnsupportedAppUsage
     @Override public long getScreenBrightnessTime(int brightnessBin,
             long elapsedRealtimeUs, int which) {
         return mScreenBrightnessTimer[brightnessBin].getTotalTimeLocked(
@@ -6365,6 +6391,7 @@
         return (long) energyUsedMaMs;
     }
 
+    @UnsupportedAppUsage
     @Override public long getPhoneOnTime(long elapsedRealtimeUs, int which) {
         return mPhoneOnTimer.getTotalTimeLocked(elapsedRealtimeUs, which);
     }
@@ -6373,12 +6400,14 @@
         return mPhoneOnTimer.getCountLocked(which);
     }
 
+    @UnsupportedAppUsage
     @Override public long getPhoneSignalStrengthTime(int strengthBin,
             long elapsedRealtimeUs, int which) {
         return mPhoneSignalStrengthsTimer[strengthBin].getTotalTimeLocked(
                 elapsedRealtimeUs, which);
     }
 
+    @UnsupportedAppUsage
     @Override public long getPhoneSignalScanningTime(
             long elapsedRealtimeUs, int which) {
         return mPhoneSignalScanningTimer.getTotalTimeLocked(
@@ -6389,6 +6418,7 @@
         return mPhoneSignalScanningTimer;
     }
 
+    @UnsupportedAppUsage
     @Override public int getPhoneSignalStrengthCount(int strengthBin, int which) {
         return mPhoneSignalStrengthsTimer[strengthBin].getCountLocked(which);
     }
@@ -6397,12 +6427,14 @@
         return mPhoneSignalStrengthsTimer[strengthBin];
     }
 
+    @UnsupportedAppUsage
     @Override public long getPhoneDataConnectionTime(int dataType,
             long elapsedRealtimeUs, int which) {
         return mPhoneDataConnectionsTimer[dataType].getTotalTimeLocked(
                 elapsedRealtimeUs, which);
     }
 
+    @UnsupportedAppUsage
     @Override public int getPhoneDataConnectionCount(int dataType, int which) {
         return mPhoneDataConnectionsTimer[dataType].getCountLocked(which);
     }
@@ -6411,6 +6443,7 @@
         return mPhoneDataConnectionsTimer[dataType];
     }
 
+    @UnsupportedAppUsage
     @Override public long getMobileRadioActiveTime(long elapsedRealtimeUs, int which) {
         return mMobileRadioActiveTimer.getTotalTimeLocked(elapsedRealtimeUs, which);
     }
@@ -6441,6 +6474,7 @@
         return mWifiMulticastWakelockTimer.getCountLocked(which);
     }
 
+    @UnsupportedAppUsage
     @Override public long getWifiOnTime(long elapsedRealtimeUs, int which) {
         return mWifiOnTimer.getTotalTimeLocked(elapsedRealtimeUs, which);
     }
@@ -6449,6 +6483,7 @@
         return mWifiActiveTimer.getTotalTimeLocked(elapsedRealtimeUs, which);
     }
 
+    @UnsupportedAppUsage
     @Override public long getGlobalWifiRunningTime(long elapsedRealtimeUs, int which) {
         return mGlobalWifiRunningTimer.getTotalTimeLocked(elapsedRealtimeUs, which);
     }
@@ -6546,6 +6581,7 @@
     }
 
     @Override
+    @UnsupportedAppUsage
     public long getNetworkActivityBytes(int type, int which) {
         if (type >= 0 && type < mNetworkByteActivityCounters.length) {
             return mNetworkByteActivityCounters[type].getCountLocked(which);
@@ -6588,6 +6624,7 @@
         return mOnBattery;
     }
 
+    @UnsupportedAppUsage
     @Override public SparseArray<? extends BatteryStats.Uid> getUidStats() {
         return mUidStats;
     }
@@ -7005,6 +7042,7 @@
         }
 
         @Override
+        @UnsupportedAppUsage
         public ArrayMap<String, ? extends BatteryStats.Uid.Wakelock> getWakelockStats() {
             return mWakelockStats.getMap();
         }
@@ -7030,11 +7068,13 @@
         }
 
         @Override
+        @UnsupportedAppUsage
         public SparseArray<? extends BatteryStats.Uid.Sensor> getSensorStats() {
             return mSensorStats;
         }
 
         @Override
+        @UnsupportedAppUsage
         public ArrayMap<String, ? extends BatteryStats.Uid.Proc> getProcessStats() {
             return mProcessStats;
         }
@@ -7045,6 +7085,7 @@
         }
 
         @Override
+        @UnsupportedAppUsage
         public int getUid() {
             return mUid;
         }
@@ -7432,6 +7473,7 @@
         }
 
         @Override
+        @UnsupportedAppUsage
         public long getWifiRunningTime(long elapsedRealtimeUs, int which) {
             if (mWifiRunningTimer == null) {
                 return 0;
@@ -7448,6 +7490,7 @@
         }
 
         @Override
+        @UnsupportedAppUsage
         public long getWifiScanTime(long elapsedRealtimeUs, int which) {
             if (mWifiScanTimer == null) {
                 return 0;
@@ -8893,6 +8936,7 @@
             }
 
             @Override
+            @UnsupportedAppUsage
             public Timer getWakeTime(int type) {
                 switch (type) {
                 case WAKE_TYPE_FULL: return mTimerFull;
@@ -8962,6 +9006,7 @@
             }
 
             @Override
+            @UnsupportedAppUsage
             public Timer getSensorTime() {
                 return mTimer;
             }
@@ -8975,6 +9020,7 @@
             }
 
             @Override
+            @UnsupportedAppUsage
             public int getHandle() {
                 return mHandle;
             }
@@ -9231,6 +9277,7 @@
                 readExcessivePowerFromParcelLocked(in);
             }
 
+            @UnsupportedAppUsage
             public void addCpuTimeLocked(int utime, int stime) {
                 addCpuTimeLocked(utime, stime, mBsi.mOnBatteryTimeBase.isRunning());
             }
@@ -9242,10 +9289,12 @@
                 }
             }
 
+            @UnsupportedAppUsage
             public void addForegroundTimeLocked(long ttime) {
                 mForegroundTime += ttime;
             }
 
+            @UnsupportedAppUsage
             public void incStartsLocked() {
                 mStarts++;
             }
@@ -9264,6 +9313,7 @@
             }
 
             @Override
+            @UnsupportedAppUsage
             public long getUserTime(int which) {
                 long val = mUserTime;
                 if (which == STATS_CURRENT) {
@@ -9275,6 +9325,7 @@
             }
 
             @Override
+            @UnsupportedAppUsage
             public long getSystemTime(int which) {
                 long val = mSystemTime;
                 if (which == STATS_CURRENT) {
@@ -9286,6 +9337,7 @@
             }
 
             @Override
+            @UnsupportedAppUsage
             public long getForegroundTime(int which) {
                 long val = mForegroundTime;
                 if (which == STATS_CURRENT) {
@@ -9297,6 +9349,7 @@
             }
 
             @Override
+            @UnsupportedAppUsage
             public int getStarts(int which) {
                 int val = mStarts;
                 if (which == STATS_CURRENT) {
@@ -9621,6 +9674,7 @@
                     return mStartTime + batteryUptime - mRunningSince;
                 }
 
+                @UnsupportedAppUsage
                 public void startLaunchedLocked() {
                     if (!mLaunched) {
                         mLaunches++;
@@ -9629,6 +9683,7 @@
                     }
                 }
 
+                @UnsupportedAppUsage
                 public void stopLaunchedLocked() {
                     if (mLaunched) {
                         long time = mBsi.getBatteryUptimeLocked() - mLaunchedSince;
@@ -9641,6 +9696,7 @@
                     }
                 }
 
+                @UnsupportedAppUsage
                 public void startRunningLocked() {
                     if (!mRunning) {
                         mStarts++;
@@ -9649,6 +9705,7 @@
                     }
                 }
 
+                @UnsupportedAppUsage
                 public void stopRunningLocked() {
                     if (mRunning) {
                         long time = mBsi.getBatteryUptimeLocked() - mRunningSince;
@@ -9661,6 +9718,7 @@
                     }
                 }
 
+                @UnsupportedAppUsage
                 public BatteryStatsImpl getBatteryStats() {
                     return mBsi;
                 }
@@ -10160,6 +10218,7 @@
         mUserInfoProvider = userInfoProvider;
     }
 
+    @UnsupportedAppUsage
     public BatteryStatsImpl(Parcel p) {
         this(new SystemClocks(), p);
     }
@@ -10601,6 +10660,7 @@
     }
 
     @Override
+    @UnsupportedAppUsage
     public boolean startIteratingHistoryLocked() {
         mBatteryStatsHistory.startIteratingHistory();
         mReadOverflow = false;
@@ -10641,6 +10701,7 @@
     }
 
     @Override
+    @UnsupportedAppUsage
     public boolean getNextHistoryLocked(HistoryItem out) {
         Parcel p = mBatteryStatsHistory.getNextParcel(out);
         if (p == null) {
@@ -10674,6 +10735,7 @@
         return mStartCount;
     }
 
+    @UnsupportedAppUsage
     public boolean isOnBattery() {
         return mOnBattery;
     }
@@ -12694,10 +12756,12 @@
         }
     }
 
+    @UnsupportedAppUsage
     public long getAwakeTimeBattery() {
         return computeBatteryUptime(getBatteryUptimeLocked(), STATS_CURRENT);
     }
 
+    @UnsupportedAppUsage
     public long getAwakeTimePlugged() {
         return (mClocks.uptimeMillis() * 1000) - getAwakeTimeBattery();
     }
@@ -12723,11 +12787,13 @@
     }
 
     @Override
+    @UnsupportedAppUsage
     public long computeBatteryUptime(long curTime, int which) {
         return mOnBatteryTimeBase.computeUptime(curTime, which);
     }
 
     @Override
+    @UnsupportedAppUsage
     public long computeBatteryRealtime(long curTime, int which) {
         return mOnBatteryTimeBase.computeRealtime(curTime, which);
     }
@@ -12781,6 +12847,7 @@
     }
 
     @Override
+    @UnsupportedAppUsage
     public long computeBatteryTimeRemaining(long curTime) {
         if (!mOnBattery) {
             return -1;
@@ -12979,11 +13046,13 @@
     }
 
     @Override
+    @UnsupportedAppUsage
     public long getBatteryRealtime(long curTime) {
         return mOnBatteryTimeBase.getRealtime(curTime);
     }
 
     @Override
+    @UnsupportedAppUsage
     public int getDischargeStartLevel() {
         synchronized(this) {
             return getDischargeStartLevelLocked();
@@ -12995,6 +13064,7 @@
     }
 
     @Override
+    @UnsupportedAppUsage
     public int getDischargeCurrentLevel() {
         synchronized(this) {
             return getDischargeCurrentLevelLocked();
@@ -13028,6 +13098,7 @@
     }
 
     @Override
+    @UnsupportedAppUsage
     public int getDischargeAmount(int which) {
         int dischargeAmount = which == STATS_SINCE_CHARGED
                 ? getHighDischargeAmountSinceCharge()
@@ -13039,6 +13110,7 @@
     }
 
     @Override
+    @UnsupportedAppUsage
     public int getDischargeAmountScreenOn() {
         synchronized(this) {
             int val = mDischargeAmountScreenOn;
@@ -13063,6 +13135,7 @@
     }
 
     @Override
+    @UnsupportedAppUsage
     public int getDischargeAmountScreenOff() {
         synchronized(this) {
             int val = mDischargeAmountScreenOff;
@@ -13115,6 +13188,7 @@
     /**
      * Retrieve the statistics object for a particular uid, creating if needed.
      */
+    @UnsupportedAppUsage
     public Uid getUidStatsLocked(int uid) {
         Uid u = mUidStats.get(uid);
         if (u == null) {
@@ -13159,6 +13233,7 @@
     /**
      * Remove the statistics object for a particular uid.
      */
+    @UnsupportedAppUsage
     public void removeUidStatsLocked(int uid) {
         final Uid u = mUidStats.get(uid);
         if (u != null) {
@@ -13172,6 +13247,7 @@
      * Retrieve the statistics object for a particular process, creating
      * if needed.
      */
+    @UnsupportedAppUsage
     public Uid.Proc getProcessStatsLocked(int uid, String name) {
         uid = mapUid(uid);
         Uid u = getUidStatsLocked(uid);
@@ -13182,6 +13258,7 @@
      * Retrieve the statistics object for a particular process, creating
      * if needed.
      */
+    @UnsupportedAppUsage
     public Uid.Pkg getPackageStatsLocked(int uid, String pkg) {
         uid = mapUid(uid);
         Uid u = getUidStatsLocked(uid);
@@ -13192,6 +13269,7 @@
      * Retrieve the statistics object for a particular service, creating
      * if needed.
      */
+    @UnsupportedAppUsage
     public Uid.Pkg.Serv getServiceStatsLocked(int uid, String pkg, String name) {
         uid = mapUid(uid);
         Uid u = getUidStatsLocked(uid);
@@ -13523,6 +13601,7 @@
         }
     }
 
+    @UnsupportedAppUsage
     public void readLocked() {
         if (mDailyFile != null) {
             readDailyStatsLocked();
@@ -15146,6 +15225,7 @@
         }
     }
 
+    @UnsupportedAppUsage
     public static final Parcelable.Creator<BatteryStatsImpl> CREATOR =
         new Parcelable.Creator<BatteryStatsImpl>() {
         public BatteryStatsImpl createFromParcel(Parcel in) {
diff --git a/core/java/com/android/internal/os/FuseAppLoop.java b/core/java/com/android/internal/os/FuseAppLoop.java
index 67fbe5e..d08930b 100644
--- a/core/java/com/android/internal/os/FuseAppLoop.java
+++ b/core/java/com/android/internal/os/FuseAppLoop.java
@@ -18,6 +18,7 @@
 
 import android.annotation.NonNull;
 import android.annotation.Nullable;
+import android.annotation.UnsupportedAppUsage;
 import android.os.ProxyFileDescriptorCallback;
 import android.os.Handler;
 import android.os.Message;
@@ -226,6 +227,7 @@
 
     // Called by JNI.
     @SuppressWarnings("unused")
+    @UnsupportedAppUsage
     private void onCommand(int command, long unique, long inode, long offset, int size,
             byte[] data) {
         synchronized (mLock) {
@@ -254,6 +256,7 @@
 
     // Called by JNI.
     @SuppressWarnings("unused")
+    @UnsupportedAppUsage
     private byte[] onOpen(long unique, long inode) {
         synchronized (mLock) {
             try {
diff --git a/core/java/com/android/internal/os/HandlerCaller.java b/core/java/com/android/internal/os/HandlerCaller.java
index ae7c5f2..c8bfa1b 100644
--- a/core/java/com/android/internal/os/HandlerCaller.java
+++ b/core/java/com/android/internal/os/HandlerCaller.java
@@ -16,11 +16,18 @@
 
 package com.android.internal.os;
 
+import android.annotation.UnsupportedAppUsage;
 import android.content.Context;
 import android.os.Handler;
 import android.os.Looper;
 import android.os.Message;
 
+/**
+ * @deprecated Use {@link com.android.internal.util.function.pooled.PooledLambda#obtainMessage}
+ *      to achieve the same effect of storing multiple values in a message with the added typesafety
+ *      and code continuity benefits.
+ */
+@Deprecated
 public class HandlerCaller {
     final Looper mMainLooper;
     final Handler mH;
@@ -82,6 +89,7 @@
         mH.removeMessages(what, obj);
     }
     
+    @UnsupportedAppUsage
     public void sendMessage(Message msg) {
         mH.sendMessage(msg);
     }
@@ -106,6 +114,7 @@
         return args;
     }
 
+    @UnsupportedAppUsage
     public Message obtainMessage(int what) {
         return mH.obtainMessage(what);
     }
@@ -121,6 +130,7 @@
         return mH.obtainMessage(what, arg1 ? 1 : 0, 0, args);
     }
     
+    @UnsupportedAppUsage
     public Message obtainMessageO(int what, Object arg1) {
         return mH.obtainMessage(what, 0, 0, arg1);
     }
@@ -133,6 +143,7 @@
         return mH.obtainMessage(what, arg1, arg2);
     }
     
+    @UnsupportedAppUsage
     public Message obtainMessageIO(int what, int arg1, Object arg2) {
         return mH.obtainMessage(what, arg1, 0, arg2);
     }
@@ -149,6 +160,7 @@
         return mH.obtainMessage(what, arg1, arg2, args);
     }
     
+    @UnsupportedAppUsage
     public Message obtainMessageIOO(int what, int arg1, Object arg2, Object arg3) {
         SomeArgs args = SomeArgs.obtain();
         args.arg1 = arg2;
@@ -183,6 +195,7 @@
         return mH.obtainMessage(what, arg1, arg2, args);
     }
 
+    @UnsupportedAppUsage
     public Message obtainMessageOO(int what, Object arg1, Object arg2) {
         SomeArgs args = SomeArgs.obtain();
         args.arg1 = arg1;
@@ -190,6 +203,7 @@
         return mH.obtainMessage(what, 0, 0, args);
     }
     
+    @UnsupportedAppUsage
     public Message obtainMessageOOO(int what, Object arg1, Object arg2, Object arg3) {
         SomeArgs args = SomeArgs.obtain();
         args.arg1 = arg1;
diff --git a/core/java/com/android/internal/os/PowerProfile.java b/core/java/com/android/internal/os/PowerProfile.java
index 246a50f..997b722 100644
--- a/core/java/com/android/internal/os/PowerProfile.java
+++ b/core/java/com/android/internal/os/PowerProfile.java
@@ -17,6 +17,7 @@
 package com.android.internal.os;
 
 
+import android.annotation.UnsupportedAppUsage;
 import android.content.Context;
 import android.content.res.Resources;
 import android.content.res.XmlResourceParser;
@@ -57,22 +58,27 @@
      *               + core_power.cluster1 * num running cores in cluster 1
      */
     public static final String POWER_CPU_SUSPEND = "cpu.suspend";
+    @UnsupportedAppUsage
     public static final String POWER_CPU_IDLE = "cpu.idle";
+    @UnsupportedAppUsage
     public static final String POWER_CPU_ACTIVE = "cpu.active";
 
     /**
      * Power consumption when WiFi driver is scanning for networks.
      */
+    @UnsupportedAppUsage
     public static final String POWER_WIFI_SCAN = "wifi.scan";
 
     /**
      * Power consumption when WiFi driver is on.
      */
+    @UnsupportedAppUsage
     public static final String POWER_WIFI_ON = "wifi.on";
 
     /**
      * Power consumption when WiFi driver is transmitting/receiving.
      */
+    @UnsupportedAppUsage
     public static final String POWER_WIFI_ACTIVE = "wifi.active";
 
     //
@@ -101,6 +107,7 @@
     /**
      * Power consumption when GPS is on.
      */
+    @UnsupportedAppUsage
     public static final String POWER_GPS_ON = "gps.on";
 
     /**
@@ -115,6 +122,7 @@
      * @deprecated
      */
     @Deprecated
+    @UnsupportedAppUsage
     public static final String POWER_BLUETOOTH_ON = "bluetooth.on";
 
     /**
@@ -131,6 +139,7 @@
      * @deprecated
      */
     @Deprecated
+    @UnsupportedAppUsage
     public static final String POWER_BLUETOOTH_AT_CMD = "bluetooth.at";
 
     /**
@@ -141,27 +150,32 @@
     /**
      * Power consumption when screen is on, not including the backlight power.
      */
+    @UnsupportedAppUsage
     public static final String POWER_SCREEN_ON = "screen.on";
 
     /**
      * Power consumption when cell radio is on but not on a call.
      */
+    @UnsupportedAppUsage
     public static final String POWER_RADIO_ON = "radio.on";
 
     /**
      * Power consumption when cell radio is hunting for a signal.
      */
+    @UnsupportedAppUsage
     public static final String POWER_RADIO_SCANNING = "radio.scanning";
 
     /**
      * Power consumption when talking on the phone.
      */
+    @UnsupportedAppUsage
     public static final String POWER_RADIO_ACTIVE = "radio.active";
 
     /**
      * Power consumption at full backlight brightness. If the backlight is at
      * 50% brightness, then this should be multiplied by 0.5
      */
+    @UnsupportedAppUsage
     public static final String POWER_SCREEN_FULL = "screen.full";
 
     /**
@@ -224,6 +238,7 @@
     private static final Object sLock = new Object();
 
     @VisibleForTesting
+    @UnsupportedAppUsage
     public PowerProfile(Context context) {
         this(context, false);
     }
@@ -371,6 +386,7 @@
         }
     }
 
+    @UnsupportedAppUsage
     public int getNumCpuClusters() {
         return mCpuClusters.length;
     }
@@ -379,6 +395,7 @@
         return mCpuClusters[cluster].numCpus;
     }
 
+    @UnsupportedAppUsage
     public int getNumSpeedStepsInCpuCluster(int cluster) {
         if (cluster < 0 || cluster >= mCpuClusters.length) {
             return 0; // index out of bound
@@ -442,6 +459,7 @@
      * @param type the subsystem type
      * @return the average current in milliAmps.
      */
+    @UnsupportedAppUsage
     public double getAveragePower(String type) {
         return getAveragePowerOrDefault(type, 0);
     }
@@ -455,6 +473,7 @@
      *              If there is no data for multiple levels, the level is ignored.
      * @return the average current in milliAmps.
      */
+    @UnsupportedAppUsage
     public double getAveragePower(String type, int level) {
         if (sPowerItemMap.containsKey(type)) {
             return sPowerItemMap.get(type);
@@ -478,6 +497,7 @@
      *
      * @return the battery capacity in mAh
      */
+    @UnsupportedAppUsage
     public double getBatteryCapacity() {
         return getAveragePower(POWER_BATTERY_CAPACITY);
     }
diff --git a/core/java/com/android/internal/os/SomeArgs.java b/core/java/com/android/internal/os/SomeArgs.java
index d9aa325..b9d53c1 100644
--- a/core/java/com/android/internal/os/SomeArgs.java
+++ b/core/java/com/android/internal/os/SomeArgs.java
@@ -16,6 +16,8 @@
 
 package com.android.internal.os;
 
+import android.annotation.UnsupportedAppUsage;
+
 /**
  * Helper class for passing more arguments though a message
  * and avoiding allocation of a custom class for wrapping the
@@ -40,8 +42,11 @@
     static final int WAIT_FINISHED = 2;
     int mWaitState = WAIT_NONE;
 
+    @UnsupportedAppUsage
     public Object arg1;
+    @UnsupportedAppUsage
     public Object arg2;
+    @UnsupportedAppUsage
     public Object arg3;
     public Object arg4;
     public Object arg5;
@@ -50,7 +55,9 @@
     public Object arg8;
     public Object arg9;
     public int argi1;
+    @UnsupportedAppUsage
     public int argi2;
+    @UnsupportedAppUsage
     public int argi3;
     public int argi4;
     public int argi5;
@@ -60,6 +67,7 @@
         /* do nothing - reduce visibility */
     }
 
+    @UnsupportedAppUsage
     public static SomeArgs obtain() {
         synchronized (sPoolLock) {
             if (sPoolSize > 0) {
@@ -85,6 +93,7 @@
         }
     }
 
+    @UnsupportedAppUsage
     public void recycle() {
         if (mInPool) {
             throw new IllegalStateException("Already recycled.");
diff --git a/core/java/com/android/internal/statusbar/IStatusBarService.aidl b/core/java/com/android/internal/statusbar/IStatusBarService.aidl
index a79e15a..b3af147 100644
--- a/core/java/com/android/internal/statusbar/IStatusBarService.aidl
+++ b/core/java/com/android/internal/statusbar/IStatusBarService.aidl
@@ -60,7 +60,7 @@
             int uid, int initialPid, String message, int userId);
     void onClearAllNotifications(int userId);
     void onNotificationClear(String pkg, String tag, int id, int userId, String key,
-            int dismissalSurface, in NotificationVisibility nv);
+            int dismissalSurface, int dismissalSentiment, in NotificationVisibility nv);
     void onNotificationVisibilityChanged( in NotificationVisibility[] newlyVisibleKeys,
             in NotificationVisibility[] noLongerVisibleKeys);
     void onNotificationExpansionChanged(in String key, in boolean userAction, in boolean expanded);
diff --git a/core/java/com/android/internal/util/AsyncChannel.java b/core/java/com/android/internal/util/AsyncChannel.java
index e760f25..69297b5 100644
--- a/core/java/com/android/internal/util/AsyncChannel.java
+++ b/core/java/com/android/internal/util/AsyncChannel.java
@@ -16,6 +16,7 @@
 
 package com.android.internal.util;
 
+import android.annotation.UnsupportedAppUsage;
 import android.content.ComponentName;
 import android.content.Context;
 import android.content.Intent;
@@ -105,6 +106,7 @@
      * msg.obj  == the AsyncChannel
      * msg.replyTo == dstMessenger if successful
      */
+    @UnsupportedAppUsage
     public static final int CMD_CHANNEL_HALF_CONNECTED = BASE + 0;
 
     /**
@@ -114,6 +116,7 @@
      *
      * msg.replyTo = srcMessenger.
      */
+    @UnsupportedAppUsage
     public static final int CMD_CHANNEL_FULL_CONNECTION = BASE + 1;
 
     /**
@@ -159,6 +162,7 @@
         sCmdToString[CMD_CHANNEL_DISCONNECT - BASE] = "CMD_CHANNEL_DISCONNECT";
         sCmdToString[CMD_CHANNEL_DISCONNECTED - BASE] = "CMD_CHANNEL_DISCONNECTED";
     }
+    @UnsupportedAppUsage
     protected static String cmdToString(int cmd) {
         cmd -= BASE;
         if ((cmd >= 0) && (cmd < sCmdToString.length)) {
@@ -169,6 +173,7 @@
     }
 
     /** Successful status always 0, !0 is an unsuccessful status */
+    @UnsupportedAppUsage
     public static final int STATUS_SUCCESSFUL = 0;
 
     /** Error attempting to bind on a connect */
@@ -204,6 +209,7 @@
     /**
      * AsyncChannel constructor
      */
+    @UnsupportedAppUsage
     public AsyncChannel() {
     }
 
@@ -255,6 +261,7 @@
      *
      * @return STATUS_SUCCESSFUL on success any other value is an error.
      */
+    @UnsupportedAppUsage
     public int connectSync(Context srcContext, Handler srcHandler, Messenger dstMessenger) {
         if (DBG) log("halfConnectSync srcHandler to the dstMessenger  E");
 
@@ -370,6 +377,7 @@
      * @param srcHandler
      * @param dstMessenger
      */
+    @UnsupportedAppUsage
     public void connect(Context srcContext, Handler srcHandler, Messenger dstMessenger) {
         if (DBG) log("connect srcHandler to the dstMessenger  E");
 
@@ -392,6 +400,7 @@
      * @param srcHandler
      * @param dstMessenger
      */
+    @UnsupportedAppUsage
     public void connected(Context srcContext, Handler srcHandler, Messenger dstMessenger) {
         if (DBG) log("connected srcHandler to the dstMessenger  E");
 
@@ -446,6 +455,7 @@
     /**
      * Disconnect
      */
+    @UnsupportedAppUsage
     public void disconnect() {
         if ((mConnection != null) && (mSrcContext != null)) {
             mSrcContext.unbindService(mConnection);
@@ -475,6 +485,7 @@
      *
      * @param msg
      */
+    @UnsupportedAppUsage
     public void sendMessage(Message msg) {
         msg.replyTo = mSrcMessenger;
         try {
@@ -489,6 +500,7 @@
      *
      * @param what
      */
+    @UnsupportedAppUsage
     public void sendMessage(int what) {
         Message msg = Message.obtain();
         msg.what = what;
@@ -501,6 +513,7 @@
      * @param what
      * @param arg1
      */
+    @UnsupportedAppUsage
     public void sendMessage(int what, int arg1) {
         Message msg = Message.obtain();
         msg.what = what;
@@ -515,6 +528,7 @@
      * @param arg1
      * @param arg2
      */
+    @UnsupportedAppUsage
     public void sendMessage(int what, int arg1, int arg2) {
         Message msg = Message.obtain();
         msg.what = what;
@@ -531,6 +545,7 @@
      * @param arg2
      * @param obj
      */
+    @UnsupportedAppUsage
     public void sendMessage(int what, int arg1, int arg2, Object obj) {
         Message msg = Message.obtain();
         msg.what = what;
@@ -559,6 +574,7 @@
      * @param srcMsg
      * @param dstMsg
      */
+    @UnsupportedAppUsage
     public void replyToMessage(Message srcMsg, Message dstMsg) {
         try {
             dstMsg.replyTo = mSrcMessenger;
@@ -575,6 +591,7 @@
      * @param srcMsg
      * @param what
      */
+    @UnsupportedAppUsage
     public void replyToMessage(Message srcMsg, int what) {
         Message msg = Message.obtain();
         msg.what = what;
@@ -588,6 +605,7 @@
      * @param what
      * @param arg1
      */
+    @UnsupportedAppUsage
     public void replyToMessage(Message srcMsg, int what, int arg1) {
         Message msg = Message.obtain();
         msg.what = what;
@@ -620,6 +638,7 @@
      * @param arg2
      * @param obj
      */
+    @UnsupportedAppUsage
     public void replyToMessage(Message srcMsg, int what, int arg1, int arg2, Object obj) {
         Message msg = Message.obtain();
         msg.what = what;
@@ -636,6 +655,7 @@
      * @param what
      * @param obj
      */
+    @UnsupportedAppUsage
     public void replyToMessage(Message srcMsg, int what, Object obj) {
         Message msg = Message.obtain();
         msg.what = what;
@@ -649,6 +669,7 @@
      * @param msg to send
      * @return reply message or null if an error.
      */
+    @UnsupportedAppUsage
     public Message sendMessageSynchronously(Message msg) {
         Message resultMsg = SyncMessenger.sendMessageSynchronously(mDstMessenger, msg);
         return resultMsg;
@@ -690,6 +711,7 @@
      * @param arg2
      * @return reply message or null if an error.
      */
+    @UnsupportedAppUsage
     public Message sendMessageSynchronously(int what, int arg1, int arg2) {
         Message msg = Message.obtain();
         msg.what = what;
diff --git a/core/java/com/android/internal/util/FastPrintWriter.java b/core/java/com/android/internal/util/FastPrintWriter.java
index cc2c4cf..981fbaa 100644
--- a/core/java/com/android/internal/util/FastPrintWriter.java
+++ b/core/java/com/android/internal/util/FastPrintWriter.java
@@ -16,6 +16,7 @@
 
 package com.android.internal.util;
 
+import android.annotation.UnsupportedAppUsage;
 import android.util.Log;
 import android.util.Printer;
 
@@ -77,6 +78,7 @@
      * @throws NullPointerException
      *             if {@code out} is {@code null}.
      */
+    @UnsupportedAppUsage
     public FastPrintWriter(OutputStream out) {
         this(out, false, 8192);
     }
diff --git a/core/java/com/android/internal/util/IndentingPrintWriter.java b/core/java/com/android/internal/util/IndentingPrintWriter.java
index e453866..03a555e 100644
--- a/core/java/com/android/internal/util/IndentingPrintWriter.java
+++ b/core/java/com/android/internal/util/IndentingPrintWriter.java
@@ -16,6 +16,7 @@
 
 package com.android.internal.util;
 
+import android.annotation.UnsupportedAppUsage;
 import java.io.PrintWriter;
 import java.io.Writer;
 import java.util.Arrays;
@@ -47,6 +48,7 @@
 
     private char[] mSingleChar = new char[1];
 
+    @UnsupportedAppUsage
     public IndentingPrintWriter(Writer writer, String singleIndent) {
         this(writer, singleIndent, -1);
     }
@@ -72,12 +74,14 @@
         return this;
     }
 
+    @UnsupportedAppUsage
     public IndentingPrintWriter increaseIndent() {
         mIndentBuilder.append(mSingleIndent);
         mCurrentIndent = null;
         return this;
     }
 
+    @UnsupportedAppUsage
     public IndentingPrintWriter decreaseIndent() {
         mIndentBuilder.delete(0, mSingleIndent.length());
         mCurrentIndent = null;
diff --git a/core/java/com/android/internal/util/JournaledFile.java b/core/java/com/android/internal/util/JournaledFile.java
index 5372fc0..258db2a 100644
--- a/core/java/com/android/internal/util/JournaledFile.java
+++ b/core/java/com/android/internal/util/JournaledFile.java
@@ -16,6 +16,8 @@
 
 package com.android.internal.util;
 
+import android.annotation.UnsupportedAppUsage;
+
 import java.io.File;
 import java.io.IOException;
 
@@ -33,6 +35,7 @@
     File mTemp;
     boolean mWriting;
 
+    @UnsupportedAppUsage
     public JournaledFile(File real, File temp) {
         mReal = real;
         mTemp = temp;
@@ -44,6 +47,7 @@
      * it to the real one.  If there is both a real file and a temp one, assumes that the
      * temp one isn't fully written and deletes it.
      */
+    @UnsupportedAppUsage
     public File chooseForRead() {
         File result;
         if (mReal.exists()) {
@@ -68,6 +72,7 @@
      * <p>
      * Call {@link #commit} to commit the changes, or {@link #rollback} to forget the changes.
      */
+    @UnsupportedAppUsage
     public File chooseForWrite() {
         if (mWriting) {
             throw new IllegalStateException("uncommitted write already in progress");
@@ -95,6 +100,7 @@
     /**
      * Commit changes.
      */
+    @UnsupportedAppUsage
     public void commit() {
         if (!mWriting) {
             throw new IllegalStateException("no file to commit");
@@ -106,6 +112,7 @@
     /**
      * Roll back changes.
      */
+    @UnsupportedAppUsage
     public void rollback() {
         if (!mWriting) {
             throw new IllegalStateException("no file to roll back");
diff --git a/core/java/com/android/internal/util/XmlUtils.java b/core/java/com/android/internal/util/XmlUtils.java
index 3188d30..5da587b 100644
--- a/core/java/com/android/internal/util/XmlUtils.java
+++ b/core/java/com/android/internal/util/XmlUtils.java
@@ -16,6 +16,7 @@
 
 package com.android.internal.util;
 
+import android.annotation.UnsupportedAppUsage;
 import android.graphics.Bitmap;
 import android.graphics.BitmapFactory;
 import android.graphics.Bitmap.CompressFormat;
@@ -48,6 +49,7 @@
 
     private static final String STRING_ARRAY_SEPARATOR = ":";
 
+    @UnsupportedAppUsage
     public static void skipCurrentTag(XmlPullParser parser)
             throws XmlPullParserException, IOException {
         int outerDepth = parser.getDepth();
@@ -71,6 +73,7 @@
         return defaultValue;
     }
 
+    @UnsupportedAppUsage
     public static final boolean
     convertValueToBoolean(CharSequence value, boolean defaultValue)
     {
@@ -87,6 +90,7 @@
         return result;
     }
 
+    @UnsupportedAppUsage
     public static final int
     convertValueToInt(CharSequence charSeq, int defaultValue)
     {
@@ -183,6 +187,7 @@
      * @see #writeValueXml
      * @see #readMapXml
      */
+    @UnsupportedAppUsage
     public static final void writeMapXml(Map val, OutputStream out)
             throws XmlPullParserException, java.io.IOException {
         XmlSerializer serializer = new FastXmlSerializer();
@@ -732,6 +737,7 @@
      * #see #writeMapXml
      */
     @SuppressWarnings("unchecked")
+    @UnsupportedAppUsage
     public static final HashMap<String, ?> readMapXml(InputStream in)
     throws XmlPullParserException, java.io.IOException
     {
@@ -1550,6 +1556,7 @@
         }
     }
 
+    @UnsupportedAppUsage
     public static final void beginDocument(XmlPullParser parser, String firstElementName) throws XmlPullParserException, IOException
     {
         int type;
@@ -1568,6 +1575,7 @@
         }
     }
 
+    @UnsupportedAppUsage
     public static final void nextElement(XmlPullParser parser) throws XmlPullParserException, IOException
     {
         int type;
diff --git a/core/java/com/android/internal/view/BaseIWindow.java b/core/java/com/android/internal/view/BaseIWindow.java
index 7178a0d..e3490f1 100644
--- a/core/java/com/android/internal/view/BaseIWindow.java
+++ b/core/java/com/android/internal/view/BaseIWindow.java
@@ -16,6 +16,7 @@
 
 package com.android.internal.view;
 
+import android.annotation.UnsupportedAppUsage;
 import android.graphics.Rect;
 import android.hardware.input.InputManager;
 import android.os.Bundle;
diff --git a/core/java/com/android/internal/view/IInputConnectionWrapper.java b/core/java/com/android/internal/view/IInputConnectionWrapper.java
index 28291ae..189c8d5 100644
--- a/core/java/com/android/internal/view/IInputConnectionWrapper.java
+++ b/core/java/com/android/internal/view/IInputConnectionWrapper.java
@@ -21,6 +21,7 @@
 
 import android.annotation.NonNull;
 import android.annotation.Nullable;
+import android.annotation.UnsupportedAppUsage;
 import android.os.Bundle;
 import android.os.Handler;
 import android.os.Looper;
@@ -67,10 +68,12 @@
 
     @GuardedBy("mLock")
     @Nullable
+    @UnsupportedAppUsage
     private InputConnection mInputConnection;
 
     private Looper mMainLooper;
     private Handler mH;
+    @UnsupportedAppUsage
     private Object mLock = new Object();
     @GuardedBy("mLock")
     private boolean mFinished = false;
diff --git a/core/java/com/android/internal/view/InputBindResult.java b/core/java/com/android/internal/view/InputBindResult.java
index f05bd32..9d4383f 100644
--- a/core/java/com/android/internal/view/InputBindResult.java
+++ b/core/java/com/android/internal/view/InputBindResult.java
@@ -19,6 +19,7 @@
 import static java.lang.annotation.RetentionPolicy.SOURCE;
 
 import android.annotation.IntDef;
+import android.annotation.UnsupportedAppUsage;
 import android.content.ComponentName;
 import android.content.Intent;
 import android.content.ServiceConnection;
@@ -151,6 +152,7 @@
     /**
      * The input method service.
      */
+    @UnsupportedAppUsage
     public final IInputMethodSession method;
 
     /**
@@ -230,6 +232,7 @@
     /**
      * Used to make this class parcelable.
      */
+    @UnsupportedAppUsage
     public static final Parcelable.Creator<InputBindResult> CREATOR =
             new Parcelable.Creator<InputBindResult>() {
         @Override
diff --git a/core/java/com/android/internal/view/menu/ActionMenuItemView.java b/core/java/com/android/internal/view/menu/ActionMenuItemView.java
index 92e1d80..eb94db3 100644
--- a/core/java/com/android/internal/view/menu/ActionMenuItemView.java
+++ b/core/java/com/android/internal/view/menu/ActionMenuItemView.java
@@ -16,6 +16,7 @@
 
 package com.android.internal.view.menu;
 
+import android.annotation.UnsupportedAppUsage;
 import android.content.Context;
 import android.content.res.Configuration;
 import android.content.res.Resources;
@@ -224,6 +225,7 @@
         updateTextButtonVisibility();
     }
 
+    @UnsupportedAppUsage
     public boolean hasText() {
         return !TextUtils.isEmpty(getText());
     }
diff --git a/core/java/com/android/internal/view/menu/MenuBuilder.java b/core/java/com/android/internal/view/menu/MenuBuilder.java
index 48485e0..0e07ca7 100644
--- a/core/java/com/android/internal/view/menu/MenuBuilder.java
+++ b/core/java/com/android/internal/view/menu/MenuBuilder.java
@@ -18,6 +18,7 @@
 
 
 import android.annotation.NonNull;
+import android.annotation.UnsupportedAppUsage;
 import android.content.ComponentName;
 import android.content.Context;
 import android.content.Intent;
@@ -64,6 +65,7 @@
         0, /* SELECTED_ALTERNATIVE */
     };
 
+    @UnsupportedAppUsage
     private final Context mContext;
     private final Resources mResources;
 
@@ -173,6 +175,7 @@
          * @param item The menu item that is selected
          * @return whether the menu item selection was handled
          */
+        @UnsupportedAppUsage
         public boolean onMenuItemSelected(MenuBuilder menu, MenuItem item);
         
         /**
@@ -180,6 +183,7 @@
          * 
          * @param menu the menu that has changed modes
          */
+        @UnsupportedAppUsage
         public void onMenuModeChange(MenuBuilder menu);
     }
 
@@ -190,6 +194,7 @@
         public boolean invokeItem(MenuItemImpl item);
     }
 
+    @UnsupportedAppUsage
     public MenuBuilder(Context context) {
         mContext = context;
         mResources = context.getResources();
@@ -205,6 +210,7 @@
         setShortcutsVisibleInner(true);
     }
     
+    @UnsupportedAppUsage
     public MenuBuilder setDefaultShowAsAction(int defaultShowAsAction) {
         mDefaultShowAsAction = defaultShowAsAction;
         return this;
@@ -217,6 +223,7 @@
      *
      * @param presenter The presenter to add
      */
+    @UnsupportedAppUsage
     public void addMenuPresenter(MenuPresenter presenter) {
         addMenuPresenter(presenter, mContext);
     }
@@ -230,6 +237,7 @@
      * @param presenter The presenter to add
      * @param menuContext The context used to inflate menu items
      */
+    @UnsupportedAppUsage
     public void addMenuPresenter(MenuPresenter presenter, Context menuContext) {
         mPresenters.add(new WeakReference<MenuPresenter>(presenter));
         presenter.initForMenu(menuContext, this);
@@ -242,6 +250,7 @@
      *
      * @param presenter The presenter to remove
      */
+    @UnsupportedAppUsage
     public void removeMenuPresenter(MenuPresenter presenter) {
         for (WeakReference<MenuPresenter> ref : mPresenters) {
             final MenuPresenter item = ref.get();
@@ -401,6 +410,7 @@
         return ACTION_VIEW_STATES_KEY;
     }
 
+    @UnsupportedAppUsage
     public void setCallback(Callback cb) {
         mCallback = cb;
     }
@@ -768,6 +778,7 @@
         return mResources;
     }
     
+    @UnsupportedAppUsage
     public Context getContext() {
         return mContext;
     }
@@ -1004,6 +1015,7 @@
      * {@link #startDispatchingItemsChanged()} is called. Useful when
      * many menu operations are going to be performed as a batch.
      */
+    @UnsupportedAppUsage
     public void stopDispatchingItemsChanged() {
         if (!mPreventDispatchingItemsChanged) {
             mPreventDispatchingItemsChanged = true;
@@ -1011,6 +1023,7 @@
         }
     }
 
+    @UnsupportedAppUsage
     public void startDispatchingItemsChanged() {
         mPreventDispatchingItemsChanged = false;
 
@@ -1041,6 +1054,7 @@
     }
 
     @NonNull
+    @UnsupportedAppUsage
     public ArrayList<MenuItemImpl> getVisibleItems() {
         if (!mIsVisibleItemsStale) return mVisibleItems;
 
@@ -1131,6 +1145,7 @@
         return mActionItems;
     }
     
+    @UnsupportedAppUsage
     public ArrayList<MenuItemImpl> getNonActionItems() {
         flagActionItems();
         return mNonActionItems;
@@ -1235,10 +1250,12 @@
         return this;
     }
     
+    @UnsupportedAppUsage
     public CharSequence getHeaderTitle() {
         return mHeaderTitle;
     }
     
+    @UnsupportedAppUsage
     public Drawable getHeaderIcon() {
         return mHeaderIcon;
     }
@@ -1251,6 +1268,7 @@
      * Gets the root menu (if this is a submenu, find its root menu).
      * @return The root menu.
      */
+    @UnsupportedAppUsage
     public MenuBuilder getRootMenu() {
         return this;
     }
@@ -1262,10 +1280,12 @@
      * 
      * @param menuInfo The extra menu information to add.
      */
+    @UnsupportedAppUsage
     public void setCurrentMenuInfo(ContextMenuInfo menuInfo) {
         mCurrentMenuInfo = menuInfo;
     }
 
+    @UnsupportedAppUsage
     void setOptionalIconsVisible(boolean visible) {
         mOptionalIconsVisible = visible;
     }
@@ -1296,6 +1316,7 @@
         return expanded;
     }
 
+    @UnsupportedAppUsage
     public boolean collapseItemActionView(MenuItemImpl item) {
         if (mPresenters.isEmpty() || mExpandedItem != item) return false;
 
diff --git a/core/java/com/android/internal/view/menu/MenuItemImpl.java b/core/java/com/android/internal/view/menu/MenuItemImpl.java
index 0c5ea63..994a9c1 100644
--- a/core/java/com/android/internal/view/menu/MenuItemImpl.java
+++ b/core/java/com/android/internal/view/menu/MenuItemImpl.java
@@ -19,6 +19,7 @@
 import com.android.internal.view.menu.MenuView.ItemView;
 
 import android.annotation.Nullable;
+import android.annotation.UnsupportedAppUsage;
 import android.content.ActivityNotFoundException;
 import android.content.Context;
 import android.content.Intent;
@@ -67,6 +68,7 @@
      * needed (if the Drawable isn't already obtained--only one of the two is
      * needed).
      */
+    @UnsupportedAppUsage
     private int mIconResId = NO_ICON;
 
     private ColorStateList mIconTintList = null;
@@ -139,6 +141,7 @@
      *
      * @return true if the invocation was handled, false otherwise
      */
+    @UnsupportedAppUsage
     public boolean invoke() {
         if (mClickListener != null &&
             mClickListener.onMenuItemClick(this)) {
@@ -565,6 +568,7 @@
         return this;
     }
 
+    @UnsupportedAppUsage
     public void setExclusiveCheckable(boolean exclusive) {
         mFlags = (mFlags & ~EXCLUSIVE) | (exclusive ? EXCLUSIVE : 0);
     }
@@ -638,6 +642,7 @@
         return mTitle != null ? mTitle.toString() : null;
     }
 
+    @UnsupportedAppUsage
     void setMenuInfo(ContextMenuInfo menuInfo) {
         mMenuInfo = menuInfo;
     }
@@ -657,14 +662,17 @@
         return mMenu.getOptionalIconsVisible();
     }
 
+    @UnsupportedAppUsage
     public boolean isActionButton() {
         return (mFlags & IS_ACTION) == IS_ACTION;
     }
 
+    @UnsupportedAppUsage
     public boolean requestsActionButton() {
         return (mShowAsAction & SHOW_AS_ACTION_IF_ROOM) == SHOW_AS_ACTION_IF_ROOM;
     }
 
+    @UnsupportedAppUsage
     public boolean requiresActionButton() {
         return (mShowAsAction & SHOW_AS_ACTION_ALWAYS) == SHOW_AS_ACTION_ALWAYS;
     }
@@ -806,6 +814,7 @@
         return false;
     }
 
+    @UnsupportedAppUsage
     public void setActionViewExpanded(boolean isExpanded) {
         mIsActionViewExpanded = isExpanded;
         mMenu.onItemsChanged(false);
diff --git a/core/java/com/android/internal/view/menu/MenuPopupHelper.java b/core/java/com/android/internal/view/menu/MenuPopupHelper.java
index 324f923..e6d3460 100644
--- a/core/java/com/android/internal/view/menu/MenuPopupHelper.java
+++ b/core/java/com/android/internal/view/menu/MenuPopupHelper.java
@@ -22,6 +22,7 @@
 import android.annotation.NonNull;
 import android.annotation.Nullable;
 import android.annotation.StyleRes;
+import android.annotation.UnsupportedAppUsage;
 import android.content.Context;
 import android.graphics.Point;
 import android.graphics.Rect;
@@ -49,16 +50,19 @@
     // Mutable cached popup menu properties.
     private View mAnchorView;
     private int mDropDownGravity = Gravity.START;
+    @UnsupportedAppUsage
     private boolean mForceShowIcon;
     private Callback mPresenterCallback;
 
     private MenuPopup mPopup;
     private OnDismissListener mOnDismissListener;
 
+    @UnsupportedAppUsage
     public MenuPopupHelper(@NonNull Context context, @NonNull MenuBuilder menu) {
         this(context, menu, null, false, com.android.internal.R.attr.popupMenuStyle, 0);
     }
 
+    @UnsupportedAppUsage
     public MenuPopupHelper(@NonNull Context context, @NonNull MenuBuilder menu,
             @NonNull View anchorView) {
         this(context, menu, anchorView, false, com.android.internal.R.attr.popupMenuStyle, 0);
@@ -92,6 +96,7 @@
       *
       * @param anchor the view to which the popup window should be anchored
       */
+    @UnsupportedAppUsage
     public void setAnchorView(@NonNull View anchor) {
         mAnchorView = anchor;
     }
@@ -105,6 +110,7 @@
      * @param forceShowIcon {@code true} to force icons to be shown, or
      *                  {@code false} for icons to be optionally shown
      */
+    @UnsupportedAppUsage
     public void setForceShowIcon(boolean forceShowIcon) {
         mForceShowIcon = forceShowIcon;
         if (mPopup != null) {
@@ -119,6 +125,7 @@
       *
       * @param gravity alignment of the popup relative to the anchor
       */
+    @UnsupportedAppUsage
     public void setGravity(int gravity) {
         mDropDownGravity = gravity;
     }
@@ -130,6 +137,7 @@
         return mDropDownGravity;
     }
 
+    @UnsupportedAppUsage
     public void show() {
         if (!tryShow()) {
             throw new IllegalStateException("MenuPopupHelper cannot be used without an anchor");
@@ -143,6 +151,7 @@
     }
 
     @NonNull
+    @UnsupportedAppUsage
     public MenuPopup getPopup() {
         if (mPopup == null) {
             mPopup = createPopup();
@@ -156,6 +165,7 @@
      * @return {@code true} if the popup was shown or was already showing prior to calling this
      *         method, {@code false} otherwise
      */
+    @UnsupportedAppUsage
     public boolean tryShow() {
         if (isShowing()) {
             return true;
@@ -280,6 +290,7 @@
      * Dismisses the popup, if showing.
      */
     @Override
+    @UnsupportedAppUsage
     public void dismiss() {
         if (isShowing()) {
             mPopup.dismiss();
diff --git a/core/java/com/android/internal/view/menu/MenuPresenter.java b/core/java/com/android/internal/view/menu/MenuPresenter.java
index 65bdc09..c5df8ad 100644
--- a/core/java/com/android/internal/view/menu/MenuPresenter.java
+++ b/core/java/com/android/internal/view/menu/MenuPresenter.java
@@ -18,6 +18,7 @@
 
 import android.annotation.NonNull;
 import android.annotation.Nullable;
+import android.annotation.UnsupportedAppUsage;
 import android.content.Context;
 import android.os.Parcelable;
 import android.view.ViewGroup;
@@ -47,6 +48,7 @@
          * @return true if the Callback will handle presenting the submenu, false if
          *         the presenter should attempt to do so.
          */
+        @UnsupportedAppUsage
         public boolean onOpenSubMenu(MenuBuilder subMenu);
     }
 
diff --git a/core/java/com/android/internal/view/menu/MenuView.java b/core/java/com/android/internal/view/menu/MenuView.java
index 407caae..67a5530 100644
--- a/core/java/com/android/internal/view/menu/MenuView.java
+++ b/core/java/com/android/internal/view/menu/MenuView.java
@@ -19,6 +19,7 @@
 import com.android.internal.view.menu.MenuBuilder;
 import com.android.internal.view.menu.MenuItemImpl;
 
+import android.annotation.UnsupportedAppUsage;
 import android.graphics.drawable.Drawable;
 
 /**
@@ -40,6 +41,7 @@
      * Returns the default animations to be used for this menu when entering/exiting.
      * @return A resource ID for the default animations to be used for this menu.
      */
+    @UnsupportedAppUsage
     public int getWindowAnimations();
     
     /**
@@ -61,6 +63,7 @@
          * Gets the item data that this view is displaying.
          * @return the item data, or null if there is not one
          */
+        @UnsupportedAppUsage
         public MenuItemImpl getItemData();
         
         /**
diff --git a/core/java/com/android/internal/view/menu/SubMenuBuilder.java b/core/java/com/android/internal/view/menu/SubMenuBuilder.java
index 897440e..cf6d974 100644
--- a/core/java/com/android/internal/view/menu/SubMenuBuilder.java
+++ b/core/java/com/android/internal/view/menu/SubMenuBuilder.java
@@ -16,6 +16,7 @@
 
 package com.android.internal.view.menu;
 
+import android.annotation.UnsupportedAppUsage;
 import android.content.Context;
 import android.graphics.drawable.Drawable;
 import android.view.Menu;
@@ -67,11 +68,13 @@
     }
 
     @Override
+    @UnsupportedAppUsage
     public void setCallback(Callback callback) {
         mParentMenu.setCallback(callback);
     }
 
     @Override
+    @UnsupportedAppUsage
     public MenuBuilder getRootMenu() {
         return mParentMenu.getRootMenu();
     }
diff --git a/core/java/com/android/internal/widget/CachingIconView.java b/core/java/com/android/internal/widget/CachingIconView.java
index f3b6552..35bff6d 100644
--- a/core/java/com/android/internal/widget/CachingIconView.java
+++ b/core/java/com/android/internal/widget/CachingIconView.java
@@ -18,6 +18,7 @@
 
 import android.annotation.DrawableRes;
 import android.annotation.Nullable;
+import android.annotation.UnsupportedAppUsage;
 import android.content.Context;
 import android.content.res.Configuration;
 import android.graphics.Bitmap;
@@ -44,6 +45,7 @@
     private boolean mForceHidden;
     private int mDesiredVisibility;
 
+    @UnsupportedAppUsage
     public CachingIconView(Context context, @Nullable AttributeSet attrs) {
         super(context, attrs);
     }
diff --git a/core/java/com/android/internal/widget/ScrollingTabContainerView.java b/core/java/com/android/internal/widget/ScrollingTabContainerView.java
index 311bfac..5d48ab9 100644
--- a/core/java/com/android/internal/widget/ScrollingTabContainerView.java
+++ b/core/java/com/android/internal/widget/ScrollingTabContainerView.java
@@ -20,6 +20,7 @@
 import android.animation.Animator;
 import android.animation.ObjectAnimator;
 import android.animation.TimeInterpolator;
+import android.annotation.UnsupportedAppUsage;
 import android.app.ActionBar;
 import android.content.Context;
 import android.content.res.Configuration;
@@ -67,6 +68,7 @@
 
     private static final int FADE_DURATION = 200;
 
+    @UnsupportedAppUsage
     public ScrollingTabContainerView(Context context) {
         super(context);
         setHorizontalScrollBarEnabled(false);
@@ -134,6 +136,7 @@
         return mTabSpinner != null && mTabSpinner.getParent() == this;
     }
 
+    @UnsupportedAppUsage
     public void setAllowCollapse(boolean allowCollapse) {
         mAllowCollapse = allowCollapse;
     }
@@ -169,6 +172,7 @@
         return false;
     }
 
+    @UnsupportedAppUsage
     public void setTabSelected(int position) {
         mSelectedTabIndex = position;
         final int tabCount = mTabLayout.getChildCount();
@@ -220,6 +224,7 @@
         mStackedTabMaxWidth = abp.getStackedTabMaxWidth();
     }
 
+    @UnsupportedAppUsage
     public void animateToVisibility(int visibility) {
         if (mVisibilityAnim != null) {
             mVisibilityAnim.cancel();
@@ -244,6 +249,7 @@
         }
     }
 
+    @UnsupportedAppUsage
     public void animateToTab(final int position) {
         final View tabView = mTabLayout.getChildAt(position);
         if (mTabSelector != null) {
@@ -293,6 +299,7 @@
         return tabView;
     }
 
+    @UnsupportedAppUsage
     public void addTab(ActionBar.Tab tab, boolean setSelected) {
         TabView tabView = createTabView(mContext, tab, false);
         mTabLayout.addView(tabView, new LinearLayout.LayoutParams(0,
@@ -308,6 +315,7 @@
         }
     }
 
+    @UnsupportedAppUsage
     public void addTab(ActionBar.Tab tab, int position, boolean setSelected) {
         final TabView tabView = createTabView(mContext, tab, false);
         mTabLayout.addView(tabView, position, new LinearLayout.LayoutParams(
@@ -323,6 +331,7 @@
         }
     }
 
+    @UnsupportedAppUsage
     public void updateTab(int position) {
         ((TabView) mTabLayout.getChildAt(position)).update();
         if (mTabSpinner != null) {
@@ -333,6 +342,7 @@
         }
     }
 
+    @UnsupportedAppUsage
     public void removeTabAt(int position) {
         mTabLayout.removeViewAt(position);
         if (mTabSpinner != null) {
@@ -343,6 +353,7 @@
         }
     }
 
+    @UnsupportedAppUsage
     public void removeAllTabs() {
         mTabLayout.removeAllViews();
         if (mTabSpinner != null) {
diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml
index 4989406..8f176e8 100644
--- a/core/res/AndroidManifest.xml
+++ b/core/res/AndroidManifest.xml
@@ -359,6 +359,7 @@
     <protected-broadcast android:name="android.net.wifi.action.PASSPOINT_ICON" />
     <protected-broadcast android:name="android.net.wifi.action.PASSPOINT_OSU_PROVIDERS_LIST" />
     <protected-broadcast android:name="android.net.wifi.action.PASSPOINT_SUBSCRIPTION_REMEDIATION" />
+    <protected-broadcast android:name="android.net.wifi.action.PASSPOINT_LAUNCH_OSU_VIEW" />
     <protected-broadcast android:name="android.net.wifi.supplicant.CONNECTION_CHANGE" />
     <protected-broadcast android:name="android.net.wifi.supplicant.STATE_CHANGE" />
     <protected-broadcast android:name="android.net.wifi.p2p.STATE_CHANGED" />
diff --git a/core/res/res/values-watch/config.xml b/core/res/res/values-watch/config.xml
index 8e82479..a96a96d 100644
--- a/core/res/res/values-watch/config.xml
+++ b/core/res/res/values-watch/config.xml
@@ -64,9 +64,8 @@
          Set to true for watch devices. -->
     <bool name="config_focusScrollContainersInTouchMode">true</bool>
 
-    <!-- Enable generic multi-window in order to support Activity in virtual display. -->
-    <bool name="config_supportsMultiWindow">true</bool>
-    <bool name="config_supportsMultiDisplay">true</bool>
+    <bool name="config_supportsMultiWindow">false</bool>
+    <bool name="config_supportsMultiDisplay">false</bool>
     <bool name="config_supportsSplitScreenMultiWindow">false</bool>
 
      <!-- Default Gravity setting for the system Toast view. Equivalent to: Gravity.CENTER -->
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index b15c9c5..c6931aa 100644
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -2988,6 +2988,10 @@
          -->
     <bool name="config_fillMainBuiltInDisplayCutout">false</bool>
 
+    <!-- If true, and there is a cutout on the main built in display, the cutout will be masked
+         by shrinking the display such that it does not overlap the cutout area. -->
+    <bool name="config_maskMainBuiltInDisplayCutout">false</bool>
+
     <!-- Ultrasound support for Mic/speaker path -->
     <!-- Whether the default microphone audio source supports near-ultrasound frequencies
          (range of 18 - 21 kHz). -->
diff --git a/core/res/res/values/dimens.xml b/core/res/res/values/dimens.xml
index 471170b..73cb59e 100644
--- a/core/res/res/values/dimens.xml
+++ b/core/res/res/values/dimens.xml
@@ -61,6 +61,15 @@
     <!-- Margin at the edge of the screen to ignore touch events for in the windowshade. -->
     <dimen name="status_bar_edge_ignore">5dp</dimen>
 
+    <!-- Default radius of the software rounded corners. -->
+    <dimen name="rounded_corner_radius">0dp</dimen>
+    <!-- Radius of the software rounded corners at the top of the display in its natural
+        orientation. If zero, the value of rounded_corner_radius is used. -->
+    <dimen name="rounded_corner_radius_top">0dp</dimen>
+    <!-- Radius of the software rounded corners at the bottom of the display in its natural
+        orientation. If zero, the value of rounded_corner_radius is used. -->
+    <dimen name="rounded_corner_radius_bottom">0dp</dimen>
+
     <!-- Width of the window of the divider bar used to resize docked stacks. -->
     <dimen name="docked_stack_divider_thickness">48dp</dimen>
 
diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml
index 2271baa..7fbad16 100644
--- a/core/res/res/values/symbols.xml
+++ b/core/res/res/values/symbols.xml
@@ -3442,6 +3442,8 @@
   <java-symbol type="integer" name="config_defaultHapticFeedbackIntensity" />
   <java-symbol type="integer" name="config_defaultNotificationVibrationIntensity" />
 
+  <java-symbol type="bool" name="config_maskMainBuiltInDisplayCutout" />
+
   <java-symbol type="array" name="config_disableApksUnlessMatchedSku_apk_list" />
   <java-symbol type="array" name="config_disableApkUnlessMatchedSku_skus_list" />
 </resources>
diff --git a/core/tests/coretests/src/android/view/DisplayCutoutTest.java b/core/tests/coretests/src/android/view/DisplayCutoutTest.java
index 6ee74cb..fe45fe7 100644
--- a/core/tests/coretests/src/android/view/DisplayCutoutTest.java
+++ b/core/tests/coretests/src/android/view/DisplayCutoutTest.java
@@ -19,6 +19,7 @@
 import static android.view.DisplayCutout.NO_CUTOUT;
 import static android.view.DisplayCutout.fromSpec;
 
+import static org.hamcrest.Matchers.equalTo;
 import static org.hamcrest.Matchers.not;
 import static org.hamcrest.Matchers.sameInstance;
 import static org.junit.Assert.assertEquals;
@@ -220,6 +221,19 @@
     }
 
     @Test
+    public void fromSpec_setsSafeInsets_top() {
+        DisplayCutout cutout = fromSpec("M -50,0 v 20 h 100 v -20 z", 200, 400, 2f);
+        assertThat(cutout.getSafeInsets(), equalTo(new Rect(0, 20, 0, 0)));
+    }
+
+    @Test
+    public void fromSpec_setsSafeInsets_top_and_bottom() {
+        DisplayCutout cutout = fromSpec("M -50,0 v 20 h 100 v -20 z"
+                + "@bottom M -50,0 v -10,0 h 100 v 20 z", 200, 400, 2f);
+        assertThat(cutout.getSafeInsets(), equalTo(new Rect(0, 20, 0, 10)));
+    }
+
+    @Test
     public void parcel_unparcel_nocutout() {
         Parcel p = Parcel.obtain();
 
diff --git a/graphics/java/android/graphics/fonts/SystemFonts.java b/graphics/java/android/graphics/fonts/SystemFonts.java
index dae48f8..26b4ec5 100644
--- a/graphics/java/android/graphics/fonts/SystemFonts.java
+++ b/graphics/java/android/graphics/fonts/SystemFonts.java
@@ -24,6 +24,7 @@
 import android.util.Log;
 
 import com.android.internal.annotations.VisibleForTesting;
+import com.android.internal.util.ArrayUtils;
 
 import org.xmlpull.v1.XmlPullParserException;
 
@@ -251,7 +252,7 @@
             return fontConfig.getAliases();
         } catch (IOException | XmlPullParserException e) {
             Log.e(TAG, "Failed initialize system fallbacks.", e);
-            return null;
+            return ArrayUtils.emptyArray(FontConfig.Alias.class);
         }
     }
 
diff --git a/libs/hwui/hwui/AnimatedImageDrawable.cpp b/libs/hwui/hwui/AnimatedImageDrawable.cpp
index 007961a..8d4e7e0 100644
--- a/libs/hwui/hwui/AnimatedImageDrawable.cpp
+++ b/libs/hwui/hwui/AnimatedImageDrawable.cpp
@@ -21,7 +21,8 @@
 
 #include <SkPicture.h>
 #include <SkRefCnt.h>
-#include <SkTLazy.h>
+
+#include <optional>
 
 namespace android {
 
@@ -126,13 +127,13 @@
 
 // Only called on the RenderThread.
 void AnimatedImageDrawable::onDraw(SkCanvas* canvas) {
-    SkTLazy<SkPaint> lazyPaint;
+    std::optional<SkPaint> lazyPaint;
     SkAutoCanvasRestore acr(canvas, false);
     if (mProperties.mAlpha != SK_AlphaOPAQUE || mProperties.mColorFilter.get()) {
-        lazyPaint.init();
-        lazyPaint.get()->setAlpha(mProperties.mAlpha);
-        lazyPaint.get()->setColorFilter(mProperties.mColorFilter);
-        lazyPaint.get()->setFilterQuality(kLow_SkFilterQuality);
+        lazyPaint.emplace();
+        lazyPaint->setAlpha(mProperties.mAlpha);
+        lazyPaint->setColorFilter(mProperties.mColorFilter);
+        lazyPaint->setFilterQuality(kLow_SkFilterQuality);
     }
     if (mProperties.mMirrored) {
         canvas->save();
@@ -147,8 +148,8 @@
     if (drawDirectly) {
         // The image is not animating, and never was. Draw directly from
         // mSkAnimatedImage.
-        if (lazyPaint.isValid()) {
-            canvas->saveLayer(mSkAnimatedImage->getBounds(), lazyPaint.get());
+        if (lazyPaint) {
+            canvas->saveLayer(mSkAnimatedImage->getBounds(), &*lazyPaint);
         }
 
         std::unique_lock lock{mImageLock};
@@ -193,7 +194,7 @@
     if (!drawDirectly) {
         // No other thread will modify mCurrentSnap so this should be safe to
         // use without locking.
-        canvas->drawPicture(mSnapshot.mPic, nullptr, lazyPaint.getMaybeNull());
+        canvas->drawPicture(mSnapshot.mPic, nullptr, lazyPaint ? &*lazyPaint : nullptr);
     }
 
     if (finalFrame) {
diff --git a/libs/hwui/pipeline/skia/RenderNodeDrawable.cpp b/libs/hwui/pipeline/skia/RenderNodeDrawable.cpp
index 85fdc103..ea14d11 100644
--- a/libs/hwui/pipeline/skia/RenderNodeDrawable.cpp
+++ b/libs/hwui/pipeline/skia/RenderNodeDrawable.cpp
@@ -21,6 +21,8 @@
 #include "SkiaPipeline.h"
 #include "utils/TraceUtils.h"
 
+#include <optional>
+
 namespace android {
 namespace uirenderer {
 namespace skiapipeline {
@@ -171,9 +173,9 @@
 
 protected:
     bool onFilter(SkTCopyOnFirstWrite<SkPaint>* paint, Type t) const override {
-        SkTLazy<SkPaint> defaultPaint;
+        std::optional<SkPaint> defaultPaint;
         if (!*paint) {
-            paint->init(*defaultPaint.init());
+            paint->init(defaultPaint.emplace());
         }
         paint->writable()->setAlpha((uint8_t)(*paint)->getAlpha() * mAlpha);
         return true;
diff --git a/libs/hwui/renderthread/VulkanManager.cpp b/libs/hwui/renderthread/VulkanManager.cpp
index a19edae..1517f57 100644
--- a/libs/hwui/renderthread/VulkanManager.cpp
+++ b/libs/hwui/renderthread/VulkanManager.cpp
@@ -25,6 +25,8 @@
 #include <GrBackendSurface.h>
 #include <GrContext.h>
 #include <GrTypes.h>
+#include <GrTypes.h>
+#include <vk/GrVkExtensions.h>
 #include <vk/GrVkTypes.h>
 
 namespace android {
@@ -62,7 +64,7 @@
     mInstance = VK_NULL_HANDLE;
 }
 
-bool VulkanManager::setupDevice(VkPhysicalDeviceFeatures& deviceFeatures) {
+bool VulkanManager::setupDevice(GrVkExtensions& grExtensions, VkPhysicalDeviceFeatures2& features) {
     VkResult err;
 
     constexpr VkApplicationInfo app_info = {
@@ -128,7 +130,7 @@
     GET_INST_PROC(DestroyInstance);
     GET_INST_PROC(EnumeratePhysicalDevices);
     GET_INST_PROC(GetPhysicalDeviceQueueFamilyProperties);
-    GET_INST_PROC(GetPhysicalDeviceFeatures);
+    GET_INST_PROC(GetPhysicalDeviceFeatures2);
     GET_INST_PROC(CreateDevice);
     GET_INST_PROC(EnumerateDeviceExtensionProperties);
     GET_INST_PROC(CreateAndroidSurfaceKHR);
@@ -217,11 +219,38 @@
         }
     }
 
-    // query to get the physical device properties
-    mGetPhysicalDeviceFeatures(mPhysicalDevice, &deviceFeatures);
+    auto getProc = [] (const char* proc_name, VkInstance instance, VkDevice device) {
+        if (device != VK_NULL_HANDLE) {
+            return vkGetDeviceProcAddr(device, proc_name);
+        }
+        return vkGetInstanceProcAddr(instance, proc_name);
+    };
+    grExtensions.init(getProc, mInstance, mPhysicalDevice, instanceExtensions.size(),
+            instanceExtensions.data(), deviceExtensions.size(), deviceExtensions.data());
+
+    memset(&features, 0, sizeof(VkPhysicalDeviceFeatures2));
+    features.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2;
+    features.pNext = nullptr;
+
+    // Setup all extension feature structs we may want to use.
+    void** tailPNext = &features.pNext;
+
+    if (grExtensions.hasExtension(VK_EXT_BLEND_OPERATION_ADVANCED_EXTENSION_NAME, 2)) {
+        VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT* blend;
+        blend = (VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT*) malloc(
+                sizeof(VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT));
+        LOG_ALWAYS_FATAL_IF(!blend);
+        blend->sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BLEND_OPERATION_ADVANCED_FEATURES_EXT;
+        blend->pNext = nullptr;
+        *tailPNext = blend;
+        tailPNext = &blend->pNext;
+    }
+
+    // query to get the physical device features
+    mGetPhysicalDeviceFeatures2(mPhysicalDevice, &features);
     // this looks like it would slow things down,
     // and we can't depend on it on all platforms
-    deviceFeatures.robustBufferAccess = VK_FALSE;
+    features.features.robustBufferAccess = VK_FALSE;
 
     float queuePriorities[1] = { 0.0 };
 
@@ -247,7 +276,7 @@
 
     const VkDeviceCreateInfo deviceInfo = {
         VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO,    // sType
-        nullptr,                                 // pNext
+        &features,                               // pNext
         0,                                       // VkDeviceCreateFlags
         queueInfoCount,                          // queueCreateInfoCount
         queueInfo,                               // pQueueCreateInfos
@@ -255,7 +284,7 @@
         nullptr,                                 // ppEnabledLayerNames
         (uint32_t) deviceExtensions.size(),      // extensionCount
         deviceExtensions.data(),                 // ppEnabledExtensionNames
-        &deviceFeatures                          // ppEnabledFeatures
+        nullptr,                                 // ppEnabledFeatures
     };
 
     err = mCreateDevice(mPhysicalDevice, &deviceInfo, nullptr, &mDevice);
@@ -294,33 +323,39 @@
     return true;
 }
 
+static void free_features_extensions_structs(const VkPhysicalDeviceFeatures2& features) {
+    // All Vulkan structs that could be part of the features chain will start with the
+    // structure type followed by the pNext pointer. We cast to the CommonVulkanHeader
+    // so we can get access to the pNext for the next struct.
+    struct CommonVulkanHeader {
+        VkStructureType sType;
+        void*           pNext;
+    };
+
+    void* pNext = features.pNext;
+    while (pNext) {
+        void* current = pNext;
+        pNext = static_cast<CommonVulkanHeader*>(current)->pNext;
+        free(current);
+    }
+}
+
 void VulkanManager::initialize() {
     if (mDevice != VK_NULL_HANDLE) {
         return;
     }
 
-    std::vector<const char*> instanceExtensions;
-    std::vector<const char*> deviceExtensions;
-    VkPhysicalDeviceFeatures deviceFeatures;
-    LOG_ALWAYS_FATAL_IF(!this->setupDevice(deviceFeatures));
+    GET_PROC(EnumerateInstanceVersion);
+    uint32_t instanceVersion = 0;
+    LOG_ALWAYS_FATAL_IF(mEnumerateInstanceVersion(&instanceVersion));
+    LOG_ALWAYS_FATAL_IF(instanceVersion < VK_MAKE_VERSION(1, 1, 0));
+
+    GrVkExtensions extensions;
+    VkPhysicalDeviceFeatures2 features;
+    LOG_ALWAYS_FATAL_IF(!this->setupDevice(extensions, features));
 
     mGetDeviceQueue(mDevice, mGraphicsQueueIndex, 0, &mGraphicsQueue);
 
-    uint32_t extensionFlags = kKHR_surface_GrVkExtensionFlag |
-                              kKHR_android_surface_GrVkExtensionFlag |
-                              kKHR_swapchain_GrVkExtensionFlag;
-
-    uint32_t featureFlags = 0;
-    if (deviceFeatures.geometryShader) {
-        featureFlags |= kGeometryShader_GrVkFeatureFlag;
-    }
-    if (deviceFeatures.dualSrcBlend) {
-        featureFlags |= kDualSrcBlend_GrVkFeatureFlag;
-    }
-    if (deviceFeatures.sampleRateShading) {
-        featureFlags |= kSampleRateShading_GrVkFeatureFlag;
-    }
-
     auto getProc = [] (const char* proc_name, VkInstance instance, VkDevice device) {
         if (device != VK_NULL_HANDLE) {
             return vkGetDeviceProcAddr(device, proc_name);
@@ -334,11 +369,10 @@
     backendContext.fDevice = mDevice;
     backendContext.fQueue = mGraphicsQueue;
     backendContext.fGraphicsQueueIndex = mGraphicsQueueIndex;
-    backendContext.fMinAPIVersion = VK_MAKE_VERSION(1, 0, 0);
-    backendContext.fExtensions = extensionFlags;
-    backendContext.fFeatures = featureFlags;
+    backendContext.fInstanceVersion = instanceVersion;
+    backendContext.fVkExtensions = &extensions;
+    backendContext.fDeviceFeatures2 = &features;
     backendContext.fGetProc = std::move(getProc);
-    backendContext.fOwnsInstanceAndDevice = false;
 
     // create the command pool for the command buffers
     if (VK_NULL_HANDLE == mCommandPool) {
@@ -361,6 +395,9 @@
     sk_sp<GrContext> grContext(GrContext::MakeVulkan(backendContext, options));
     LOG_ALWAYS_FATAL_IF(!grContext.get());
     mRenderThread.setGrContext(grContext);
+
+    free_features_extensions_structs(features);
+
     DeviceInfo::initialize(mRenderThread.getGrContext()->maxRenderTargetSize());
 
     if (Properties::enablePartialUpdates && Properties::useBufferAge) {
diff --git a/libs/hwui/renderthread/VulkanManager.h b/libs/hwui/renderthread/VulkanManager.h
index 69641d5..5524c39 100644
--- a/libs/hwui/renderthread/VulkanManager.h
+++ b/libs/hwui/renderthread/VulkanManager.h
@@ -25,6 +25,8 @@
 #include <SkSurface.h>
 #include <vk/GrVkBackendContext.h>
 
+class GrVkExtensions;
+
 namespace android {
 namespace uirenderer {
 namespace renderthread {
@@ -116,7 +118,7 @@
 
     // Sets up the VkInstance and VkDevice objects. Also fills out the passed in
     // VkPhysicalDeviceFeatures struct.
-    bool setupDevice(VkPhysicalDeviceFeatures& deviceFeatures);
+    bool setupDevice(GrVkExtensions&, VkPhysicalDeviceFeatures2&);
 
     void destroyBuffers(VulkanSurface* surface);
 
@@ -156,13 +158,14 @@
     VkPtr<PFN_vkCreateSharedSwapchainsKHR> mCreateSharedSwapchainsKHR;
 
     // Instance Functions
+    VkPtr<PFN_vkEnumerateInstanceVersion> mEnumerateInstanceVersion;
     VkPtr<PFN_vkEnumerateInstanceExtensionProperties> mEnumerateInstanceExtensionProperties;
     VkPtr<PFN_vkCreateInstance> mCreateInstance;
 
     VkPtr<PFN_vkDestroyInstance> mDestroyInstance;
     VkPtr<PFN_vkEnumeratePhysicalDevices> mEnumeratePhysicalDevices;
     VkPtr<PFN_vkGetPhysicalDeviceQueueFamilyProperties> mGetPhysicalDeviceQueueFamilyProperties;
-    VkPtr<PFN_vkGetPhysicalDeviceFeatures> mGetPhysicalDeviceFeatures;
+    VkPtr<PFN_vkGetPhysicalDeviceFeatures2> mGetPhysicalDeviceFeatures2;
     VkPtr<PFN_vkCreateDevice> mCreateDevice;
     VkPtr<PFN_vkEnumerateDeviceExtensionProperties> mEnumerateDeviceExtensionProperties;
 
diff --git a/location/java/com/android/internal/location/ProviderRequest.java b/location/java/com/android/internal/location/ProviderRequest.java
index 45fdb76..88919f6 100644
--- a/location/java/com/android/internal/location/ProviderRequest.java
+++ b/location/java/com/android/internal/location/ProviderRequest.java
@@ -19,6 +19,7 @@
 import java.util.ArrayList;
 import java.util.List;
 
+import android.annotation.UnsupportedAppUsage;
 import android.location.LocationRequest;
 import android.os.Parcel;
 import android.os.Parcelable;
@@ -27,9 +28,11 @@
 /** @hide */
 public final class ProviderRequest implements Parcelable {
     /** Location reporting is requested (true) */
+    @UnsupportedAppUsage
     public boolean reportLocation = false;
 
     /** The smallest requested interval */
+    @UnsupportedAppUsage
     public long interval = Long.MAX_VALUE;
 
     /**
@@ -45,8 +48,10 @@
      * is a high power slow interval request and a
      * low power fast interval request.
      */
+    @UnsupportedAppUsage
     public List<LocationRequest> locationRequests = new ArrayList<LocationRequest>();
 
+    @UnsupportedAppUsage
     public ProviderRequest() {
     }
 
diff --git a/media/java/android/media/audiofx/DefaultEffect.java b/media/java/android/media/audiofx/DefaultEffect.java
index a919868..ce087ad 100644
--- a/media/java/android/media/audiofx/DefaultEffect.java
+++ b/media/java/android/media/audiofx/DefaultEffect.java
@@ -24,6 +24,7 @@
  * <p>Applications should not use the DefaultEffect class directly but one of its derived classes
  * to control specific types of defaults:
  * <ul>
+ *   <li> {@link android.media.audiofx.SourceDefaultEffect}</li>
  *   <li> {@link android.media.audiofx.StreamDefaultEffect}</li>
  * </ul>
  * <p>Creating a DefaultEffect object will register the corresponding effect engine as a default
diff --git a/media/java/android/media/audiofx/SourceDefaultEffect.java b/media/java/android/media/audiofx/SourceDefaultEffect.java
new file mode 100644
index 0000000..d7a292e
--- /dev/null
+++ b/media/java/android/media/audiofx/SourceDefaultEffect.java
@@ -0,0 +1,118 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.media.audiofx;
+
+import android.annotation.RequiresPermission;
+import android.app.ActivityThread;
+import android.util.Log;
+import java.util.UUID;
+
+/**
+ * SourceDefaultEffect is a default effect that attaches automatically to all AudioRecord and
+ * MediaRecorder instances of a given source type.
+ * <p>see {@link android.media.audiofx.DefaultEffect} class for more details on default effects.
+ * @hide
+ */
+
+public class SourceDefaultEffect extends DefaultEffect {
+    static {
+        System.loadLibrary("audioeffect_jni");
+    }
+
+    private final static String TAG = "SourceDefaultEffect-JAVA";
+
+    /**
+     * Class constructor.
+     *
+     * @param type type of effect engine to be default. This parameter is ignored if uuid is set,
+     *             and can be set to {@link android.media.audiofx.AudioEffect#EFFECT_TYPE_NULL}
+     *             in that case.
+     * @param uuid unique identifier of a particular effect implementation to be default. This
+     *             parameter can be set to
+     *             {@link android.media.audiofx.AudioEffect#EFFECT_TYPE_NULL}, in which case only
+     *             the type will be used to select the effect.
+     * @param priority the priority level requested by the application for controlling the effect
+     *             engine. As the same engine can be shared by several applications, this parameter
+     *             indicates how much the requesting application needs control of effect parameters.
+     *             The normal priority is 0, above normal is a positive number, below normal a
+     *             negative number.
+     * @param source a MediaRecorder.AudioSource.* constant from
+     *             {@link android.media.MediaRecorder.AudioSource} indicating
+     *             what sources the given effect should attach to by default. Note that similar
+     *             sources may share defaults.
+     *
+     * @throws java.lang.IllegalArgumentException
+     * @throws java.lang.UnsupportedOperationException
+     * @throws java.lang.RuntimeException
+     */
+    @RequiresPermission(value = android.Manifest.permission.MODIFY_DEFAULT_AUDIO_EFFECTS,
+                        conditional = true)  // Android Things uses an alternate permission.
+    public SourceDefaultEffect(UUID type, UUID uuid, int priority, int source) {
+        int[] id = new int[1];
+        int initResult = native_setup(type.toString(),
+                                      uuid.toString(),
+                                      priority,
+                                      source,
+                                      ActivityThread.currentOpPackageName(),
+                                      id);
+        if (initResult != AudioEffect.SUCCESS) {
+            Log.e(TAG, "Error code " + initResult + " when initializing SourceDefaultEffect");
+            switch (initResult) {
+                case AudioEffect.ERROR_BAD_VALUE:
+                    throw (new IllegalArgumentException(
+                            "Source, type uuid, or implementation uuid not supported."));
+                case AudioEffect.ERROR_INVALID_OPERATION:
+                    throw (new UnsupportedOperationException(
+                            "Effect library not loaded"));
+                default:
+                    throw (new RuntimeException(
+                            "Cannot initialize effect engine for type: " + type
+                            + " Error: " + initResult));
+            }
+        }
+
+        mId = id[0];
+    }
+
+
+    /**
+     * Releases the native SourceDefaultEffect resources. It is a good practice to
+     * release the default effect when done with use as control can be returned to
+     * other applications or the native resources released.
+     */
+    public void release() {
+        native_release(mId);
+    }
+
+    @Override
+    protected void finalize() {
+        release();
+    }
+
+    // ---------------------------------------------------------
+    // Native methods called from the Java side
+    // --------------------
+
+    private native final int native_setup(String type,
+                                          String uuid,
+                                          int priority,
+                                          int source,
+                                          String opPackageName,
+                                          int[] id);
+
+    private native final void native_release(int id);
+}
diff --git a/media/jni/audioeffect/Android.bp b/media/jni/audioeffect/Android.bp
index 0063c11..09c546a 100644
--- a/media/jni/audioeffect/Android.bp
+++ b/media/jni/audioeffect/Android.bp
@@ -3,6 +3,7 @@
 
     srcs: [
         "android_media_AudioEffect.cpp",
+        "android_media_SourceDefaultEffect.cpp",
         "android_media_StreamDefaultEffect.cpp",
         "android_media_Visualizer.cpp",
     ],
diff --git a/media/jni/audioeffect/android_media_AudioEffect.cpp b/media/jni/audioeffect/android_media_AudioEffect.cpp
index d3ba9f2..693bd8b 100644
--- a/media/jni/audioeffect/android_media_AudioEffect.cpp
+++ b/media/jni/audioeffect/android_media_AudioEffect.cpp
@@ -824,21 +824,19 @@
 android_media_AudioEffect_native_queryPreProcessings(JNIEnv *env, jclass clazz __unused,
                                                      jint audioSession)
 {
-    effect_descriptor_t *descriptors = new effect_descriptor_t[AudioEffect::kMaxPreProcessing];
+    auto descriptors = std::make_unique<effect_descriptor_t[]>(AudioEffect::kMaxPreProcessing);
     uint32_t numEffects = AudioEffect::kMaxPreProcessing;
 
     status_t status = AudioEffect::queryDefaultPreProcessing((audio_session_t) audioSession,
-                                           descriptors,
+                                           descriptors.get(),
                                            &numEffects);
     if (status != NO_ERROR || numEffects == 0) {
-        delete[] descriptors;
         return NULL;
     }
     ALOGV("queryDefaultPreProcessing() got %d effects", numEffects);
 
     jobjectArray ret = env->NewObjectArray(numEffects, fields.clazzDesc, NULL);
     if (ret == NULL) {
-        delete[] descriptors;
         return ret;
     }
 
@@ -875,7 +873,7 @@
         if (jdesc == NULL) {
             ALOGE("env->NewObject(fields.clazzDesc, fields.midDescCstor)");
             env->DeleteLocalRef(ret);
-            return NULL;;
+            return NULL;
         }
 
         env->SetObjectArrayElement(ret, i, jdesc);
@@ -907,6 +905,7 @@
 
 // ----------------------------------------------------------------------------
 
+extern int register_android_media_SourceDefaultEffect(JNIEnv *env);
 extern int register_android_media_StreamDefaultEffect(JNIEnv *env);
 extern int register_android_media_visualizer(JNIEnv *env);
 
@@ -932,6 +931,11 @@
         goto bail;
     }
 
+    if (register_android_media_SourceDefaultEffect(env) < 0) {
+        ALOGE("ERROR: SourceDefaultEffect native registration failed\n");
+        goto bail;
+    }
+
     if (register_android_media_StreamDefaultEffect(env) < 0) {
         ALOGE("ERROR: StreamDefaultEffect native registration failed\n");
         goto bail;
diff --git a/media/jni/audioeffect/android_media_SourceDefaultEffect.cpp b/media/jni/audioeffect/android_media_SourceDefaultEffect.cpp
new file mode 100644
index 0000000..d244bcb7
--- /dev/null
+++ b/media/jni/audioeffect/android_media_SourceDefaultEffect.cpp
@@ -0,0 +1,142 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+//#define LOG_NDEBUG 0
+#define LOG_TAG "SourceDefaultEffect-JNI"
+
+#include <utils/Errors.h>
+#include <utils/Log.h>
+#include <jni.h>
+#include <nativehelper/JNIHelp.h>
+#include <android_runtime/AndroidRuntime.h>
+#include "media/AudioEffect.h"
+
+#include <nativehelper/ScopedUtfChars.h>
+
+#include "android_media_AudioEffect.h"
+
+using namespace android;
+
+static const char* const kClassPathName = "android/media/audiofx/SourceDefaultEffect";
+
+static jint android_media_SourceDefaultEffect_native_setup(JNIEnv *env,
+                                                           jobject /*thiz*/,
+                                                           jstring type,
+                                                           jstring uuid,
+                                                           jint priority,
+                                                           jint source,
+                                                           jstring opPackageName,
+                                                           jintArray jId)
+{
+    ALOGV("android_media_SourceDefaultEffect_native_setup");
+    status_t lStatus = NO_ERROR;
+    jint* nId = NULL;
+    const char *typeStr = NULL;
+    const char *uuidStr = NULL;
+
+    ScopedUtfChars opPackageNameStr(env, opPackageName);
+
+    if (type != NULL) {
+        typeStr = env->GetStringUTFChars(type, NULL);
+        if (typeStr == NULL) {  // Out of memory
+            lStatus = NO_MEMORY;
+            jniThrowException(env, "java/lang/RuntimeException", "Out of memory");
+            goto setup_exit;
+        }
+    }
+
+    if (uuid != NULL) {
+        uuidStr = env->GetStringUTFChars(uuid, NULL);
+        if (uuidStr == NULL) {  // Out of memory
+            lStatus = NO_MEMORY;
+            jniThrowException(env, "java/lang/RuntimeException", "Out of memory");
+            goto setup_exit;
+        }
+    }
+
+    if (typeStr == NULL && uuidStr == NULL) {
+        lStatus = BAD_VALUE;
+        goto setup_exit;
+    }
+
+    nId = reinterpret_cast<jint *>(env->GetPrimitiveArrayCritical(jId, NULL));
+    if (nId == NULL) {
+        ALOGE("setup: Error retrieving id pointer");
+        lStatus = BAD_VALUE;
+        goto setup_exit;
+    }
+
+    // create the native SourceDefaultEffect.
+    audio_unique_id_t id;
+    lStatus = AudioEffect::addSourceDefaultEffect(typeStr,
+                                                  String16(opPackageNameStr.c_str()),
+                                                  uuidStr,
+                                                  priority,
+                                                  static_cast<audio_source_t>(source),
+                                                  &id);
+    if (lStatus != NO_ERROR) {
+        ALOGE("setup: Error adding SourceDefaultEffect");
+        goto setup_exit;
+    }
+
+    nId[0] = static_cast<jint>(id);
+
+setup_exit:
+    // Final cleanup and return.
+
+    if (nId != NULL) {
+        env->ReleasePrimitiveArrayCritical(jId, nId, 0);
+        nId = NULL;
+    }
+
+    if (uuidStr != NULL) {
+        env->ReleaseStringUTFChars(uuid, uuidStr);
+        uuidStr = NULL;
+    }
+
+    if (typeStr != NULL) {
+        env->ReleaseStringUTFChars(type, typeStr);
+        typeStr = NULL;
+    }
+
+    return AudioEffectJni::translateNativeErrorToJava(lStatus);
+}
+
+static void android_media_SourceDefaultEffect_native_release(JNIEnv */*env*/,
+                                                             jobject /*thiz*/,
+                                                             jint id) {
+    status_t lStatus = AudioEffect::removeSourceDefaultEffect(id);
+    if (lStatus != NO_ERROR) {
+        ALOGW("Error releasing SourceDefaultEffect: %d", lStatus);
+    }
+}
+
+// ----------------------------------------------------------------------------
+
+// Dalvik VM type signatures
+static const JNINativeMethod gMethods[] = {
+    {"native_setup",         "(Ljava/lang/String;Ljava/lang/String;IILjava/lang/String;[I)I",
+                                         (void *)android_media_SourceDefaultEffect_native_setup},
+    {"native_release",       "(I)V",      (void *)android_media_SourceDefaultEffect_native_release},
+};
+
+
+// ----------------------------------------------------------------------------
+
+int register_android_media_SourceDefaultEffect(JNIEnv *env)
+{
+    return AndroidRuntime::registerNativeMethods(env, kClassPathName, gMethods, NELEM(gMethods));
+}
diff --git a/packages/ExtServices/src/android/ext/services/notification/AgingHelper.java b/packages/ExtServices/src/android/ext/services/notification/AgingHelper.java
new file mode 100644
index 0000000..5782ea1
--- /dev/null
+++ b/packages/ExtServices/src/android/ext/services/notification/AgingHelper.java
@@ -0,0 +1,172 @@
+/**
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package android.ext.services.notification;
+
+import static android.app.NotificationManager.IMPORTANCE_MIN;
+
+import android.app.AlarmManager;
+import android.app.PendingIntent;
+import android.content.BroadcastReceiver;
+import android.content.Context;
+import android.content.Intent;
+import android.content.IntentFilter;
+import android.ext.services.notification.NotificationCategorizer.Category;
+import android.net.Uri;
+import android.util.ArraySet;
+import android.util.Slog;
+
+import java.util.Set;
+
+public class AgingHelper {
+    private final static String TAG = "AgingHelper";
+    private final boolean DEBUG = false;
+
+    private static final String AGING_ACTION = AgingHelper.class.getSimpleName() + ".EVALUATE";
+    private static final int REQUEST_CODE_AGING = 1;
+    private static final String AGING_SCHEME = "aging";
+    private static final String EXTRA_KEY = "key";
+    private static final String EXTRA_CATEGORY = "category";
+
+    private static final int HOUR_MS = 1000 * 60 * 60;
+    private static final int TWO_HOURS_MS = 2 * HOUR_MS;
+
+    private Context mContext;
+    private NotificationCategorizer mNotificationCategorizer;
+    private AlarmManager mAm;
+    private Callback mCallback;
+
+    // The set of keys we've scheduled alarms for
+    private Set<String> mAging = new ArraySet<>();
+
+    public AgingHelper(Context context, NotificationCategorizer categorizer, Callback callback) {
+        mNotificationCategorizer = categorizer;
+        mContext = context;
+        mAm = mContext.getSystemService(AlarmManager.class);
+        mCallback = callback;
+
+        IntentFilter filter = new IntentFilter(AGING_ACTION);
+        filter.addDataScheme(AGING_SCHEME);
+        mContext.registerReceiver(mBroadcastReceiver, filter);
+    }
+
+    // NAS lifecycle methods
+
+    public void onNotificationSeen(NotificationEntry entry) {
+        // user has strong opinions about this notification. we can't down rank it, so don't bother.
+        if (entry.getChannel().isImportanceLocked()) {
+            return;
+        }
+
+        @Category int category = mNotificationCategorizer.getCategory(entry);
+
+        // already very low
+        if (category == NotificationCategorizer.CATEGORY_MIN) {
+            return;
+        }
+
+        if (entry.hasSeen()) {
+            if (category == NotificationCategorizer.CATEGORY_ONGOING
+                    || category > NotificationCategorizer.CATEGORY_REMINDER) {
+                scheduleAging(entry.getSbn().getKey(), category, TWO_HOURS_MS);
+            } else {
+                scheduleAging(entry.getSbn().getKey(), category, HOUR_MS);
+            }
+
+            mAging.add(entry.getSbn().getKey());
+        }
+    }
+
+    public void onNotificationPosted(NotificationEntry entry) {
+        cancelAging(entry.getSbn().getKey());
+    }
+
+    public void onNotificationRemoved(String key) {
+        cancelAging(key);
+    }
+
+    public void onDestroy() {
+        mContext.unregisterReceiver(mBroadcastReceiver);
+    }
+
+    // Aging
+
+    private void scheduleAging(String key, @Category int category, long duration) {
+        if (mAging.contains(key)) {
+            // already scheduled. Don't reset aging just because the user saw the noti again.
+            return;
+        }
+        final PendingIntent pi = createPendingIntent(key, category);
+        long time = System.currentTimeMillis() + duration;
+        if (DEBUG) Slog.d(TAG, "Scheduling evaluate for " + key + " in ms: " + duration);
+        mAm.setExactAndAllowWhileIdle(AlarmManager.RTC_WAKEUP, time, pi);
+    }
+
+    private void cancelAging(String key) {
+        final PendingIntent pi = createPendingIntent(key);
+        mAm.cancel(pi);
+        mAging.remove(key);
+    }
+
+    private Intent createBaseIntent(String key) {
+        return new Intent(AGING_ACTION)
+                .setData(new Uri.Builder().scheme(AGING_SCHEME).appendPath(key).build());
+    }
+
+    private Intent createAgingIntent(String key, @Category int category) {
+        Intent intent = createBaseIntent(key);
+        intent.addFlags(Intent.FLAG_RECEIVER_FOREGROUND)
+                .putExtra(EXTRA_CATEGORY, category)
+                .putExtra(EXTRA_KEY, key);
+        return intent;
+    }
+
+    private PendingIntent createPendingIntent(String key, @Category int category) {
+        return PendingIntent.getBroadcast(mContext,
+                REQUEST_CODE_AGING,
+                createAgingIntent(key, category),
+                PendingIntent.FLAG_UPDATE_CURRENT);
+    }
+
+    private PendingIntent createPendingIntent(String key) {
+        return PendingIntent.getBroadcast(mContext,
+                REQUEST_CODE_AGING,
+                createBaseIntent(key),
+                PendingIntent.FLAG_UPDATE_CURRENT);
+    }
+
+    private void demote(String key, @Category int category) {
+        int newImportance = IMPORTANCE_MIN;
+        // TODO: Change "aged" importance based on category
+        mCallback.sendAdjustment(key, newImportance);
+    }
+
+    protected interface Callback {
+        void sendAdjustment(String key, int newImportance);
+    }
+
+    private final BroadcastReceiver mBroadcastReceiver = new BroadcastReceiver() {
+        @Override
+        public void onReceive(Context context, Intent intent) {
+            if (DEBUG) {
+                Slog.d(TAG, "Reposting notification");
+            }
+            if (AGING_ACTION.equals(intent.getAction())) {
+                demote(intent.getStringExtra(EXTRA_KEY), intent.getIntExtra(EXTRA_CATEGORY,
+                        NotificationCategorizer.CATEGORY_EVERYTHING_ELSE));
+            }
+        }
+    };
+}
diff --git a/packages/ExtServices/src/android/ext/services/notification/Assistant.java b/packages/ExtServices/src/android/ext/services/notification/Assistant.java
index a8ecec3..3333e15 100644
--- a/packages/ExtServices/src/android/ext/services/notification/Assistant.java
+++ b/packages/ExtServices/src/android/ext/services/notification/Assistant.java
@@ -18,23 +18,28 @@
 
 import static android.app.NotificationManager.IMPORTANCE_LOW;
 import static android.app.NotificationManager.IMPORTANCE_MIN;
+import static android.service.notification.Adjustment.KEY_IMPORTANCE;
 import static android.service.notification.NotificationListenerService.Ranking
         .USER_SENTIMENT_NEGATIVE;
 
 import android.annotation.NonNull;
 import android.annotation.Nullable;
 import android.app.ActivityThread;
+import android.app.AlarmManager;
 import android.app.INotificationManager;
 import android.app.Notification;
 import android.app.NotificationChannel;
 import android.content.ContentResolver;
 import android.content.Context;
+import android.content.pm.IPackageManager;
 import android.database.ContentObserver;
+import android.ext.services.notification.AgingHelper.Callback;
 import android.net.Uri;
 import android.os.AsyncTask;
 import android.os.Bundle;
 import android.os.Environment;
 import android.os.Handler;
+import android.os.UserHandle;
 import android.os.storage.StorageManager;
 import android.provider.Settings;
 import android.service.notification.Adjustment;
@@ -64,6 +69,7 @@
 import java.io.InputStream;
 import java.nio.charset.StandardCharsets;
 import java.util.ArrayList;
+import java.util.List;
 import java.util.Map;
 
 /**
@@ -89,15 +95,17 @@
     private int mStreakLimit;
     private SmartActionsHelper mSmartActionsHelper;
     private NotificationCategorizer mNotificationCategorizer;
+    private AgingHelper mAgingHelper;
 
     // key : impressions tracker
     // TODO: prune deleted channels and apps
-    final ArrayMap<String, ChannelImpressions> mkeyToImpressions = new ArrayMap<>();
-    // SBN key : channel id
-    ArrayMap<String, String> mLiveNotifications = new ArrayMap<>();
+    private final ArrayMap<String, ChannelImpressions> mkeyToImpressions = new ArrayMap<>();
+    // SBN key : entry
+    protected ArrayMap<String, NotificationEntry> mLiveNotifications = new ArrayMap<>();
 
     private Ranking mFakeRanking = null;
     private AtomicFile mFile = null;
+    private IPackageManager mPackageManager;
     protected SettingsObserver mSettingsObserver;
 
     public Assistant() {
@@ -108,9 +116,13 @@
         super.onCreate();
         // Contexts are correctly hooked up by the creation step, which is required for the observer
         // to be hooked up/initialized.
+        mPackageManager = ActivityThread.getPackageManager();
         mSettingsObserver = new SettingsObserver(mHandler);
         mSmartActionsHelper = new SmartActionsHelper();
         mNotificationCategorizer = new NotificationCategorizer();
+        mAgingHelper = new AgingHelper(getContext(),
+                mNotificationCategorizer,
+                new AgingCallback());
     }
 
     private void loadFile() {
@@ -157,7 +169,7 @@
         }
     }
 
-    private void saveFile() throws IOException {
+    private void saveFile() {
         AsyncTask.execute(() -> {
             final FileOutputStream stream;
             try {
@@ -200,6 +212,9 @@
     public Adjustment onNotificationEnqueued(StatusBarNotification sbn,
             NotificationChannel channel) {
         if (DEBUG) Log.i(TAG, "ENQUEUED " + sbn.getKey() + " on " + channel.getId());
+        if (!isForCurrentUser(sbn)) {
+            return null;
+        }
         NotificationEntry entry = new NotificationEntry(
                 ActivityThread.getPackageManager(), sbn, channel);
         ArrayList<Notification.Action> actions =
@@ -222,7 +237,7 @@
             signals.putCharSequenceArrayList(Adjustment.KEY_SMART_REPLIES, smartReplies);
         }
         if (mNotificationCategorizer.shouldSilence(entry)) {
-            signals.putInt(Adjustment.KEY_IMPORTANCE, IMPORTANCE_LOW);
+            signals.putInt(KEY_IMPORTANCE, IMPORTANCE_LOW);
         }
 
         return new Adjustment(
@@ -237,8 +252,13 @@
     public void onNotificationPosted(StatusBarNotification sbn, RankingMap rankingMap) {
         if (DEBUG) Log.i(TAG, "POSTED " + sbn.getKey());
         try {
+            if (!isForCurrentUser(sbn)) {
+                return;
+            }
             Ranking ranking = getRanking(sbn.getKey(), rankingMap);
             if (ranking != null && ranking.getChannel() != null) {
+                NotificationEntry entry = new NotificationEntry(mPackageManager,
+                        sbn, ranking.getChannel());
                 String key = getKey(
                         sbn.getPackageName(), sbn.getUserId(), ranking.getChannel().getId());
                 ChannelImpressions ci = mkeyToImpressions.getOrDefault(key,
@@ -248,7 +268,8 @@
                             sbn.getPackageName(), sbn.getKey(), sbn.getUserId()));
                 }
                 mkeyToImpressions.put(key, ci);
-                mLiveNotifications.put(sbn.getKey(), ranking.getChannel().getId());
+                mLiveNotifications.put(sbn.getKey(), entry);
+                mAgingHelper.onNotificationPosted(entry);
             }
         } catch (Throwable e) {
             Log.e(TAG, "Error occurred processing post", e);
@@ -259,8 +280,11 @@
     public void onNotificationRemoved(StatusBarNotification sbn, RankingMap rankingMap,
             NotificationStats stats, int reason) {
         try {
+            if (!isForCurrentUser(sbn)) {
+                return;
+            }
             boolean updatedImpressions = false;
-            String channelId = mLiveNotifications.remove(sbn.getKey());
+            String channelId = mLiveNotifications.remove(sbn.getKey()).getChannel().getId();
             String key = getKey(sbn.getPackageName(), sbn.getUserId(), channelId);
             synchronized (mkeyToImpressions) {
                 ChannelImpressions ci = mkeyToImpressions.getOrDefault(key,
@@ -292,7 +316,7 @@
                 saveFile();
             }
         } catch (Throwable e) {
-            Slog.e(TAG, "Error occurred processing removal", e);
+            Slog.e(TAG, "Error occurred processing removal of " + sbn, e);
         }
     }
 
@@ -302,6 +326,26 @@
     }
 
     @Override
+    public void onNotificationsSeen(List<String> keys) {
+        try {
+            if (keys == null) {
+                return;
+            }
+
+            for (String key : keys) {
+                NotificationEntry entry = mLiveNotifications.get(key);
+
+                if (entry != null) {
+                    entry.setSeen();
+                    mAgingHelper.onNotificationSeen(entry);
+                }
+            }
+        } catch (Throwable e) {
+            Slog.e(TAG, "Error occurred processing seen", e);
+        }
+    }
+
+    @Override
     public void onListenerConnected() {
         if (DEBUG) Log.i(TAG, "CONNECTED");
         try {
@@ -318,6 +362,17 @@
         }
     }
 
+    @Override
+    public void onListenerDisconnected() {
+        if (mAgingHelper != null) {
+            mAgingHelper.onDestroy();
+        }
+    }
+
+    private boolean isForCurrentUser(StatusBarNotification sbn) {
+        return sbn != null && sbn.getUserId() == UserHandle.myUserId();
+    }
+
     protected String getKey(String pkg, int userId, String channelId) {
         return pkg + "|" + userId + "|" + channelId;
     }
@@ -361,6 +416,11 @@
     }
 
     @VisibleForTesting
+    public void setPackageManager(IPackageManager pm) {
+        mPackageManager = pm;
+    }
+
+    @VisibleForTesting
     public ChannelImpressions getImpressions(String key) {
         synchronized (mkeyToImpressions) {
             return mkeyToImpressions.get(key);
@@ -380,6 +440,20 @@
         return impressions;
     }
 
+    protected final class AgingCallback implements Callback {
+        @Override
+        public void sendAdjustment(String key, int newImportance) {
+            NotificationEntry entry = mLiveNotifications.get(key);
+            if (entry != null) {
+                Bundle bundle = new Bundle();
+                bundle.putInt(KEY_IMPORTANCE, newImportance);
+                Adjustment adjustment = new Adjustment(entry.getSbn().getPackageName(), key, bundle,
+                        "aging", entry.getSbn().getUserId());
+                adjustNotification(adjustment);
+            }
+        }
+    }
+
     /**
      * Observer for updates on blocking helper threshold values.
      */
diff --git a/packages/ExtServices/src/android/ext/services/notification/NotificationEntry.java b/packages/ExtServices/src/android/ext/services/notification/NotificationEntry.java
index cdc0990..8fee822 100644
--- a/packages/ExtServices/src/android/ext/services/notification/NotificationEntry.java
+++ b/packages/ExtServices/src/android/ext/services/notification/NotificationEntry.java
@@ -50,6 +50,7 @@
     private AudioAttributes mAttributes;
     private NotificationChannel mChannel;
     private int mImportance;
+    private boolean mSeen;
 
     public NotificationEntry(IPackageManager packageManager, StatusBarNotification sbn,
             NotificationChannel channel) {
@@ -198,6 +199,14 @@
         return false;
     }
 
+    public void setSeen() {
+        mSeen = true;
+    }
+
+    public boolean hasSeen() {
+        return mSeen;
+    }
+
     public StatusBarNotification getSbn() {
         return mSbn;
     }
diff --git a/packages/ExtServices/tests/AndroidTest.xml b/packages/ExtServices/tests/AndroidTest.xml
new file mode 100644
index 0000000..c3d32de
--- /dev/null
+++ b/packages/ExtServices/tests/AndroidTest.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2018 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+<configuration description="Runs Tests for ExtServices">
+    <target_preparer class="com.android.tradefed.targetprep.TestAppInstallSetup">
+        <option name="test-file-name" value="ExtServicesUnitTests.apk" />
+    </target_preparer>
+
+    <option name="test-suite-tag" value="apct" />
+    <option name="test-suite-tag" value="framework-base-presubmit" />
+    <option name="test-tag" value="ExtServicesUnitTests" />
+    <test class="com.android.tradefed.testtype.AndroidJUnitTest" >
+        <option name="package" value="android.ext.services.tests.unit" />
+        <option name="runner" value="android.support.test.runner.AndroidJUnitRunner" />
+        <option name="hidden-api-checks" value="false"/>
+    </test>
+</configuration>
\ No newline at end of file
diff --git a/packages/ExtServices/tests/src/android/ext/services/notification/AgingHelperTest.java b/packages/ExtServices/tests/src/android/ext/services/notification/AgingHelperTest.java
new file mode 100644
index 0000000..b023b36
--- /dev/null
+++ b/packages/ExtServices/tests/src/android/ext/services/notification/AgingHelperTest.java
@@ -0,0 +1,153 @@
+/**
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.ext.services.notification;
+
+import static android.app.NotificationManager.IMPORTANCE_HIGH;
+import static android.app.NotificationManager.IMPORTANCE_MIN;
+
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyInt;
+import static org.mockito.ArgumentMatchers.anyLong;
+import static org.mockito.ArgumentMatchers.anyString;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.never;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+import android.app.AlarmManager;
+import android.app.Notification;
+import android.app.NotificationChannel;
+import android.app.PendingIntent;
+import android.content.pm.ApplicationInfo;
+import android.content.pm.IPackageManager;
+import android.os.Build;
+import android.os.Process;
+import android.os.UserHandle;
+import android.service.notification.StatusBarNotification;
+import android.support.test.InstrumentationRegistry;
+import android.support.test.runner.AndroidJUnit4;
+import android.testing.TestableContext;
+
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+
+@RunWith(AndroidJUnit4.class)
+public class AgingHelperTest {
+    private String mPkg = "pkg";
+    private int mUid = 2018;
+
+    @Rule
+    public final TestableContext mContext =
+            new TestableContext(InstrumentationRegistry.getTargetContext(), null);
+
+    @Mock
+    private NotificationCategorizer mCategorizer;
+    @Mock
+    private AlarmManager mAlarmManager;
+    @Mock
+    private IPackageManager mPackageManager;
+    @Mock
+    private AgingHelper.Callback mCallback;
+
+    private AgingHelper mAgingHelper;
+
+    private StatusBarNotification generateSbn(String channelId) {
+        Notification n = new Notification.Builder(mContext, channelId)
+                .setContentTitle("foo")
+                .build();
+
+        return new StatusBarNotification(mPkg, mPkg, 0, "tag", mUid, mUid, n,
+                UserHandle.SYSTEM, null, 0);
+    }
+
+    @Before
+    public void setUp() throws Exception {
+        MockitoAnnotations.initMocks(this);
+        mPkg = mContext.getPackageName();
+        mUid = Process.myUid();
+
+        ApplicationInfo info = mock(ApplicationInfo.class);
+        when(mPackageManager.getApplicationInfo(anyString(), anyInt(), anyInt()))
+                .thenReturn(info);
+        info.targetSdkVersion = Build.VERSION_CODES.P;
+
+        mContext.addMockSystemService(AlarmManager.class, mAlarmManager);
+
+        mAgingHelper = new AgingHelper(mContext, mCategorizer, mCallback);
+    }
+
+    @Test
+    public void testNoSnoozingOnPost() {
+        NotificationChannel channel = new NotificationChannel("", "", IMPORTANCE_HIGH);
+        StatusBarNotification sbn = generateSbn(channel.getId());
+        NotificationEntry entry = new NotificationEntry(mPackageManager, sbn, channel);
+
+
+        mAgingHelper.onNotificationPosted(entry);
+        verify(mAlarmManager, never()).setExactAndAllowWhileIdle(anyInt(), anyLong(), any());
+    }
+
+    @Test
+    public void testPostResetsSnooze() {
+        NotificationChannel channel = new NotificationChannel("", "", IMPORTANCE_HIGH);
+        StatusBarNotification sbn = generateSbn(channel.getId());
+        NotificationEntry entry = new NotificationEntry(mPackageManager, sbn, channel);
+
+
+        mAgingHelper.onNotificationPosted(entry);
+        verify(mAlarmManager, times(1)).cancel(any(PendingIntent.class));
+    }
+
+    @Test
+    public void testSnoozingOnSeen() {
+        NotificationChannel channel = new NotificationChannel("", "", IMPORTANCE_HIGH);
+        StatusBarNotification sbn = generateSbn(channel.getId());
+        NotificationEntry entry = new NotificationEntry(mPackageManager, sbn, channel);
+        entry.setSeen();
+        when(mCategorizer.getCategory(entry)).thenReturn(NotificationCategorizer.CATEGORY_PEOPLE);
+
+        mAgingHelper.onNotificationSeen(entry);
+        verify(mAlarmManager, times(1)).setExactAndAllowWhileIdle(anyInt(), anyLong(), any());
+    }
+
+    @Test
+    public void testNoSnoozingOnSeenUserLocked() {
+        NotificationChannel channel = new NotificationChannel("", "", IMPORTANCE_HIGH);
+        channel.lockFields(NotificationChannel.USER_LOCKED_IMPORTANCE);
+        StatusBarNotification sbn = generateSbn(channel.getId());
+        NotificationEntry entry = new NotificationEntry(mPackageManager, sbn, channel);
+        when(mCategorizer.getCategory(entry)).thenReturn(NotificationCategorizer.CATEGORY_PEOPLE);
+
+        mAgingHelper.onNotificationSeen(entry);
+        verify(mAlarmManager, never()).setExactAndAllowWhileIdle(anyInt(), anyLong(), any());
+    }
+
+    @Test
+    public void testNoSnoozingOnSeenAlreadyLow() {
+        NotificationEntry entry = mock(NotificationEntry.class);
+        when(entry.getChannel()).thenReturn(new NotificationChannel("", "", IMPORTANCE_HIGH));
+        when(entry.getImportance()).thenReturn(IMPORTANCE_MIN);
+
+        mAgingHelper.onNotificationSeen(entry);
+        verify(mAlarmManager, never()).setExactAndAllowWhileIdle(anyInt(), anyLong(), any());
+    }
+}
diff --git a/packages/ExtServices/tests/src/android/ext/services/notification/AssistantTest.java b/packages/ExtServices/tests/src/android/ext/services/notification/AssistantTest.java
index bb68bc2..2820232 100644
--- a/packages/ExtServices/tests/src/android/ext/services/notification/AssistantTest.java
+++ b/packages/ExtServices/tests/src/android/ext/services/notification/AssistantTest.java
@@ -21,6 +21,8 @@
 import static android.app.NotificationManager.IMPORTANCE_MIN;
 
 import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyInt;
+import static org.mockito.ArgumentMatchers.anyString;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.never;
 import static org.mockito.Mockito.times;
@@ -33,6 +35,9 @@
 import android.app.NotificationChannel;
 import android.content.ContentResolver;
 import android.content.Intent;
+import android.content.pm.ApplicationInfo;
+import android.content.pm.IPackageManager;
+import android.os.Build;
 import android.os.UserHandle;
 import android.provider.Settings;
 import android.service.notification.Adjustment;
@@ -80,6 +85,8 @@
 
     @Mock INotificationManager mNoMan;
     @Mock AtomicFile mFile;
+    @Mock
+    IPackageManager mPackageManager;
 
     Assistant mAssistant;
     Application mApplication;
@@ -113,6 +120,11 @@
         mAssistant = getService();
         mAssistant.setNoMan(mNoMan);
         mAssistant.setFile(mFile);
+        mAssistant.setPackageManager(mPackageManager);
+        ApplicationInfo info = mock(ApplicationInfo.class);
+        when(mPackageManager.getApplicationInfo(anyString(), anyInt(), anyInt()))
+                .thenReturn(info);
+        info.targetSdkVersion = Build.VERSION_CODES.P;
         when(mFile.startWrite()).thenReturn(mock(FileOutputStream.class));
     }
 
@@ -439,4 +451,19 @@
         // With the new threshold, the blocking helper should be triggered.
         assertEquals(true, ci.shouldTriggerBlock());
     }
+
+    @Test
+    public void testTrimLiveNotifications() {
+        StatusBarNotification sbn = generateSbn(PKG1, UID1, P1C1, "no", null);
+        mAssistant.setFakeRanking(generateRanking(sbn, P1C1));
+
+        mAssistant.onNotificationPosted(sbn, mock(RankingMap.class));
+
+        assertTrue(mAssistant.mLiveNotifications.containsKey(sbn.getKey()));
+
+        mAssistant.onNotificationRemoved(
+                sbn, mock(RankingMap.class), new NotificationStats(), 0);
+
+        assertFalse(mAssistant.mLiveNotifications.containsKey(sbn.getKey()));
+    }
 }
diff --git a/packages/OsuLogin/Android.mk b/packages/OsuLogin/Android.mk
new file mode 100644
index 0000000..f04227b
--- /dev/null
+++ b/packages/OsuLogin/Android.mk
@@ -0,0 +1,14 @@
+LOCAL_PATH:= $(call my-dir)
+include $(CLEAR_VARS)
+
+LOCAL_MODULE_TAGS := optional
+LOCAL_USE_AAPT2 := true
+LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res
+
+LOCAL_SRC_FILES := $(call all-java-files-under, src)
+
+LOCAL_PACKAGE_NAME := OsuLogin
+LOCAL_PRIVATE_PLATFORM_APIS := true
+LOCAL_CERTIFICATE := platform
+
+include $(BUILD_PACKAGE)
diff --git a/packages/OsuLogin/AndroidManifest.xml b/packages/OsuLogin/AndroidManifest.xml
new file mode 100644
index 0000000..bc32d10
--- /dev/null
+++ b/packages/OsuLogin/AndroidManifest.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+-->
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+    package="com.android.hotspot2">
+    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
+    <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
+    <uses-permission android:name="android.permission.INTERNET" />
+
+    <application
+        android:networkSecurityConfig="@xml/network_security_config"
+        android:enabled="true"
+        android:label="@string/app_name"
+        android:configChanges="keyboardHidden|orientation|screenSize"
+        android:supportsRtl="true">
+        <activity android:name="com.android.hotspot2.osu.OsuLoginActivity">
+            <intent-filter>
+                <action android:name="android.net.wifi.action.PASSPOINT_LAUNCH_OSU_VIEW"/>
+                <category android:name="android.intent.category.DEFAULT"/>
+            </intent-filter>
+        </activity>
+    </application>
+</manifest>
diff --git a/packages/OsuLogin/OWNERS b/packages/OsuLogin/OWNERS
new file mode 100644
index 0000000..aa7c3e6
--- /dev/null
+++ b/packages/OsuLogin/OWNERS
@@ -0,0 +1,2 @@
+satk@google.com
+etancohen@google.com
diff --git a/packages/OsuLogin/res/layout/osu_web_view.xml b/packages/OsuLogin/res/layout/osu_web_view.xml
new file mode 100644
index 0000000..4eafb39
--- /dev/null
+++ b/packages/OsuLogin/res/layout/osu_web_view.xml
@@ -0,0 +1,13 @@
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:id="@+id/container"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent">
+    <WebView
+        android:id="@+id/webview"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:layout_alignParentBottom="true"
+        android:layout_alignParentRight="true" />
+
+</FrameLayout>
diff --git a/packages/OsuLogin/res/values/dimens.xml b/packages/OsuLogin/res/values/dimens.xml
new file mode 100644
index 0000000..47c8224
--- /dev/null
+++ b/packages/OsuLogin/res/values/dimens.xml
@@ -0,0 +1,5 @@
+<resources>
+    <!-- Default screen margins, per the Android Design guidelines. -->
+    <dimen name="activity_horizontal_margin">16dp</dimen>
+    <dimen name="activity_vertical_margin">16dp</dimen>
+</resources>
diff --git a/packages/OsuLogin/res/values/strings.xml b/packages/OsuLogin/res/values/strings.xml
new file mode 100644
index 0000000..9fafeef
--- /dev/null
+++ b/packages/OsuLogin/res/values/strings.xml
@@ -0,0 +1,4 @@
+<resources>
+    <!-- application name [CHAR LIMIT=32] -->
+    <string name="app_name">OsuLogin</string>
+</resources>
diff --git a/packages/OsuLogin/res/values/styles.xml b/packages/OsuLogin/res/values/styles.xml
new file mode 100644
index 0000000..f6c2339
--- /dev/null
+++ b/packages/OsuLogin/res/values/styles.xml
@@ -0,0 +1,19 @@
+<resources>
+
+    <!--
+        Base application theme, dependent on API level. This theme is replaced
+        by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
+    -->
+    <style name="AppBaseTheme" parent="@android:style/Theme.DeviceDefault.Settings">
+        <!--
+            Theme customizations available in newer API levels can go in
+            res/values-vXX/styles.xml, while customizations related to
+            backward-compatibility can go here.
+        -->
+    </style>
+
+    <!-- Application theme. -->
+    <style name="AppTheme" parent="AppBaseTheme">
+        <!-- All customizations that are NOT specific to a particular API-level can go here. -->
+    </style>
+</resources>
diff --git a/packages/OsuLogin/res/xml/network_security_config.xml b/packages/OsuLogin/res/xml/network_security_config.xml
new file mode 100644
index 0000000..3ef4b84
--- /dev/null
+++ b/packages/OsuLogin/res/xml/network_security_config.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<network-security-config>
+<base-config cleartextTrafficPermitted="true">
+    <trust-anchors>
+        <certificates src="system" />
+        <certificates src="wfa" />
+    </trust-anchors>
+</base-config>
+</network-security-config>
diff --git a/packages/OsuLogin/src/com/android/hotspot2/osu/OsuLoginActivity.java b/packages/OsuLogin/src/com/android/hotspot2/osu/OsuLoginActivity.java
new file mode 100644
index 0000000..6a48904
--- /dev/null
+++ b/packages/OsuLogin/src/com/android/hotspot2/osu/OsuLoginActivity.java
@@ -0,0 +1,216 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.hotspot2.osu;
+
+import android.annotation.Nullable;
+import android.app.Activity;
+import android.content.Context;
+import android.net.ConnectivityManager;
+import android.net.Network;
+import android.net.NetworkCapabilities;
+import android.net.NetworkRequest;
+import android.net.wifi.WifiManager;
+import android.os.Bundle;
+import android.util.Log;
+import android.view.KeyEvent;
+import android.webkit.WebResourceError;
+import android.webkit.WebResourceRequest;
+import android.webkit.WebSettings;
+import android.webkit.WebView;
+import android.webkit.WebViewClient;
+
+import com.android.hotspot2.R;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+
+/**
+ * Online Sign Up Login Web View launched during Provision Process of Hotspot 2.0 rel2.
+ */
+public class OsuLoginActivity extends Activity {
+    private static final String TAG = "OsuLogin";
+    private static final boolean DBG = true;
+
+    private String mUrl;
+    private String mHostName;
+    private Network mNetwork;
+    private ConnectivityManager mCm;
+    private ConnectivityManager.NetworkCallback mNetworkCallback;
+    private WifiManager mWifiManager;
+    private WebView mWebView;
+
+    @Override
+    protected void onCreate(@Nullable Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        if (DBG) {
+            Log.d(TAG, "onCreate: Opening OSU Web View");
+        }
+
+        mWifiManager = (WifiManager) getApplicationContext().getSystemService(Context.WIFI_SERVICE);
+        if (mWifiManager == null) {
+            Log.e(TAG, "Cannot get wifi service");
+            finishAndRemoveTask();
+            return;
+        }
+
+        if (getIntent() == null) {
+            Log.e(TAG, "Intent is null");
+            finishAndRemoveTask();
+            return;
+        }
+
+        mNetwork = getIntent().getParcelableExtra(WifiManager.EXTRA_OSU_NETWORK);
+        if (mNetwork == null) {
+            Log.e(TAG, "Cannot get the network instance for OSU from intent");
+            finishAndRemoveTask();
+            return;
+        }
+
+        mUrl = getIntent().getStringExtra(WifiManager.EXTRA_URL);
+        if (mUrl == null) {
+            Log.e(TAG, "Cannot get OSU server url from intent");
+            finishAndRemoveTask();
+            return;
+        }
+
+        mHostName = getHost(mUrl);
+        if (mHostName == null) {
+            Log.e(TAG, "Cannot get host from the url");
+            finishAndRemoveTask();
+            return;
+        }
+
+        mCm = (ConnectivityManager) getApplicationContext().getSystemService(
+                Context.CONNECTIVITY_SERVICE);
+        if (mCm == null) {
+            Log.e(TAG, "Cannot get connectivity service");
+            finishAndRemoveTask();
+            return;
+        }
+
+        if (!mCm.bindProcessToNetwork(mNetwork)) {
+            Log.e(TAG, "Network is no longer valid");
+            finishAndRemoveTask();
+            return;
+        }
+
+        final NetworkCapabilities networkCapabilities = mCm.getNetworkCapabilities(mNetwork);
+        if (networkCapabilities == null || !networkCapabilities.hasTransport(
+                NetworkCapabilities.TRANSPORT_WIFI)) {
+            Log.e(TAG, "WiFi is not supported for the Network");
+            finishAndRemoveTask();
+            return;
+        }
+
+        getActionBar().setDisplayShowHomeEnabled(false);
+        setContentView(R.layout.osu_web_view);
+
+        // Exit this app if network disappeared.
+        mNetworkCallback = new ConnectivityManager.NetworkCallback() {
+            @Override
+            public void onLost(Network network) {
+                if (DBG) {
+                    Log.d(TAG, "Lost for the current Network, close the browser");
+                }
+                if (mNetwork.equals(network)) {
+                    finishAndRemoveTask();
+                }
+            }
+        };
+
+        mCm.registerNetworkCallback(
+                new NetworkRequest.Builder().addTransportType(
+                        NetworkCapabilities.TRANSPORT_WIFI).build(),
+                mNetworkCallback);
+
+        mWebView = findViewById(R.id.webview);
+        mWebView.clearCache(true);
+        WebSettings webSettings = mWebView.getSettings();
+        webSettings.setJavaScriptEnabled(true);
+        webSettings.setMixedContentMode(WebSettings.MIXED_CONTENT_COMPATIBILITY_MODE);
+        webSettings.setUseWideViewPort(true);
+        webSettings.setLoadWithOverviewMode(true);
+        webSettings.setSupportZoom(true);
+        webSettings.setBuiltInZoomControls(true);
+        webSettings.setDisplayZoomControls(false);
+
+        mWebView.setWebViewClient(new OsuWebViewClient());
+        if (DBG) {
+            Log.d(TAG, "OSU Web View to " + mUrl);
+        }
+        mWebView.loadUrl(mUrl);
+    }
+
+    @Override
+    public boolean onKeyDown(int keyCode, KeyEvent event) {
+        // Check if the key event was the Back button.
+        if ((keyCode == KeyEvent.KEYCODE_BACK)) {
+            // If there is a history to move back
+            if (mWebView.canGoBack()){
+                mWebView.goBack();
+                return true;
+            }
+
+            // In case of back key, it needs to disconnect current connection with OSU AP to
+            // abort current Provisioning flow.
+            if (mWifiManager != null) {
+                mWifiManager.disconnect();
+            }
+        }
+        return super.onKeyDown(keyCode, event);
+    }
+
+    @Override
+    protected void onDestroy() {
+        if (mNetworkCallback != null) {
+            mCm.unregisterNetworkCallback(mNetworkCallback);
+        }
+        super.onDestroy();
+    }
+
+    private String getHost(String url) {
+        try {
+            return new URL(url).getHost();
+        } catch (MalformedURLException e) {
+            Log.e(TAG, "Invalid URL " + url);
+        }
+        return null;
+    }
+
+    private class OsuWebViewClient extends WebViewClient {
+        boolean mPageError = false;
+
+        @Override
+        public void onPageFinished(WebView view, String url) {
+            // Do not show the page error on UI.
+            if (mPageError) {
+                finishAndRemoveTask();
+            }
+        }
+
+        @Override
+        public void onReceivedError(WebView view, WebResourceRequest request,
+                WebResourceError error) {
+            if (request.isForMainFrame()) {
+                // This happens right after getting HTTP redirect response from an OSU server
+                // since no more Http request is allowed to send to the OSU server.
+                mPageError = true;
+                Log.e(TAG, "onReceived Error for MainFrame: " + error.getErrorCode());
+            }
+         }
+    }
+}
diff --git a/packages/PackageInstaller/AndroidManifest.xml b/packages/PackageInstaller/AndroidManifest.xml
index 513c862..2be9311 100644
--- a/packages/PackageInstaller/AndroidManifest.xml
+++ b/packages/PackageInstaller/AndroidManifest.xml
@@ -19,7 +19,7 @@
             android:label="@string/app_name"
             android:icon="@drawable/ic_app_icon"
             android:allowBackup="false"
-            android:theme="@style/DialogWhenLarge"
+            android:theme="@style/Theme.AlertDialogActivity"
             android:supportsRtl="true"
             android:defaultToDeviceProtectedStorage="true"
             android:directBootAware="true">
@@ -32,6 +32,7 @@
         </receiver>
 
         <activity android:name=".InstallStart"
+                android:theme="@android:style/Theme.Translucent.NoTitleBar"
                 android:exported="true"
                 android:excludeFromRecents="true">
             <intent-filter android:priority="1">
@@ -59,13 +60,14 @@
                 android:exported="false" />
 
         <activity android:name=".DeleteStagedFileOnResult"
+            android:theme="@android:style/Theme.Translucent.NoTitleBar"
             android:exported="false" />
 
         <activity android:name=".PackageInstallerActivity"
                 android:exported="false" />
 
         <activity android:name=".InstallInstalling"
-                android:theme="@style/DialogWhenLargeNoAnimation"
+                android:theme="@style/Theme.AlertDialogActivity.NoAnimation"
                 android:exported="false" />
 
         <receiver android:name=".InstallEventReceiver"
@@ -77,18 +79,17 @@
         </receiver>
 
         <activity android:name=".InstallSuccess"
-                android:theme="@style/DialogWhenLargeNoAnimation"
+                android:theme="@style/Theme.AlertDialogActivity.NoAnimation"
                 android:exported="false" />
 
         <activity android:name=".InstallFailed"
-                android:theme="@style/DialogWhenLargeNoAnimation"
+                android:theme="@style/Theme.AlertDialogActivity.NoAnimation"
                 android:exported="false" />
 
         <activity android:name=".UninstallerActivity"
                 android:configChanges="orientation|keyboardHidden|screenSize"
                 android:excludeFromRecents="true"
-                android:noHistory="true"
-                android:theme="@style/AlertDialogActivity">
+                android:noHistory="true">
             <intent-filter android:priority="1">
                 <action android:name="android.intent.action.DELETE" />
                 <action android:name="android.intent.action.UNINSTALL_PACKAGE" />
@@ -107,7 +108,6 @@
 
         <activity android:name=".UninstallUninstalling"
             android:excludeFromRecents="true"
-            android:theme="@style/AlertDialogActivity"
             android:exported="false" />
 
         <receiver android:name=".UninstallFinish"
diff --git a/packages/PackageInstaller/res/layout/install_confirm.xml b/packages/PackageInstaller/res/layout/install_confirm.xml
deleted file mode 100644
index 6be46fc..0000000
--- a/packages/PackageInstaller/res/layout/install_confirm.xml
+++ /dev/null
@@ -1,91 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-  Copyright (C) 2016 The Android Open Source Project
-
-   Licensed under the Apache License, Version 2.0 (the "License");
-   you may not use this file except in compliance with the License.
-   You may obtain a copy of the License at
-
-        http://www.apache.org/licenses/LICENSE-2.0
-
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.
-  -->
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:orientation="vertical">
-
-    <LinearLayout android:id="@+id/app_snippet"
-        android:background="?android:attr/colorPrimary"
-        android:layout_width="match_parent"
-        android:layout_height="?android:attr/actionBarSize"
-        android:orientation="horizontal"
-        android:elevation="@dimen/headerElevation"
-        android:gravity="center_vertical">
-
-        <ImageView android:id="@+id/app_icon"
-            android:layout_marginStart="16dp"
-            android:layout_width="24dp"
-            android:layout_height="24dp"
-            android:scaleType="fitCenter"
-            android:src="@drawable/ic_file_download" />
-
-        <TextView android:id="@+id/app_name"
-            android:layout_marginStart="32dp"
-            android:layout_marginEnd="16dp"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:textAppearance="?android:attr/titleTextStyle"
-            android:singleLine="true"
-            android:text="@string/app_name_unknown"
-            android:ellipsize="end" />
-
-    </LinearLayout>
-
-    <ScrollView android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:layout_weight="1"
-        android:padding="16dip">
-
-        <TextView android:id="@+id/install_confirm_question"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:textAppearance="?android:attr/textAppearanceMedium" />
-
-    </ScrollView>
-
-    <LinearLayout style="?android:attr/buttonBarStyle"
-        android:background="?android:attr/colorBackground"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:orientation="horizontal"
-        android:padding="8dp"
-        android:measureWithLargestChild="true">
-
-        <!-- spacer to push buttons to the right -->
-        <View android:layout_width="0dp"
-            android:layout_height="0dp"
-            android:layout_weight="1" />
-
-        <Button android:id="@+id/cancel_button"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="@string/cancel"
-            android:maxLines="2"
-            style="?android:attr/buttonBarButtonStyle" />
-
-        <Button android:id="@+id/ok_button"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="@string/install"
-            android:maxLines="2"
-            style="?android:attr/buttonBarButtonStyle" />
-
-    </LinearLayout>
-
-</LinearLayout>
diff --git a/packages/PackageInstaller/res/layout/install_content_view.xml b/packages/PackageInstaller/res/layout/install_content_view.xml
new file mode 100644
index 0000000..5e94a29
--- /dev/null
+++ b/packages/PackageInstaller/res/layout/install_content_view.xml
@@ -0,0 +1,144 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+  Copyright (C) 2018 The Android Open Source Project
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+  -->
+
+<FrameLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:theme="?android:attr/alertDialogTheme"
+    android:paddingTop="8dp"
+    android:paddingLeft="?android:attr/dialogPreferredPadding"
+    android:paddingRight="?android:attr/dialogPreferredPadding">
+
+    <LinearLayout
+        android:id="@+id/staging"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:orientation="vertical"
+        android:visibility="invisible">
+
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            style="@android:style/TextAppearance.Material.Subhead"
+            android:text="@string/message_staging" />
+
+        <ProgressBar
+            android:id="@+id/progress_indeterminate"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:paddingTop="8dp"
+            style="?android:attr/progressBarStyleHorizontal"
+            android:indeterminate="true" />
+
+    </LinearLayout>
+
+    <LinearLayout
+        android:id="@+id/installing"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:orientation="vertical"
+        android:visibility="invisible">
+
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            style="@android:style/TextAppearance.Material.Subhead"
+            android:text="@string/installing" />
+
+        <ProgressBar
+            android:id="@+id/progress"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:paddingTop="8dp"
+            style="?android:attr/progressBarStyleHorizontal" />
+
+    </LinearLayout>
+
+    <TextView
+        android:id="@+id/install_confirm_question"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        style="@android:style/TextAppearance.Material.Subhead"
+        android:text="@string/install_confirm_question"
+        android:visibility="invisible" />
+
+    <TextView
+        android:id="@+id/install_confirm_question_update"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        style="@android:style/TextAppearance.Material.Subhead"
+        android:text="@string/install_confirm_question_update"
+        android:visibility="invisible" />
+
+    <TextView
+        android:id="@+id/install_confirm_question_update_system"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        style="@android:style/TextAppearance.Material.Subhead"
+        android:text="@string/install_confirm_question_update_system"
+        android:visibility="invisible" />
+
+    <TextView
+        android:id="@+id/install_success"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        style="@android:style/TextAppearance.Material.Subhead"
+        android:text="@string/install_done"
+        android:visibility="invisible" />
+
+    <TextView
+        android:id="@+id/install_failed"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        style="@android:style/TextAppearance.Material.Subhead"
+        android:text="@string/install_failed"
+        android:visibility="invisible" />
+
+    <TextView
+        android:id="@+id/install_failed_blocked"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        style="@android:style/TextAppearance.Material.Subhead"
+        android:text="@string/install_failed_blocked"
+        android:visibility="invisible" />
+
+    <TextView
+        android:id="@+id/install_failed_conflict"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        style="@android:style/TextAppearance.Material.Subhead"
+        android:text="@string/install_failed_conflict"
+        android:visibility="invisible" />
+
+    <TextView
+        android:id="@+id/install_failed_incompatible"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        style="@android:style/TextAppearance.Material.Subhead"
+        android:text="@string/install_failed_incompatible"
+        android:visibility="invisible" />
+
+    <TextView
+        android:id="@+id/install_failed_invalid_apk"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        style="@android:style/TextAppearance.Material.Subhead"
+        android:text="@string/install_failed_invalid_apk"
+        android:visibility="invisible" />
+
+</FrameLayout>
diff --git a/packages/PackageInstaller/res/layout/install_failed.xml b/packages/PackageInstaller/res/layout/install_failed.xml
deleted file mode 100644
index d000ee9..0000000
--- a/packages/PackageInstaller/res/layout/install_failed.xml
+++ /dev/null
@@ -1,96 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-  Copyright (C) 2016 The Android Open Source Project
-
-   Licensed under the Apache License, Version 2.0 (the "License");
-   you may not use this file except in compliance with the License.
-   You may obtain a copy of the License at
-
-        http://www.apache.org/licenses/LICENSE-2.0
-
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.
-  -->
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:orientation="vertical">
-
-    <LinearLayout android:id="@+id/app_snippet"
-            android:background="?android:attr/colorPrimary"
-            android:layout_width="match_parent"
-            android:layout_height="?android:attr/actionBarSize"
-            android:orientation="horizontal"
-            android:elevation="@dimen/headerElevation"
-            android:gravity="center_vertical">
-
-        <ImageView android:id="@+id/app_icon"
-                android:layout_marginStart="16dp"
-                android:layout_width="24dp"
-                android:layout_height="24dp"
-                android:scaleType="fitCenter" />
-
-        <TextView android:id="@+id/app_name"
-                android:layout_marginStart="32dp"
-                android:layout_marginEnd="16dp"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:textAppearance="?android:attr/titleTextStyle"
-                android:singleLine="true"
-                android:ellipsize="end" />
-
-    </LinearLayout>
-
-    <LinearLayout android:id="@+id/simple_status_view"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:layout_weight="1"
-            android:gravity="center"
-            android:orientation="vertical"
-            android:paddingLeft="16dip"
-            android:paddingRight="16dip">
-
-        <ImageView android:id="@+id/center_icon"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_marginBottom="12dp"
-                android:src="@drawable/ic_report_problem_92"
-                android:tint="@color/bigIconColor"
-                android:contentDescription="@null" />
-
-        <TextView android:id="@+id/simple_status"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:textAppearance="?android:attr/textAppearanceMedium" />
-
-    </LinearLayout>
-
-    <LinearLayout android:id="@+id/buttons_panel"
-            style="?android:attr/buttonBarStyle"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:orientation="horizontal"
-            android:measureWithLargestChild="true"
-            android:padding="8dip">
-
-        <!-- spacer to push button to the right -->
-        <View android:layout_width="0dp"
-                android:layout_height="0dp"
-                android:layout_weight="1" />
-
-        <Button android:id="@+id/done_button"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:text="@string/done"
-                android:maxLines="2"
-                style="?android:attr/buttonBarButtonStyle" />
-
-    </LinearLayout>
-
-</LinearLayout>
-
-
diff --git a/packages/PackageInstaller/res/layout/install_installing.xml b/packages/PackageInstaller/res/layout/install_installing.xml
deleted file mode 100644
index a043a01..0000000
--- a/packages/PackageInstaller/res/layout/install_installing.xml
+++ /dev/null
@@ -1,108 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-
-<!-- Copyright (C) 2016 The Android Open Source Project
-
-     Licensed under the Apache License, Version 2.0 (the "License");
-     you may not use this file except in compliance with the License.
-     You may obtain a copy of the License at
-
-          http://www.apache.org/licenses/LICENSE-2.0
-
-     Unless required by applicable law or agreed to in writing, software
-     distributed under the License is distributed on an "AS IS" BASIS,
-     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-     See the License for the specific language governing permissions and
-     limitations under the License.
--->
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:orientation="vertical">
-
-    <LinearLayout android:id="@+id/app_snippet"
-            android:background="?android:attr/colorPrimary"
-            android:layout_width="match_parent"
-            android:layout_height="?android:attr/actionBarSize"
-            android:orientation="horizontal"
-            android:elevation="@dimen/headerElevation"
-            android:gravity="center_vertical">
-
-        <ImageView
-                android:id="@+id/app_icon"
-                android:layout_width="24dp"
-                android:layout_height="24dp"
-                android:layout_marginStart="16dp"
-                android:scaleType="fitCenter" />
-
-        <TextView
-                android:id="@+id/app_name"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_marginStart="32dp"
-                android:layout_marginEnd="16dp"
-                android:ellipsize="end"
-                android:singleLine="true"
-                android:textAppearance="?android:attr/titleTextStyle" />
-
-    </LinearLayout>
-
-    <LinearLayout
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:layout_weight="1"
-            android:gravity="center"
-            android:orientation="vertical"
-            android:paddingLeft="16dip"
-            android:paddingRight="16dip">
-
-        <ImageView
-                android:layout_width="92dp"
-                android:layout_height="92dp"
-                android:layout_marginBottom="12dp"
-                android:contentDescription="@null"
-                android:tint="@color/bigIconColor"
-                android:src="@drawable/ic_file_download" />
-
-        <ProgressBar
-                android:id="@+id/progress_bar"
-                style="?android:attr/progressBarStyleHorizontal"
-                android:layout_width="250dp"
-                android:layout_height="wrap_content"
-                android:indeterminate="false" />
-
-        <TextView
-                android:id="@+id/center_text"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:gravity="center_horizontal"
-                android:text="@string/installing"
-                android:textAppearance="?android:attr/textAppearanceMedium" />
-
-    </LinearLayout>
-
-    <LinearLayout
-            android:id="@+id/buttons_panel"
-            style="?android:attr/buttonBarStyle"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:measureWithLargestChild="true"
-            android:orientation="horizontal"
-            android:padding="8dip">
-
-        <View
-                android:layout_width="0dp"
-                android:layout_height="0dp"
-                android:layout_weight="1" />
-
-        <Button
-                android:id="@+id/cancel_button"
-                style="?android:attr/buttonBarButtonStyle"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:maxLines="2"
-                android:text="@string/cancel" />
-
-    </LinearLayout>
-
-</LinearLayout>
diff --git a/packages/PackageInstaller/res/layout/install_staging.xml b/packages/PackageInstaller/res/layout/install_staging.xml
deleted file mode 100644
index e3022e7..0000000
--- a/packages/PackageInstaller/res/layout/install_staging.xml
+++ /dev/null
@@ -1,113 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-  Copyright (C) 2016 The Android Open Source Project
-
-   Licensed under the Apache License, Version 2.0 (the "License");
-   you may not use this file except in compliance with the License.
-   You may obtain a copy of the License at
-
-        http://www.apache.org/licenses/LICENSE-2.0
-
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.
-  -->
-
-<!--
-  Defines the layout of the splash screen that displays the security
-  settings required for an application and requests the confirmation of the
-  user before it is installed.
--->
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:orientation="vertical">
-
-    <!-- title bar -->
-    <LinearLayout android:id="@+id/app_snippet"
-            android:layout_width="match_parent"
-            android:layout_height="?android:attr/actionBarSize"
-            android:background="?android:attr/colorPrimary"
-            android:elevation="@dimen/headerElevation"
-            android:gravity="center_vertical"
-            android:orientation="horizontal">
-
-        <ImageView android:layout_width="24dp"
-                android:layout_height="24dp"
-                android:layout_marginLeft="16dp"
-                android:scaleType="fitCenter"
-                android:src="@drawable/ic_file_download"
-                android:tint="?android:attr/colorAccent" />
-
-        <TextView android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_marginLeft="32dp"
-                android:layout_marginRight="16dp"
-                android:ellipsize="end"
-                android:singleLine="true"
-                android:text="@string/app_name_unknown"
-                android:textAppearance="?android:attr/titleTextStyle" />
-
-    </LinearLayout>
-
-    <!-- content -->
-    <LinearLayout
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:layout_weight="1"
-            android:gravity="center"
-            android:orientation="vertical"
-            android:paddingLeft="16dip"
-            android:paddingRight="16dip">
-
-        <ImageView
-                android:layout_width="92dp"
-                android:layout_height="92dp"
-                android:scaleType="fitCenter"
-                android:layout_marginBottom="12dp"
-                android:contentDescription="@null"
-                android:tint="@color/bigIconColor"
-                android:src="@drawable/ic_file_download" />
-
-        <ProgressBar
-                style="?android:attr/progressBarStyleHorizontal"
-                android:layout_width="250dp"
-                android:layout_height="wrap_content"
-                android:indeterminate="true" />
-
-        <TextView
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:gravity="center_horizontal"
-                android:text="@string/message_staging"
-                android:textAppearance="?android:attr/textAppearanceMedium" />
-
-    </LinearLayout>
-
-    <!-- Bottom buttons -->
-    <LinearLayout style="?android:attr/buttonBarStyle"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:orientation="horizontal"
-            android:padding="8dp">
-
-        <!-- spacer to push button to the right -->
-        <View android:layout_width="0dp"
-                android:layout_height="0dp"
-                android:layout_weight="1" />
-
-        <Button android:id="@+id/cancel_button"
-                style="?android:attr/buttonBarButtonStyle"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:maxLines="2"
-                android:text="@string/cancel" />
-
-    </LinearLayout>
-
-</LinearLayout>
-
-
diff --git a/packages/PackageInstaller/res/layout/install_success.xml b/packages/PackageInstaller/res/layout/install_success.xml
deleted file mode 100644
index fee6bed..0000000
--- a/packages/PackageInstaller/res/layout/install_success.xml
+++ /dev/null
@@ -1,101 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-  Copyright (C) 2016 The Android Open Source Project
-
-   Licensed under the Apache License, Version 2.0 (the "License");
-   you may not use this file except in compliance with the License.
-   You may obtain a copy of the License at
-
-        http://www.apache.org/licenses/LICENSE-2.0
-
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.
-  -->
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:orientation="vertical">
-
-    <LinearLayout android:id="@+id/app_snippet"
-            android:background="?android:attr/colorPrimary"
-            android:layout_width="match_parent"
-            android:layout_height="?android:attr/actionBarSize"
-            android:orientation="horizontal"
-            android:elevation="@dimen/headerElevation"
-            android:gravity="center_vertical">
-
-        <ImageView android:id="@+id/app_icon"
-                android:layout_marginStart="16dp"
-                android:layout_width="24dp"
-                android:layout_height="24dp"
-                android:scaleType="fitCenter" />
-
-        <TextView android:id="@+id/app_name"
-                android:layout_marginStart="32dp"
-                android:layout_marginEnd="16dp"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:textAppearance="?android:attr/titleTextStyle"
-                android:singleLine="true"
-                android:ellipsize="end" />
-
-    </LinearLayout>
-
-    <LinearLayout android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:layout_weight="1"
-            android:gravity="center"
-            android:orientation="vertical"
-            android:paddingLeft="16dip"
-            android:paddingRight="16dip">
-
-        <ImageView android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_marginBottom="12dp"
-                android:src="@drawable/ic_done_92"
-                android:tint="@color/bigIconColor"
-                android:contentDescription="@null" />
-
-        <TextView android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:gravity="center_horizontal"
-                android:text="@string/install_done"
-                android:textAppearance="?android:attr/textAppearanceMedium" />
-
-    </LinearLayout>
-
-    <LinearLayout style="?android:attr/buttonBarStyle"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:orientation="horizontal"
-            android:measureWithLargestChild="true"
-            android:padding="8dip">
-
-        <!-- spacer to push buttons to the right -->
-        <View android:layout_width="0dp"
-                android:layout_height="0dp"
-                android:layout_weight="1" />
-
-        <Button android:id="@+id/done_button"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:text="@string/done"
-                android:maxLines="2"
-                style="?android:attr/buttonBarButtonStyle" />
-
-        <Button android:id="@+id/launch_button"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:text="@string/launch"
-                android:maxLines="2"
-                style="?android:attr/buttonBarButtonStyle" />
-
-    </LinearLayout>
-
-</LinearLayout>
-
-
diff --git a/packages/PackageInstaller/res/values-night/themes.xml b/packages/PackageInstaller/res/values-night/themes.xml
new file mode 100644
index 0000000..483b0cf
--- /dev/null
+++ b/packages/PackageInstaller/res/values-night/themes.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+  Copyright (C) 2018 The Android Open Source Project
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+  -->
+
+<resources>
+
+    <style name="Theme.AlertDialogActivity"
+            parent="@android:style/Theme.DeviceDefault.Dialog.Alert" />
+
+</resources>
diff --git a/packages/PackageInstaller/res/values/strings.xml b/packages/PackageInstaller/res/values/strings.xml
index 6c7160f..ba81278 100644
--- a/packages/PackageInstaller/res/values/strings.xml
+++ b/packages/PackageInstaller/res/values/strings.xml
@@ -36,11 +36,11 @@
     <!-- Message for updating an existing app [CHAR LIMIT=NONE] -->
     <string name="install_confirm_question_update">Do you want to install an update
             to this existing application?  Your existing data will not
-            be lost.  The updated application will get access to:</string>
+            be lost.</string>
     <!-- Message for updating an existing system app [CHAR LIMIT=NONE] -->
     <string name="install_confirm_question_update_system">Do you want to install an update
             to this built-in application?  Your existing data will not
-            be lost.  The updated application will get access to:</string>
+            be lost.</string>
     <!-- [CHAR LIMIT=100] -->
     <string name="install_failed">App not installed.</string>
     <!-- Reason displayed when installation fails because the package was blocked
diff --git a/packages/PackageInstaller/res/values/styles.xml b/packages/PackageInstaller/res/values/styles.xml
deleted file mode 100755
index f79f98f..0000000
--- a/packages/PackageInstaller/res/values/styles.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2010 The Android Open Source Project
-
-     Licensed under the Apache License, Version 2.0 (the "License");
-     you may not use this file except in compliance with the License.
-     You may obtain a copy of the License at
-
-          http://www.apache.org/licenses/LICENSE-2.0
-
-     Unless required by applicable law or agreed to in writing, software
-     distributed under the License is distributed on an "AS IS" BASIS,
-     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-     See the License for the specific language governing permissions and
-     limitations under the License.
--->
-
-<resources>
-
-    <style name="MediumText"
-            parent="@android:style/TextAppearance.Medium">
-        <item name="android:textColor">?android:attr/textColorPrimary</item>
-    </style>
-
-    <style name="SmallText"
-            parent="@android:style/TextAppearance.Small">
-        <item name="android:textColor">?android:attr/textColorPrimary</item>
-    </style>
-
-    <style name="TitleText">
-        <item name="android:fontFamily">sans-serif-medium</item>
-        <item name="android:textSize">20dp</item>
-        <item name="android:textColor">?android:attr/textColorPrimary</item>
-    </style>
-
-    <style name="ActionBar" parent="@android:style/Widget.Material.ActionBar.Solid">
-        <item name="android:contentInsetStart">72dp</item>
-    </style>
-
-</resources>
diff --git a/packages/PackageInstaller/res/values/themes.xml b/packages/PackageInstaller/res/values/themes.xml
index 6df6246..6c8e4c5 100644
--- a/packages/PackageInstaller/res/values/themes.xml
+++ b/packages/PackageInstaller/res/values/themes.xml
@@ -17,25 +17,11 @@
 
 <resources>
 
-    <style name="DialogWhenLarge"
-            parent="@android:style/Theme.DeviceDefault.Light.NoActionBar">
-        <item name="android:textAppearanceMedium">@style/MediumText</item>
-        <item name="android:textAppearanceSmall">@style/SmallText</item>
-        <item name="android:titleTextStyle">@style/TitleText</item>
-    </style>
-
-    <style name="DialogWhenLargeNoAnimation" parent="DialogWhenLarge">
+    <style name="Theme.AlertDialogActivity.NoAnimation">
         <item name="android:windowAnimationStyle">@null</item>
     </style>
 
-    <style name="AlertDialogActivity"
-            parent="@android:style/Theme.DeviceDefault.Light.Panel">
-        <item name="android:backgroundDimEnabled">true</item>
-    </style>
-
-    <style name="Header.Settings"
-            parent="@android:style/Theme.DeviceDefault.Settings">
-    </style>
-
+    <style name="Theme.AlertDialogActivity"
+            parent="@android:style/Theme.DeviceDefault.Light.Dialog.Alert" />
 
 </resources>
diff --git a/packages/PackageInstaller/src/com/android/packageinstaller/InstallFailed.java b/packages/PackageInstaller/src/com/android/packageinstaller/InstallFailed.java
index 5ba2d32..54105bb 100644
--- a/packages/PackageInstaller/src/com/android/packageinstaller/InstallFailed.java
+++ b/packages/PackageInstaller/src/com/android/packageinstaller/InstallFailed.java
@@ -30,41 +30,49 @@
 import android.net.Uri;
 import android.os.Bundle;
 import android.util.Log;
-import android.widget.TextView;
+import android.view.View;
+
+import com.android.internal.app.AlertActivity;
 
 import java.io.File;
 
 /**
  * Installation failed: Return status code to the caller or display failure UI to user
  */
-public class InstallFailed extends Activity {
+public class InstallFailed extends AlertActivity {
     private static final String LOG_TAG = InstallFailed.class.getSimpleName();
 
     /** Label of the app that failed to install */
     private CharSequence mLabel;
 
     /**
-     * Convert an package installer status code into the user friendly label.
+     * Unhide the appropriate label for the statusCode.
      *
      * @param statusCode The status code from the package installer.
-     *
-     * @return The user friendly label for the status code
      */
-    private int getExplanationFromErrorCode(int statusCode) {
+    private void setExplanationFromErrorCode(int statusCode) {
         Log.d(LOG_TAG, "Installation status code: " + statusCode);
 
+        View viewToEnable;
         switch (statusCode) {
             case PackageInstaller.STATUS_FAILURE_BLOCKED:
-                return R.string.install_failed_blocked;
+                viewToEnable = requireViewById(R.id.install_failed_blocked);
+                break;
             case PackageInstaller.STATUS_FAILURE_CONFLICT:
-                return R.string.install_failed_conflict;
+                viewToEnable = requireViewById(R.id.install_failed_conflict);
+                break;
             case PackageInstaller.STATUS_FAILURE_INCOMPATIBLE:
-                return R.string.install_failed_incompatible;
+                viewToEnable = requireViewById(R.id.install_failed_incompatible);
+                break;
             case PackageInstaller.STATUS_FAILURE_INVALID:
-                return R.string.install_failed_invalid_apk;
+                viewToEnable = requireViewById(R.id.install_failed_invalid_apk);
+                break;
             default:
-                return R.string.install_failed;
+                viewToEnable = requireViewById(R.id.install_failed);
+                break;
         }
+
+        viewToEnable.setVisibility(View.VISIBLE);
     }
 
     @Override
@@ -89,8 +97,6 @@
                     .getParcelableExtra(PackageUtil.INTENT_ATTR_APPLICATION_INFO);
             Uri packageURI = intent.getData();
 
-            setContentView(R.layout.install_failed);
-
             // Set header icon and title
             PackageUtil.AppSnippet as;
             PackageManager pm = getPackageManager();
@@ -106,7 +112,12 @@
             // Store label for dialog
             mLabel = as.label;
 
-            PackageUtil.initSnippetForNewApp(this, as, R.id.app_snippet);
+            mAlert.setIcon(as.icon);
+            mAlert.setTitle(as.label);
+            mAlert.setView(R.layout.install_content_view);
+            mAlert.setButton(DialogInterface.BUTTON_POSITIVE, getString(R.string.done),
+                    (ignored, ignored2) -> finish(), null);
+            setupAlert();
 
             // Show out of space dialog if needed
             if (statusCode == PackageInstaller.STATUS_FAILURE_STORAGE) {
@@ -114,11 +125,7 @@
             }
 
             // Get status messages
-            ((TextView) findViewById(R.id.simple_status)).setText(
-                    getExplanationFromErrorCode(statusCode));
-
-            // Set up "done" button
-            findViewById(R.id.done_button).setOnClickListener(view -> finish());
+            setExplanationFromErrorCode(statusCode);
         }
     }
 
diff --git a/packages/PackageInstaller/src/com/android/packageinstaller/InstallInstalling.java b/packages/PackageInstaller/src/com/android/packageinstaller/InstallInstalling.java
index c2dd740..deb6163 100755
--- a/packages/PackageInstaller/src/com/android/packageinstaller/InstallInstalling.java
+++ b/packages/PackageInstaller/src/com/android/packageinstaller/InstallInstalling.java
@@ -19,8 +19,8 @@
 import static android.content.pm.PackageInstaller.SessionParams.UID_UNKNOWN;
 
 import android.annotation.Nullable;
-import android.app.Activity;
 import android.app.PendingIntent;
+import android.content.DialogInterface;
 import android.content.Intent;
 import android.content.pm.ApplicationInfo;
 import android.content.pm.PackageInstaller;
@@ -30,9 +30,11 @@
 import android.os.AsyncTask;
 import android.os.Bundle;
 import android.util.Log;
+import android.view.View;
 import android.widget.Button;
 import android.widget.ProgressBar;
 
+import com.android.internal.app.AlertActivity;
 import com.android.internal.content.PackageHelper;
 
 import java.io.File;
@@ -47,7 +49,7 @@
  * <p>This has two phases: First send the data to the package manager, then wait until the package
  * manager processed the result.</p>
  */
-public class InstallInstalling extends Activity {
+public class InstallInstalling extends AlertActivity {
     private static final String LOG_TAG = InstallInstalling.class.getSimpleName();
 
     private static final String SESSION_ID = "com.android.packageinstaller.SESSION_ID";
@@ -78,11 +80,31 @@
     protected void onCreate(@Nullable Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
 
-        setContentView(R.layout.install_installing);
-
         ApplicationInfo appInfo = getIntent()
                 .getParcelableExtra(PackageUtil.INTENT_ATTR_APPLICATION_INFO);
         mPackageURI = getIntent().getData();
+        final File sourceFile = new File(mPackageURI.getPath());
+        PackageUtil.AppSnippet as = PackageUtil.getAppSnippet(this, appInfo, sourceFile);
+
+        mAlert.setIcon(as.icon);
+        mAlert.setTitle(as.label);
+        mAlert.setView(R.layout.install_content_view);
+        mAlert.setButton(DialogInterface.BUTTON_NEGATIVE, getString(R.string.cancel),
+                (ignored, ignored2) -> {
+                    if (mInstallingTask != null) {
+                        mInstallingTask.cancel(true);
+                    }
+
+                    if (mSessionId > 0) {
+                        getPackageManager().getPackageInstaller().abandonSession(mSessionId);
+                        mSessionId = 0;
+                    }
+
+                    setResult(RESULT_CANCELED);
+                    finish();
+                }, null);
+        setupAlert();
+        requireViewById(R.id.installing).setVisibility(View.VISIBLE);
 
         if ("package".equals(mPackageURI.getScheme())) {
             try {
@@ -92,10 +114,6 @@
                 launchFailure(PackageManager.INSTALL_FAILED_INTERNAL_ERROR, null);
             }
         } else {
-            final File sourceFile = new File(mPackageURI.getPath());
-            PackageUtil.initSnippetForNewApp(this, PackageUtil.getAppSnippet(this, appInfo,
-                    sourceFile), R.id.app_snippet);
-
             if (savedInstanceState != null) {
                 mSessionId = savedInstanceState.getInt(SESSION_ID);
                 mInstallId = savedInstanceState.getInt(INSTALL_ID);
@@ -153,21 +171,7 @@
                 }
             }
 
-            mCancelButton = (Button) findViewById(R.id.cancel_button);
-
-            mCancelButton.setOnClickListener(view -> {
-                if (mInstallingTask != null) {
-                    mInstallingTask.cancel(true);
-                }
-
-                if (mSessionId > 0) {
-                    getPackageManager().getPackageInstaller().abandonSession(mSessionId);
-                    mSessionId = 0;
-                }
-
-                setResult(RESULT_CANCELED);
-                finish();
-            });
+            mCancelButton = mAlert.getButton(DialogInterface.BUTTON_NEGATIVE);
 
             mSessionCallback = new InstallSessionCallback();
         }
@@ -307,7 +311,7 @@
         @Override
         public void onProgressChanged(int sessionId, float progress) {
             if (sessionId == mSessionId) {
-                ProgressBar progressBar = (ProgressBar)findViewById(R.id.progress_bar);
+                ProgressBar progressBar = requireViewById(R.id.progress);
                 progressBar.setMax(Integer.MAX_VALUE);
                 progressBar.setProgress((int) (Integer.MAX_VALUE * progress));
             }
diff --git a/packages/PackageInstaller/src/com/android/packageinstaller/InstallStaging.java b/packages/PackageInstaller/src/com/android/packageinstaller/InstallStaging.java
index 1bc9dbd..98438cd 100644
--- a/packages/PackageInstaller/src/com/android/packageinstaller/InstallStaging.java
+++ b/packages/PackageInstaller/src/com/android/packageinstaller/InstallStaging.java
@@ -29,6 +29,9 @@
 import android.os.AsyncTask;
 import android.os.Bundle;
 import android.util.Log;
+import android.view.View;
+
+import com.android.internal.app.AlertActivity;
 
 import java.io.File;
 import java.io.FileOutputStream;
@@ -40,7 +43,7 @@
  * If a package gets installed from an content URI this step loads the package and turns it into
  * and installation from a file. Then it re-starts the installation as usual.
  */
-public class InstallStaging extends Activity {
+public class InstallStaging extends AlertActivity {
     private static final String LOG_TAG = InstallStaging.class.getSimpleName();
 
     private static final String STAGED_FILE = "STAGED_FILE";
@@ -55,7 +58,19 @@
     protected void onCreate(@Nullable Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
 
-        setContentView(R.layout.install_staging);
+        mAlert.setIcon(R.drawable.ic_file_download);
+        mAlert.setTitle(getString(R.string.app_name_unknown));
+        mAlert.setView(R.layout.install_content_view);
+        mAlert.setButton(DialogInterface.BUTTON_NEGATIVE, getString(R.string.cancel),
+                (ignored, ignored2) -> {
+                    if (mStagingTask != null) {
+                        mStagingTask.cancel(true);
+                    }
+                    setResult(RESULT_CANCELED);
+                    finish();
+                }, null);
+        setupAlert();
+        requireViewById(R.id.staging).setVisibility(View.VISIBLE);
 
         if (savedInstanceState != null) {
             mStagedFile = new File(savedInstanceState.getString(STAGED_FILE));
@@ -64,14 +79,6 @@
                 mStagedFile = null;
             }
         }
-
-        findViewById(R.id.cancel_button).setOnClickListener(view -> {
-            if (mStagingTask != null) {
-                mStagingTask.cancel(true);
-            }
-            setResult(RESULT_CANCELED);
-            finish();
-        });
     }
 
     @Override
diff --git a/packages/PackageInstaller/src/com/android/packageinstaller/InstallSuccess.java b/packages/PackageInstaller/src/com/android/packageinstaller/InstallSuccess.java
index 94f6b31..705d3f4 100644
--- a/packages/PackageInstaller/src/com/android/packageinstaller/InstallSuccess.java
+++ b/packages/PackageInstaller/src/com/android/packageinstaller/InstallSuccess.java
@@ -19,6 +19,7 @@
 import android.annotation.Nullable;
 import android.app.Activity;
 import android.content.ActivityNotFoundException;
+import android.content.DialogInterface;
 import android.content.Intent;
 import android.content.pm.ApplicationInfo;
 import android.content.pm.PackageManager;
@@ -26,15 +27,18 @@
 import android.net.Uri;
 import android.os.Bundle;
 import android.util.Log;
+import android.view.View;
 import android.widget.Button;
 
+import com.android.internal.app.AlertActivity;
+
 import java.io.File;
 import java.util.List;
 
 /**
  * Finish installation: Return status code to the caller or display "success" UI to user
  */
-public class InstallSuccess extends Activity {
+public class InstallSuccess extends AlertActivity {
     private static final String LOG_TAG = InstallSuccess.class.getSimpleName();
 
     @Override
@@ -53,8 +57,6 @@
                     intent.getParcelableExtra(PackageUtil.INTENT_ATTR_APPLICATION_INFO);
             Uri packageURI = intent.getData();
 
-            setContentView(R.layout.install_success);
-
             // Set header icon and title
             PackageUtil.AppSnippet as;
             PackageManager pm = getPackageManager();
@@ -67,16 +69,20 @@
                 as = PackageUtil.getAppSnippet(this, appInfo, sourceFile);
             }
 
-            PackageUtil.initSnippetForNewApp(this, as, R.id.app_snippet);
-
-            // Set up "done" button
-            findViewById(R.id.done_button).setOnClickListener(view -> {
-                if (appInfo.packageName != null) {
-                    Log.i(LOG_TAG, "Finished installing " + appInfo.packageName);
-                }
-                finish();
-            });
-
+            mAlert.setIcon(as.icon);
+            mAlert.setTitle(as.label);
+            mAlert.setView(R.layout.install_content_view);
+            mAlert.setButton(DialogInterface.BUTTON_POSITIVE, getString(R.string.launch), null,
+                    null);
+            mAlert.setButton(DialogInterface.BUTTON_NEGATIVE, getString(R.string.done),
+                    (ignored, ignored2) -> {
+                        if (appInfo.packageName != null) {
+                            Log.i(LOG_TAG, "Finished installing " + appInfo.packageName);
+                        }
+                        finish();
+                    }, null);
+            setupAlert();
+            requireViewById(R.id.install_success).setVisibility(View.VISIBLE);
             // Enable or disable "launch" button
             Intent launchIntent = getPackageManager().getLaunchIntentForPackage(
                     appInfo.packageName);
@@ -89,7 +95,7 @@
                 }
             }
 
-            Button launchButton = (Button)findViewById(R.id.launch_button);
+            Button launchButton = mAlert.getButton(DialogInterface.BUTTON_POSITIVE);
             if (enabled) {
                 launchButton.setOnClickListener(view -> {
                     try {
diff --git a/packages/PackageInstaller/src/com/android/packageinstaller/OverlayTouchActivity.java b/packages/PackageInstaller/src/com/android/packageinstaller/OverlayTouchActivity.java
deleted file mode 100644
index 1fdbd97..0000000
--- a/packages/PackageInstaller/src/com/android/packageinstaller/OverlayTouchActivity.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright (C) 2018 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.packageinstaller;
-
-import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS;
-
-import android.app.Activity;
-import android.os.Bundle;
-
-class OverlayTouchActivity extends Activity {
-    @Override
-    protected void onCreate(Bundle savedInstanceState) {
-        getWindow().addPrivateFlags(PRIVATE_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS);
-        super.onCreate(savedInstanceState);
-    }
-}
diff --git a/packages/PackageInstaller/src/com/android/packageinstaller/PackageInstallerActivity.java b/packages/PackageInstaller/src/com/android/packageinstaller/PackageInstallerActivity.java
index 97bafe7..580308a 100644
--- a/packages/PackageInstaller/src/com/android/packageinstaller/PackageInstallerActivity.java
+++ b/packages/PackageInstaller/src/com/android/packageinstaller/PackageInstallerActivity.java
@@ -16,6 +16,8 @@
 */
 package com.android.packageinstaller;
 
+import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS;
+
 import android.Manifest;
 import android.annotation.NonNull;
 import android.annotation.StringRes;
@@ -45,9 +47,9 @@
 import android.provider.Settings;
 import android.util.Log;
 import android.view.View;
-import android.view.View.OnClickListener;
 import android.widget.Button;
-import android.widget.TextView;
+
+import com.android.internal.app.AlertActivity;
 
 import java.io.File;
 
@@ -61,7 +63,7 @@
  * Based on the user response the package is then installed by launching InstallAppConfirm
  * sub activity. All state transitions are handled in this activity
  */
-public class PackageInstallerActivity extends OverlayTouchActivity implements OnClickListener {
+public class PackageInstallerActivity extends AlertActivity {
     private static final String TAG = "PackageInstaller";
 
     private static final int REQUEST_TRUST_EXTERNAL_SOURCE = 1;
@@ -95,7 +97,6 @@
 
     // Buttons to indicate user acceptance
     private Button mOk;
-    private Button mCancel;
 
     private PackageUtil.AppSnippet mAppSnippet;
 
@@ -119,18 +120,18 @@
     private boolean mEnableOk = false;
 
     private void startInstallConfirm() {
-        int msg;
+        View viewToEnable;
 
         if (mAppInfo != null) {
-            msg = (mAppInfo.flags & ApplicationInfo.FLAG_SYSTEM) != 0
-                    ? R.string.install_confirm_question_update_system
-                    : R.string.install_confirm_question_update;
+            viewToEnable = (mAppInfo.flags & ApplicationInfo.FLAG_SYSTEM) != 0
+                    ? requireViewById(R.id.install_confirm_question_update_system)
+                    : requireViewById(R.id.install_confirm_question_update);
         } else {
             // This is a new application with no permissions.
-            msg = R.string.install_confirm_question;
+            viewToEnable = requireViewById(R.id.install_confirm_question);
         }
 
-        ((TextView) findViewById(R.id.install_confirm_question)).setText(msg);
+        viewToEnable.setVisibility(View.VISIBLE);
 
         mEnableOk = true;
         mOk.setEnabled(true);
@@ -280,6 +281,8 @@
 
     @Override
     protected void onCreate(Bundle icicle) {
+        getWindow().addPrivateFlags(PRIVATE_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS);
+
         super.onCreate(null);
 
         if (icicle != null) {
@@ -344,7 +347,7 @@
 
         // load dummy layout with OK button disabled until we override this layout in
         // startInstallConfirm
-        bindUi(R.layout.install_confirm);
+        bindUi();
         checkIfAllowedAndInitiateInstall();
     }
 
@@ -374,17 +377,34 @@
         outState.putBoolean(ALLOW_UNKNOWN_SOURCES_KEY, mAllowUnknownSources);
     }
 
-    private void bindUi(int layout) {
-        setContentView(layout);
+    private void bindUi() {
+        mAlert.setIcon(mAppSnippet.icon);
+        mAlert.setTitle(mAppSnippet.label);
+        mAlert.setView(R.layout.install_content_view);
+        mAlert.setButton(DialogInterface.BUTTON_POSITIVE, getString(R.string.install),
+                (ignored, ignored2) -> {
+                    if (mOk.isEnabled()) {
+                        if (mSessionId != -1) {
+                            mInstaller.setPermissionsResult(mSessionId, true);
+                            finish();
+                        } else {
+                            startInstall();
+                        }
+                    }
+                }, null);
+        mAlert.setButton(DialogInterface.BUTTON_NEGATIVE, getString(R.string.cancel),
+                (ignored, ignored2) -> {
+                    // Cancel and finish
+                    setResult(RESULT_CANCELED);
+                    if (mSessionId != -1) {
+                        mInstaller.setPermissionsResult(mSessionId, false);
+                    }
+                    finish();
+                }, null);
+        setupAlert();
 
-        mOk = (Button) findViewById(R.id.ok_button);
-        mCancel = (Button)findViewById(R.id.cancel_button);
-        mOk.setOnClickListener(this);
-        mCancel.setOnClickListener(this);
-
+        mOk = mAlert.getButton(DialogInterface.BUTTON_POSITIVE);
         mOk.setEnabled(false);
-
-        PackageUtil.initSnippetForNewApp(this, mAppSnippet, R.id.app_snippet);
     }
 
     /**
@@ -525,26 +545,6 @@
         super.onBackPressed();
     }
 
-    public void onClick(View v) {
-        if (v == mOk) {
-            if (mOk.isEnabled()) {
-                if (mSessionId != -1) {
-                    mInstaller.setPermissionsResult(mSessionId, true);
-                    finish();
-                } else {
-                    startInstall();
-                }
-            }
-        } else if (v == mCancel) {
-            // Cancel and finish
-            setResult(RESULT_CANCELED);
-            if (mSessionId != -1) {
-                mInstaller.setPermissionsResult(mSessionId, false);
-            }
-            finish();
-        }
-    }
-
     private void startInstall() {
         // Start subactivity to actually install the application
         Intent newIntent = new Intent();
diff --git a/packages/PackageInstaller/src/com/android/packageinstaller/PackageUtil.java b/packages/PackageInstaller/src/com/android/packageinstaller/PackageUtil.java
index ba4bf8a..0e89f56 100644
--- a/packages/PackageInstaller/src/com/android/packageinstaller/PackageUtil.java
+++ b/packages/PackageInstaller/src/com/android/packageinstaller/PackageUtil.java
@@ -108,26 +108,6 @@
                 icon);
     }
 
-    /**
-     * Utility method to display application snippet of a new package.
-     * The content view should have been set on context before invoking this method.
-     * appSnippet view should include R.id.app_icon and R.id.app_name
-     * defined on it.
-     *
-     * @param pContext context of package that can load the resources
-     * @param as The resources to be loaded
-     * @param snippetId view id of app snippet view
-     */
-    @NonNull public static View initSnippetForNewApp(@NonNull Activity pContext,
-            @NonNull AppSnippet as, int snippetId) {
-        View appSnippet = pContext.findViewById(snippetId);
-        if (as.icon != null) {
-            ((ImageView) appSnippet.findViewById(R.id.app_icon)).setImageDrawable(as.icon);
-        }
-        ((TextView)appSnippet.findViewById(R.id.app_name)).setText(as.label);
-        return appSnippet;
-    }
-
     static public class AppSnippet {
         @NonNull public CharSequence label;
         @Nullable public Drawable icon;
diff --git a/packages/SettingsLib/OWNERS b/packages/SettingsLib/OWNERS
index 4211c27..d188c65 100644
--- a/packages/SettingsLib/OWNERS
+++ b/packages/SettingsLib/OWNERS
@@ -8,8 +8,8 @@
 evanlaird@google.com
 jackqdyulei@google.com
 jmonk@google.com
+leifhendrik@google.com
 mfritze@google.com
-nicoya@google.com
 rogerxue@google.com
 virgild@google.com
 zhfan@google.com
@@ -18,4 +18,4 @@
 miket@google.com
 
 # Exempt resource files (because they are in a flat directory and too hard to manage via OWNERS)
-per-file *.xml=*
\ No newline at end of file
+per-file *.xml=*
diff --git a/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java b/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java
index 5ecbe80..c511589 100644
--- a/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java
+++ b/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java
@@ -1189,7 +1189,7 @@
     /**
      * @return {@code true} if {@code cachedBluetoothDevice} is a2dp device
      */
-    public boolean isA2dpDevice() {
+    public boolean isConnectedA2dpDevice() {
         A2dpProfile a2dpProfile = mProfileManager.getA2dpProfile();
         return a2dpProfile != null && a2dpProfile.getConnectionStatus(mDevice) ==
                 BluetoothProfile.STATE_CONNECTED;
@@ -1198,7 +1198,7 @@
     /**
      * @return {@code true} if {@code cachedBluetoothDevice} is HFP device
      */
-    public boolean isHfpDevice() {
+    public boolean isConnectedHfpDevice() {
         HeadsetProfile headsetProfile = mProfileManager.getHeadsetProfile();
         return headsetProfile != null && headsetProfile.getConnectionStatus(mDevice) ==
                 BluetoothProfile.STATE_CONNECTED;
diff --git a/packages/SettingsLib/src/com/android/settingslib/drawer/Tile.java b/packages/SettingsLib/src/com/android/settingslib/drawer/Tile.java
index 84c8b21..6d60a09 100644
--- a/packages/SettingsLib/src/com/android/settingslib/drawer/Tile.java
+++ b/packages/SettingsLib/src/com/android/settingslib/drawer/Tile.java
@@ -21,6 +21,9 @@
 import static com.android.settingslib.drawer.TileUtils.META_DATA_PREFERENCE_ICON;
 import static com.android.settingslib.drawer.TileUtils.META_DATA_PREFERENCE_ICON_URI;
 import static com.android.settingslib.drawer.TileUtils.META_DATA_PREFERENCE_KEYHINT;
+import static com.android.settingslib.drawer.TileUtils.META_DATA_PREFERENCE_SUMMARY;
+import static com.android.settingslib.drawer.TileUtils.META_DATA_PREFERENCE_SUMMARY_URI;
+import static com.android.settingslib.drawer.TileUtils.META_DATA_PREFERENCE_TITLE;
 import static com.android.settingslib.drawer.TileUtils.PROFILE_ALL;
 import static com.android.settingslib.drawer.TileUtils.PROFILE_PRIMARY;
 
@@ -29,16 +32,19 @@
 import android.content.pm.ActivityInfo;
 import android.content.pm.PackageManager;
 import android.content.pm.ResolveInfo;
+import android.content.res.Resources;
 import android.graphics.drawable.Icon;
 import android.os.Bundle;
 import android.os.Parcel;
 import android.os.Parcelable;
 import android.os.UserHandle;
 import android.text.TextUtils;
+import android.util.Log;
 
 import java.util.ArrayList;
 import java.util.Comparator;
 import java.util.List;
+import java.util.Objects;
 
 /**
  * Description of a single dashboard tile that the user can select.
@@ -48,20 +54,6 @@
     private static final String TAG = "Tile";
 
     /**
-     * Title of the tile that is shown to the user.
-     *
-     * @attr ref android.R.styleable#PreferenceHeader_title
-     */
-    public CharSequence title;
-
-    /**
-     * Optional summary describing what this tile controls.
-     *
-     * @attr ref android.R.styleable#PreferenceHeader_summary
-     */
-    public CharSequence summary;
-
-    /**
      * Optional list of user handles which the intent should be launched on.
      */
     public ArrayList<UserHandle> userHandle = new ArrayList<>();
@@ -70,11 +62,13 @@
      * The metaData from the activity that defines this tile.
      */
     private final Bundle mMetaData;
+
     private final String mActivityPackage;
     private final String mActivityName;
     private final Intent mIntent;
-
     private ActivityInfo mActivityInfo;
+    private CharSequence mSummaryOverride;
+
     private String mCategory;
 
     public Tile(ActivityInfo activityInfo, String category) {
@@ -90,8 +84,6 @@
         mActivityPackage = in.readString();
         mActivityName = in.readString();
         mIntent = new Intent().setClassName(mActivityPackage, mActivityName);
-        title = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(in);
-        summary = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(in);
         final int N = in.readInt();
         for (int i = 0; i < N; i++) {
             userHandle.add(UserHandle.CREATOR.createFromParcel(in));
@@ -109,8 +101,6 @@
     public void writeToParcel(Parcel dest, int flags) {
         dest.writeString(mActivityPackage);
         dest.writeString(mActivityName);
-        TextUtils.writeToParcel(title, dest, flags);
-        TextUtils.writeToParcel(summary, dest, flags);
         final int N = userHandle.size();
         dest.writeInt(N);
         for (int i = 0; i < N; i++) {
@@ -120,6 +110,14 @@
         dest.writeBundle(mMetaData);
     }
 
+    public int getId() {
+        return Objects.hash(mActivityPackage, mActivityName);
+    }
+
+    public String getDescription() {
+        return mActivityPackage + "/" + mActivityName;
+    }
+
     public String getPackageName() {
         return mActivityPackage;
     }
@@ -158,6 +156,84 @@
                 && mMetaData.get(META_DATA_KEY_ORDER) instanceof Integer;
     }
 
+    /**
+     * Title of the tile that is shown to the user.
+     */
+    public CharSequence getTitle(Context context) {
+        CharSequence title = null;
+        final PackageManager packageManager = context.getPackageManager();
+        if (mMetaData.containsKey(META_DATA_PREFERENCE_TITLE)) {
+            if (mMetaData.get(META_DATA_PREFERENCE_TITLE) instanceof Integer) {
+                try {
+                    final Resources res =
+                            packageManager.getResourcesForApplication(mActivityPackage);
+                    title = res.getString(mMetaData.getInt(META_DATA_PREFERENCE_TITLE));
+                } catch (PackageManager.NameNotFoundException | Resources.NotFoundException e) {
+                    Log.d(TAG, "Couldn't find info", e);
+                }
+            } else {
+                title = mMetaData.getString(META_DATA_PREFERENCE_TITLE);
+            }
+        }
+        // Set the preference title to the activity's label if no
+        // meta-data is found
+        if (title == null) {
+            title = getActivityInfo(context).loadLabel(packageManager);
+        }
+        return title;
+    }
+
+    /**
+     * Returns the raw metadata for summary, this is used for comparing 2 summary text without
+     * loading the real string.
+     */
+    public String getSummaryReference() {
+        if (mSummaryOverride != null) {
+            return mSummaryOverride.toString();
+        }
+        if (mMetaData != null && mMetaData.containsKey(META_DATA_PREFERENCE_SUMMARY)) {
+            return mMetaData.get(META_DATA_PREFERENCE_SUMMARY).toString();
+        }
+        return null;
+    }
+
+    /**
+     * Overrides the summary. This can happen when injected tile wants to provide dynamic summary.
+     */
+    public void overrideSummary(CharSequence summaryOverride) {
+        mSummaryOverride = summaryOverride;
+    }
+
+    /**
+     * Optional summary describing what this tile controls.
+     */
+    public CharSequence getSummary(Context context) {
+        if (mSummaryOverride != null) {
+            return mSummaryOverride;
+        }
+        CharSequence summary = null;
+        final PackageManager packageManager = context.getPackageManager();
+        if (mMetaData != null) {
+            if (mMetaData.containsKey(META_DATA_PREFERENCE_SUMMARY_URI)) {
+                return null;
+            }
+            if (mMetaData.containsKey(META_DATA_PREFERENCE_SUMMARY)) {
+                if (mMetaData.get(META_DATA_PREFERENCE_SUMMARY) instanceof Integer) {
+                    try {
+                        final Resources res =
+                                packageManager.getResourcesForApplication(mActivityPackage);
+                        summary = res.getString(mMetaData.getInt(META_DATA_PREFERENCE_SUMMARY));
+                    } catch (PackageManager.NameNotFoundException | Resources.NotFoundException e) {
+                        Log.d(TAG, "Couldn't find info", e);
+                    }
+                } else {
+                    summary = mMetaData.getString(META_DATA_PREFERENCE_SUMMARY);
+                }
+            }
+        }
+        return summary;
+    }
+
     public Bundle getMetaData() {
         return mMetaData;
     }
diff --git a/packages/SettingsLib/src/com/android/settingslib/drawer/TileUtils.java b/packages/SettingsLib/src/com/android/settingslib/drawer/TileUtils.java
index e2c8ecd..af73158 100644
--- a/packages/SettingsLib/src/com/android/settingslib/drawer/TileUtils.java
+++ b/packages/SettingsLib/src/com/android/settingslib/drawer/TileUtils.java
@@ -205,12 +205,9 @@
 
     /**
      * Build a list of DashboardCategory.
-     *
-     * @param extraAction additional intent filter action to be usetileutild to build the dashboard
-     *                    categories
      */
     public static List<DashboardCategory> getCategories(Context context,
-            Map<Pair<String, String>, Tile> cache, String extraAction) {
+            Map<Pair<String, String>, Tile> cache) {
         final long startTime = System.currentTimeMillis();
         boolean setup = Global.getInt(context.getContentResolver(), Global.DEVICE_PROVISIONED, 0)
                 != 0;
@@ -229,9 +226,6 @@
             if (setup) {
                 getTilesForAction(context, user, EXTRA_SETTINGS_ACTION, cache, null, tiles, false);
                 getTilesForAction(context, user, IA_SETTINGS_ACTION, cache, null, tiles, false);
-                if (extraAction != null) {
-                    getTilesForAction(context, user, extraAction, cache, null, tiles, false);
-                }
             }
         }
 
@@ -313,7 +307,6 @@
             if (tile == null) {
                 tile = new Tile(activityInfo, categoryKey);
                 updateTileData(context, tile, activityInfo, activityInfo.applicationInfo, pm);
-                if (DEBUG) Log.d(LOG_TAG, "Adding tile " + tile.title);
                 addedCache.put(key, tile);
             }
 
@@ -329,7 +322,6 @@
     private static boolean updateTileData(Context context, Tile tile,
             ActivityInfo activityInfo, ApplicationInfo applicationInfo, PackageManager pm) {
         if (applicationInfo.isSystemApp()) {
-            CharSequence title = null;
             String summary = null;
 
             // Get the activity's meta-data
@@ -338,13 +330,6 @@
                 Bundle metaData = activityInfo.metaData;
 
                 if (res != null && metaData != null) {
-                    if (metaData.containsKey(META_DATA_PREFERENCE_TITLE)) {
-                        if (metaData.get(META_DATA_PREFERENCE_TITLE) instanceof Integer) {
-                            title = res.getString(metaData.getInt(META_DATA_PREFERENCE_TITLE));
-                        } else {
-                            title = metaData.getString(META_DATA_PREFERENCE_TITLE);
-                        }
-                    }
                     if (metaData.containsKey(META_DATA_PREFERENCE_SUMMARY)) {
                         if (metaData.get(META_DATA_PREFERENCE_SUMMARY) instanceof Integer) {
                             summary = res.getString(metaData.getInt(META_DATA_PREFERENCE_SUMMARY));
@@ -356,16 +341,6 @@
             } catch (PackageManager.NameNotFoundException | Resources.NotFoundException e) {
                 if (DEBUG) Log.d(LOG_TAG, "Couldn't find info", e);
             }
-
-            // Set the preference title to the activity's label if no
-            // meta-data is found
-            if (TextUtils.isEmpty(title)) {
-                title = activityInfo.loadLabel(pm).toString();
-            }
-
-            // Set title and summary for the preference
-            tile.title = title;
-            tile.summary = summary;
             return true;
         }
 
diff --git a/packages/SettingsLib/tests/robotests/src/com/android/settingslib/bluetooth/CachedBluetoothDeviceManagerTest.java b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/bluetooth/CachedBluetoothDeviceManagerTest.java
index 2d34f23..7baded8 100644
--- a/packages/SettingsLib/tests/robotests/src/com/android/settingslib/bluetooth/CachedBluetoothDeviceManagerTest.java
+++ b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/bluetooth/CachedBluetoothDeviceManagerTest.java
@@ -50,7 +50,6 @@
     private final static String DEVICE_ADDRESS_3 = "AA:BB:CC:DD:EE:33";
     private final static String DEVICE_SUMMARY_1 = "summary 1";
     private final static String DEVICE_SUMMARY_2 = "summary 2";
-    private final static String DEVICE_SUMMARY_3 = "summary 3";
     private final static long HISYNCID1 = 10;
     private final static long HISYNCID2 = 11;
     private final BluetoothClass DEVICE_CLASS_1 =
@@ -82,11 +81,6 @@
     private CachedBluetoothDevice mCachedDevice3;
     private CachedBluetoothDeviceManager mCachedDeviceManager;
     private Context mContext;
-    private String[] mActiveDeviceStringsArray;
-    private String mActiveDeviceStringNone;
-    private String mActiveDeviceStringAll;
-    private String mActiveDeviceStringMedia;
-    private String mActiveDeviceStringPhone;
 
     @Before
     public void setUp() {
diff --git a/packages/SettingsLib/tests/robotests/src/com/android/settingslib/bluetooth/CachedBluetoothDeviceTest.java b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/bluetooth/CachedBluetoothDeviceTest.java
index 034574f..5e417c3 100644
--- a/packages/SettingsLib/tests/robotests/src/com/android/settingslib/bluetooth/CachedBluetoothDeviceTest.java
+++ b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/bluetooth/CachedBluetoothDeviceTest.java
@@ -538,7 +538,7 @@
         when(mA2dpProfile.getConnectionStatus(mDevice)).
                 thenReturn(BluetoothProfile.STATE_CONNECTED);
 
-        assertThat(mCachedDevice.isA2dpDevice()).isTrue();
+        assertThat(mCachedDevice.isConnectedA2dpDevice()).isTrue();
     }
 
     @Test
@@ -547,7 +547,7 @@
         when(mA2dpProfile.getConnectionStatus(mDevice)).
                 thenReturn(BluetoothProfile.STATE_DISCONNECTING);
 
-        assertThat(mCachedDevice.isA2dpDevice()).isFalse();
+        assertThat(mCachedDevice.isConnectedA2dpDevice()).isFalse();
     }
 
     @Test
@@ -556,7 +556,7 @@
         when(mHfpProfile.getConnectionStatus(mDevice)).
                 thenReturn(BluetoothProfile.STATE_CONNECTED);
 
-        assertThat(mCachedDevice.isHfpDevice()).isTrue();
+        assertThat(mCachedDevice.isConnectedHfpDevice()).isTrue();
     }
 
     @Test
@@ -565,7 +565,7 @@
         when(mHfpProfile.getConnectionStatus(mDevice)).
                 thenReturn(BluetoothProfile.STATE_DISCONNECTING);
 
-        assertThat(mCachedDevice.isHfpDevice()).isFalse();
+        assertThat(mCachedDevice.isConnectedHfpDevice()).isFalse();
     }
 
     @Test
@@ -590,14 +590,14 @@
     public void isConnectedHfpDevice_profileIsNull_returnFalse() {
         when(mProfileManager.getHeadsetProfile()).thenReturn(null);
 
-        assertThat(mCachedDevice.isHfpDevice()).isFalse();
+        assertThat(mCachedDevice.isConnectedHfpDevice()).isFalse();
     }
 
     @Test
     public void isConnectedA2dpDevice_profileIsNull_returnFalse() {
         when(mProfileManager.getA2dpProfile()).thenReturn(null);
 
-        assertThat(mCachedDevice.isA2dpDevice()).isFalse();
+        assertThat(mCachedDevice.isConnectedA2dpDevice()).isFalse();
     }
 
     @Test
diff --git a/packages/SettingsLib/tests/robotests/src/com/android/settingslib/drawer/TileUtilsTest.java b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/drawer/TileUtilsTest.java
index 9f097d8..91db95c 100644
--- a/packages/SettingsLib/tests/robotests/src/com/android/settingslib/drawer/TileUtilsTest.java
+++ b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/drawer/TileUtilsTest.java
@@ -24,7 +24,6 @@
 
 import static com.google.common.truth.Truth.assertThat;
 
-import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.ArgumentMatchers.anyInt;
 import static org.mockito.ArgumentMatchers.anyString;
 import static org.mockito.ArgumentMatchers.argThat;
@@ -39,7 +38,6 @@
 import android.app.ActivityManager;
 import android.content.ContentResolver;
 import android.content.Context;
-import android.content.IContentProvider;
 import android.content.Intent;
 import android.content.pm.ActivityInfo;
 import android.content.pm.ApplicationInfo;
@@ -47,9 +45,7 @@
 import android.content.pm.PackageManager.NameNotFoundException;
 import android.content.pm.ResolveInfo;
 import android.content.res.Resources;
-import android.net.Uri;
 import android.os.Bundle;
-import android.os.RemoteException;
 import android.os.UserHandle;
 import android.os.UserManager;
 import android.provider.Settings.Global;
@@ -80,8 +76,6 @@
     @Mock
     private UserManager mUserManager;
     @Mock
-    private IContentProvider mIContentProvider;
-    @Mock
     private ContentResolver mContentResolver;
 
     private static final String URI_GET_SUMMARY = "content://authority/text/summary";
@@ -158,27 +152,6 @@
     }
 
     @Test
-    public void getCategories_shouldHandleExtraIntentAction() {
-        final String testCategory = "category1";
-        final String testAction = "action1";
-        Map<Pair<String, String>, Tile> cache = new ArrayMap<>();
-        List<ResolveInfo> info = new ArrayList<>();
-        info.add(newInfo(true, testCategory));
-        Global.putInt(mContext.getContentResolver(), Global.DEVICE_PROVISIONED, 1);
-        when(mContext.getSystemService(Context.USER_SERVICE)).thenReturn(mUserManager);
-        List<UserHandle> userHandleList = new ArrayList<>();
-        userHandleList.add(UserHandle.CURRENT);
-        when(mUserManager.getUserProfiles()).thenReturn(userHandleList);
-
-        when(mPackageManager.queryIntentActivitiesAsUser(argThat(
-                event -> testAction.equals(event.getAction())), anyInt(), anyInt()))
-                .thenReturn(info);
-
-        List<DashboardCategory> categoryList = TileUtils.getCategories(mContext, cache, testAction);
-        assertThat(categoryList.get(0).getTile(0).getCategory()).isEqualTo(testCategory);
-    }
-
-    @Test
     public void getCategories_withPackageName() {
         ArgumentCaptor<Intent> intentCaptor = ArgumentCaptor.forClass(Intent.class);
         Map<Pair<String, String>, Tile> cache = new ArrayMap<>();
@@ -189,7 +162,7 @@
         userHandleList.add(new UserHandle(ActivityManager.getCurrentUser()));
         when(mUserManager.getUserProfiles()).thenReturn(userHandleList);
 
-        TileUtils.getCategories(mContext, cache, null /* action */);
+        TileUtils.getCategories(mContext, cache);
         verify(mPackageManager, atLeastOnce()).queryIntentActivitiesAsUser(
                 intentCaptor.capture(), anyInt(), anyInt());
 
@@ -214,7 +187,7 @@
                 null /* defaultCategory */, outTiles, false /* usePriority */);
 
         assertThat(outTiles.size()).isEqualTo(1);
-        assertThat(outTiles.get(0).title).isEqualTo("my title");
+        assertThat(outTiles.get(0).getTitle(mContext)).isEqualTo("my title");
     }
 
     @Test
@@ -236,7 +209,7 @@
         TileUtils.getTilesForIntent(mContext, UserHandle.CURRENT, intent, addedCache,
                 null /* defaultCategory */, outTiles, false /* usePriority */);
         assertThat(outTiles.size()).isEqualTo(1);
-        assertThat(outTiles.get(0).title).isEqualTo("my localized title");
+        assertThat(outTiles.get(0).getTitle(mContext)).isEqualTo("my localized title");
 
         // Icon should be tintable because the tile is not from settings package, and
         // "forceTintExternalIcon" is set
@@ -286,45 +259,6 @@
     }
 
     @Test
-    public void getTilesForIntent_shouldNotProcessInvalidUriContentSystemApp()
-            throws RemoteException {
-        Intent intent = new Intent();
-        Map<Pair<String, String>, Tile> addedCache = new ArrayMap<>();
-        List<Tile> outTiles = new ArrayList<>();
-        List<ResolveInfo> info = new ArrayList<>();
-        ResolveInfo resolveInfo = newInfo(true, null /* category */, null, null, URI_GET_SUMMARY);
-        info.add(resolveInfo);
-
-        when(mPackageManager.queryIntentActivitiesAsUser(eq(intent), anyInt(), anyInt()))
-                .thenReturn(info);
-
-        // Case 1: No provider associated with the uri specified.
-        TileUtils.getTilesForIntent(mContext, UserHandle.CURRENT, intent, addedCache,
-                null /* defaultCategory */, outTiles, false /* usePriority */);
-
-        assertThat(outTiles.size()).isEqualTo(1);
-        assertThat(outTiles.get(0).getIcon(mContext).getResId()).isEqualTo(314159);
-        assertThat(outTiles.get(0).summary).isEqualTo("static-summary");
-
-        // Case 2: Empty bundle.
-        Bundle bundle = new Bundle();
-        when(mIContentProvider.call(anyString(),
-                eq(TileUtils.getMethodFromUri(Uri.parse(URI_GET_SUMMARY))), eq(URI_GET_SUMMARY),
-                any())).thenReturn(bundle);
-        when(mContentResolver.acquireUnstableProvider(anyString()))
-                .thenReturn(mIContentProvider);
-        when(mContentResolver.acquireUnstableProvider(any(Uri.class)))
-                .thenReturn(mIContentProvider);
-
-        TileUtils.getTilesForIntent(mContext, UserHandle.CURRENT, intent, addedCache,
-                null /* defaultCategory */, outTiles, false /* usePriority */);
-
-        assertThat(outTiles.size()).isEqualTo(1);
-        assertThat(outTiles.get(0).getIcon(mContext).getResId()).isEqualTo(314159);
-        assertThat(outTiles.get(0).summary).isEqualTo("static-summary");
-    }
-
-    @Test
     public void getTilesForIntent_shouldProcessUriContentForSystemApp() {
         Intent intent = new Intent();
         Map<Pair<String, String>, Tile> addedCache = new ArrayMap<>();
diff --git a/packages/SystemUI/res/drawable-hdpi/ic_sysbar_back_carmode.png b/packages/SystemUI/res/drawable-hdpi/ic_sysbar_back_carmode.png
deleted file mode 100644
index 95e5778..0000000
--- a/packages/SystemUI/res/drawable-hdpi/ic_sysbar_back_carmode.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-hdpi/ic_sysbar_back_ime_carmode.png b/packages/SystemUI/res/drawable-hdpi/ic_sysbar_back_ime_carmode.png
deleted file mode 100644
index 6421146..0000000
--- a/packages/SystemUI/res/drawable-hdpi/ic_sysbar_back_ime_carmode.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-hdpi/ic_sysbar_home_carmode.png b/packages/SystemUI/res/drawable-hdpi/ic_sysbar_home_carmode.png
deleted file mode 100644
index 151d5fe..0000000
--- a/packages/SystemUI/res/drawable-hdpi/ic_sysbar_home_carmode.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-ldrtl-hdpi/ic_sysbar_back_carmode.png b/packages/SystemUI/res/drawable-ldrtl-hdpi/ic_sysbar_back_carmode.png
deleted file mode 100644
index b954aa7..0000000
--- a/packages/SystemUI/res/drawable-ldrtl-hdpi/ic_sysbar_back_carmode.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-ldrtl-mdpi/ic_sysbar_back_carmode.png b/packages/SystemUI/res/drawable-ldrtl-mdpi/ic_sysbar_back_carmode.png
deleted file mode 100644
index 61d5db6..0000000
--- a/packages/SystemUI/res/drawable-ldrtl-mdpi/ic_sysbar_back_carmode.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-ldrtl-xhdpi/ic_sysbar_back_carmode.png b/packages/SystemUI/res/drawable-ldrtl-xhdpi/ic_sysbar_back_carmode.png
deleted file mode 100644
index 7b98c1f..0000000
--- a/packages/SystemUI/res/drawable-ldrtl-xhdpi/ic_sysbar_back_carmode.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-ldrtl-xxhdpi/ic_sysbar_back_carmode.png b/packages/SystemUI/res/drawable-ldrtl-xxhdpi/ic_sysbar_back_carmode.png
deleted file mode 100644
index aad1320..0000000
--- a/packages/SystemUI/res/drawable-ldrtl-xxhdpi/ic_sysbar_back_carmode.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-ldrtl/ic_sysbar_back_carmode.xml b/packages/SystemUI/res/drawable-ldrtl/ic_sysbar_back_carmode.xml
new file mode 100644
index 0000000..f91190b
--- /dev/null
+++ b/packages/SystemUI/res/drawable-ldrtl/ic_sysbar_back_carmode.xml
@@ -0,0 +1,12 @@
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+        android:width="44dp"
+        android:height="44dp"
+        android:viewportWidth="44.0"
+        android:viewportHeight="44.0">
+    <path
+        android:pathData="M35,21.94C35,22.78 34.49,23.58 33.64,24.05L12.44,36.13C11.43,36.7 10.58,36.51 10.11,36.25C9.08,35.67 9,34.56 9,34.09L9,9.91C9,9.35 9.08,8.31 10.09,7.75C10.54,7.49 11.34,7.31 12.33,7.86L33.74,19.95C34.51,20.39 35,21.13 35,21.94L35,21.94ZM12.5,32L30.5,21.96L12.5,12L12.5,32Z"
+        android:strokeColor="#00000000"
+        android:fillType="evenOdd"
+        android:fillColor="#F8F9FA"
+        android:strokeWidth="1"/>
+</vector>
diff --git a/packages/SystemUI/res/drawable-mdpi/ic_sysbar_back_carmode.png b/packages/SystemUI/res/drawable-mdpi/ic_sysbar_back_carmode.png
deleted file mode 100644
index 754b2d9..0000000
--- a/packages/SystemUI/res/drawable-mdpi/ic_sysbar_back_carmode.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-mdpi/ic_sysbar_back_ime_carmode.png b/packages/SystemUI/res/drawable-mdpi/ic_sysbar_back_ime_carmode.png
deleted file mode 100644
index 873ed7f..0000000
--- a/packages/SystemUI/res/drawable-mdpi/ic_sysbar_back_ime_carmode.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-mdpi/ic_sysbar_home_carmode.png b/packages/SystemUI/res/drawable-mdpi/ic_sysbar_home_carmode.png
deleted file mode 100644
index 7696d87..0000000
--- a/packages/SystemUI/res/drawable-mdpi/ic_sysbar_home_carmode.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-xhdpi/ic_sysbar_back_carmode.png b/packages/SystemUI/res/drawable-xhdpi/ic_sysbar_back_carmode.png
deleted file mode 100644
index c98f55e..0000000
--- a/packages/SystemUI/res/drawable-xhdpi/ic_sysbar_back_carmode.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-xhdpi/ic_sysbar_back_ime_carmode.png b/packages/SystemUI/res/drawable-xhdpi/ic_sysbar_back_ime_carmode.png
deleted file mode 100644
index 187a566..0000000
--- a/packages/SystemUI/res/drawable-xhdpi/ic_sysbar_back_ime_carmode.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-xhdpi/ic_sysbar_home_carmode.png b/packages/SystemUI/res/drawable-xhdpi/ic_sysbar_home_carmode.png
deleted file mode 100644
index c66f8be..0000000
--- a/packages/SystemUI/res/drawable-xhdpi/ic_sysbar_home_carmode.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-xxhdpi/ic_sysbar_back_carmode.png b/packages/SystemUI/res/drawable-xxhdpi/ic_sysbar_back_carmode.png
deleted file mode 100644
index 3a3a119..0000000
--- a/packages/SystemUI/res/drawable-xxhdpi/ic_sysbar_back_carmode.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-xxhdpi/ic_sysbar_back_ime_carmode.png b/packages/SystemUI/res/drawable-xxhdpi/ic_sysbar_back_ime_carmode.png
deleted file mode 100644
index 7198c82..0000000
--- a/packages/SystemUI/res/drawable-xxhdpi/ic_sysbar_back_ime_carmode.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-xxhdpi/ic_sysbar_home_carmode.png b/packages/SystemUI/res/drawable-xxhdpi/ic_sysbar_home_carmode.png
deleted file mode 100644
index b1fc02e..0000000
--- a/packages/SystemUI/res/drawable-xxhdpi/ic_sysbar_home_carmode.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-xxxhdpi/ic_sysbar_back_carmode.png b/packages/SystemUI/res/drawable-xxxhdpi/ic_sysbar_back_carmode.png
deleted file mode 100644
index c06bfda..0000000
--- a/packages/SystemUI/res/drawable-xxxhdpi/ic_sysbar_back_carmode.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-xxxhdpi/ic_sysbar_back_ime_carmode.png b/packages/SystemUI/res/drawable-xxxhdpi/ic_sysbar_back_ime_carmode.png
deleted file mode 100644
index a8c76bf..0000000
--- a/packages/SystemUI/res/drawable-xxxhdpi/ic_sysbar_back_ime_carmode.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-xxxhdpi/ic_sysbar_home_carmode.png b/packages/SystemUI/res/drawable-xxxhdpi/ic_sysbar_home_carmode.png
deleted file mode 100644
index b798e3d..0000000
--- a/packages/SystemUI/res/drawable-xxxhdpi/ic_sysbar_home_carmode.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable/ic_sysbar_back_carmode.xml b/packages/SystemUI/res/drawable/ic_sysbar_back_carmode.xml
new file mode 100644
index 0000000..5844b2e
--- /dev/null
+++ b/packages/SystemUI/res/drawable/ic_sysbar_back_carmode.xml
@@ -0,0 +1,12 @@
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+        android:width="44dp"
+        android:height="44dp"
+        android:viewportWidth="44.0"
+        android:viewportHeight="44.0">
+    <path
+        android:pathData="M9,22.06C9,21.22 9.51,20.42 10.36,19.95L31.56,7.87C32.57,7.3 33.42,7.49 33.89,7.75C34.92,8.33 35,9.44 35,9.91L35,34.09C35,34.65 34.92,35.69 33.91,36.25C33.46,36.51 32.66,36.69 31.67,36.14L10.26,24.05C9.49,23.61 9,22.87 9,22.06L9,22.06ZM31.5,12L13.5,22.04L31.5,32L31.5,12Z"
+        android:strokeColor="#00000000"
+        android:fillType="evenOdd"
+        android:fillColor="#F8F9FA"
+        android:strokeWidth="1"/>
+</vector>
diff --git a/packages/SystemUI/res/drawable/ic_sysbar_back_ime_carmode.xml b/packages/SystemUI/res/drawable/ic_sysbar_back_ime_carmode.xml
new file mode 100644
index 0000000..542ba9b
--- /dev/null
+++ b/packages/SystemUI/res/drawable/ic_sysbar_back_ime_carmode.xml
@@ -0,0 +1,12 @@
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+        android:width="44dp"
+        android:height="44dp"
+        android:viewportWidth="44.0"
+        android:viewportHeight="44.0">
+    <path
+        android:pathData="M22.06,35C21.22,35 20.42,34.49 19.95,33.64L7.87,12.44C7.3,11.43 7.49,10.58 7.75,10.11C8.33,9.08 9.44,9 9.91,9L34.09,9C34.65,9 35.69,9.08 36.25,10.09C36.51,10.54 36.69,11.34 36.14,12.33L24.05,33.74C23.61,34.51 22.87,35 22.06,35L22.06,35ZM12,12.5L22.04,30.5L32,12.5L12,12.5Z"
+        android:strokeColor="#00000000"
+        android:fillType="evenOdd"
+        android:fillColor="#F8F9FA"
+        android:strokeWidth="1"/>
+</vector>
diff --git a/packages/SystemUI/res/drawable/ic_sysbar_home_carmode.xml b/packages/SystemUI/res/drawable/ic_sysbar_home_carmode.xml
new file mode 100644
index 0000000..e07bf6f
--- /dev/null
+++ b/packages/SystemUI/res/drawable/ic_sysbar_home_carmode.xml
@@ -0,0 +1,12 @@
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+        android:width="44dp"
+        android:height="44dp"
+        android:viewportWidth="44.0"
+        android:viewportHeight="44.0">
+    <path
+        android:pathData="M22.39,22.39m-14.54,0a14.54,14.54 0,1 1,29.07 0a14.54,14.54 0,1 1,-29.07 0"
+        android:fillType="evenOdd"
+        android:strokeColor="#F8F9FA"
+        android:fillColor="#00000000"
+        android:strokeWidth="4"/>
+</vector>
diff --git a/packages/SystemUI/res/layout/notification_snooze.xml b/packages/SystemUI/res/layout/notification_snooze.xml
index fae759a..ffe2eee 100644
--- a/packages/SystemUI/res/layout/notification_snooze.xml
+++ b/packages/SystemUI/res/layout/notification_snooze.xml
@@ -22,7 +22,7 @@
     android:orientation="vertical"
     android:clickable="true"
     android:background="@color/notification_guts_bg_color"
-    android:theme="@*android:style/Theme.DeviceDefault.Light">
+    android:theme="@style/Theme.SystemUI">
 
     <RelativeLayout
         android:id="@+id/notification_snooze"
@@ -36,7 +36,7 @@
             android:layout_alignParentStart="true"
             android:layout_centerVertical="true"
             android:paddingStart="@*android:dimen/notification_content_margin_start"
-            android:textColor="@color/notification_primary_text_color"
+            android:textColor="?android:attr/textColorPrimary"
             android:paddingEnd="4dp"/>
 
         <ImageView
diff --git a/packages/SystemUI/res/layout/notification_snooze_option.xml b/packages/SystemUI/res/layout/notification_snooze_option.xml
index aaf45f3..f203839 100644
--- a/packages/SystemUI/res/layout/notification_snooze_option.xml
+++ b/packages/SystemUI/res/layout/notification_snooze_option.xml
@@ -22,4 +22,4 @@
         android:layout_marginEnd="@*android:dimen/notification_content_margin_end"
         android:gravity="center_vertical"
         android:textSize="14sp"
-        android:textColor="#DD000000"/>
\ No newline at end of file
+        android:textColor="?android:attr/textColorSecondary"/>
\ No newline at end of file
diff --git a/packages/SystemUI/res/values-television/styles.xml b/packages/SystemUI/res/values-television/styles.xml
index 53dc4aa..b59f007 100644
--- a/packages/SystemUI/res/values-television/styles.xml
+++ b/packages/SystemUI/res/values-television/styles.xml
@@ -15,5 +15,6 @@
 -->
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android">
+    <style name="Theme.SystemUI.Dialog" parent="@android:style/Theme.DeviceDefault.Dialog" />
     <style name="Theme.SystemUI.Dialog.Alert" parent="@*android:style/Theme.DeviceDefault.Dialog.Alert" />
 </resources>
diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml
index ca6b2d9..412e89a 100644
--- a/packages/SystemUI/res/values/dimens.xml
+++ b/packages/SystemUI/res/values/dimens.xml
@@ -945,9 +945,9 @@
     <dimen name="bottom_padding">48dp</dimen>
     <dimen name="edge_margin">8dp</dimen>
 
-    <dimen name="rounded_corner_radius">0dp</dimen>
-    <dimen name="rounded_corner_radius_top">0dp</dimen>
-    <dimen name="rounded_corner_radius_bottom">0dp</dimen>
+    <dimen name="rounded_corner_radius">@*android:dimen/rounded_corner_radius</dimen>
+    <dimen name="rounded_corner_radius_top">@*android:dimen/rounded_corner_radius_top</dimen>
+    <dimen name="rounded_corner_radius_bottom">@*android:dimen/rounded_corner_radius_bottom</dimen>
     <dimen name="rounded_corner_content_padding">0dp</dimen>
     <dimen name="nav_content_padding">0dp</dimen>
     <dimen name="nav_quick_scrub_track_edge_padding">24dp</dimen>
diff --git a/packages/SystemUI/src/com/android/systemui/Dependency.java b/packages/SystemUI/src/com/android/systemui/Dependency.java
index 86e0e1f..e7fc3c9 100644
--- a/packages/SystemUI/src/com/android/systemui/Dependency.java
+++ b/packages/SystemUI/src/com/android/systemui/Dependency.java
@@ -55,7 +55,7 @@
 import com.android.systemui.statusbar.phone.ManagedProfileControllerImpl;
 import com.android.systemui.statusbar.phone.StatusBarIconController;
 import com.android.systemui.statusbar.phone.StatusBarIconControllerImpl;
-import com.android.systemui.statusbar.phone.StatusBarWindowManager;
+import com.android.systemui.statusbar.phone.StatusBarWindowController;
 import com.android.systemui.statusbar.policy.AccessibilityController;
 import com.android.systemui.statusbar.policy.AccessibilityManagerWrapper;
 import com.android.systemui.statusbar.policy.BatteryController;
@@ -258,8 +258,8 @@
         mProviders.put(TunerService.class, () ->
                 new TunerServiceImpl(mContext));
 
-        mProviders.put(StatusBarWindowManager.class, () ->
-                new StatusBarWindowManager(mContext));
+        mProviders.put(StatusBarWindowController.class, () ->
+                new StatusBarWindowController(mContext));
 
         mProviders.put(DarkIconDispatcher.class, () ->
                 new DarkIconDispatcherImpl(mContext));
diff --git a/packages/SystemUI/src/com/android/systemui/ImageWallpaper.java b/packages/SystemUI/src/com/android/systemui/ImageWallpaper.java
index 50d862d..39e3155 100644
--- a/packages/SystemUI/src/com/android/systemui/ImageWallpaper.java
+++ b/packages/SystemUI/src/com/android/systemui/ImageWallpaper.java
@@ -30,6 +30,7 @@
 import android.util.Log;
 import android.view.Display;
 import android.view.DisplayInfo;
+import android.view.DisplayListCanvas;
 import android.view.Surface;
 import android.view.SurfaceHolder;
 import android.view.WindowManager;
@@ -366,7 +367,12 @@
                 protected Bitmap doInBackground(Void... params) {
                     Throwable exception;
                     try {
-                        return mWallpaperManager.getBitmap(true /* hardware */);
+                        Bitmap wallpaper = mWallpaperManager.getBitmap(true /* hardware */);
+                        if (wallpaper != null
+                                && wallpaper.getByteCount() > DisplayListCanvas.MAX_BITMAP_SIZE) {
+                            throw new RuntimeException("Wallpaper is too large to draw!");
+                        }
+                        return wallpaper;
                     } catch (RuntimeException | OutOfMemoryError e) {
                         exception = e;
                     }
diff --git a/packages/SystemUI/src/com/android/systemui/SystemUIApplication.java b/packages/SystemUI/src/com/android/systemui/SystemUIApplication.java
index 4e7c3ab..b96a604 100644
--- a/packages/SystemUI/src/com/android/systemui/SystemUIApplication.java
+++ b/packages/SystemUI/src/com/android/systemui/SystemUIApplication.java
@@ -36,7 +36,7 @@
 import com.android.systemui.plugins.PluginListener;
 import com.android.systemui.plugins.PluginManager;
 import com.android.systemui.statusbar.phone.StatusBar;
-import com.android.systemui.statusbar.phone.StatusBarWindowManager;
+import com.android.systemui.statusbar.phone.StatusBarWindowController;
 import com.android.systemui.util.NotificationChannels;
 
 import java.util.HashMap;
@@ -210,9 +210,9 @@
                         if (mOverlays == null) mOverlays = new ArraySet<>();
                         if (plugin.holdStatusBarOpen()) {
                             mOverlays.add(plugin);
-                            Dependency.get(StatusBarWindowManager.class).setStateListener(b ->
+                            Dependency.get(StatusBarWindowController.class).setStateListener(b ->
                                     mOverlays.forEach(o -> o.setCollapseDesired(b)));
-                            Dependency.get(StatusBarWindowManager.class).setForcePluginOpen(
+                            Dependency.get(StatusBarWindowController.class).setForcePluginOpen(
                                     mOverlays.size() != 0);
 
                         }
@@ -221,7 +221,7 @@
                     @Override
                     public void onPluginDisconnected(OverlayPlugin plugin) {
                         mOverlays.remove(plugin);
-                        Dependency.get(StatusBarWindowManager.class).setForcePluginOpen(
+                        Dependency.get(StatusBarWindowController.class).setForcePluginOpen(
                                 mOverlays.size() != 0);
                     }
                 }, OverlayPlugin.class, true /* Allow multiple plugins */);
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/car/CarStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/car/CarStatusBar.java
index 6920d10..6c9ca70 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/car/CarStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/car/CarStatusBar.java
@@ -18,6 +18,7 @@
 
 import android.app.ActivityManager;
 import android.app.ActivityTaskManager;
+import android.car.user.CarUserManagerHelper;
 import android.graphics.PixelFormat;
 import android.graphics.drawable.Drawable;
 import android.util.Log;
@@ -28,7 +29,6 @@
 import android.view.WindowManager;
 
 import com.android.keyguard.KeyguardUpdateMonitor;
-import com.android.settingslib.users.UserManagerHelper;
 import com.android.systemui.BatteryMeterView;
 import com.android.systemui.Dependency;
 import com.android.systemui.Prefs;
@@ -506,7 +506,7 @@
     @Override
     public void updateKeyguardState(boolean goingToFullShade, boolean fromShadeLocked) {
         super.updateKeyguardState(goingToFullShade, fromShadeLocked);
-        UserManagerHelper helper = new UserManagerHelper(mContext);
+        CarUserManagerHelper helper = new CarUserManagerHelper(mContext);
         if (!helper.isHeadlessSystemUser()) {
             showUserSwitcher();
         }
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/car/FullscreenUserSwitcher.java b/packages/SystemUI/src/com/android/systemui/statusbar/car/FullscreenUserSwitcher.java
index 506d697..67a76fd 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/car/FullscreenUserSwitcher.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/car/FullscreenUserSwitcher.java
@@ -18,15 +18,13 @@
 
 import android.animation.Animator;
 import android.animation.AnimatorListenerAdapter;
+import android.car.user.CarUserManagerHelper;
 import android.content.Context;
-import android.content.pm.UserInfo;
-import android.util.Log;
 import android.view.View;
 import android.view.ViewStub;
 
 import androidx.recyclerview.widget.GridLayoutManager;
 
-import com.android.settingslib.users.UserManagerHelper;
 import com.android.systemui.R;
 import com.android.systemui.statusbar.phone.StatusBar;
 
@@ -39,7 +37,7 @@
     private final UserGridRecyclerView mUserGridView;
     private final int mShortAnimDuration;
     private final StatusBar mStatusBar;
-    private final UserManagerHelper mUserManagerHelper;
+    private final CarUserManagerHelper mCarUserManagerHelper;
     private boolean mShowing;
 
     public FullscreenUserSwitcher(StatusBar statusBar, ViewStub containerStub, Context context) {
@@ -53,14 +51,14 @@
         mUserGridView.buildAdapter();
         mUserGridView.setUserSelectionListener(this::onUserSelected);
 
-        mUserManagerHelper = new UserManagerHelper(context);
+        mCarUserManagerHelper = new CarUserManagerHelper(context);
 
         mShortAnimDuration = mContainer.getResources()
             .getInteger(android.R.integer.config_shortAnimTime);
     }
 
     public void show() {
-        if (mUserManagerHelper.isHeadlessSystemUser()) {
+        if (mCarUserManagerHelper.isHeadlessSystemUser()) {
             showUserGrid();
         }
         if (mShowing) {
@@ -81,12 +79,12 @@
     }
 
     private void onUserSelected(UserGridRecyclerView.UserRecord record) {
-        if (mUserManagerHelper.isHeadlessSystemUser()) {
+        if (mCarUserManagerHelper.isHeadlessSystemUser()) {
             hideUserGrid();
         }
 
         if (record.mIsForeground || (record.mIsStartGuestSession
-                && mUserManagerHelper.foregroundUserIsGuestUser())) {
+                && mCarUserManagerHelper.isForegroundUserGuest())) {
             dismissKeyguard();
             return;
         }
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/car/UserGridRecyclerView.java b/packages/SystemUI/src/com/android/systemui/statusbar/car/UserGridRecyclerView.java
index ee10d34..b376c00 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/car/UserGridRecyclerView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/car/UserGridRecyclerView.java
@@ -22,6 +22,7 @@
 import android.app.AlertDialog;
 import android.app.AlertDialog.Builder;
 import android.app.Dialog;
+import android.car.user.CarUserManagerHelper;
 import android.content.Context;
 import android.content.DialogInterface;
 import android.content.pm.UserInfo;
@@ -42,7 +43,6 @@
 import androidx.recyclerview.widget.RecyclerView;
 
 import com.android.internal.util.UserIcons;
-import com.android.settingslib.users.UserManagerHelper;
 import com.android.systemui.R;
 
 import com.android.systemui.statusbar.phone.SystemUIDialog;
@@ -54,16 +54,16 @@
  * One of the uses of this is for the lock screen in auto.
  */
 public class UserGridRecyclerView extends PagedListView implements
-        UserManagerHelper.OnUsersUpdateListener {
+        CarUserManagerHelper.OnUsersUpdateListener {
     private UserSelectionListener mUserSelectionListener;
     private UserAdapter mAdapter;
-    private UserManagerHelper mUserManagerHelper;
+    private CarUserManagerHelper mCarUserManagerHelper;
     private Context mContext;
 
     public UserGridRecyclerView(Context context, AttributeSet attrs) {
         super(context, attrs);
         mContext = context;
-        mUserManagerHelper = new UserManagerHelper(mContext);
+        mCarUserManagerHelper = new CarUserManagerHelper(mContext);
     }
 
     /**
@@ -72,7 +72,7 @@
     @Override
     public void onFinishInflate() {
         super.onFinishInflate();
-        mUserManagerHelper.registerOnUsersUpdateListener(this);
+        mCarUserManagerHelper.registerOnUsersUpdateListener(this);
     }
 
     /**
@@ -81,7 +81,7 @@
     @Override
     public void onDetachedFromWindow() {
         super.onDetachedFromWindow();
-        mUserManagerHelper.unregisterOnUsersUpdateListener();
+        mCarUserManagerHelper.unregisterOnUsersUpdateListener(this);
     }
 
     /**
@@ -90,7 +90,7 @@
      * @return the adapter
      */
     public void buildAdapter() {
-        List<UserRecord> userRecords = createUserRecords(mUserManagerHelper
+        List<UserRecord> userRecords = createUserRecords(mCarUserManagerHelper
                 .getAllUsers());
         mAdapter = new UserAdapter(mContext, userRecords);
         super.setAdapter(mAdapter);
@@ -103,7 +103,9 @@
                 // Don't display guests in the switcher.
                 continue;
             }
-            boolean isForeground = mUserManagerHelper.getForegroundUserId() == userInfo.id;
+
+            boolean isForeground =
+                    mCarUserManagerHelper.getCurrentForegroundUserId() == userInfo.id;
             UserRecord record = new UserRecord(userInfo, false /* isStartGuestSession */,
                     false /* isAddUser */, isForeground);
             userRecords.add(record);
@@ -113,7 +115,7 @@
         userRecords.add(createStartGuestUserRecord());
 
         // Add add user record if the foreground user can add users
-        if (mUserManagerHelper.foregroundUserCanAddUsers()) {
+        if (mCarUserManagerHelper.canForegroundUserAddUsers()) {
             userRecords.add(createAddUserRecord());
         }
 
@@ -147,7 +149,7 @@
     @Override
     public void onUsersUpdate() {
         mAdapter.clearUsers();
-        mAdapter.updateUsers(createUserRecords(mUserManagerHelper.getAllUsers()));
+        mAdapter.updateUsers(createUserRecords(mCarUserManagerHelper.getAllUsers()));
         mAdapter.notifyDataSetChanged();
     }
 
@@ -210,7 +212,7 @@
 
                 if (userRecord.mIsStartGuestSession) {
                     notifyUserSelected(userRecord);
-                    mUserManagerHelper.startNewGuestSession(mGuestName);
+                    mCarUserManagerHelper.startNewGuestSession(mGuestName);
                     return;
                 }
 
@@ -240,7 +242,7 @@
                 }
                 // If the user doesn't want to be a guest or add a user, switch to the user selected
                 notifyUserSelected(userRecord);
-                mUserManagerHelper.switchToUser(userRecord.mInfo);
+                mCarUserManagerHelper.switchToUser(userRecord.mInfo);
             });
 
         }
@@ -254,7 +256,7 @@
 
         private Bitmap getUserRecordIcon(UserRecord userRecord) {
             if (userRecord.mIsStartGuestSession) {
-                return mUserManagerHelper.getGuestDefaultIcon();
+                return mCarUserManagerHelper.getGuestDefaultIcon();
             }
 
             if (userRecord.mIsAddUser) {
@@ -262,7 +264,7 @@
                     .getDrawable(R.drawable.car_add_circle_round));
             }
 
-            return mUserManagerHelper.getUserIcon(userRecord.mInfo);
+            return mCarUserManagerHelper.getUserIcon(userRecord.mInfo);
         }
 
         @Override
@@ -290,7 +292,7 @@
 
             @Override
             protected UserInfo doInBackground(String... userNames) {
-                return mUserManagerHelper.createNewUser(userNames[0]);
+                return mCarUserManagerHelper.createNewNonAdminUser(userNames[0]);
             }
 
             @Override
@@ -300,7 +302,7 @@
             @Override
             protected void onPostExecute(UserInfo user) {
                 if (user != null) {
-                    mUserManagerHelper.switchToUser(user);
+                    mCarUserManagerHelper.switchToUser(user);
                 }
             }
         }
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationEntryManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationEntryManager.java
index 0ab71382..b655a6b 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationEntryManager.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationEntryManager.java
@@ -414,7 +414,9 @@
             } else if (mListContainer.hasPulsingNotifications()) {
                 dismissalSurface = NotificationStats.DISMISSAL_AOD;
             }
-            mBarService.onNotificationClear(pkg, tag, id, userId, n.getKey(), dismissalSurface, nv);
+            int dismissalSentiment = NotificationStats.DISMISS_SENTIMENT_NEUTRAL;
+            mBarService.onNotificationClear(pkg, tag, id, userId, n.getKey(), dismissalSurface,
+                    dismissalSentiment, nv);
             removeNotification(n.getKey(), null);
 
         } catch (RemoteException ex) {
@@ -678,9 +680,15 @@
                     entry.row.getNotificationChildren();
             for (int i = 0; i < notificationChildren.size(); i++) {
                 ExpandableNotificationRow row = notificationChildren.get(i);
-                if ((row.getStatusBarNotification().getNotification().flags
-                        & Notification.FLAG_FOREGROUND_SERVICE) != 0) {
-                    // the child is a foreground service notification which we can't remove!
+                NotificationData.Entry childEntry = row.getEntry();
+                boolean isForeground = (row.getStatusBarNotification().getNotification().flags
+                        & Notification.FLAG_FOREGROUND_SERVICE) != 0;
+                boolean keepForReply = FORCE_REMOTE_INPUT_HISTORY
+                        && (shouldKeepForRemoteInput(childEntry)
+                                || shouldKeepForSmartReply(childEntry));
+                if (isForeground || keepForReply) {
+                    // the child is a foreground service notification which we can't remove or it's
+                    // a child we're keeping around for reply!
                     continue;
                 }
                 row.setKeepInParent(true);
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/logging/NotificationLogger.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/logging/NotificationLogger.java
index 767b07f..e96e176 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/logging/NotificationLogger.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/logging/NotificationLogger.java
@@ -62,6 +62,8 @@
     protected IStatusBarService mBarService;
     private long mLastVisibilityReportUptimeMs;
     private NotificationListContainer mListContainer;
+    private Object mDozingLock = new Object();
+    private boolean mDozing;
 
     protected final OnChildLocationsChangedListener mNotificationLocationsChangedListener =
             new OnChildLocationsChangedListener() {
@@ -174,6 +176,12 @@
         mNotificationLocationsChangedListener.onChildLocationsChanged();
     }
 
+    public void setDozing(boolean dozing) {
+        synchronized (mDozingLock) {
+            mDozing = dozing;
+        }
+    }
+
     private void logNotificationVisibilityChanges(
             Collection<NotificationVisibility> newlyVisible,
             Collection<NotificationVisibility> noLongerVisible) {
@@ -190,19 +198,25 @@
                 // Ignore.
             }
 
-            final int N = newlyVisible.size();
+            final int N = newlyVisibleAr.length;
             if (N > 0) {
                 String[] newlyVisibleKeyAr = new String[N];
                 for (int i = 0; i < N; i++) {
                     newlyVisibleKeyAr[i] = newlyVisibleAr[i].key;
                 }
 
-                // TODO: Call NotificationEntryManager to do this, once it exists.
-                // TODO: Consider not catching all runtime exceptions here.
-                try {
-                    mNotificationListener.setNotificationsShown(newlyVisibleKeyAr);
-                } catch (RuntimeException e) {
-                    Log.d(TAG, "failed setNotificationsShown: ", e);
+                synchronized (mDozingLock) {
+                    // setNotificationsShown should only be called if we are confident that
+                    // the user has seen the notification, aka not when ambient display is on
+                    if (!mDozing) {
+                        // TODO: Call NotificationEntryManager to do this, once it exists.
+                        // TODO: Consider not catching all runtime exceptions here.
+                        try {
+                            mNotificationListener.setNotificationsShown(newlyVisibleKeyAr);
+                        } catch (RuntimeException e) {
+                            Log.d(TAG, "failed setNotificationsShown: ", e);
+                        }
+                    }
                 }
             }
             recycleAllVisibilityObjects(newlyVisibleAr);
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java
index 094912b..67db68d 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java
@@ -1307,6 +1307,7 @@
         }
         setDismissed(fromAccessibility);
         if (isClearable()) {
+            // TODO: track dismiss sentiment
             if (mOnDismissRunnable != null) {
                 mOnDismissRunnable.run();
             }
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/BiometricUnlockController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/BiometricUnlockController.java
index 2087a16..b57a366 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/BiometricUnlockController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/BiometricUnlockController.java
@@ -101,7 +101,7 @@
     private KeyguardUpdateMonitor mUpdateMonitor;
     private int mMode;
     private StatusBarKeyguardViewManager mStatusBarKeyguardViewManager;
-    private StatusBarWindowManager mStatusBarWindowManager;
+    private StatusBarWindowController mStatusBarWindowController;
     private DozeScrimController mDozeScrimController;
     private KeyguardViewMediator mKeyguardViewMediator;
     private ScrimController mScrimController;
@@ -125,7 +125,7 @@
         mUpdateMonitor.registerCallback(this);
         Dependency.get(WakefulnessLifecycle.class).addObserver(mWakefulnessObserver);
         Dependency.get(ScreenLifecycle.class).addObserver(mScreenObserver);
-        mStatusBarWindowManager = Dependency.get(StatusBarWindowManager.class);
+        mStatusBarWindowController = Dependency.get(StatusBarWindowController.class);
         mDozeScrimController = dozeScrimController;
         mKeyguardViewMediator = keyguardViewMediator;
         mScrimController = scrimController;
@@ -214,7 +214,7 @@
             // notifications would light up first, creating an unpleasant animation.
             // Defer changing the screen brightness by forcing doze brightness on our window
             // until the clock and the notifications are faded out.
-            mStatusBarWindowManager.setForceDozeBrightness(true);
+            mStatusBarWindowController.setForceDozeBrightness(true);
         }
         // During wake and unlock, we need to draw black before waking up to avoid abrupt
         // brightness changes due to display state transitions.
@@ -269,7 +269,7 @@
                     Trace.beginSection("MODE_WAKE_AND_UNLOCK_FROM_DREAM");
                     mUpdateMonitor.awakenFromDream();
                 }
-                mStatusBarWindowManager.setStatusBarFocusable(false);
+                mStatusBarWindowController.setStatusBarFocusable(false);
                 if (delayWakeUp) {
                     mHandler.postDelayed(wakeUp, 50);
                 } else {
@@ -384,7 +384,7 @@
         mHandler.postDelayed(new Runnable() {
             @Override
             public void run() {
-                mStatusBarWindowManager.setForceDozeBrightness(false);
+                mStatusBarWindowController.setForceDozeBrightness(false);
             }
         }, StatusBar.FADE_KEYGUARD_DURATION_PULSING);
     }
@@ -395,7 +395,7 @@
 
     private void resetMode() {
         mMode = MODE_NONE;
-        mStatusBarWindowManager.setForceDozeBrightness(false);
+        mStatusBarWindowController.setForceDozeBrightness(false);
         if (mStatusBar.getNavigationBarView() != null) {
             mStatusBar.getNavigationBarView().setWakeAndUnlocking(false);
         }
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 f3e100d..40c8fde 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarFragment.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarFragment.java
@@ -181,6 +181,9 @@
         public void onQuickStepStarted() {
             // Use navbar dragging as a signal to hide the rotate button
             setRotateSuggestionButtonState(false);
+
+            // Hide the notifications panel when quick step starts
+            mStatusBar.collapsePanel(true /* animate */);
         }
 
         @Override
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarGestureHelper.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarGestureHelper.java
index ed1ae10..8c02e1f 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarGestureHelper.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarGestureHelper.java
@@ -75,7 +75,6 @@
     private int mTouchDownY;
     private boolean mDownOnRecents;
     private VelocityTracker mVelocityTracker;
-    private boolean mNotificationsVisibleOnDown;
 
     private boolean mDockWindowEnabled;
     private boolean mDockWindowTouchSlopExceeded;
@@ -108,9 +107,6 @@
     }
 
     public boolean onInterceptTouchEvent(MotionEvent event) {
-        if (event.getActionMasked() == MotionEvent.ACTION_DOWN) {
-            mNotificationsVisibleOnDown = !mStatusBar.isPresenterFullyCollapsed();
-        }
         if (!canHandleGestures()) {
             return false;
         }
@@ -275,7 +271,7 @@
     }
 
     private boolean canHandleGestures() {
-        return !mStatusBar.isKeyguardShowing() && !mNotificationsVisibleOnDown;
+        return !mStatusBar.isKeyguardShowing();
     }
 
     private int calculateDragMode() {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java
index 3837fbc..3e41cd2 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java
@@ -791,8 +791,19 @@
                 showSwipeUpUI ? mQuickStepAccessibilityDelegate : null);
     }
 
+    public boolean isNotificationsFullyCollapsed() {
+        return mPanelView.isFullyCollapsed();
+    }
+
+    /**
+     * Updates the {@link WindowManager.LayoutParams.FLAG_SLIPPERY} state dependent on if swipe up
+     * is enabled, or the notifications is fully opened without being in an animated state. If
+     * slippery is enabled, touch events will leave the nav bar window and enter into the fullscreen
+     * app/home window, if not nav bar will receive a cancelled touch event once gesture leaves bar.
+     */
     public void updateSlippery() {
-        setSlippery(!isQuickStepSwipeUpEnabled() || mPanelView.isFullyExpanded());
+        setSlippery(!isQuickStepSwipeUpEnabled() ||
+                (mPanelView.isFullyExpanded() && !mPanelView.isCollapsing()));
     }
 
     private void setSlippery(boolean slippery) {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickStepController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickStepController.java
index 6cc88bb..a13bebd 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickStepController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickStepController.java
@@ -45,9 +45,6 @@
 import android.view.MotionEvent;
 import android.view.View;
 import android.view.WindowManagerGlobal;
-import android.view.animation.DecelerateInterpolator;
-import android.view.animation.Interpolator;
-import androidx.annotation.DimenRes;
 import com.android.systemui.Dependency;
 import com.android.systemui.OverviewProxyService;
 import com.android.systemui.R;
@@ -72,6 +69,7 @@
     private boolean mQuickScrubActive;
     private boolean mAllowGestureDetection;
     private boolean mQuickStepStarted;
+    private boolean mNotificationsVisibleOnDown;
     private int mTouchDownX;
     private int mTouchDownY;
     private boolean mDragPositive;
@@ -190,7 +188,7 @@
                 mNavigationBarView.getDownHitTarget() == HIT_TARGET_DEAD_ZONE;
         if (mOverviewEventSender.getProxy() == null || (!mNavigationBarView.isQuickScrubEnabled()
                 && !mNavigationBarView.isQuickStepSwipeUpEnabled())) {
-            return false;
+            return deadZoneConsumed;
         }
         mNavigationBarView.requestUnbufferedDispatch(event);
 
@@ -221,6 +219,7 @@
                 mNavigationBarView.transformMatrixToLocal(mTransformLocalMatrix);
                 mQuickStepStarted = false;
                 mAllowGestureDetection = true;
+                mNotificationsVisibleOnDown = !mNavigationBarView.isNotificationsFullyCollapsed();
                 break;
             }
             case MotionEvent.ACTION_MOVE: {
@@ -257,7 +256,8 @@
                 // Decide to start quickstep if dragging away from the navigation bar, otherwise in
                 // the parallel direction, decide to start quickscrub. Only one may run.
                 if (!mQuickScrubActive && exceededSwipeUpTouchSlop) {
-                    if (mNavigationBarView.isQuickStepSwipeUpEnabled()) {
+                    if (mNavigationBarView.isQuickStepSwipeUpEnabled()
+                            && !mNotificationsVisibleOnDown) {
                         startQuickStep(event);
                     }
                     break;
@@ -303,15 +303,28 @@
                 break;
         }
 
-        // Proxy motion events to launcher if not handled by quick scrub
-        // Proxy motion events up/cancel that would be sent after long press on any nav button
-        if (!mQuickScrubActive && !mIsInScreenPinning && (mAllowGestureDetection
-                || action == MotionEvent.ACTION_CANCEL || action == MotionEvent.ACTION_UP)) {
+        if (shouldProxyEvents(action)) {
             proxyMotionEvents(event);
         }
         return mQuickScrubActive || mQuickStepStarted || deadZoneConsumed;
     }
 
+    private boolean shouldProxyEvents(int action) {
+        if (!mQuickScrubActive && !mIsInScreenPinning) {
+            // Allow down, cancel and up events, move and other events are passed if notifications
+            // are not showing and disabled gestures (such as long press) are not executed
+            switch (action) {
+                case MotionEvent.ACTION_DOWN:
+                case MotionEvent.ACTION_CANCEL:
+                case MotionEvent.ACTION_UP:
+                    return true;
+                default:
+                    return !mNotificationsVisibleOnDown && mAllowGestureDetection;
+            }
+        }
+        return false;
+    }
+
     @Override
     public void onDraw(Canvas canvas) {
         if (!mNavigationBarView.isQuickScrubEnabled()) {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
index cd0255b..dcd794d 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
@@ -370,7 +370,7 @@
     protected StatusBarWindowView mStatusBarWindow;
     protected PhoneStatusBarView mStatusBarView;
     private int mStatusBarWindowState = WINDOW_STATE_SHOWING;
-    protected StatusBarWindowManager mStatusBarWindowManager;
+    protected StatusBarWindowController mStatusBarWindowController;
     protected UnlockMethodCache mUnlockMethodCache;
     private DozeServiceHost mDozeServiceHost = new DozeServiceHost();
     private boolean mWakeUpComingFromTouch;
@@ -515,7 +515,7 @@
             final boolean supportsAmbientMode = info != null &&
                     info.supportsAmbientMode();
 
-            mStatusBarWindowManager.setWallpaperSupportsAmbientMode(supportsAmbientMode);
+            mStatusBarWindowController.setWallpaperSupportsAmbientMode(supportsAmbientMode);
             mScrimController.setWallpaperSupportsAmbientMode(supportsAmbientMode);
         }
     };
@@ -957,8 +957,8 @@
                 scrimBehind, scrimInFront, mLockscreenWallpaper,
                 (state, alpha, color) -> mLightBarController.setScrimState(state, alpha, color),
                 scrimsVisible -> {
-                    if (mStatusBarWindowManager != null) {
-                        mStatusBarWindowManager.setScrimsVisibility(scrimsVisible);
+                    if (mStatusBarWindowController != null) {
+                        mStatusBarWindowController.setScrimsVisibility(scrimsVisible);
                     }
                 }, DozeParameters.getInstance(mContext),
                 mContext.getSystemService(AlarmManager.class));
@@ -1702,7 +1702,7 @@
                     mBackdrop.animate().cancel();
                     mBackdrop.setAlpha(1f);
                 }
-                mStatusBarWindowManager.setBackdropShowing(true);
+                mStatusBarWindowController.setBackdropShowing(true);
                 metaDataChanged = true;
                 if (DEBUG_MEDIA) {
                     Log.v(TAG, "DEBUG_MEDIA: Fading in album artwork");
@@ -1762,9 +1762,9 @@
                     // We are unlocking directly - no animation!
                     mBackdrop.setVisibility(View.GONE);
                     mBackdropBack.setImageDrawable(null);
-                    mStatusBarWindowManager.setBackdropShowing(false);
+                    mStatusBarWindowController.setBackdropShowing(false);
                 } else {
-                    mStatusBarWindowManager.setBackdropShowing(false);
+                    mStatusBarWindowController.setBackdropShowing(false);
                     mBackdrop.animate()
                             .alpha(SRC_MIN_ALPHA)
                             .setInterpolator(Interpolators.ACCELERATE_DECELERATE)
@@ -1918,7 +1918,7 @@
     }
 
     public void setQsExpanded(boolean expanded) {
-        mStatusBarWindowManager.setQsExpanded(expanded);
+        mStatusBarWindowController.setQsExpanded(expanded);
         mNotificationPanel.setStatusAccessibilityImportance(expanded
                 ? View.IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS
                 : View.IMPORTANT_FOR_ACCESSIBILITY_AUTO);
@@ -2001,31 +2001,31 @@
     @Override
     public void onHeadsUpPinnedModeChanged(boolean inPinnedMode) {
         if (inPinnedMode) {
-            mStatusBarWindowManager.setHeadsUpShowing(true);
-            mStatusBarWindowManager.setForceStatusBarVisible(true);
+            mStatusBarWindowController.setHeadsUpShowing(true);
+            mStatusBarWindowController.setForceStatusBarVisible(true);
             if (mNotificationPanel.isFullyCollapsed()) {
                 // We need to ensure that the touchable region is updated before the window will be
                 // resized, in order to not catch any touches. A layout will ensure that
                 // onComputeInternalInsets will be called and after that we can resize the layout. Let's
                 // make sure that the window stays small for one frame until the touchableRegion is set.
                 mNotificationPanel.requestLayout();
-                mStatusBarWindowManager.setForceWindowCollapsed(true);
+                mStatusBarWindowController.setForceWindowCollapsed(true);
                 mNotificationPanel.post(() -> {
-                    mStatusBarWindowManager.setForceWindowCollapsed(false);
+                    mStatusBarWindowController.setForceWindowCollapsed(false);
                 });
             }
         } else {
             if (!mNotificationPanel.isFullyCollapsed() || mNotificationPanel.isTracking()) {
                 // We are currently tracking or is open and the shade doesn't need to be kept
                 // open artificially.
-                mStatusBarWindowManager.setHeadsUpShowing(false);
+                mStatusBarWindowController.setHeadsUpShowing(false);
             } else {
                 // we need to keep the panel open artificially, let's wait until the animation
                 // is finished.
                 mHeadsUpManager.setHeadsUpGoingAway(true);
                 mStackScroller.runAfterAnimationFinished(() -> {
                     if (!mHeadsUpManager.hasPinnedHeadsUp()) {
-                        mStatusBarWindowManager.setHeadsUpShowing(false);
+                        mStatusBarWindowController.setHeadsUpShowing(false);
                         mHeadsUpManager.setHeadsUpGoingAway(false);
                     }
                     mRemoteInputManager.removeRemoteInputEntriesKeptUntilCollapsed();
@@ -2065,7 +2065,7 @@
     public void setPanelExpanded(boolean isExpanded) {
         mPanelExpanded = isExpanded;
         updateHideIconsForBouncer(false /* animate */);
-        mStatusBarWindowManager.setPanelExpanded(isExpanded);
+        mStatusBarWindowController.setPanelExpanded(isExpanded);
         mVisualStabilityManager.setPanelExpanded(isExpanded);
         if (isExpanded && getBarState() != StatusBarState.KEYGUARD) {
             if (DEBUG) {
@@ -2274,7 +2274,7 @@
 
         // Expand the window to encompass the full screen in anticipation of the drag.
         // This is only possible to do atomically because the status bar is at the top of the screen!
-        mStatusBarWindowManager.setPanelVisible(true);
+        mStatusBarWindowController.setPanelVisible(true);
 
         visibilityChanged(true);
         recomputeDisableFlags(!force /* animate */);
@@ -2348,7 +2348,7 @@
                 + mNotificationPanel.canPanelBeCollapsed());
         if (mStatusBarWindow != null && mNotificationPanel.canPanelBeCollapsed()) {
             // release focus immediately to kick off focus change transition
-            mStatusBarWindowManager.setStatusBarFocusable(false);
+            mStatusBarWindowController.setStatusBarFocusable(false);
 
             mStatusBarWindow.cancelExpandHelper();
             mStatusBarView.collapsePanel(true /* animate */, delayed, speedUpFactor);
@@ -2420,8 +2420,8 @@
         visibilityChanged(false);
 
         // Shrink the window to the size of the status bar only
-        mStatusBarWindowManager.setPanelVisible(false);
-        mStatusBarWindowManager.setForceStatusBarVisible(false);
+        mStatusBarWindowController.setPanelVisible(false);
+        mStatusBarWindowController.setForceStatusBarVisible(false);
 
         // Close any guts that might be visible
         mGutsManager.closeAndSaveGuts(true /* removeLeavebehind */, true /* force */,
@@ -2894,7 +2894,7 @@
 
     private void addStatusBarWindow() {
         makeStatusBarView();
-        mStatusBarWindowManager = Dependency.get(StatusBarWindowManager.class);
+        mStatusBarWindowController = Dependency.get(StatusBarWindowController.class);
         mRemoteInputManager.setUpWithPresenter(this, mEntryManager, this,
                 new RemoteInputController.Delegate() {
                     public void setRemoteInputActive(NotificationData.Entry entry,
@@ -2911,8 +2911,8 @@
                         mStackScroller.requestDisallowDismiss();
                     }
                 });
-        mRemoteInputManager.getController().addCallback(mStatusBarWindowManager);
-        mStatusBarWindowManager.add(mStatusBarWindow, getStatusBarHeight());
+        mRemoteInputManager.getController().addCallback(mStatusBarWindowController);
+        mStatusBarWindowController.add(mStatusBarWindow, getStatusBarHeight());
     }
 
     // called by makeStatusbar and also by PhoneStatusBarView
@@ -3222,8 +3222,8 @@
         int oldBarHeight = mNaturalBarHeight;
         mNaturalBarHeight = res.getDimensionPixelSize(
                 com.android.internal.R.dimen.status_bar_height);
-        if (mStatusBarWindowManager != null && mNaturalBarHeight != oldBarHeight) {
-            mStatusBarWindowManager.setBarHeight(mNaturalBarHeight);
+        if (mStatusBarWindowController != null && mNaturalBarHeight != oldBarHeight) {
+            mStatusBarWindowController.setBarHeight(mNaturalBarHeight);
         }
         mMaxAllowedKeyguardNotifications = res.getInteger(
                 R.integer.keyguard_max_notification_count);
@@ -3881,7 +3881,7 @@
      * Switches theme from light to dark and vice-versa.
      */
     protected void updateTheme() {
-        final boolean inflated = mStackScroller != null && mStatusBarWindowManager != null;
+        final boolean inflated = mStackScroller != null && mStatusBarWindowController != null;
 
         // Lock wallpaper defines the color of the majority of the views, hence we'll use it
         // to set our default theme.
@@ -3907,7 +3907,7 @@
             mStackScroller.updateDecorViews(useDarkText);
 
             // Make sure we have the correct navbar/statusbar colors.
-            mStatusBarWindowManager.setKeyguardDark(useDarkText);
+            mStatusBarWindowController.setKeyguardDark(useDarkText);
         }
     }
 
@@ -3924,6 +3924,7 @@
         mDozeScrimController.setDozing(mDozing);
         mKeyguardIndicationController.setDozing(mDozing);
         mNotificationPanel.setDozing(mDozing, animate);
+        mNotificationLogger.setDozing(mDozing);
         updateQsExpansionEnabled();
         Trace.endSection();
     }
@@ -4070,7 +4071,7 @@
         mGroupManager.setStatusBarState(state);
         mHeadsUpManager.setStatusBarState(state);
         mFalsingManager.setStatusBarState(state);
-        mStatusBarWindowManager.setStatusBarState(state);
+        mStatusBarWindowController.setStatusBarState(state);
         mStackScroller.setStatusBarState(state);
         updateReportRejectedTouchVisibility();
         updateDozing();
@@ -4100,7 +4101,7 @@
         if (!isPresenterFullyCollapsed()) {
             // if we set it not to be focusable when collapsing, we have to undo it when we aborted
             // the closing
-            mStatusBarWindowManager.setStatusBarFocusable(true);
+            mStatusBarWindowController.setStatusBarFocusable(true);
         }
     }
 
@@ -4717,7 +4718,7 @@
         if (mDozing != dozing) {
             mDozing = dozing;
             mKeyguardViewMediator.setAodShowing(mDozing);
-            mStatusBarWindowManager.setDozing(mDozing);
+            mStatusBarWindowController.setDozing(mDozing);
             mStatusBarKeyguardViewManager.setDozing(mDozing);
             if (mAmbientIndicationContainer instanceof DozeReceiver) {
                 ((DozeReceiver) mAmbientIndicationContainer).setDozing(mDozing);
@@ -4947,7 +4948,7 @@
 
         @Override
         public void setDozeScreenBrightness(int value) {
-            mStatusBarWindowManager.setDozeScreenBrightness(value);
+            mStatusBarWindowController.setDozeScreenBrightness(value);
         }
 
         @Override
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
index c4424d8..9bc0252 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
@@ -74,7 +74,7 @@
     private static String TAG = "StatusBarKeyguardViewManager";
 
     protected final Context mContext;
-    private final StatusBarWindowManager mStatusBarWindowManager;
+    private final StatusBarWindowController mStatusBarWindowController;
     private final BouncerExpansionCallback mExpansionCallback = new BouncerExpansionCallback() {
         @Override
         public void onFullyShown() {
@@ -135,7 +135,7 @@
         mContext = context;
         mViewMediatorCallback = callback;
         mLockPatternUtils = lockPatternUtils;
-        mStatusBarWindowManager = Dependency.get(StatusBarWindowManager.class);
+        mStatusBarWindowController = Dependency.get(StatusBarWindowController.class);
         KeyguardUpdateMonitor.getInstance(context).registerCallback(mUpdateMonitorCallback);
     }
 
@@ -190,7 +190,7 @@
      */
     public void show(Bundle options) {
         mShowing = true;
-        mStatusBarWindowManager.setKeyguardShowing(true);
+        mStatusBarWindowController.setKeyguardShowing(true);
         reset(true /* hideBouncerWhenShowing */);
         StatsLog.write(StatsLog.KEYGUARD_STATE_CHANGED,
             StatsLog.KEYGUARD_STATE_CHANGED__STATE__SHOWN);
@@ -342,11 +342,11 @@
     }
 
     public void setNeedsInput(boolean needsInput) {
-        mStatusBarWindowManager.setKeyguardNeedsInput(needsInput);
+        mStatusBarWindowController.setKeyguardNeedsInput(needsInput);
     }
 
     public boolean isUnlockWithWallpaper() {
-        return mStatusBarWindowManager.isShowingWallpaper();
+        return mStatusBarWindowController.isShowingWallpaper();
     }
 
     public void setOccluded(boolean occluded, boolean animate) {
@@ -360,7 +360,7 @@
                         new Runnable() {
                             @Override
                             public void run() {
-                                mStatusBarWindowManager.setKeyguardOccluded(mOccluded);
+                                mStatusBarWindowController.setKeyguardOccluded(mOccluded);
                                 reset(true /* hideBouncerWhenShowing */);
                             }
                         });
@@ -375,7 +375,7 @@
         if (mShowing) {
             mStatusBar.updateMediaMetaData(false, animate && !occluded);
         }
-        mStatusBarWindowManager.setKeyguardOccluded(occluded);
+        mStatusBarWindowController.setKeyguardOccluded(occluded);
 
         // setDozing(false) will call reset once we stop dozing.
         if (!mDozing) {
@@ -425,8 +425,8 @@
             mStatusBar.fadeKeyguardAfterLaunchTransition(new Runnable() {
                 @Override
                 public void run() {
-                    mStatusBarWindowManager.setKeyguardShowing(false);
-                    mStatusBarWindowManager.setKeyguardFadingAway(true);
+                    mStatusBarWindowController.setKeyguardShowing(false);
+                    mStatusBarWindowController.setKeyguardFadingAway(true);
                     hideBouncer(true /* destroyView */);
                     updateStates();
                 }
@@ -434,7 +434,7 @@
                 @Override
                 public void run() {
                     mStatusBar.hideKeyguard();
-                    mStatusBarWindowManager.setKeyguardFadingAway(false);
+                    mStatusBarWindowController.setKeyguardFadingAway(false);
                     mViewMediatorCallback.keyguardGone();
                     executeAfterKeyguardGoneAction();
                 }
@@ -456,7 +456,7 @@
             } else {
                 boolean staying = mStatusBar.hideKeyguard();
                 if (!staying) {
-                    mStatusBarWindowManager.setKeyguardFadingAway(true);
+                    mStatusBarWindowController.setKeyguardFadingAway(true);
                     wakeAndUnlockDejank();
                 } else {
                     mStatusBar.finishKeyguardFadingAway();
@@ -464,7 +464,7 @@
                 }
             }
             updateStates();
-            mStatusBarWindowManager.setKeyguardShowing(false);
+            mStatusBarWindowController.setKeyguardShowing(false);
             mViewMediatorCallback.keyguardGone();
         }
         StatsLog.write(StatsLog.KEYGUARD_STATE_CHANGED,
@@ -481,7 +481,7 @@
     }
 
     public void onKeyguardFadedAway() {
-        mContainer.postDelayed(() -> mStatusBarWindowManager.setKeyguardFadingAway(false),
+        mContainer.postDelayed(() -> mStatusBarWindowController.setKeyguardFadingAway(false),
                 100);
         mStatusBar.finishKeyguardFadingAway();
         mBiometricUnlockController.finishKeyguardFadingAway();
@@ -599,7 +599,7 @@
         }
 
         if (bouncerShowing != mLastBouncerShowing || mFirstUpdate) {
-            mStatusBarWindowManager.setBouncerShowing(bouncerShowing);
+            mStatusBarWindowController.setBouncerShowing(bouncerShowing);
             mStatusBar.setBouncerShowing(bouncerShowing);
         }
 
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowController.java
similarity index 94%
rename from packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowManager.java
rename to packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowController.java
index a5716f2..4d60121 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowManager.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowController.java
@@ -36,6 +36,7 @@
 import android.view.WindowManager;
 import android.view.WindowManager.LayoutParams;
 
+import com.android.internal.annotations.VisibleForTesting;
 import com.android.keyguard.R;
 import com.android.systemui.Dumpable;
 import com.android.systemui.keyguard.KeyguardViewMediator;
@@ -49,9 +50,9 @@
 /**
  * Encapsulates all logic for the status bar window state management.
  */
-public class StatusBarWindowManager implements RemoteInputController.Callback, Dumpable {
+public class StatusBarWindowController implements RemoteInputController.Callback, Dumpable {
 
-    private static final String TAG = "StatusBarWindowManager";
+    private static final String TAG = "StatusBarWindowController";
 
     private final Context mContext;
     private final WindowManager mWindowManager;
@@ -68,12 +69,19 @@
     private final State mCurrentState = new State();
     private OtherwisedCollapsedListener mListener;
 
-    public StatusBarWindowManager(Context context) {
+    public StatusBarWindowController(Context context) {
+        this(context, context.getSystemService(WindowManager.class), ActivityManager.getService(),
+                DozeParameters.getInstance(context));
+    }
+
+    @VisibleForTesting
+    StatusBarWindowController(Context context, WindowManager windowManager,
+            IActivityManager activityManager, DozeParameters dozeParameters) {
         mContext = context;
-        mWindowManager = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
-        mActivityManager = ActivityManager.getService();
+        mWindowManager = windowManager;
+        mActivityManager = activityManager;
         mKeyguardScreenRotation = shouldEnableKeyguardScreenRotation();
-        mDozeParameters = DozeParameters.getInstance(mContext);
+        mDozeParameters = dozeParameters;
         mScreenBrightnessDoze = mDozeParameters.getScreenBrightnessDoze();
     }
 
@@ -149,6 +157,12 @@
         } else {
             mLpChanged.flags &= ~WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER;
         }
+
+        if (state.dozing) {
+            mLpChanged.privateFlags |= LayoutParams.PRIVATE_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS;
+        } else {
+            mLpChanged.privateFlags &= ~LayoutParams.PRIVATE_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS;
+        }
     }
 
     private void adjustScreenOrientation(State state) {
@@ -433,7 +447,7 @@
     }
 
     public void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
-        pw.println("StatusBarWindowManager state:");
+        pw.println("StatusBarWindowController state:");
         pw.println(mCurrentState);
     }
 
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/CastControllerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/CastControllerImpl.java
index 2bf62bb..533bd86 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/CastControllerImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/CastControllerImpl.java
@@ -30,6 +30,7 @@
 import android.util.ArraySet;
 import android.util.Log;
 
+import com.android.internal.annotations.GuardedBy;
 import com.android.systemui.R;
 
 import java.io.FileDescriptor;
@@ -41,12 +42,16 @@
 
 import static android.media.MediaRouter.ROUTE_TYPE_REMOTE_DISPLAY;
 
+import androidx.annotation.VisibleForTesting;
+
+
 /** Platform implementation of the cast controller. **/
 public class CastControllerImpl implements CastController {
     private static final String TAG = "CastController";
     private static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG);
 
     private final Context mContext;
+    @GuardedBy("mCallbacks")
     private final ArrayList<Callback> mCallbacks = new ArrayList<Callback>();
     private final MediaRouter mMediaRouter;
     private final ArrayMap<String, RouteInfo> mRoutes = new ArrayMap<>();
@@ -72,7 +77,7 @@
         pw.println("CastController state:");
         pw.print("  mDiscovering="); pw.println(mDiscovering);
         pw.print("  mCallbackRegistered="); pw.println(mCallbackRegistered);
-        pw.print("  mCallbacks.size="); pw.println(mCallbacks.size());
+        pw.print("  mCallbacks.size="); synchronized (mCallbacks) {pw.println(mCallbacks.size());}
         pw.print("  mRoutes.size="); pw.println(mRoutes.size());
         for (int i = 0; i < mRoutes.size(); i++) {
             final RouteInfo route = mRoutes.valueAt(i);
@@ -83,7 +88,9 @@
 
     @Override
     public void addCallback(Callback callback) {
-        mCallbacks.add(callback);
+        synchronized (mCallbacks) {
+            mCallbacks.add(callback);
+        }
         fireOnCastDevicesChanged(callback);
         synchronized (mDiscoveringLock) {
             handleDiscoveryChangeLocked();
@@ -92,7 +99,9 @@
 
     @Override
     public void removeCallback(Callback callback) {
-        mCallbacks.remove(callback);
+        synchronized (mCallbacks) {
+            mCallbacks.remove(callback);
+        }
         synchronized (mDiscoveringLock) {
             handleDiscoveryChangeLocked();
         }
@@ -117,10 +126,16 @@
             mMediaRouter.addCallback(ROUTE_TYPE_REMOTE_DISPLAY, mMediaCallback,
                     MediaRouter.CALLBACK_FLAG_REQUEST_DISCOVERY);
             mCallbackRegistered = true;
-        } else if (mCallbacks.size() != 0) {
-            mMediaRouter.addCallback(ROUTE_TYPE_REMOTE_DISPLAY, mMediaCallback,
-                    MediaRouter.CALLBACK_FLAG_PASSIVE_DISCOVERY);
-            mCallbackRegistered = true;
+        } else {
+            boolean hasCallbacks = false;
+            synchronized (mCallbacks) {
+                hasCallbacks = mCallbacks.isEmpty();
+            }
+            if (!hasCallbacks) {
+                mMediaRouter.addCallback(ROUTE_TYPE_REMOTE_DISPLAY, mMediaCallback,
+                        MediaRouter.CALLBACK_FLAG_PASSIVE_DISCOVERY);
+                mCallbackRegistered = true;
+            }
         }
     }
 
@@ -248,12 +263,17 @@
         }
     }
 
-    private void fireOnCastDevicesChanged() {
-        for (Callback callback : mCallbacks) {
-            fireOnCastDevicesChanged(callback);
+    @VisibleForTesting
+    void fireOnCastDevicesChanged() {
+        synchronized (mCallbacks) {
+            for (Callback callback : mCallbacks) {
+                fireOnCastDevicesChanged(callback);
+            }
+
         }
     }
 
+
     private void fireOnCastDevicesChanged(Callback callback) {
         callback.onCastDevicesChanged();
     }
diff --git a/packages/SystemUI/tests/src/com/android/AAAPlusPlusVerifySysuiRequiredTestPropertiesTest.java b/packages/SystemUI/tests/src/com/android/AAAPlusPlusVerifySysuiRequiredTestPropertiesTest.java
index 6792bc0..7f83ed6 100644
--- a/packages/SystemUI/tests/src/com/android/AAAPlusPlusVerifySysuiRequiredTestPropertiesTest.java
+++ b/packages/SystemUI/tests/src/com/android/AAAPlusPlusVerifySysuiRequiredTestPropertiesTest.java
@@ -19,6 +19,7 @@
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertThat;
 
+import android.content.pm.PackageManager;
 import android.support.test.filters.LargeTest;
 import android.support.test.filters.MediumTest;
 import android.support.test.filters.SmallTest;
@@ -115,6 +116,13 @@
         filter.add(new ExternalClassNameFilter());
         filter.add(s -> s.startsWith("com.android.systemui")
                 || s.startsWith("com.android.keyguard"));
+
+
+        if (!mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_AUTOMOTIVE)) {
+            // If it's not automotive target, exclude automotive classes from the test.
+            excludeAutomotiveClasses(filter);
+        }
+
         try {
             return scanner.getClassPathEntries(filter);
         } catch (IOException e) {
@@ -123,6 +131,13 @@
         return Collections.emptyList();
     }
 
+    private void excludeAutomotiveClasses(ChainedClassNameFilter filter) {
+        // Modifies the passed in filter.
+        filter.add(s -> !s.startsWith("com.android.systemui.statusbar.car."));
+        filter.add(s -> !s.startsWith("com.android.systemui.qs.car."));
+        filter.add(s -> !s.startsWith("com.android.systemui.car."));
+    }
+
     private String getClsStr() {
         return TextUtils.join(",", Arrays.asList(BASE_CLS_WHITELIST)
                 .stream().map(cls -> cls.getSimpleName()).toArray());
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/NonPhoneDependencyTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/NonPhoneDependencyTest.java
index 9121473..8129b01 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/NonPhoneDependencyTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/NonPhoneDependencyTest.java
@@ -33,7 +33,7 @@
 import com.android.systemui.statusbar.notification.row.NotificationInfo;
 import com.android.systemui.statusbar.notification.stack.NotificationListContainer;
 import com.android.systemui.statusbar.phone.NotificationGroupManager;
-import com.android.systemui.statusbar.phone.StatusBarWindowManager;
+import com.android.systemui.statusbar.phone.StatusBarWindowController;
 import com.android.systemui.statusbar.policy.HeadsUpManager;
 
 import org.junit.Before;
@@ -96,6 +96,6 @@
         viewHierarchyManager.setUpWithPresenter(mPresenter, entryManager, mListContainer);
         notificationListener.setUpWithPresenter(mPresenter, entryManager);
 
-        assertFalse(mDependency.hasInstantiatedDependency(StatusBarWindowManager.class));
+        assertFalse(mDependency.hasInstantiatedDependency(StatusBarWindowController.class));
     }
 }
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManagerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManagerTest.java
index 6933328..be4560b 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManagerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManagerTest.java
@@ -68,7 +68,7 @@
     @Before
     public void setUp() {
         MockitoAnnotations.initMocks(this);
-        mDependency.injectMockDependency(StatusBarWindowManager.class);
+        mDependency.injectMockDependency(StatusBarWindowController.class);
         mStatusBarKeyguardViewManager = new TestableStatusBarKeyguardViewManager(getContext(),
                 mViewMediatorCallback, mLockPatternUtils);
         mStatusBarKeyguardViewManager.registerStatusBar(mStatusBar, mContainer,
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarTest.java
index e39238d..a90346b 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarTest.java
@@ -204,7 +204,7 @@
                 mEntryManager, mScrimController, mBiometricUnlockController,
                 mock(ActivityLaunchAnimator.class), mKeyguardViewMediator,
                 mRemoteInputManager, mock(NotificationGroupManager.class),
-                mock(FalsingManager.class), mock(StatusBarWindowManager.class),
+                mock(FalsingManager.class), mock(StatusBarWindowController.class),
                 mock(NotificationIconAreaController.class), mock(DozeScrimController.class),
                 mock(NotificationShelf.class), mLockscreenUserManager,
                 mock(CommandQueue.class));
@@ -716,7 +716,7 @@
                 NotificationRemoteInputManager notificationRemoteInputManager,
                 NotificationGroupManager notificationGroupManager,
                 FalsingManager falsingManager,
-                StatusBarWindowManager statusBarWindowManager,
+                StatusBarWindowController statusBarWindowController,
                 NotificationIconAreaController notificationIconAreaController,
                 DozeScrimController dozeScrimController,
                 NotificationShelf notificationShelf,
@@ -744,7 +744,7 @@
             mRemoteInputManager = notificationRemoteInputManager;
             mGroupManager = notificationGroupManager;
             mFalsingManager = falsingManager;
-            mStatusBarWindowManager = statusBarWindowManager;
+            mStatusBarWindowController = statusBarWindowController;
             mNotificationIconAreaController = notificationIconAreaController;
             mDozeScrimController = dozeScrimController;
             mNotificationShelf = notificationShelf;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarWindowControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarWindowControllerTest.java
new file mode 100644
index 0000000..f8223f6
--- /dev/null
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarWindowControllerTest.java
@@ -0,0 +1,86 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License
+ */
+
+package com.android.systemui.statusbar.phone;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.Mockito.reset;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+import android.app.IActivityManager;
+import android.support.test.filters.SmallTest;
+import android.testing.AndroidTestingRunner;
+import android.testing.TestableLooper.RunWithLooper;
+import android.view.View;
+import android.view.WindowManager;
+
+import com.android.systemui.SysuiTestCase;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.ArgumentCaptor;
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+
+@RunWith(AndroidTestingRunner.class)
+@RunWithLooper
+@SmallTest
+public class StatusBarWindowControllerTest extends SysuiTestCase {
+
+    @Mock
+    private WindowManager mWindowManager;
+    @Mock
+    private DozeParameters mDozeParameters;
+    @Mock
+    private View mStatusBarView;
+    @Mock
+    private IActivityManager mActivityManager;
+
+    private StatusBarWindowController mStatusBarWindowController;
+
+    @Before
+    public void setUp() {
+        MockitoAnnotations.initMocks(this);
+        when(mDozeParameters.getAlwaysOn()).thenReturn(true);
+
+        mStatusBarWindowController = new StatusBarWindowController(mContext, mWindowManager,
+                mActivityManager, mDozeParameters);
+        mStatusBarWindowController.add(mStatusBarView, 100 /* height */);
+    }
+
+    @Test
+    public void testSetDozing_hidesSystemOverlays() {
+        mStatusBarWindowController.setDozing(true);
+        ArgumentCaptor<WindowManager.LayoutParams> captor =
+                ArgumentCaptor.forClass(WindowManager.LayoutParams.class);
+        verify(mWindowManager).updateViewLayout(any(), captor.capture());
+        int flag = captor.getValue().privateFlags
+                & WindowManager.LayoutParams.PRIVATE_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS;
+        assertThat(flag).isNotEqualTo(0);
+
+        reset(mWindowManager);
+        mStatusBarWindowController.setDozing(false);
+        verify(mWindowManager).updateViewLayout(any(), captor.capture());
+        flag = captor.getValue().privateFlags
+                & WindowManager.LayoutParams.PRIVATE_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS;
+        assertThat(flag).isEqualTo(0);
+    }
+}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/CastControllerImplTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/CastControllerImplTest.java
new file mode 100644
index 0000000..1ee7094
--- /dev/null
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/CastControllerImplTest.java
@@ -0,0 +1,126 @@
+package com.android.systemui.statusbar.policy;
+
+
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.never;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+import static org.junit.Assert.fail;
+
+import android.media.MediaRouter;
+import android.media.projection.MediaProjectionInfo;
+import android.media.projection.MediaProjectionManager;
+import android.support.test.filters.SmallTest;
+import android.testing.AndroidTestingRunner;
+import android.testing.TestableLooper;
+
+import com.android.systemui.SysuiTestCase;
+import com.android.systemui.statusbar.policy.CastController.Callback;
+
+import org.junit.Before;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+import org.junit.Test;
+
+import java.util.ConcurrentModificationException;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicBoolean;
+
+@SmallTest
+@RunWith(AndroidTestingRunner.class)
+@TestableLooper.RunWithLooper
+public class CastControllerImplTest extends SysuiTestCase {
+
+    @Mock
+    MediaRouter mMediaRouter;
+    @Mock
+    MediaProjectionManager mMediaProjectionManager;
+    @Mock
+    MediaProjectionInfo mProjection;
+
+    private CastControllerImpl mController;
+
+    @Before
+    public void setUp() {
+        MockitoAnnotations.initMocks(this);
+        mContext.addMockSystemService(MediaRouter.class, mMediaRouter);
+        mContext.addMockSystemService(MediaProjectionManager.class, mMediaProjectionManager);
+        when(mMediaProjectionManager.getActiveProjectionInfo()).thenReturn(mProjection);
+
+        mController = new CastControllerImpl(mContext);
+    }
+
+    @Test
+    public void testAddCallback() {
+        Callback mockCallback = mock(Callback.class);
+
+        mController.addCallback(mockCallback);
+        verify(mockCallback, times(1)).onCastDevicesChanged();
+    }
+
+    @Test
+    public void testRemoveCallback() {
+        Callback mockCallback = mock(Callback.class);
+
+        mController.addCallback(mockCallback);
+        verify(mockCallback, times(1)).onCastDevicesChanged();
+
+        mController.removeCallback(mockCallback);
+        verify(mockCallback, times(1)).onCastDevicesChanged();
+    }
+
+    @Test
+    public void testRemoveCallbackFromEmptyList() {
+        Callback mockCallback = mock(Callback.class);
+
+        mController.removeCallback(mockCallback);
+        verify(mockCallback, never()).onCastDevicesChanged();
+    }
+
+    @Test
+    public void testAddCallbackRemoveCallback_concurrently() throws InterruptedException {
+        int callbackCount = 20;
+        int numThreads = 2 * callbackCount;
+        CountDownLatch startThreadsLatch = new CountDownLatch(1);
+        CountDownLatch threadsDone = new CountDownLatch(numThreads);
+        Callback[] callbackList = new Callback[callbackCount];
+        mController.setDiscovering(true);
+        AtomicBoolean error = new AtomicBoolean(false);
+        for (int cbIndex = 0; cbIndex < callbackCount; cbIndex++) {
+            callbackList[cbIndex] = mock(Callback.class);
+        }
+        for (int i = 0; i < numThreads; i++) {
+            final Callback mCallback = callbackList[i / 2];
+            final boolean shouldAdd = (i % 2 == 0);
+            new Thread() {
+                public void run() {
+                    try {
+                        startThreadsLatch.await(10, TimeUnit.SECONDS);
+                    } catch (InterruptedException e) {
+                        throw new RuntimeException(e);
+                    }
+                    try {
+                        if (shouldAdd) {
+                            mController.addCallback(mCallback);
+                        } else {
+                            mController.removeCallback(mCallback);
+                        }
+                        mController.fireOnCastDevicesChanged();
+                    } catch (ConcurrentModificationException exc) {
+                        error.compareAndSet(false, true);
+                    } finally {
+                        threadsDone.countDown();
+                    }
+                }
+            }.start();
+        }
+        startThreadsLatch.countDown();
+        threadsDone.await(10, TimeUnit.SECONDS);
+        if (error.get()) {
+            fail("Concurrent modification exception");
+        }
+    }
+}
diff --git a/packages/overlays/DisplayCutoutEmulationCornerOverlay/res/values/strings.xml b/packages/overlays/DisplayCutoutEmulationCornerOverlay/res/values/strings.xml
index 754ba72..b08924b 100644
--- a/packages/overlays/DisplayCutoutEmulationCornerOverlay/res/values/strings.xml
+++ b/packages/overlays/DisplayCutoutEmulationCornerOverlay/res/values/strings.xml
@@ -16,7 +16,7 @@
   -->
 <resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
 
-    <string name="display_cutout_emulation_overlay">Corner display cutout</string>
+    <string name="display_cutout_emulation_overlay">Corner cutout</string>
 
 </resources>
 
diff --git a/packages/overlays/DisplayCutoutEmulationDoubleOverlay/res/values/strings.xml b/packages/overlays/DisplayCutoutEmulationDoubleOverlay/res/values/strings.xml
index 68c2dcb..0a106fa 100644
--- a/packages/overlays/DisplayCutoutEmulationDoubleOverlay/res/values/strings.xml
+++ b/packages/overlays/DisplayCutoutEmulationDoubleOverlay/res/values/strings.xml
@@ -16,7 +16,7 @@
   -->
 <resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
 
-    <string name="display_cutout_emulation_overlay">Double display cutout</string>
+    <string name="display_cutout_emulation_overlay">Double cutout</string>
 
 </resources>
 
diff --git a/packages/overlays/DisplayCutoutEmulationNarrowOverlay/res/values/strings.xml b/packages/overlays/DisplayCutoutEmulationNarrowOverlay/res/values/strings.xml
index 4989677..0bf8330 100644
--- a/packages/overlays/DisplayCutoutEmulationNarrowOverlay/res/values/strings.xml
+++ b/packages/overlays/DisplayCutoutEmulationNarrowOverlay/res/values/strings.xml
@@ -18,7 +18,7 @@
 -->
 <resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
 
-    <string name="display_cutout_emulation_overlay">Narrow display cutout</string>
+    <string name="display_cutout_emulation_overlay">Narrow cutout</string>
 
 </resources>
 
diff --git a/packages/overlays/DisplayCutoutEmulationTallOverlay/res/values/strings.xml b/packages/overlays/DisplayCutoutEmulationTallOverlay/res/values/strings.xml
index 6dcbbd9..bcc7c97 100644
--- a/packages/overlays/DisplayCutoutEmulationTallOverlay/res/values/strings.xml
+++ b/packages/overlays/DisplayCutoutEmulationTallOverlay/res/values/strings.xml
@@ -16,7 +16,7 @@
   -->
 <resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
 
-    <string name="display_cutout_emulation_overlay">Tall display cutout</string>
+    <string name="display_cutout_emulation_overlay">Tall cutout</string>
 
 </resources>
 
diff --git a/packages/overlays/DisplayCutoutEmulationWideOverlay/res/values/strings.xml b/packages/overlays/DisplayCutoutEmulationWideOverlay/res/values/strings.xml
index f4b9f7e..0fcbdebb 100644
--- a/packages/overlays/DisplayCutoutEmulationWideOverlay/res/values/strings.xml
+++ b/packages/overlays/DisplayCutoutEmulationWideOverlay/res/values/strings.xml
@@ -16,7 +16,7 @@
   -->
 <resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
 
-    <string name="display_cutout_emulation_overlay">Wide display cutout</string>
+    <string name="display_cutout_emulation_overlay">Wide cutout</string>
 
 </resources>
 
diff --git a/services/autofill/java/com/android/server/autofill/AutofillManagerService.java b/services/autofill/java/com/android/server/autofill/AutofillManagerService.java
index 6f03b76..5771748 100644
--- a/services/autofill/java/com/android/server/autofill/AutofillManagerService.java
+++ b/services/autofill/java/com/android/server/autofill/AutofillManagerService.java
@@ -438,8 +438,13 @@
         Slog.i(TAG, "setLogLevel(): " + level);
         mContext.enforceCallingPermission(MANAGE_AUTO_FILL, TAG);
 
-        Settings.Global.putInt(mContext.getContentResolver(),
-                Settings.Global.AUTOFILL_LOGGING_LEVEL, level);
+        final long token = Binder.clearCallingIdentity();
+        try {
+            Settings.Global.putInt(mContext.getContentResolver(),
+                    Settings.Global.AUTOFILL_LOGGING_LEVEL, level);
+        } finally {
+            Binder.restoreCallingIdentity(token);
+        }
     }
 
     private void setLogLevelFromSettings() {
@@ -492,8 +497,13 @@
         mContext.enforceCallingPermission(MANAGE_AUTO_FILL, TAG);
         Slog.i(TAG, "setMaxPartitions(): " + max);
 
-        Settings.Global.putInt(mContext.getContentResolver(),
-                Settings.Global.AUTOFILL_MAX_PARTITIONS_SIZE, max);
+        final long token = Binder.clearCallingIdentity();
+        try {
+            Settings.Global.putInt(mContext.getContentResolver(),
+                    Settings.Global.AUTOFILL_MAX_PARTITIONS_SIZE, max);
+        } finally {
+            Binder.restoreCallingIdentity(token);
+        }
     }
 
     private void setMaxPartitionsFromSettings() {
@@ -521,8 +531,13 @@
         mContext.enforceCallingPermission(MANAGE_AUTO_FILL, TAG);
         Slog.i(TAG, "setMaxVisibleDatasets(): " + max);
 
-        Settings.Global.putInt(mContext.getContentResolver(),
-                Settings.Global.AUTOFILL_MAX_VISIBLE_DATASETS, max);
+        final long token = Binder.clearCallingIdentity();
+        try {
+            Settings.Global.putInt(mContext.getContentResolver(),
+                    Settings.Global.AUTOFILL_MAX_VISIBLE_DATASETS, max);
+        } finally {
+            Binder.restoreCallingIdentity(token);
+        }
     }
 
     private void setMaxVisibleDatasetsFromSettings() {
diff --git a/services/autofill/java/com/android/server/autofill/ui/SaveUi.java b/services/autofill/java/com/android/server/autofill/ui/SaveUi.java
index 0812cb9..9d3d3cb 100644
--- a/services/autofill/java/com/android/server/autofill/ui/SaveUi.java
+++ b/services/autofill/java/com/android/server/autofill/ui/SaveUi.java
@@ -35,6 +35,7 @@
 import android.os.RemoteException;
 import android.service.autofill.BatchUpdates;
 import android.service.autofill.CustomDescription;
+import android.service.autofill.InternalOnClickAction;
 import android.service.autofill.InternalTransformation;
 import android.service.autofill.InternalValidator;
 import android.service.autofill.SaveInfo;
@@ -43,6 +44,7 @@
 import android.util.ArraySet;
 import android.util.Pair;
 import android.util.Slog;
+import android.util.SparseArray;
 import android.view.ContextThemeWrapper;
 import android.view.Gravity;
 import android.view.LayoutInflater;
@@ -82,18 +84,19 @@
     }
 
     /**
-     * Wrapper that guarantees that only one callback is triggered by ignoring further calls after
+     * Wrapper that guarantees that only one callback action (either {@link #onSave()} or
+     * {@link #onCancel(IntentSender)}) is triggered by ignoring further calls after
      * it's destroyed.
      *
      * <p>It's needed becase {@link #onCancel(IntentSender)} is always called when the Save UI
      * dialog is dismissed.
      */
-    private class OneTimeListener implements OnSaveListener {
+    private class OneActionThenDestroyListener implements OnSaveListener {
 
         private final OnSaveListener mRealListener;
         private boolean mDone;
 
-        OneTimeListener(OnSaveListener realListener) {
+        OneActionThenDestroyListener(OnSaveListener realListener) {
             mRealListener = realListener;
         }
 
@@ -131,7 +134,7 @@
 
     private final @NonNull Dialog mDialog;
 
-    private final @NonNull OneTimeListener mListener;
+    private final @NonNull OneActionThenDestroyListener mListener;
 
     private final @NonNull OverlayControl mOverlayControl;
 
@@ -151,7 +154,7 @@
            @NonNull OverlayControl overlayControl, @NonNull OnSaveListener listener,
            boolean isUpdate, boolean compatMode) {
         mPendingUi= pendingUi;
-        mListener = new OneTimeListener(listener);
+        mListener = new OneActionThenDestroyListener(listener);
         mOverlayControl = overlayControl;
         mServicePackageName = servicePackageName;
         mComponentName = componentName;
@@ -337,7 +340,7 @@
             template.setApplyTheme(THEME_ID);
             final View customSubtitleView = template.apply(context, null, handler);
 
-            // And apply batch updates (if any).
+            // Apply batch updates (if any).
             final ArrayList<Pair<InternalValidator, BatchUpdates>> updates =
                     customDescription.getUpdates();
             if (updates != null) {
@@ -376,6 +379,35 @@
                 }
             }
 
+            // Apply click actions (if any).
+            final SparseArray<InternalOnClickAction> actions = customDescription.getActions();
+            if (actions != null) {
+                final int size = actions.size();
+                if (sDebug) Slog.d(TAG, "custom description has " + size + " actions");
+                if (!(customSubtitleView instanceof ViewGroup)) {
+                    Slog.w(TAG, "cannot apply actions because custom description root is not a "
+                            + "ViewGroup: " + customSubtitleView);
+                } else {
+                    final ViewGroup rootView = (ViewGroup) customSubtitleView;
+                    for (int i = 0; i < size; i++) {
+                        final int id = actions.keyAt(i);
+                        final InternalOnClickAction action = actions.valueAt(i);
+                        final View child = rootView.findViewById(id);
+                        if (child == null) {
+                            Slog.w(TAG, "Ignoring action " + action + " for view " + id
+                                    + " because it's not on " + rootView);
+                            continue;
+                        }
+                        child.setOnClickListener((v) -> {
+                            if (sVerbose) {
+                                Slog.v(TAG, "Applying " + action + " after " + v + " was clicked");
+                            }
+                            action.onClick(rootView);
+                        });
+                    }
+                }
+            }
+
             // Finally, add the custom description to the save UI.
             final ViewGroup subtitleContainer =
                     saveUiView.findViewById(R.id.autofill_save_custom_subtitle);
diff --git a/services/core/java/com/android/server/BluetoothManagerService.java b/services/core/java/com/android/server/BluetoothManagerService.java
index f81541e..a07939e 100644
--- a/services/core/java/com/android/server/BluetoothManagerService.java
+++ b/services/core/java/com/android/server/BluetoothManagerService.java
@@ -1171,6 +1171,26 @@
         }
 
         private boolean bindService() {
+            int state = BluetoothAdapter.STATE_OFF;
+            try {
+                mBluetoothLock.readLock().lock();
+                if (mBluetooth != null) {
+                    state = mBluetooth.getState();
+                }
+            } catch (RemoteException e) {
+                Slog.e(TAG, "Unable to call getState", e);
+                return false;
+            } finally {
+                mBluetoothLock.readLock().unlock();
+            }
+
+            if (!mEnable || state != BluetoothAdapter.STATE_ON) {
+                if (DBG) {
+                    Slog.d(TAG, "Unable to bindService while Bluetooth is disabled");
+                }
+                return false;
+            }
+
             if (mIntent != null && mService == null && doBind(mIntent, this, 0,
                     UserHandle.CURRENT_OR_SELF)) {
                 Message msg = mHandler.obtainMessage(MESSAGE_BIND_PROFILE_SERVICE);
diff --git a/services/core/java/com/android/server/InputMethodManagerService.java b/services/core/java/com/android/server/InputMethodManagerService.java
index 784dfb4..02a62ff 100644
--- a/services/core/java/com/android/server/InputMethodManagerService.java
+++ b/services/core/java/com/android/server/InputMethodManagerService.java
@@ -1714,10 +1714,9 @@
     }
 
     @Override
-    public void addClient(IInputMethodClient client,
-            IInputContext inputContext, int uid, int pid) {
-        if (!calledFromValidUser()) {
-            return;
+    public void addClient(IInputMethodClient client, IInputContext inputContext, int uid, int pid) {
+        if (Binder.getCallingUid() != Process.SYSTEM_UID) {
+            throw new SecurityException("Only system process can call this method.");
         }
         synchronized (mMethodMap) {
             mClients.put(client.asBinder(), new ClientState(client,
@@ -1727,8 +1726,8 @@
 
     @Override
     public void removeClient(IInputMethodClient client) {
-        if (!calledFromValidUser()) {
-            return;
+        if (Binder.getCallingUid() != Process.SYSTEM_UID) {
+            throw new SecurityException("Only system process can call this method.");
         }
         synchronized (mMethodMap) {
             ClientState cs = mClients.remove(client.asBinder());
diff --git a/services/core/java/com/android/server/TelephonyRegistry.java b/services/core/java/com/android/server/TelephonyRegistry.java
index ad9fa40..566ce4f 100644
--- a/services/core/java/com/android/server/TelephonyRegistry.java
+++ b/services/core/java/com/android/server/TelephonyRegistry.java
@@ -36,6 +36,7 @@
 import android.telephony.CellLocation;
 import android.telephony.DisconnectCause;
 import android.telephony.LocationAccessPolicy;
+import android.telephony.PhoneCapability;
 import android.telephony.PhoneStateListener;
 import android.telephony.PhysicalChannelConfig;
 import android.telephony.PreciseCallState;
@@ -47,7 +48,6 @@
 import android.telephony.SubscriptionManager;
 import android.telephony.TelephonyManager;
 import android.telephony.VoLteServiceState;
-import android.text.TextUtils;
 import android.util.LocalLog;
 
 import com.android.internal.app.IBatteryStats;
@@ -200,6 +200,8 @@
 
     private boolean mCarrierNetworkChangeState = false;
 
+    private PhoneCapability mPhoneCapability = null;
+
     private final LocalLog mLocalLog = new LocalLog(100);
 
     private PreciseDataConnectionState mPreciseDataConnectionState =
@@ -658,6 +660,13 @@
                             remove(r.binder);
                         }
                     }
+                    if ((events & PhoneStateListener.LISTEN_PHONE_CAPABILITY_CHANGE) != 0) {
+                        try {
+                            r.callback.onPhoneCapabilityChanged(mPhoneCapability);
+                        } catch (RemoteException ex) {
+                            remove(r.binder);
+                        }
+                    }
                 }
             }
         } else {
@@ -1453,6 +1462,33 @@
         }
     }
 
+    public void notifyPhoneCapabilityChanged(PhoneCapability capability) {
+        if (!checkNotifyPermission("notifyPhoneCapabilityChanged()")) {
+            return;
+        }
+
+        if (VDBG) {
+            log("notifyPhoneCapabilityChanged: capability=" + capability);
+        }
+
+        synchronized (mRecords) {
+            mPhoneCapability = capability;
+
+            for (Record r : mRecords) {
+                if (r.matchPhoneStateListenerEvent(
+                        PhoneStateListener.LISTEN_PHONE_CAPABILITY_CHANGE)) {
+                    try {
+                        r.callback.onPhoneCapabilityChanged(capability);
+                    } catch (RemoteException ex) {
+                        mRemoveList.add(r.binder);
+                    }
+                }
+            }
+            handleRemoveListLocked();
+        }
+    }
+
+
     @Override
     public void dump(FileDescriptor fd, PrintWriter writer, String[] args) {
         final IndentingPrintWriter pw = new IndentingPrintWriter(writer, "  ");
@@ -1488,6 +1524,7 @@
             pw.println("mForegroundCallState=" + mForegroundCallState);
             pw.println("mBackgroundCallState=" + mBackgroundCallState);
             pw.println("mVoLteServiceState=" + mVoLteServiceState);
+            pw.println("mPhoneCapability=" + mPhoneCapability);
 
             pw.decreaseIndent();
 
diff --git a/services/core/java/com/android/server/biometrics/common/AuthenticationClient.java b/services/core/java/com/android/server/biometrics/common/AuthenticationClient.java
index 10a1b90..a9cf963 100644
--- a/services/core/java/com/android/server/biometrics/common/AuthenticationClient.java
+++ b/services/core/java/com/android/server/biometrics/common/AuthenticationClient.java
@@ -21,10 +21,11 @@
 import android.hardware.biometrics.BiometricConstants;
 import android.hardware.biometrics.BiometricPrompt;
 import android.hardware.biometrics.IBiometricPromptReceiver;
-import android.hardware.fingerprint.Fingerprint;
 import android.hardware.fingerprint.FingerprintManager;
 import android.os.Bundle;
+import android.os.Handler;
 import android.os.IBinder;
+import android.os.Looper;
 import android.os.RemoteException;
 import android.util.Slog;
 
@@ -35,6 +36,7 @@
  */
 public abstract class AuthenticationClient extends ClientMonitor {
     private long mOpId;
+    private Handler mHandler;
 
     public abstract int handleFailedAttempt();
     public abstract void resetFailedAttempts();
@@ -97,6 +99,7 @@
         mStatusBarService = statusBarService;
         mFingerprintManager = (FingerprintManager) getContext()
                 .getSystemService(Context.FINGERPRINT_SERVICE);
+        mHandler = new Handler(Looper.getMainLooper());
     }
 
     @Override
@@ -217,15 +220,19 @@
                             BiometricConstants.BIOMETRIC_ERROR_LOCKOUT :
                             BiometricConstants.BIOMETRIC_ERROR_LOCKOUT_PERMANENT;
 
-                    // TODO: if the dialog is showing, this error should be delayed. On a similar
-                    // note, AuthenticationClient should override onError and delay all other errors
-                    // as well, if the dialog is showing
-                    listener.onError(getHalDeviceId(), errorCode, 0 /* vendorCode */);
-
                     // Send the lockout message to the system dialog
                     if (mBundle != null) {
                         mStatusBarService.onBiometricError(
                                 mFingerprintManager.getErrorString(errorCode, 0 /* vendorCode */));
+                        mHandler.postDelayed(() -> {
+                            try {
+                                listener.onError(getHalDeviceId(), errorCode, 0 /* vendorCode */);
+                            } catch (RemoteException e) {
+                                Slog.w(getLogTag(), "RemoteException while sending error");
+                            }
+                        }, BiometricPrompt.HIDE_DIALOG_DELAY);
+                    } else {
+                        listener.onError(getHalDeviceId(), errorCode, 0 /* vendorCode */);
                     }
                 } catch (RemoteException e) {
                     Slog.w(getLogTag(), "Failed to notify lockout:", e);
diff --git a/services/core/java/com/android/server/biometrics/common/BiometricService.java b/services/core/java/com/android/server/biometrics/common/BiometricService.java
index f54baef..5603f2f 100644
--- a/services/core/java/com/android/server/biometrics/common/BiometricService.java
+++ b/services/core/java/com/android/server/biometrics/common/BiometricService.java
@@ -58,7 +58,6 @@
 import com.android.internal.logging.MetricsLogger;
 import com.android.internal.statusbar.IStatusBarService;
 import com.android.server.SystemService;
-import com.android.server.biometrics.face.FaceService;
 import com.android.server.biometrics.fingerprint.FingerprintService;
 
 import java.util.ArrayList;
diff --git a/services/core/java/com/android/server/display/DisplayDeviceInfo.java b/services/core/java/com/android/server/display/DisplayDeviceInfo.java
index 349e1c8..512e851 100644
--- a/services/core/java/com/android/server/display/DisplayDeviceInfo.java
+++ b/services/core/java/com/android/server/display/DisplayDeviceInfo.java
@@ -104,6 +104,12 @@
     public static final int FLAG_DESTROY_CONTENT_ON_REMOVAL = 1 << 10;
 
     /**
+     * Flag: The display cutout of this display is masked.
+     * @hide
+     */
+    public static final int FLAG_MASK_DISPLAY_CUTOUT = 1 << 11;
+
+    /**
      * Touch attachment: Display does not receive touch.
      */
     public static final int TOUCH_NONE = 0;
@@ -453,6 +459,9 @@
         if ((flags & FLAG_CAN_SHOW_WITH_INSECURE_KEYGUARD) != 0) {
             msg.append(", FLAG_CAN_SHOW_WITH_INSECURE_KEYGUARD");
         }
+        if ((flags & FLAG_MASK_DISPLAY_CUTOUT) != 0) {
+            msg.append(", FLAG_MASK_DISPLAY_CUTOUT");
+        }
         return msg.toString();
     }
 }
diff --git a/services/core/java/com/android/server/display/LocalDisplayAdapter.java b/services/core/java/com/android/server/display/LocalDisplayAdapter.java
index 21ae048..16d82df 100644
--- a/services/core/java/com/android/server/display/LocalDisplayAdapter.java
+++ b/services/core/java/com/android/server/display/LocalDisplayAdapter.java
@@ -402,6 +402,10 @@
                             && SystemProperties.getBoolean(PROPERTY_EMULATOR_CIRCULAR, false))) {
                         mInfo.flags |= DisplayDeviceInfo.FLAG_ROUND;
                     }
+                    if (res.getBoolean(
+                            com.android.internal.R.bool.config_maskMainBuiltInDisplayCutout)) {
+                        mInfo.flags |= DisplayDeviceInfo.FLAG_MASK_DISPLAY_CUTOUT;
+                    }
                     mInfo.displayCutout = DisplayCutout.fromResourcesRectApproximation(res,
                             mInfo.width, mInfo.height);
                     mInfo.type = Display.TYPE_BUILT_IN;
diff --git a/services/core/java/com/android/server/display/LogicalDisplay.java b/services/core/java/com/android/server/display/LogicalDisplay.java
index 23ee56b..373de63 100644
--- a/services/core/java/com/android/server/display/LogicalDisplay.java
+++ b/services/core/java/com/android/server/display/LogicalDisplay.java
@@ -23,6 +23,8 @@
 import android.view.Surface;
 import android.view.SurfaceControl;
 
+import com.android.server.wm.utils.InsetUtils;
+
 import java.io.PrintWriter;
 import java.util.Arrays;
 import java.util.List;
@@ -251,14 +253,18 @@
             if ((deviceInfo.flags & DisplayDeviceInfo.FLAG_CAN_SHOW_WITH_INSECURE_KEYGUARD) != 0) {
                 mBaseDisplayInfo.flags |= Display.FLAG_CAN_SHOW_WITH_INSECURE_KEYGUARD;
             }
+            Rect maskingInsets = getMaskingInsets(deviceInfo);
+            int maskedWidth = deviceInfo.width - maskingInsets.left - maskingInsets.right;
+            int maskedHeight = deviceInfo.height - maskingInsets.top - maskingInsets.bottom;
+
             mBaseDisplayInfo.type = deviceInfo.type;
             mBaseDisplayInfo.address = deviceInfo.address;
             mBaseDisplayInfo.name = deviceInfo.name;
             mBaseDisplayInfo.uniqueId = deviceInfo.uniqueId;
-            mBaseDisplayInfo.appWidth = deviceInfo.width;
-            mBaseDisplayInfo.appHeight = deviceInfo.height;
-            mBaseDisplayInfo.logicalWidth = deviceInfo.width;
-            mBaseDisplayInfo.logicalHeight = deviceInfo.height;
+            mBaseDisplayInfo.appWidth = maskedWidth;
+            mBaseDisplayInfo.appHeight = maskedHeight;
+            mBaseDisplayInfo.logicalWidth = maskedWidth;
+            mBaseDisplayInfo.logicalHeight = maskedHeight;
             mBaseDisplayInfo.rotation = Surface.ROTATION_0;
             mBaseDisplayInfo.modeId = deviceInfo.modeId;
             mBaseDisplayInfo.defaultModeId = deviceInfo.defaultModeId;
@@ -275,13 +281,15 @@
             mBaseDisplayInfo.appVsyncOffsetNanos = deviceInfo.appVsyncOffsetNanos;
             mBaseDisplayInfo.presentationDeadlineNanos = deviceInfo.presentationDeadlineNanos;
             mBaseDisplayInfo.state = deviceInfo.state;
-            mBaseDisplayInfo.smallestNominalAppWidth = deviceInfo.width;
-            mBaseDisplayInfo.smallestNominalAppHeight = deviceInfo.height;
-            mBaseDisplayInfo.largestNominalAppWidth = deviceInfo.width;
-            mBaseDisplayInfo.largestNominalAppHeight = deviceInfo.height;
+            mBaseDisplayInfo.smallestNominalAppWidth = maskedWidth;
+            mBaseDisplayInfo.smallestNominalAppHeight = maskedHeight;
+            mBaseDisplayInfo.largestNominalAppWidth = maskedWidth;
+            mBaseDisplayInfo.largestNominalAppHeight = maskedHeight;
             mBaseDisplayInfo.ownerUid = deviceInfo.ownerUid;
             mBaseDisplayInfo.ownerPackageName = deviceInfo.ownerPackageName;
-            mBaseDisplayInfo.displayCutout = deviceInfo.displayCutout;
+            boolean maskCutout =
+                    (deviceInfo.flags & DisplayDeviceInfo.FLAG_MASK_DISPLAY_CUTOUT) != 0;
+            mBaseDisplayInfo.displayCutout = maskCutout ? null : deviceInfo.displayCutout;
 
             mPrimaryDisplayDeviceInfo = deviceInfo;
             mInfo = null;
@@ -289,6 +297,18 @@
     }
 
     /**
+     * Returns insets in ROTATION_0 for areas that are masked.
+     */
+    private static Rect getMaskingInsets(DisplayDeviceInfo deviceInfo) {
+        boolean maskCutout = (deviceInfo.flags & DisplayDeviceInfo.FLAG_MASK_DISPLAY_CUTOUT) != 0;
+        if (maskCutout && deviceInfo.displayCutout != null) {
+            return deviceInfo.displayCutout.getSafeInsets();
+        } else {
+            return new Rect();
+        }
+    }
+
+    /**
      * Applies the layer stack and transformation to the given display device
      * so that it shows the contents of this logical display.
      *
@@ -349,6 +369,12 @@
         int physWidth = rotated ? displayDeviceInfo.height : displayDeviceInfo.width;
         int physHeight = rotated ? displayDeviceInfo.width : displayDeviceInfo.height;
 
+        Rect maskingInsets = getMaskingInsets(displayDeviceInfo);
+        InsetUtils.rotateInsets(maskingInsets, orientation);
+        // Don't consider the masked area as available when calculating the scaling below.
+        physWidth -= maskingInsets.left + maskingInsets.right;
+        physHeight -= maskingInsets.top + maskingInsets.bottom;
+
         // Determine whether the width or height is more constrained to be scaled.
         //    physWidth / displayInfo.logicalWidth    => letter box
         // or physHeight / displayInfo.logicalHeight  => pillar box
@@ -375,6 +401,9 @@
         mTempDisplayRect.set(displayRectLeft, displayRectTop,
                 displayRectLeft + displayRectWidth, displayRectTop + displayRectHeight);
 
+        // Now add back the offset for the masked area.
+        mTempDisplayRect.offset(maskingInsets.left, maskingInsets.top);
+
         mTempDisplayRect.left += mDisplayOffsetX;
         mTempDisplayRect.right += mDisplayOffsetX;
         mTempDisplayRect.top += mDisplayOffsetY;
diff --git a/services/core/java/com/android/server/notification/NotificationDelegate.java b/services/core/java/com/android/server/notification/NotificationDelegate.java
index 8be8450..decdac6 100644
--- a/services/core/java/com/android/server/notification/NotificationDelegate.java
+++ b/services/core/java/com/android/server/notification/NotificationDelegate.java
@@ -30,6 +30,7 @@
     void onNotificationClear(int callingUid, int callingPid,
             String pkg, String tag, int id, int userId, String key,
             @NotificationStats.DismissalSurface int dismissalSurface,
+            @NotificationStats.DismissalSentiment int dismissalSentiment,
             NotificationVisibility nv);
     void onNotificationError(int callingUid, int callingPid,
             String pkg, String tag, int id,
diff --git a/services/core/java/com/android/server/notification/NotificationManagerService.java b/services/core/java/com/android/server/notification/NotificationManagerService.java
index f074319..ce71dd2 100644
--- a/services/core/java/com/android/server/notification/NotificationManagerService.java
+++ b/services/core/java/com/android/server/notification/NotificationManagerService.java
@@ -72,7 +72,6 @@
 import static android.service.notification.NotificationListenerService.REASON_USER_STOPPED;
 import static android.service.notification.NotificationListenerService.TRIM_FULL;
 import static android.service.notification.NotificationListenerService.TRIM_LIGHT;
-import static android.view.Display.DEFAULT_DISPLAY;
 import static android.view.WindowManager.LayoutParams.TYPE_TOAST;
 
 import static com.android.server.utils.PriorityDump.PRIORITY_ARG;
@@ -701,7 +700,8 @@
         }
 
         @Override
-        public void onNotificationClick(int callingUid, int callingPid, String key, NotificationVisibility nv) {
+        public void onNotificationClick(int callingUid, int callingPid, String key,
+                NotificationVisibility nv) {
             exitIdle();
             synchronized (mNotificationLock) {
                 NotificationRecord r = mNotificationsByKey.get(key);
@@ -758,11 +758,13 @@
         public void onNotificationClear(int callingUid, int callingPid,
                 String pkg, String tag, int id, int userId, String key,
                 @NotificationStats.DismissalSurface int dismissalSurface,
+                @NotificationStats.DismissalSentiment int dismissalSentiment,
                 NotificationVisibility nv) {
             synchronized (mNotificationLock) {
                 NotificationRecord r = mNotificationsByKey.get(key);
                 if (r != null) {
                     r.recordDismissalSurface(dismissalSurface);
+                    r.recordDismissalSentiment(dismissalSentiment);
                 }
             }
             cancelNotification(callingUid, callingPid, pkg, tag, id, 0,
@@ -798,8 +800,8 @@
         }
 
         @Override
-        public void onNotificationError(int callingUid, int callingPid, String pkg, String tag, int id,
-                int uid, int initialPid, String message, int userId) {
+        public void onNotificationError(int callingUid, int callingPid, String pkg, String tag,
+                int id, int uid, int initialPid, String message, int userId) {
             cancelNotification(callingUid, callingPid, pkg, tag, id, 0, 0, false, userId,
                     REASON_ERROR, null);
         }
@@ -1041,10 +1043,12 @@
                     uidList = intent.getIntArrayExtra(Intent.EXTRA_CHANGED_UID_LIST);
                 } else if (action.equals(Intent.ACTION_PACKAGES_SUSPENDED)) {
                     pkgList = intent.getStringArrayExtra(Intent.EXTRA_CHANGED_PACKAGE_LIST);
+                    uidList = intent.getIntArrayExtra(Intent.EXTRA_CHANGED_UID_LIST);
                     cancelNotifications = false;
                     hideNotifications = true;
                 } else if (action.equals(Intent.ACTION_PACKAGES_UNSUSPENDED)) {
                     pkgList = intent.getStringArrayExtra(Intent.EXTRA_CHANGED_PACKAGE_LIST);
+                    uidList = intent.getIntArrayExtra(Intent.EXTRA_CHANGED_UID_LIST);
                     cancelNotifications = false;
                     unhideNotifications = true;
                 } else if (queryRestart) {
@@ -2694,24 +2698,30 @@
             try {
                 synchronized (mNotificationLock) {
                     final ManagedServiceInfo info = mListeners.checkServiceTokenLocked(token);
-                    if (keys != null) {
-                        final int N = keys.length;
-                        for (int i = 0; i < N; i++) {
-                            NotificationRecord r = mNotificationsByKey.get(keys[i]);
-                            if (r == null) continue;
-                            final int userId = r.sbn.getUserId();
-                            if (userId != info.userid && userId != UserHandle.USER_ALL &&
-                                    !mUserProfiles.isCurrentProfile(userId)) {
-                                throw new SecurityException("Disallowed call from listener: "
-                                        + info.service);
-                            }
-                            if (!r.isSeen()) {
-                                if (DBG) Slog.d(TAG, "Marking notification as seen " + keys[i]);
-                                reportSeen(r);
-                                r.setSeen();
-                                maybeRecordInterruptionLocked(r);
-                            }
+                    if (keys == null) {
+                        return;
+                    }
+                    ArrayList<NotificationRecord> seen = new ArrayList<>();
+                    final int n = keys.length;
+                    for (int i = 0; i < n; i++) {
+                        NotificationRecord r = mNotificationsByKey.get(keys[i]);
+                        if (r == null) continue;
+                        final int userId = r.sbn.getUserId();
+                        if (userId != info.userid && userId != UserHandle.USER_ALL
+                                && !mUserProfiles.isCurrentProfile(userId)) {
+                            throw new SecurityException("Disallowed call from listener: "
+                                    + info.service);
                         }
+                        seen.add(r);
+                        if (!r.isSeen()) {
+                            if (DBG) Slog.d(TAG, "Marking notification as seen " + keys[i]);
+                            reportSeen(r);
+                            r.setSeen();
+                            maybeRecordInterruptionLocked(r);
+                        }
+                    }
+                    if (!seen.isEmpty()) {
+                        mAssistants.onNotificationsSeenLocked(seen);
                     }
                 }
             } finally {
@@ -5959,6 +5969,7 @@
             }
             notificationList.remove(i);
             mNotificationsByKey.remove(r.getKey());
+            r.recordDismissalSentiment(NotificationStats.DISMISS_SENTIMENT_NEUTRAL);
             canceledNotifications.add(r);
             cancelNotificationLocked(r, sendDelete, reason, wasPosted, listenerName);
         }
@@ -6556,6 +6567,35 @@
             rebindServices(true);
         }
 
+        protected void onNotificationsSeenLocked(ArrayList<NotificationRecord> records) {
+            // There should be only one, but it's a list, so while we enforce
+            // singularity elsewhere, we keep it general here, to avoid surprises.
+            for (final ManagedServiceInfo info : NotificationAssistants.this.getServices()) {
+                ArrayList<String> keys = new ArrayList<>(records.size());
+                for (NotificationRecord r : records) {
+                    boolean sbnVisible = isVisibleToListener(r.sbn, info)
+                            && info.isSameUser(r.getUserId());
+                    if (sbnVisible) {
+                        keys.add(r.getKey());
+                    }
+                }
+
+                if (!keys.isEmpty()) {
+                    mHandler.post(() -> notifySeen(info, keys));
+                }
+            }
+        }
+
+        private void notifySeen(final ManagedServiceInfo info,
+                final ArrayList<String> keys) {
+            final INotificationListener assistant = (INotificationListener) info.service;
+            try {
+                assistant.onNotificationsSeen(keys);
+            } catch (RemoteException ex) {
+                Log.e(TAG, "unable to notify assistant (seen): " + assistant, ex);
+            }
+        }
+
         public void onNotificationEnqueued(final NotificationRecord r) {
             final StatusBarNotification sbn = r.sbn;
             TrimCache trimCache = new TrimCache(sbn);
diff --git a/services/core/java/com/android/server/notification/NotificationRecord.java b/services/core/java/com/android/server/notification/NotificationRecord.java
index a6d8615..fbb42ea 100644
--- a/services/core/java/com/android/server/notification/NotificationRecord.java
+++ b/services/core/java/com/android/server/notification/NotificationRecord.java
@@ -1065,6 +1065,10 @@
         mStats.setDismissalSurface(surface);
     }
 
+    public void recordDismissalSentiment(@NotificationStats.DismissalSentiment int sentiment) {
+        mStats.setDismissalSentiment(sentiment);
+    }
+
     public void recordSnoozed() {
         mStats.setSnoozed();
     }
diff --git a/services/core/java/com/android/server/pm/PackageManagerService.java b/services/core/java/com/android/server/pm/PackageManagerService.java
index f3d333b..3c2b089 100644
--- a/services/core/java/com/android/server/pm/PackageManagerService.java
+++ b/services/core/java/com/android/server/pm/PackageManagerService.java
@@ -254,6 +254,7 @@
 import android.util.DisplayMetrics;
 import android.util.EventLog;
 import android.util.ExceptionUtils;
+import android.util.IntArray;
 import android.util.Log;
 import android.util.LogPrinter;
 import android.util.LongSparseArray;
@@ -14169,11 +14170,12 @@
         info.sendPackageRemovedBroadcasts(true /*killApp*/);
     }
 
-    private void sendPackagesSuspendedForUser(String[] pkgList, int userId, boolean suspended,
-            PersistableBundle launcherExtras) {
+    private void sendPackagesSuspendedForUser(String[] pkgList, int[] uidList, int userId,
+            boolean suspended, PersistableBundle launcherExtras) {
         if (pkgList.length > 0) {
             Bundle extras = new Bundle(1);
             extras.putStringArray(Intent.EXTRA_CHANGED_PACKAGE_LIST, pkgList);
+            extras.putIntArray(Intent.EXTRA_CHANGED_UID_LIST, uidList);
             if (launcherExtras != null) {
                 extras.putBundle(Intent.EXTRA_LAUNCHER_EXTRAS,
                         new Bundle(launcherExtras.deepCopy()));
@@ -14355,6 +14357,7 @@
         }
 
         final List<String> changedPackagesList = new ArrayList<>(packageNames.length);
+        final IntArray changedUids = new IntArray(packageNames.length);
         final List<String> unactionedPackages = new ArrayList<>(packageNames.length);
         final long callingId = Binder.clearCallingIdentity();
         try {
@@ -14382,6 +14385,7 @@
                     pkgSetting.setSuspended(suspended, callingPackage, dialogMessage, appExtras,
                             launcherExtras, userId);
                     changedPackagesList.add(packageName);
+                    changedUids.add(UserHandle.getUid(userId, pkgSetting.appId));
                 }
             }
         } finally {
@@ -14390,7 +14394,8 @@
         if (!changedPackagesList.isEmpty()) {
             final String[] changedPackages = changedPackagesList.toArray(
                     new String[changedPackagesList.size()]);
-            sendPackagesSuspendedForUser(changedPackages, userId, suspended, launcherExtras);
+            sendPackagesSuspendedForUser(
+                    changedPackages, changedUids.toArray(), userId, suspended, launcherExtras);
             sendMyPackageSuspendedOrUnsuspended(changedPackages, suspended, appExtras, userId);
             synchronized (mPackages) {
                 scheduleWritePackageRestrictionsLocked(userId);
@@ -14505,12 +14510,14 @@
 
     private void unsuspendForSuspendingPackages(Predicate<String> packagePredicate, int userId) {
         final List<String> affectedPackages = new ArrayList<>();
+        final IntArray affectedUids = new IntArray();
         synchronized (mPackages) {
             for (PackageSetting ps : mSettings.mPackages.values()) {
                 final PackageUserState pus = ps.readUserState(userId);
                 if (pus.suspended && packagePredicate.test(pus.suspendingPackage)) {
                     ps.setSuspended(false, null, null, null, null, userId);
                     affectedPackages.add(ps.name);
+                    affectedUids.add(UserHandle.getUid(userId, ps.getAppId()));
                 }
             }
         }
@@ -14518,7 +14525,8 @@
             final String[] packageArray = affectedPackages.toArray(
                     new String[affectedPackages.size()]);
             sendMyPackageSuspendedOrUnsuspended(packageArray, false, null, userId);
-            sendPackagesSuspendedForUser(packageArray, userId, false, null);
+            sendPackagesSuspendedForUser(
+                    packageArray, affectedUids.toArray(), userId, false, null);
             // Write package restrictions immediately to avoid an inconsistent state.
             mSettings.writePackageRestrictionsLPr(userId);
         }
diff --git a/services/core/java/com/android/server/pm/permission/BasePermission.java b/services/core/java/com/android/server/pm/permission/BasePermission.java
index 1d002ef..8202580 100644
--- a/services/core/java/com/android/server/pm/permission/BasePermission.java
+++ b/services/core/java/com/android/server/pm/permission/BasePermission.java
@@ -39,6 +39,7 @@
 
 import com.android.server.pm.DumpState;
 import com.android.server.pm.PackageManagerService;
+import com.android.server.pm.PackageSetting;
 import com.android.server.pm.PackageSettingBase;
 
 import org.xmlpull.v1.XmlPullParser;
@@ -374,8 +375,10 @@
     }
 
     public void enforceDeclaredUsedAndRuntimeOrDevelopment(PackageParser.Package pkg) {
+        final PackageSetting pkgSetting = (PackageSetting) pkg.mExtras;
+        final PermissionsState permsState = pkgSetting.getPermissionsState();
         int index = pkg.requestedPermissions.indexOf(name);
-        if (index == -1) {
+        if (!permsState.hasRequestedPermission(name) && index == -1) {
             throw new SecurityException("Package " + pkg.packageName
                     + " has not requested permission " + name);
         }
diff --git a/services/core/java/com/android/server/pm/permission/PermissionsState.java b/services/core/java/com/android/server/pm/permission/PermissionsState.java
index 11df380..5e66bfc3 100644
--- a/services/core/java/com/android/server/pm/permission/PermissionsState.java
+++ b/services/core/java/com/android/server/pm/permission/PermissionsState.java
@@ -20,9 +20,9 @@
 import android.os.UserHandle;
 import android.util.ArrayMap;
 import android.util.ArraySet;
-
 import android.util.SparseArray;
 import android.util.SparseBooleanArray;
+
 import com.android.internal.util.ArrayUtils;
 
 import java.util.ArrayList;
@@ -291,6 +291,13 @@
     }
 
     /**
+     * Returns whether the state has any known request for the given permission name,
+     * whether or not it has been granted.
+     */
+    public boolean hasRequestedPermission(String name) {
+        return mPermissions != null && (mPermissions.get(name) != null);
+    }
+    /**
      * Gets all permissions for a given device user id regardless if they
      * are install time or runtime permissions.
      *
diff --git a/services/core/java/com/android/server/power/PowerManagerService.java b/services/core/java/com/android/server/power/PowerManagerService.java
index 13800b6..91d4717 100644
--- a/services/core/java/com/android/server/power/PowerManagerService.java
+++ b/services/core/java/com/android/server/power/PowerManagerService.java
@@ -288,6 +288,9 @@
     private long mLastWakeTime;
     private long mLastSleepTime;
 
+    // Last reason the device went to sleep.
+    private int mLastSleepReason;
+
     // Timestamp of the last call to user activity.
     private long mLastUserActivityTime;
     private long mLastUserActivityTimeNoChangeLights;
@@ -1433,6 +1436,7 @@
             }
 
             mLastSleepTime = eventTime;
+            mLastSleepReason = reason;
             mSandmanSummoned = true;
             setWakefulnessLocked(WAKEFULNESS_DOZING, reason);
 
@@ -3266,6 +3270,7 @@
             pw.println("  mDeviceIdleTempWhitelist=" + Arrays.toString(mDeviceIdleTempWhitelist));
             pw.println("  mLastWakeTime=" + TimeUtils.formatUptime(mLastWakeTime));
             pw.println("  mLastSleepTime=" + TimeUtils.formatUptime(mLastSleepTime));
+            pw.println("  mLastSleepReason=" + PowerManager.sleepReasonToString(mLastSleepReason));
             pw.println("  mLastUserActivityTime=" + TimeUtils.formatUptime(mLastUserActivityTime));
             pw.println("  mLastUserActivityTimeNoChangeLights="
                     + TimeUtils.formatUptime(mLastUserActivityTimeNoChangeLights));
@@ -4404,6 +4409,19 @@
             }
         }
 
+        @Override // Binder call
+        public int getLastSleepReason() {
+            mContext.enforceCallingOrSelfPermission(
+                    android.Manifest.permission.DEVICE_POWER, null);
+
+            final long ident = Binder.clearCallingIdentity();
+            try {
+                return getLastSleepReasonInternal();
+            } finally {
+                Binder.restoreCallingIdentity(ident);
+            }
+        }
+
         /**
          * Reboots the device.
          *
@@ -4619,6 +4637,12 @@
         }
     }
 
+    private int getLastSleepReasonInternal() {
+        synchronized (mLock) {
+            return mLastSleepReason;
+        }
+    }
+
     private final class LocalService extends PowerManagerInternal {
         @Override
         public void setScreenBrightnessOverrideFromWindowManager(int screenBrightness) {
diff --git a/services/core/java/com/android/server/statusbar/StatusBarManagerService.java b/services/core/java/com/android/server/statusbar/StatusBarManagerService.java
index 519881e..b8c9be7 100644
--- a/services/core/java/com/android/server/statusbar/StatusBarManagerService.java
+++ b/services/core/java/com/android/server/statusbar/StatusBarManagerService.java
@@ -80,6 +80,7 @@
     private int mDisabled2 = 0;
 
     private final Object mLock = new Object();
+    private final DeathRecipient mDeathRecipient = new DeathRecipient();
     // encompasses lights-out mode and other flags defined on View
     private int mSystemUiVisibility = 0;
     private int mFullscreenStackSysUiVisibility;
@@ -93,6 +94,23 @@
     private IBinder mImeToken = null;
     private int mCurrentUserId;
 
+    private class DeathRecipient implements IBinder.DeathRecipient {
+        public void binderDied() {
+            mBar.asBinder().unlinkToDeath(this,0);
+            mBar = null;
+            notifyBarAttachChanged();
+        }
+
+        public void linkToDeath() {
+            try {
+                mBar.asBinder().linkToDeath(mDeathRecipient,0);
+            } catch (RemoteException e) {
+                Slog.e(TAG,"Unable to register Death Recipient for status bar", e);
+            }
+        }
+
+    }
+
     private class DisableRecord implements IBinder.DeathRecipient {
         int userId;
         String pkg;
@@ -859,16 +877,7 @@
 
         Slog.i(TAG, "registerStatusBar bar=" + bar);
         mBar = bar;
-        try {
-            mBar.asBinder().linkToDeath(new DeathRecipient() {
-                @Override
-                public void binderDied() {
-                    mBar = null;
-                    notifyBarAttachChanged();
-                }
-            }, 0);
-        } catch (RemoteException e) {
-        }
+        mDeathRecipient.linkToDeath();
         notifyBarAttachChanged();
         synchronized (mIcons) {
             for (String slot : mIcons.keySet()) {
@@ -1044,14 +1053,16 @@
 
     @Override
     public void onNotificationClear(String pkg, String tag, int id, int userId, String key,
-            @NotificationStats.DismissalSurface int dismissalSurface, NotificationVisibility nv) {
+            @NotificationStats.DismissalSurface int dismissalSurface,
+            @NotificationStats.DismissalSentiment int dismissalSentiment,
+            NotificationVisibility nv) {
         enforceStatusBarService();
         final int callingUid = Binder.getCallingUid();
         final int callingPid = Binder.getCallingPid();
         long identity = Binder.clearCallingIdentity();
         try {
             mNotificationDelegate.onNotificationClear(callingUid, callingPid, pkg, tag, id, userId,
-                    key, dismissalSurface, nv);
+                    key, dismissalSurface, dismissalSentiment, nv);
         } finally {
             Binder.restoreCallingIdentity(identity);
         }
diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java
index c1bfbea..8a57143 100644
--- a/services/core/java/com/android/server/wm/WindowManagerService.java
+++ b/services/core/java/com/android/server/wm/WindowManagerService.java
@@ -2341,6 +2341,12 @@
 
         synchronized(mWindowMap) {
             final DisplayContent dc = mRoot.getDisplayContent(displayId);
+            if (dc == null) {
+                Slog.w(TAG_WM, "addWindowToken: Attempted to add token: " + binder
+                        + " for non-exiting displayId=" + displayId);
+                return;
+            }
+
             WindowToken token = dc.getWindowToken(binder);
             if (token != null) {
                 Slog.w(TAG_WM, "addWindowToken: Attempted to add binder token: " + binder
diff --git a/services/core/java/com/android/server/wm/utils/InsetUtils.java b/services/core/java/com/android/server/wm/utils/InsetUtils.java
index c5b103f..f5cc0d5 100644
--- a/services/core/java/com/android/server/wm/utils/InsetUtils.java
+++ b/services/core/java/com/android/server/wm/utils/InsetUtils.java
@@ -19,6 +19,7 @@
 import android.annotation.NonNull;
 import android.annotation.Nullable;
 import android.graphics.Rect;
+import android.view.Surface;
 
 
 /**
@@ -30,6 +31,32 @@
     }
 
     /**
+     * Transforms insets given in one rotation into insets in a different rotation.
+     *
+     * @param inOutInsets the insets to transform, is set to the transformed insets
+     * @param rotationDelta the delta between the new and old rotation.
+     *                      Must be one of Surface.ROTATION_0/90/180/270.
+     */
+    public static void rotateInsets(Rect inOutInsets, int rotationDelta) {
+        final Rect r = inOutInsets;
+        switch (rotationDelta) {
+            case Surface.ROTATION_0:
+                return;
+            case Surface.ROTATION_90:
+                r.set(r.top, r.right, r.bottom, r.left);
+                break;
+            case Surface.ROTATION_180:
+                r.set(r.right, r.bottom, r.left, r.top);
+                break;
+            case Surface.ROTATION_270:
+                r.set(r.bottom, r.left, r.top, r.right);
+                break;
+            default:
+                throw new IllegalArgumentException("Unknown rotation: " + rotationDelta);
+        }
+    }
+
+    /**
      * Adds {@code insetsToAdd} to {@code inOutInsets}.
      */
     public static void addInsets(Rect inOutInsets, Rect insetsToAdd) {
diff --git a/services/tests/servicestests/src/com/android/server/wm/DragDropControllerTests.java b/services/tests/servicestests/src/com/android/server/wm/DragDropControllerTests.java
index f383fda..7125246 100644
--- a/services/tests/servicestests/src/com/android/server/wm/DragDropControllerTests.java
+++ b/services/tests/servicestests/src/com/android/server/wm/DragDropControllerTests.java
@@ -23,6 +23,7 @@
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 import static org.mockito.Mockito.any;
+import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.spy;
 import static org.mockito.Mockito.when;
@@ -56,7 +57,7 @@
 /**
  * Tests for the {@link DragDropController} class.
  *
- * atest com.android.server.wm.DragDropControllerTests
+ * atest FrameworksServicesTests:com.android.server.wm.DragDropControllerTests
  */
 @SmallTest
 @RunWith(AndroidJUnit4.class)
@@ -118,7 +119,7 @@
         mTarget = new TestDragDropController(sWm, sWm.mH.getLooper());
         mDisplayContent = spy(mDisplayContent);
         mWindow = createDropTargetWindow("Drag test window", 0);
-        when(mDisplayContent.getTouchableWinAtPointLocked(0, 0)).thenReturn(mWindow);
+        doReturn(mWindow).when(mDisplayContent).getTouchableWinAtPointLocked(0, 0);
         when(sWm.mInputManager.transferTouchFocus(any(), any())).thenReturn(true);
 
         synchronized (sWm.mWindowMap) {
@@ -159,8 +160,7 @@
     public void testPerformDrag_NullDataToOtherUser() throws Exception {
         final WindowState otherUsersWindow =
                 createDropTargetWindow("Other user's window", 1 * UserHandle.PER_USER_RANGE);
-        when(mDisplayContent.getTouchableWinAtPointLocked(10, 10))
-                .thenReturn(otherUsersWindow);
+        doReturn(otherUsersWindow).when(mDisplayContent).getTouchableWinAtPointLocked(10, 10);
 
         dragFlow(0, null, 10, 10);
     }
diff --git a/services/tests/servicestests/src/com/android/server/wm/utils/InsetUtilsTest.java b/services/tests/servicestests/src/com/android/server/wm/utils/InsetUtilsTest.java
index 75b4d2f..3364aef 100644
--- a/services/tests/servicestests/src/com/android/server/wm/utils/InsetUtilsTest.java
+++ b/services/tests/servicestests/src/com/android/server/wm/utils/InsetUtilsTest.java
@@ -16,6 +16,11 @@
 
 package com.android.server.wm.utils;
 
+import static android.hardware.camera2.params.OutputConfiguration.ROTATION_90;
+import static android.view.Surface.ROTATION_0;
+import static android.view.Surface.ROTATION_180;
+import static android.view.Surface.ROTATION_270;
+
 import static junit.framework.Assert.assertEquals;
 
 import android.graphics.Rect;
@@ -39,5 +44,29 @@
         InsetUtils.addInsets(rect1, rect2);
         assertEquals(new Rect(60, 80, 100, 120), rect1);
     }
+
+    @Test
+    public void rotate() {
+        final Rect original = new Rect(1, 2, 3, 4);
+
+        assertEquals("rot0", original, rotateCopy(original, ROTATION_0));
+
+        final Rect rot90 = rotateCopy(original, ROTATION_90);
+        assertEquals("rot90", new Rect(2, 3, 4, 1), rot90);
+
+        final Rect rot180 = rotateCopy(original, ROTATION_180);
+        assertEquals("rot180", new Rect(3, 4, 1, 2), rot180);
+        assertEquals("rot90(rot90)=rot180", rotateCopy(rot90, ROTATION_90), rot180);
+
+        final Rect rot270 = rotateCopy(original, ROTATION_270);
+        assertEquals("rot270", new Rect(4, 1, 2, 3), rot270);
+        assertEquals("rot90(rot180)=rot270", rotateCopy(rot180, ROTATION_90), rot270);
+    }
+
+    private static Rect rotateCopy(Rect insets, int rotationDelta) {
+        final Rect copy = new Rect(insets);
+        InsetUtils.rotateInsets(copy, rotationDelta);
+        return copy;
+    }
 }
 
diff --git a/services/tests/uiservicestests/src/com/android/server/notification/NotificationManagerServiceTest.java b/services/tests/uiservicestests/src/com/android/server/notification/NotificationManagerServiceTest.java
index 4dcb8cf..0ff124e 100644
--- a/services/tests/uiservicestests/src/com/android/server/notification/NotificationManagerServiceTest.java
+++ b/services/tests/uiservicestests/src/com/android/server/notification/NotificationManagerServiceTest.java
@@ -2483,13 +2483,29 @@
 
         final NotificationVisibility nv = NotificationVisibility.obtain(r.getKey(), 0, 1, true);
         mService.mNotificationDelegate.onNotificationClear(mUid, 0, PKG, r.sbn.getTag(),
-                r.sbn.getId(), r.getUserId(), r.getKey(), NotificationStats.DISMISSAL_AOD, nv);
+                r.sbn.getId(), r.getUserId(), r.getKey(), NotificationStats.DISMISSAL_AOD,
+                NotificationStats.DISMISS_SENTIMENT_POSITIVE, nv);
         waitForIdle();
 
         assertEquals(NotificationStats.DISMISSAL_AOD, r.getStats().getDismissalSurface());
     }
 
     @Test
+    public void testStats_dismissalSentiment() throws Exception {
+        final NotificationRecord r = generateNotificationRecord(mTestNotificationChannel);
+        mService.addNotification(r);
+
+        final NotificationVisibility nv = NotificationVisibility.obtain(r.getKey(), 0, 1, true);
+        mService.mNotificationDelegate.onNotificationClear(mUid, 0, PKG, r.sbn.getTag(),
+                r.sbn.getId(), r.getUserId(), r.getKey(), NotificationStats.DISMISSAL_AOD,
+                NotificationStats.DISMISS_SENTIMENT_NEGATIVE, nv);
+        waitForIdle();
+
+        assertEquals(NotificationStats.DISMISS_SENTIMENT_NEGATIVE,
+                r.getStats().getDismissalSentiment());
+    }
+
+    @Test
     public void testApplyAdjustmentMultiUser() throws Exception {
         final NotificationRecord r = generateNotificationRecord(mTestNotificationChannel);
         mService.addNotification(r);
diff --git a/services/tests/uiservicestests/src/com/android/server/notification/NotificationStatsTest.java b/services/tests/uiservicestests/src/com/android/server/notification/NotificationStatsTest.java
index 0a630f4..bae8564 100644
--- a/services/tests/uiservicestests/src/com/android/server/notification/NotificationStatsTest.java
+++ b/services/tests/uiservicestests/src/com/android/server/notification/NotificationStatsTest.java
@@ -16,6 +16,8 @@
 package com.android.server.notification;
 
 import static android.service.notification.NotificationStats.DISMISSAL_PEEK;
+import static android.service.notification.NotificationStats.DISMISS_SENTIMENT_NEGATIVE;
+import static android.service.notification.NotificationStats.DISMISS_SENTIMENT_POSITIVE;
 
 import static junit.framework.Assert.assertEquals;
 import static junit.framework.Assert.assertFalse;
@@ -46,6 +48,7 @@
         assertFalse(stats.hasViewedSettings());
         assertFalse(stats.hasSnoozed());
         assertEquals(NotificationStats.DISMISSAL_NOT_DISMISSED, stats.getDismissalSurface());
+        assertEquals(NotificationStats.DISMISS_SENTIMENT_UNKNOWN, stats.getDismissalSentiment());
     }
 
     @Test
@@ -97,10 +100,19 @@
     }
 
     @Test
+    public void testDismissalSentiment() {
+        NotificationStats stats = new NotificationStats();
+        stats.setDismissalSentiment(DISMISS_SENTIMENT_NEGATIVE);
+        assertEquals(DISMISS_SENTIMENT_NEGATIVE, stats.getDismissalSentiment());
+        assertFalse(stats.hasInteracted());
+    }
+
+    @Test
     public void testWriteToParcel() {
         NotificationStats stats = new NotificationStats();
         stats.setViewedSettings();
         stats.setDismissalSurface(NotificationStats.DISMISSAL_AOD);
+        stats.setDismissalSentiment(NotificationStats.DISMISS_SENTIMENT_POSITIVE);
         Parcel parcel = Parcel.obtain();
         stats.writeToParcel(parcel, 0);
         parcel.setDataPosition(0);
diff --git a/telephony/java/android/telephony/ModemInfo.java b/telephony/java/android/telephony/ModemInfo.java
new file mode 100644
index 0000000..564effe
--- /dev/null
+++ b/telephony/java/android/telephony/ModemInfo.java
@@ -0,0 +1,104 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.telephony;
+
+import android.os.Parcel;
+import android.os.Parcelable;
+
+import java.util.Objects;
+
+/**
+ * Information of a single logical modem indicating
+ * its id, supported rats and whether it supports voice or data, etc.
+ * @hide
+ */
+public class ModemInfo implements Parcelable {
+    public final int modemId;
+    public final int rat; /* bitset */
+    public final boolean isVoiceSupported;
+    public final boolean isDataSupported;
+
+    public ModemInfo(int modemId, int rat, boolean isVoiceSupported, boolean isDataSupported) {
+        this.modemId = modemId;
+        this.rat = rat;
+        this.isVoiceSupported = isVoiceSupported;
+        this.isDataSupported = isDataSupported;
+    }
+
+    public ModemInfo(Parcel in) {
+        modemId = in.readInt();
+        rat = in.readInt();
+        isVoiceSupported = in.readBoolean();
+        isDataSupported = in.readBoolean();
+    }
+
+    @Override
+    public String toString() {
+        return "modemId=" + modemId + " rat=" + rat + " isVoiceSupported:" + isVoiceSupported
+                + " isDataSupported:" + isDataSupported;
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(modemId, rat, isVoiceSupported, isDataSupported);
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        if (o == null || !(o instanceof ModemInfo) || hashCode() != o.hashCode()) {
+            return false;
+        }
+
+        if (this == o) {
+            return true;
+        }
+
+        ModemInfo s = (ModemInfo) o;
+
+        return (modemId == s.modemId
+                && rat == s.rat
+                && isVoiceSupported == s.isVoiceSupported
+                && isDataSupported == s.isDataSupported);
+    }
+
+    /**
+     * {@link Parcelable#describeContents}
+     */
+    public @ContentsFlags int describeContents() {
+        return 0;
+    }
+
+    /**
+     * {@link Parcelable#writeToParcel}
+     */
+    public void writeToParcel(Parcel dest, @WriteFlags int flags) {
+        dest.writeInt(modemId);
+        dest.writeInt(rat);
+        dest.writeBoolean(isVoiceSupported);
+        dest.writeBoolean(isDataSupported);
+    }
+
+    public static final Parcelable.Creator<ModemInfo> CREATOR = new Parcelable.Creator() {
+        public ModemInfo createFromParcel(Parcel in) {
+            return new ModemInfo(in);
+        }
+
+        public ModemInfo[] newArray(int size) {
+            return new ModemInfo[size];
+        }
+    };
+}
diff --git a/telephony/java/android/telephony/PhoneCapability.aidl b/telephony/java/android/telephony/PhoneCapability.aidl
new file mode 100644
index 0000000..5de8d4a
--- /dev/null
+++ b/telephony/java/android/telephony/PhoneCapability.aidl
@@ -0,0 +1,20 @@
+/*
+**
+** Copyright 2018, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+
+package android.telephony;
+
+parcelable PhoneCapability;
\ No newline at end of file
diff --git a/telephony/java/android/telephony/PhoneCapability.java b/telephony/java/android/telephony/PhoneCapability.java
new file mode 100644
index 0000000..2ebfa53
--- /dev/null
+++ b/telephony/java/android/telephony/PhoneCapability.java
@@ -0,0 +1,111 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.telephony;
+
+import android.os.Parcel;
+import android.os.Parcelable;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Objects;
+
+/**
+ * Define capability of a modem group. That is, the capabilities
+ * are shared between those modems defined by list of modem IDs.
+ * @hide
+ */
+public class PhoneCapability implements Parcelable {
+    public final int maxActiveVoiceCalls;
+    public final int maxActiveData;
+    public final int max5G;
+    public final List<ModemInfo> logicalModemList;
+
+    public PhoneCapability(int maxActiveVoiceCalls, int maxActiveData, int max5G,
+            List<ModemInfo> logicalModemList) {
+        this.maxActiveVoiceCalls = maxActiveVoiceCalls;
+        this.maxActiveData = maxActiveData;
+        this.max5G = max5G;
+        // Make sure it's not null.
+        this.logicalModemList = logicalModemList == null ? new ArrayList<>() : logicalModemList;
+    }
+
+    @Override
+    public String toString() {
+        return "maxActiveVoiceCalls=" + maxActiveVoiceCalls + " maxActiveData=" + maxActiveData
+                + " max5G=" + max5G + "logicalModemList:"
+                + Arrays.toString(logicalModemList.toArray());
+    }
+
+    private PhoneCapability(Parcel in) {
+        maxActiveVoiceCalls = in.readInt();
+        maxActiveData = in.readInt();
+        max5G = in.readInt();
+        logicalModemList = new ArrayList<>();
+        in.readList(logicalModemList, ModemInfo.class.getClassLoader());
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(maxActiveVoiceCalls, maxActiveData, max5G, logicalModemList);
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        if (o == null || !(o instanceof PhoneCapability) || hashCode() != o.hashCode()) {
+            return false;
+        }
+
+        if (this == o) {
+            return true;
+        }
+
+        PhoneCapability s = (PhoneCapability) o;
+
+        return (maxActiveVoiceCalls == s.maxActiveVoiceCalls
+                && maxActiveData == s.maxActiveData
+                && max5G == s.max5G
+                && logicalModemList.equals(s.logicalModemList));
+    }
+
+    /**
+     * {@link Parcelable#describeContents}
+     */
+    public @Parcelable.ContentsFlags int describeContents() {
+        return 0;
+    }
+
+    /**
+     * {@link Parcelable#writeToParcel}
+     */
+    public void writeToParcel(Parcel dest, @Parcelable.WriteFlags int flags) {
+        dest.writeInt(maxActiveVoiceCalls);
+        dest.writeInt(maxActiveData);
+        dest.writeInt(max5G);
+        dest.writeList(logicalModemList);
+    }
+
+    public static final Parcelable.Creator<PhoneCapability> CREATOR = new Parcelable.Creator() {
+        public PhoneCapability createFromParcel(Parcel in) {
+            return new PhoneCapability(in);
+        }
+
+        public PhoneCapability[] newArray(int size) {
+            return new PhoneCapability[size];
+        }
+    };
+}
diff --git a/telephony/java/android/telephony/PhoneStateListener.java b/telephony/java/android/telephony/PhoneStateListener.java
index 7f7ce8e..bd6a59d 100644
--- a/telephony/java/android/telephony/PhoneStateListener.java
+++ b/telephony/java/android/telephony/PhoneStateListener.java
@@ -22,12 +22,11 @@
 import android.os.Handler;
 import android.os.Looper;
 import android.os.Message;
-import android.telecom.TelecomManager;
 
 import com.android.internal.telephony.IPhoneStateListener;
 
-import java.util.List;
 import java.lang.ref.WeakReference;
+import java.util.List;
 
 /**
  * A listener class for monitoring changes in specific telephony states
@@ -273,6 +272,14 @@
      */
     public static final int LISTEN_PHYSICAL_CHANNEL_CONFIGURATION          = 0x00100000;
 
+    /**
+     *  Listen for changes to the phone capability.
+     *
+     *  @see #onPhoneCapabilityChanged
+     *  @hide
+     */
+    public static final int LISTEN_PHONE_CAPABILITY_CHANGE                 = 0x00200000;
+
     /*
      * Subscription used to listen to the phone state changes
      * @hide
@@ -395,6 +402,10 @@
                         PhoneStateListener.this.onPhysicalChannelConfigurationChanged(
                                 (List<PhysicalChannelConfig>)msg.obj);
                         break;
+                    case LISTEN_PHONE_CAPABILITY_CHANGE:
+                        PhoneStateListener.this.onPhoneCapabilityChanged(
+                                (PhoneCapability) msg.obj);
+                        break;
                 }
             }
         };
@@ -625,6 +636,16 @@
     }
 
     /**
+     * Callback invoked when phone capability changes. Requires
+     * the READ_PRIVILEGED_PHONE_STATE permission.
+     * @param capability the new phone capability
+     * @hide
+     */
+    public void onPhoneCapabilityChanged(PhoneCapability capability) {
+        // default implementation empty
+    }
+
+    /**
      * Callback invoked when telephony has received notice from a carrier
      * app that a network action that could result in connectivity loss
      * has been requested by an app using
@@ -751,6 +772,10 @@
         public void onPhysicalChannelConfigurationChanged(List<PhysicalChannelConfig> configs) {
             send(LISTEN_PHYSICAL_CHANNEL_CONFIGURATION, 0, 0, configs);
         }
+
+        public void onPhoneCapabilityChanged(PhoneCapability capability) {
+            send(LISTEN_PHONE_CAPABILITY_CHANGE, 0, 0, capability);
+        }
     }
 
     @UnsupportedAppUsage
diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java
index 3a8dba8..81d0d68 100644
--- a/telephony/java/android/telephony/TelephonyManager.java
+++ b/telephony/java/android/telephony/TelephonyManager.java
@@ -8075,4 +8075,23 @@
         }
         return UNKNOWN_CARRIER_ID_LIST_VERSION;
     }
+
+
+    /**
+     * How many modems can have simultaneous data connections.
+     * @hide
+     */
+    @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE)
+    public int getNumberOfModemsWithSimultaneousDataConnections() {
+        try {
+            ITelephony telephony = getITelephony();
+            if (telephony != null) {
+                return telephony.getNumberOfModemsWithSimultaneousDataConnections(
+                        getSubId(), mContext.getOpPackageName());
+            }
+        } catch (RemoteException ex) {
+            // This could happen if binder process crashes.
+        }
+        return 0;
+    }
 }
diff --git a/telephony/java/com/android/internal/telephony/IPhoneStateListener.aidl b/telephony/java/com/android/internal/telephony/IPhoneStateListener.aidl
index 0d315e5..1ebb697 100644
--- a/telephony/java/com/android/internal/telephony/IPhoneStateListener.aidl
+++ b/telephony/java/com/android/internal/telephony/IPhoneStateListener.aidl
@@ -21,6 +21,7 @@
 import android.telephony.SignalStrength;
 import android.telephony.CellInfo;
 import android.telephony.DataConnectionRealTimeInfo;
+import android.telephony.PhoneCapability;
 import android.telephony.PhysicalChannelConfig;
 import android.telephony.PreciseCallState;
 import android.telephony.PreciseDataConnectionState;
@@ -50,5 +51,6 @@
     void onOemHookRawEvent(in byte[] rawData);
     void onCarrierNetworkChange(in boolean active);
     void onUserMobileDataStateChanged(in boolean enabled);
+    void onPhoneCapabilityChanged(in PhoneCapability capability);
 }
 
diff --git a/telephony/java/com/android/internal/telephony/ITelephony.aidl b/telephony/java/com/android/internal/telephony/ITelephony.aidl
index f9c3940..c59a739 100644
--- a/telephony/java/com/android/internal/telephony/ITelephony.aidl
+++ b/telephony/java/com/android/internal/telephony/ITelephony.aidl
@@ -1531,4 +1531,10 @@
      * @hide
      */
     void refreshUiccProfile(int subId);
+
+    /**
+     * How many modems can have simultaneous data connections.
+     * @hide
+     */
+    int getNumberOfModemsWithSimultaneousDataConnections(int subId, String callingPackage);
 }
diff --git a/telephony/java/com/android/internal/telephony/ITelephonyRegistry.aidl b/telephony/java/com/android/internal/telephony/ITelephonyRegistry.aidl
index 0127db9..e0e1a7b 100644
--- a/telephony/java/com/android/internal/telephony/ITelephonyRegistry.aidl
+++ b/telephony/java/com/android/internal/telephony/ITelephonyRegistry.aidl
@@ -21,6 +21,7 @@
 import android.net.NetworkCapabilities;
 import android.os.Bundle;
 import android.telephony.CellInfo;
+import android.telephony.PhoneCapability;
 import android.telephony.PhysicalChannelConfig;
 import android.telephony.ServiceState;
 import android.telephony.SignalStrength;
@@ -74,4 +75,5 @@
     void notifySubscriptionInfoChanged();
     void notifyCarrierNetworkChange(in boolean active);
     void notifyUserMobileDataStateChangedForPhoneId(in int phoneId, in int subId, in boolean state);
+    void notifyPhoneCapabilityChanged(in PhoneCapability capability);
 }
diff --git a/telephony/java/com/android/internal/telephony/SmsConstants.java b/telephony/java/com/android/internal/telephony/SmsConstants.java
index 2449108..0aba468 100644
--- a/telephony/java/com/android/internal/telephony/SmsConstants.java
+++ b/telephony/java/com/android/internal/telephony/SmsConstants.java
@@ -58,7 +58,11 @@
      * See TS 23.038.
      */
     public enum MessageClass{
-        UNKNOWN, CLASS_0, CLASS_1, CLASS_2, CLASS_3;
+        UNKNOWN,
+        CLASS_0,
+        CLASS_1,
+        CLASS_2,
+        CLASS_3;
     }
 
     /**
diff --git a/tools/aapt2/format/Container.cpp b/tools/aapt2/format/Container.cpp
index 739555c..d4b4571 100644
--- a/tools/aapt2/format/Container.cpp
+++ b/tools/aapt2/format/Container.cpp
@@ -270,7 +270,8 @@
   }
 
   if (magic != kContainerFormatMagic) {
-    error_ = "magic value doesn't match AAPT";
+    error_ =
+        StringPrintf("magic value is 0x%08x but AAPT expects 0x%08x", magic, kContainerFormatMagic);
     return;
   }
 
diff --git a/tools/aapt2/format/binary/TableFlattener.cpp b/tools/aapt2/format/binary/TableFlattener.cpp
index 6fd4c8d..8641a7c 100644
--- a/tools/aapt2/format/binary/TableFlattener.cpp
+++ b/tools/aapt2/format/binary/TableFlattener.cpp
@@ -133,11 +133,10 @@
   }
 
   void Visit(Array* array) override {
-    for (auto& item : array->elements) {
-      ResTable_map* out_entry = buffer_->NextBlock<ResTable_map>();
-      FlattenValue(item.get(), out_entry);
-      out_entry->value.size = util::HostToDevice16(sizeof(out_entry->value));
-      entry_count_++;
+    const size_t count = array->elements.size();
+    for (size_t i = 0; i < count; i++) {
+      Reference key(android::ResTable_map::ATTR_MIN + i);
+      FlattenEntry(&key, array->elements[i].get());
     }
   }
 
diff --git a/tools/aapt2/format/binary/TableFlattener_test.cpp b/tools/aapt2/format/binary/TableFlattener_test.cpp
index bab7010..af19b98 100644
--- a/tools/aapt2/format/binary/TableFlattener_test.cpp
+++ b/tools/aapt2/format/binary/TableFlattener_test.cpp
@@ -17,7 +17,9 @@
 #include "format/binary/TableFlattener.h"
 
 #include "android-base/stringprintf.h"
+#include "androidfw/TypeWrappers.h"
 
+#include "ResChunkPullParser.h"
 #include "ResourceUtils.h"
 #include "SdkConstants.h"
 #include "format/binary/BinaryResourceParser.h"
@@ -236,6 +238,62 @@
   EXPECT_EQ(attr.max_int, actual_attr->max_int);
 }
 
+TEST_F(TableFlattenerTest, FlattenArray) {
+  auto array = util::make_unique<Array>();
+  array->elements.push_back(util::make_unique<BinaryPrimitive>(uint8_t(Res_value::TYPE_INT_DEC),
+                                                               1u));
+  array->elements.push_back(util::make_unique<BinaryPrimitive>(uint8_t(Res_value::TYPE_INT_DEC),
+                                                               2u));
+  std::unique_ptr<ResourceTable> table =
+      test::ResourceTableBuilder()
+          .SetPackageId("android", 0x01)
+          .AddValue("android:array/foo", ResourceId(0x01010000), std::move(array))
+          .Build();
+
+  std::string result;
+  ASSERT_TRUE(Flatten(context_.get(), {}, table.get(), &result));
+
+  // Parse the flattened resource table
+  ResChunkPullParser parser(result.data(), result.size());
+  ASSERT_TRUE(parser.IsGoodEvent(parser.Next()));
+  ASSERT_EQ(util::DeviceToHost16(parser.chunk()->type), RES_TABLE_TYPE);
+
+  // Retrieve the package of the entry
+  ResChunkPullParser table_parser(GetChunkData(parser.chunk()), GetChunkDataLen(parser.chunk()));
+  const ResChunk_header* package_chunk = nullptr;
+  while (table_parser.IsGoodEvent(table_parser.Next())) {
+    if (util::DeviceToHost16(table_parser.chunk()->type) == RES_TABLE_PACKAGE_TYPE) {
+      package_chunk = table_parser.chunk();
+      break;
+    }
+  }
+
+  // Retrieve the type that proceeds the array entry
+  ASSERT_NE(package_chunk, nullptr);
+  ResChunkPullParser package_parser(GetChunkData(table_parser.chunk()),
+                                    GetChunkDataLen(table_parser.chunk()));
+  const ResChunk_header* type_chunk = nullptr;
+  while (package_parser.IsGoodEvent(package_parser.Next())) {
+    if (util::DeviceToHost16(package_parser.chunk()->type) == RES_TABLE_TYPE_TYPE) {
+      type_chunk = package_parser.chunk();
+      break;
+    }
+  }
+
+  // Retrieve the array entry
+  ASSERT_NE(type_chunk, nullptr);
+  TypeVariant typeVariant((const ResTable_type*) type_chunk);
+  auto entry = (const ResTable_map_entry*)*typeVariant.beginEntries();
+  ASSERT_EQ(util::DeviceToHost16(entry->count), 2u);
+
+  // Check that the value and name of the array entries are correct
+  auto values = (const ResTable_map*)(((const uint8_t *)entry) + entry->size);
+  ASSERT_EQ(values->value.data, 1u);
+  ASSERT_EQ(values->name.ident, android::ResTable_map::ATTR_MIN);
+  ASSERT_EQ((values+1)->value.data, 2u);
+  ASSERT_EQ((values+1)->name.ident, android::ResTable_map::ATTR_MIN + 1);
+}
+
 static std::unique_ptr<ResourceTable> BuildTableWithSparseEntries(
     IAaptContext* context, const ConfigDescription& sparse_config, float load) {
   std::unique_ptr<ResourceTable> table =
diff --git a/tools/aapt2/process/SymbolTable.cpp b/tools/aapt2/process/SymbolTable.cpp
index fc4c9b5..70efbf5 100644
--- a/tools/aapt2/process/SymbolTable.cpp
+++ b/tools/aapt2/process/SymbolTable.cpp
@@ -194,6 +194,7 @@
 
   if (sr.package->id && sr.type->id && sr.entry->id) {
     symbol->id = ResourceId(sr.package->id.value(), sr.type->id.value(), sr.entry->id.value());
+    symbol->is_dynamic = (sr.package->id.value() == 0);
   }
 
   if (name.type == ResourceType::kAttr || name.type == ResourceType::kAttrPrivate) {
diff --git a/wifi/java/android/net/wifi/IWifiManager.aidl b/wifi/java/android/net/wifi/IWifiManager.aidl
index 5631919..12f50c8 100644
--- a/wifi/java/android/net/wifi/IWifiManager.aidl
+++ b/wifi/java/android/net/wifi/IWifiManager.aidl
@@ -126,7 +126,7 @@
 
     void acquireMulticastLock(IBinder binder, String tag);
 
-    void releaseMulticastLock();
+    void releaseMulticastLock(String tag);
 
     void updateInterfaceIpState(String ifaceName, int mode);
 
diff --git a/wifi/java/android/net/wifi/WifiManager.java b/wifi/java/android/net/wifi/WifiManager.java
index f7de370..b56a758 100644
--- a/wifi/java/android/net/wifi/WifiManager.java
+++ b/wifi/java/android/net/wifi/WifiManager.java
@@ -318,6 +318,31 @@
             "android.net.wifi.extra.SUBSCRIPTION_REMEDIATION_METHOD";
 
     /**
+     * Activity Action: lunch OSU (Online Sign Up) view.
+     * Included extras:
+     *
+     * {@link #EXTRA_OSU_NETWORK}: {@link Network} instance associated with OSU AP.
+     * {@link #EXTRA_URL}: String representation of a server URL used for OSU process.
+     *
+     * <p>Note: The broadcast is only delivered to registered receivers - no manifest registered
+     * components will be launched.
+     *
+     * @hide
+     */
+    @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
+    public static final String ACTION_PASSPOINT_LAUNCH_OSU_VIEW =
+            "android.net.wifi.action.PASSPOINT_LAUNCH_OSU_VIEW";
+
+    /**
+     * The lookup key for a {@link android.net.Network} associated with OSU server.
+     *
+     * Retrieve with {@link android.content.Intent#getParcelableExtra(String)}.
+     *
+     * @hide
+     */
+    public static final String EXTRA_OSU_NETWORK = "android.net.wifi.extra.OSU_NETWORK";
+
+    /**
      * Broadcast intent action indicating that Wi-Fi has been enabled, disabled,
      * enabling, disabling, or unknown. One extra provides this state as an int.
      * Another extra provides the previous state, if available.
@@ -3409,7 +3434,7 @@
                         mService.acquireMulticastLock(mBinder, mTag);
                         synchronized (WifiManager.this) {
                             if (mActiveLockCount >= MAX_ACTIVE_LOCKS) {
-                                mService.releaseMulticastLock();
+                                mService.releaseMulticastLock(mTag);
                                 throw new UnsupportedOperationException(
                                         "Exceeded maximum number of wifi locks");
                             }
@@ -3451,7 +3476,7 @@
             synchronized (mBinder) {
                 if (mRefCounted ? (--mRefCount == 0) : (mHeld)) {
                     try {
-                        mService.releaseMulticastLock();
+                        mService.releaseMulticastLock(mTag);
                         synchronized (WifiManager.this) {
                             mActiveLockCount--;
                         }
diff --git a/wifi/java/android/net/wifi/hotspot2/ProvisioningCallback.java b/wifi/java/android/net/wifi/hotspot2/ProvisioningCallback.java
index 66297fc..ef9c59f 100644
--- a/wifi/java/android/net/wifi/hotspot2/ProvisioningCallback.java
+++ b/wifi/java/android/net/wifi/hotspot2/ProvisioningCallback.java
@@ -85,6 +85,17 @@
     public static final int OSU_FAILURE_SOAP_MESSAGE_EXCHANGE = 11;
 
     /**
+     * The reason code for provisioning failure when a redirect server fails to start.
+     */
+    public static final int OSU_FAILURE_START_REDIRECT_SERVER = 12;
+
+    /**
+     * The reason code for provisioning failure when there is no OSU activity to listen to
+     * {@link WifiManager#ACTION_PASSPOINT_LAUNCH_OSU_VIEW} intent.
+     */
+    public static final int OSU_FAILURE_NO_OSU_ACTIVITY_FOUND = 13;
+
+    /**
      * The status code for provisioning flow to indicate connecting to OSU AP
      */
     public static final int OSU_STATUS_AP_CONNECTING = 1;
@@ -115,6 +126,16 @@
     public static final int OSU_STATUS_INIT_SOAP_EXCHANGE = 6;
 
     /**
+     * The status code for provisioning flow to indicate waiting for a HTTP redirect response.
+     */
+    public static final int OSU_STATUS_WAITING_FOR_REDIRECT_RESPONSE = 7;
+
+    /**
+     * The status code for provisioning flow to indicate a HTTP redirect response is received.
+     */
+    public static final int OSU_STATUS_REDIRECT_RESPONSE_RECEIVED = 8;
+
+    /**
      * Provisioning status for OSU failure
      *
      * @param status indicates error condition