Merge "Move query methods"
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/cmds/bmgr/src/com/android/commands/bmgr/Bmgr.java b/cmds/bmgr/src/com/android/commands/bmgr/Bmgr.java
index 043b7f9..a826ec7 100644
--- a/cmds/bmgr/src/com/android/commands/bmgr/Bmgr.java
+++ b/cmds/bmgr/src/com/android/commands/bmgr/Bmgr.java
@@ -845,6 +845,7 @@
System.err.println(" bmgr fullbackup PACKAGE...");
System.err.println(" bmgr backupnow [--monitor|--monitor-verbose] --all|PACKAGE...");
System.err.println(" bmgr cancel backups");
+ System.err.println(" bmgr init TRANSPORT...");
System.err.println("");
System.err.println("The 'backup' command schedules a backup pass for the named package.");
System.err.println("Note that the backup pass will effectively be a no-op if the package");
@@ -902,7 +903,11 @@
System.err.println("For each package it will run key/value or full data backup ");
System.err.println("depending on the package's manifest declarations.");
System.err.println("The data is sent via the currently active transport.");
+ System.err.println("");
System.err.println("The 'cancel backups' command cancels all running backups.");
+ System.err.println("");
+ System.err.println("The 'init' command initializes the given transports, wiping all data");
+ System.err.println("from their backing data stores.");
}
private static class BackupMonitor extends IBackupManagerMonitor.Stub {
diff --git a/config/hiddenapi-light-greylist.txt b/config/hiddenapi-light-greylist.txt
index 8da1215..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;
diff --git a/config/hiddenapi-vendor-list.txt b/config/hiddenapi-vendor-list.txt
index c51a8d4..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
diff --git a/core/java/android/bluetooth/BluetoothA2dp.java b/core/java/android/bluetooth/BluetoothA2dp.java
index 966f902..d21f76d 100644
--- a/core/java/android/bluetooth/BluetoothA2dp.java
+++ b/core/java/android/bluetooth/BluetoothA2dp.java
@@ -30,6 +30,7 @@
import android.os.IBinder;
import android.os.ParcelUuid;
import android.os.RemoteException;
+import android.os.UserHandle;
import android.util.Log;
import com.android.internal.annotations.GuardedBy;
@@ -270,7 +271,7 @@
ComponentName comp = intent.resolveSystemService(mContext.getPackageManager(), 0);
intent.setComponent(comp);
if (comp == null || !mContext.bindServiceAsUser(intent, mConnection, 0,
- mContext.getUser())) {
+ UserHandle.CURRENT_OR_SELF)) {
Log.e(TAG, "Could not bind to Bluetooth A2DP Service with " + intent);
return false;
}
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/content/pm/ApplicationInfo.java b/core/java/android/content/pm/ApplicationInfo.java
index 83e287a..b7a5352 100644
--- a/core/java/android/content/pm/ApplicationInfo.java
+++ b/core/java/android/content/pm/ApplicationInfo.java
@@ -615,6 +615,13 @@
public static final int PRIVATE_FLAG_PRODUCT = 1 << 19;
/**
+ * Value for {@link #privateFlags}: whether this app is pre-installed on the
+ * google partition of the system image.
+ * @hide
+ */
+ public static final int PRIVATE_FLAG_PRODUCT_SERVICES = 1 << 21;
+
+ /**
* Value for {@link #privateFlags}: whether this app is signed with the
* platform key.
* @hide
@@ -639,6 +646,7 @@
PRIVATE_FLAG_PARTIALLY_DIRECT_BOOT_AWARE,
PRIVATE_FLAG_PRIVILEGED,
PRIVATE_FLAG_PRODUCT,
+ PRIVATE_FLAG_PRODUCT_SERVICES,
PRIVATE_FLAG_REQUIRED_FOR_SYSTEM_USER,
PRIVATE_FLAG_SIGNED_WITH_PLATFORM_KEY,
PRIVATE_FLAG_STATIC_SHARED_LIBRARY,
@@ -1888,6 +1896,11 @@
return (privateFlags & ApplicationInfo.PRIVATE_FLAG_PRODUCT) != 0;
}
+ /** @hide */
+ public boolean isProductServices() {
+ return (privateFlags & ApplicationInfo.PRIVATE_FLAG_PRODUCT_SERVICES) != 0;
+ }
+
/**
* Returns whether or not this application was installed as a virtual preload.
*/
diff --git a/core/java/android/content/pm/PackageParser.java b/core/java/android/content/pm/PackageParser.java
index 876cf2b..83757c4 100644
--- a/core/java/android/content/pm/PackageParser.java
+++ b/core/java/android/content/pm/PackageParser.java
@@ -6785,6 +6785,11 @@
}
/** @hide */
+ public boolean isProductServices() {
+ return applicationInfo.isProductServices();
+ }
+
+ /** @hide */
public boolean isPrivileged() {
return applicationInfo.isPrivilegedApp();
}
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/location/ContextHubManager.java b/core/java/android/hardware/location/ContextHubManager.java
index de13c81..12d0531 100644
--- a/core/java/android/hardware/location/ContextHubManager.java
+++ b/core/java/android/hardware/location/ContextHubManager.java
@@ -549,7 +549,7 @@
* Set a callback to receive messages from the context hub
*
* @param callback Callback object
- * @param handler Handler object
+ * @param handler Handler object, if null uses the Handler of the main Looper
*
* @see Callback
*
@@ -568,7 +568,7 @@
return -1;
}
mCallback = callback;
- mCallbackHandler = handler;
+ mCallbackHandler = (handler == null) ? new Handler(mMainLooper) : handler;
}
return 0;
}
@@ -722,26 +722,31 @@
return 0;
}
+ /**
+ * Invokes the ContextHubManager.Callback callback registered with the ContextHubManager.
+ *
+ * @param hubId The ID of the Context Hub the message came from
+ * @param nanoAppId The instance ID of the nanoapp the message came from
+ * @param message The message to provide the callback
+ */
+ private synchronized void invokeOnMessageReceiptCallback(
+ int hubId, int nanoAppId, ContextHubMessage message) {
+ if (mCallback != null) {
+ mCallback.onMessageReceipt(hubId, nanoAppId, message);
+ }
+ }
+
private final IContextHubCallback.Stub mClientCallback = new IContextHubCallback.Stub() {
@Override
- public void onMessageReceipt(final int hubId, final int nanoAppId,
- final ContextHubMessage message) {
- if (mCallback != null) {
- synchronized(this) {
- final Callback callback = mCallback;
- Handler handler = mCallbackHandler == null ?
- new Handler(mMainLooper) : mCallbackHandler;
- handler.post(new Runnable() {
- @Override
- public void run() {
- callback.onMessageReceipt(hubId, nanoAppId, message);
- }
- });
- }
- } else if (mLocalCallback != null) {
- // we always ensure that mCallback takes precedence, because mLocalCallback is only
- // for internal compatibility
- synchronized (this) {
+ public void onMessageReceipt(
+ final int hubId, final int nanoAppId, final ContextHubMessage message) {
+ synchronized (ContextHubManager.this) {
+ if (mCallback != null) {
+ mCallbackHandler.post(
+ () -> invokeOnMessageReceiptCallback(hubId, nanoAppId, message));
+ } else if (mLocalCallback != null) {
+ // We always ensure that mCallback takes precedence, because mLocalCallback is
+ // only for internal compatibility
mLocalCallback.onMessageReceipt(hubId, nanoAppId, message);
}
}
diff --git a/core/java/android/os/Environment.java b/core/java/android/os/Environment.java
index e32ed9d..347f60f 100644
--- a/core/java/android/os/Environment.java
+++ b/core/java/android/os/Environment.java
@@ -45,6 +45,7 @@
private static final String ENV_ODM_ROOT = "ODM_ROOT";
private static final String ENV_VENDOR_ROOT = "VENDOR_ROOT";
private static final String ENV_PRODUCT_ROOT = "PRODUCT_ROOT";
+ private static final String ENV_PRODUCT_SERVICES_ROOT = "PRODUCT_SERVICES_ROOT";
/** {@hide} */
public static final String DIR_ANDROID = "Android";
@@ -67,6 +68,8 @@
private static final File DIR_ODM_ROOT = getDirectory(ENV_ODM_ROOT, "/odm");
private static final File DIR_VENDOR_ROOT = getDirectory(ENV_VENDOR_ROOT, "/vendor");
private static final File DIR_PRODUCT_ROOT = getDirectory(ENV_PRODUCT_ROOT, "/product");
+ private static final File DIR_PRODUCT_SERVICES_ROOT = getDirectory(ENV_PRODUCT_SERVICES_ROOT,
+ "/product_services");
private static UserEnvironment sCurrentUser;
private static boolean sUserRequired;
@@ -196,6 +199,16 @@
}
/**
+ * Return root directory of the "product_services" partition holding middleware
+ * services if any. If present, the partition is mounted read-only.
+ *
+ * @hide
+ */
+ public static File getProductServicesDirectory() {
+ return DIR_PRODUCT_SERVICES_ROOT;
+ }
+
+ /**
* Return the system directory for a user. This is for use by system
* services to store files relating to the user. This directory will be
* automatically deleted when the user is removed.
diff --git a/core/java/android/preference/SeekBarVolumizer.java b/core/java/android/preference/SeekBarVolumizer.java
index ad7b103..e8daf21 100644
--- a/core/java/android/preference/SeekBarVolumizer.java
+++ b/core/java/android/preference/SeekBarVolumizer.java
@@ -104,7 +104,7 @@
@UnsupportedAppUsage
public SeekBarVolumizer(Context context, int streamType, Uri defaultUri, Callback callback) {
- this(context, streamType, defaultUri, callback, true);
+ this(context, streamType, defaultUri, callback, true /* playSample */);
}
public SeekBarVolumizer(
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/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/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/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/view/ViewGroup.java b/core/java/android/view/ViewGroup.java
index 6268a4a..0119d2e 100644
--- a/core/java/android/view/ViewGroup.java
+++ b/core/java/android/view/ViewGroup.java
@@ -8663,7 +8663,7 @@
* Compare two views based on their bounds. Use the bounds of their children to break ties.
*
* @param holder1 Holder of first view to compare
- * @param holder2 Holder of second view to compare. Must have the same root at holder1.
+ * @param holder2 Holder of second view to compare. Must have the same root as holder1.
* @return The compare result, with equality if no good comparison was found.
*/
private static int compareBoundsOfTree(
@@ -8756,6 +8756,7 @@
private void clear() {
mView = null;
+ mRoot = null;
mLocation.set(0, 0, 0, 0);
}
}
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/DatePickerSpinnerDelegate.java b/core/java/android/widget/DatePickerSpinnerDelegate.java
index dba74b1..f88a4e2 100644
--- a/core/java/android/widget/DatePickerSpinnerDelegate.java
+++ b/core/java/android/widget/DatePickerSpinnerDelegate.java
@@ -16,6 +16,7 @@
package android.widget;
+import android.annotation.UnsupportedAppUsage;
import android.content.Context;
import android.content.res.Configuration;
import android.content.res.TypedArray;
@@ -502,6 +503,7 @@
|| mCurrentDate.get(Calendar.DAY_OF_MONTH) != dayOfMonth);
}
+ @UnsupportedAppUsage
private void setDate(int year, int month, int dayOfMonth) {
mCurrentDate.set(year, month, dayOfMonth);
resetAutofilledValue();
@@ -512,6 +514,7 @@
}
}
+ @UnsupportedAppUsage
private void updateSpinners() {
// set the spinner ranges respecting the min and max dates
if (mCurrentDate.equals(mMinDate)) {
@@ -564,6 +567,7 @@
/**
* Updates the calendar view with the current date.
*/
+ @UnsupportedAppUsage
private void updateCalendarView() {
mCalendarView.setDate(mCurrentDate.getTimeInMillis(), false, false);
}
@@ -572,6 +576,7 @@
/**
* Notifies the listener, if such, for a change in the selected date.
*/
+ @UnsupportedAppUsage
private void notifyDateChanged() {
mDelegator.sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_SELECTED);
if (mOnDateChangedListener != null) {
@@ -627,6 +632,7 @@
}
}
+ @UnsupportedAppUsage
private void updateInputState() {
// Make sure that if the user changes the value and the IME is active
// for one of the inputs if this widget, the IME is closed. If the user
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 a418fad..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,17 +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;
+ @UnsupportedAppUsage
private TextView mEndTime;
+ @UnsupportedAppUsage
private TextView mCurrentTime;
+ @UnsupportedAppUsage
private boolean mShowing;
private boolean mDragging;
private static final int sDefaultTimeout = 3000;
@@ -88,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;
@@ -536,6 +554,7 @@
}
};
+ @UnsupportedAppUsage
private void updatePausePlay() {
if (mRoot == null || mPauseButton == null)
return;
@@ -569,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) {
@@ -642,6 +662,7 @@
return MediaController.class.getName();
}
+ @UnsupportedAppUsage
private final View.OnClickListener mRewListener = new View.OnClickListener() {
@Override
public void onClick(View v) {
@@ -654,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/WindowDecorActionBar.java b/core/java/com/android/internal/app/WindowDecorActionBar.java
index 1b3faf5..119f30d 100644
--- a/core/java/com/android/internal/app/WindowDecorActionBar.java
+++ b/core/java/com/android/internal/app/WindowDecorActionBar.java
@@ -33,6 +33,7 @@
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.animation.ValueAnimator;
+import android.annotation.UnsupportedAppUsage;
import android.app.ActionBar;
import android.app.Activity;
import android.app.Dialog;
@@ -79,6 +80,7 @@
private ActionBarOverlayLayout mOverlayLayout;
private ActionBarContainer mContainerView;
private DecorToolbar mDecorToolbar;
+ @UnsupportedAppUsage
private ActionBarContextView mContextView;
private ActionBarContainer mSplitView;
private View mContentView;
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/server/SystemConfig.java b/core/java/com/android/server/SystemConfig.java
index c5be8e4..0a787b9 100644
--- a/core/java/com/android/server/SystemConfig.java
+++ b/core/java/com/android/server/SystemConfig.java
@@ -169,6 +169,10 @@
final ArrayMap<String, ArraySet<String>> mProductPrivAppPermissions = new ArrayMap<>();
final ArrayMap<String, ArraySet<String>> mProductPrivAppDenyPermissions = new ArrayMap<>();
+ final ArrayMap<String, ArraySet<String>> mProductServicesPrivAppPermissions = new ArrayMap<>();
+ final ArrayMap<String, ArraySet<String>> mProductServicesPrivAppDenyPermissions =
+ new ArrayMap<>();
+
final ArrayMap<String, ArrayMap<String, Boolean>> mOemPermissions = new ArrayMap<>();
public static SystemConfig getInstance() {
@@ -276,6 +280,14 @@
return mProductPrivAppDenyPermissions.get(packageName);
}
+ public ArraySet<String> getProductServicesPrivAppPermissions(String packageName) {
+ return mProductServicesPrivAppPermissions.get(packageName);
+ }
+
+ public ArraySet<String> getProductServicesPrivAppDenyPermissions(String packageName) {
+ return mProductServicesPrivAppDenyPermissions.get(packageName);
+ }
+
public Map<String, Boolean> getOemPermissions(String packageName) {
final Map<String, Boolean> oemPermissions = mOemPermissions.get(packageName);
if (oemPermissions != null) {
@@ -326,6 +338,17 @@
Environment.getProductDirectory(), "etc", "sysconfig"), productPermissionFlag);
readPermissions(Environment.buildPath(
Environment.getProductDirectory(), "etc", "permissions"), productPermissionFlag);
+
+ // Allow /product_services to customize system configs around libs, features, permissions
+ // and apps.
+ int productServicesPermissionFlag = ALLOW_LIBS | ALLOW_FEATURES | ALLOW_PERMISSIONS |
+ ALLOW_APP_CONFIGS | ALLOW_PRIVAPP_PERMISSIONS;
+ readPermissions(Environment.buildPath(
+ Environment.getProductServicesDirectory(), "etc", "sysconfig"),
+ productServicesPermissionFlag);
+ readPermissions(Environment.buildPath(
+ Environment.getProductServicesDirectory(), "etc", "permissions"),
+ productServicesPermissionFlag);
}
void readPermissions(File libraryDir, int permissionFlag) {
@@ -659,22 +682,27 @@
}
XmlUtils.skipCurrentTag(parser);
} else if ("privapp-permissions".equals(name) && allowPrivappPermissions) {
- // privapp permissions from system, vendor and product partitions are stored
- // separately. This is to prevent xml files in the vendor partition from
- // granting permissions to priv apps in the system partition and vice
- // versa.
+ // privapp permissions from system, vendor, product and product_services
+ // partitions are stored separately. This is to prevent xml files in the vendor
+ // partition from granting permissions to priv apps in the system partition and
+ // vice versa.
boolean vendor = permFile.toPath().startsWith(
- Environment.getVendorDirectory().toPath())
+ Environment.getVendorDirectory().toPath() + "/")
|| permFile.toPath().startsWith(
- Environment.getOdmDirectory().toPath());
+ Environment.getOdmDirectory().toPath() + "/");
boolean product = permFile.toPath().startsWith(
- Environment.getProductDirectory().toPath());
+ Environment.getProductDirectory().toPath() + "/");
+ boolean productServices = permFile.toPath().startsWith(
+ Environment.getProductServicesDirectory().toPath() + "/");
if (vendor) {
readPrivAppPermissions(parser, mVendorPrivAppPermissions,
mVendorPrivAppDenyPermissions);
} else if (product) {
readPrivAppPermissions(parser, mProductPrivAppPermissions,
mProductPrivAppDenyPermissions);
+ } else if (productServices) {
+ readPrivAppPermissions(parser, mProductServicesPrivAppPermissions,
+ mProductServicesPrivAppDenyPermissions);
} else {
readPrivAppPermissions(parser, mPrivAppPermissions,
mPrivAppDenyPermissions);
diff --git a/core/jni/android/graphics/Bitmap.cpp b/core/jni/android/graphics/Bitmap.cpp
index 02076bd..8083a6a 100755
--- a/core/jni/android/graphics/Bitmap.cpp
+++ b/core/jni/android/graphics/Bitmap.cpp
@@ -310,180 +310,17 @@
using namespace android;
using namespace android::bitmap;
-///////////////////////////////////////////////////////////////////////////////
-// Conversions to/from SkColor, for get/setPixels, and the create method, which
-// is basically like setPixels
-
-typedef void (*FromColorProc)(void* dst, const SkColor src[], int width,
- int x, int y);
-
-static void FromColor_F16(void* dst, const SkColor src[], int width,
- int, int) {
- uint64_t* d = (uint64_t*)dst;
-
- for (int i = 0; i < width; i++) {
- *d++ = SkColor4f::FromColor(*src++).premul().toF16();
- }
-}
-
-static void FromColor_F16_Raw(void* dst, const SkColor src[], int width,
- int, int) {
- uint64_t* d = (uint64_t*)dst;
-
- for (int i = 0; i < width; i++) {
- const SkColor4f color = SkColor4f::FromColor(*src++);
- uint16_t* scratch = reinterpret_cast<uint16_t*>(d++);
- scratch[0] = SkFloatToHalf(color.fR);
- scratch[1] = SkFloatToHalf(color.fG);
- scratch[2] = SkFloatToHalf(color.fB);
- scratch[3] = SkFloatToHalf(color.fA);
- }
-}
-
-static void FromColor_D32(void* dst, const SkColor src[], int width,
- int, int) {
- SkPMColor* d = (SkPMColor*)dst;
-
- for (int i = 0; i < width; i++) {
- *d++ = SkPreMultiplyColor(*src++);
- }
-}
-
-static void FromColor_D32_Raw(void* dst, const SkColor src[], int width,
- int, int) {
- // Needed to thwart the unreachable code detection from clang.
- static const bool sk_color_ne_zero = SK_COLOR_MATCHES_PMCOLOR_BYTE_ORDER;
-
- // SkColor's ordering may be different from SkPMColor
- if (sk_color_ne_zero) {
- memcpy(dst, src, width * sizeof(SkColor));
- return;
- }
-
- // order isn't same, repack each pixel manually
- SkPMColor* d = (SkPMColor*)dst;
- for (int i = 0; i < width; i++) {
- SkColor c = *src++;
- *d++ = SkPackARGB32NoCheck(SkColorGetA(c), SkColorGetR(c),
- SkColorGetG(c), SkColorGetB(c));
- }
-}
-
-static void FromColor_D565(void* dst, const SkColor src[], int width,
- int x, int y) {
- uint16_t* d = (uint16_t*)dst;
-
- DITHER_565_SCAN(y);
- for (int stop = x + width; x < stop; x++) {
- SkColor c = *src++;
- *d++ = SkDitherRGBTo565(SkColorGetR(c), SkColorGetG(c), SkColorGetB(c),
- DITHER_VALUE(x));
- }
-}
-
-static void FromColor_D4444(void* dst, const SkColor src[], int width,
- int x, int y) {
- SkPMColor16* d = (SkPMColor16*)dst;
-
- DITHER_4444_SCAN(y);
- for (int stop = x + width; x < stop; x++) {
- SkPMColor pmc = SkPreMultiplyColor(*src++);
- *d++ = SkDitherARGB32To4444(pmc, DITHER_VALUE(x));
-// *d++ = SkPixel32ToPixel4444(pmc);
- }
-}
-
-static void FromColor_D4444_Raw(void* dst, const SkColor src[], int width,
- int x, int y) {
- SkPMColor16* d = (SkPMColor16*)dst;
-
- DITHER_4444_SCAN(y);
- for (int stop = x + width; x < stop; x++) {
- SkColor c = *src++;
-
- // SkPMColor is used because the ordering is ARGB32, even though the target actually premultiplied
- SkPMColor pmc = SkPackARGB32NoCheck(SkColorGetA(c), SkColorGetR(c),
- SkColorGetG(c), SkColorGetB(c));
- *d++ = SkDitherARGB32To4444(pmc, DITHER_VALUE(x));
-// *d++ = SkPixel32ToPixel4444(pmc);
- }
-}
-
-static void FromColor_DA8(void* dst, const SkColor src[], int width, int x, int y) {
- uint8_t* d = (uint8_t*)dst;
-
- for (int stop = x + width; x < stop; x++) {
- *d++ = SkColorGetA(*src++);
- }
-}
-
-// can return NULL
-static FromColorProc ChooseFromColorProc(const SkBitmap& bitmap) {
- switch (bitmap.colorType()) {
- case kN32_SkColorType:
- return bitmap.alphaType() == kPremul_SkAlphaType ? FromColor_D32 : FromColor_D32_Raw;
- case kARGB_4444_SkColorType:
- return bitmap.alphaType() == kPremul_SkAlphaType ? FromColor_D4444 :
- FromColor_D4444_Raw;
- case kRGB_565_SkColorType:
- return FromColor_D565;
- case kAlpha_8_SkColorType:
- return FromColor_DA8;
- case kRGBA_F16_SkColorType:
- return bitmap.alphaType() == kPremul_SkAlphaType ? FromColor_F16 : FromColor_F16_Raw;
- default:
- break;
- }
- return NULL;
-}
-
-static bool IsColorSpaceSRGB(SkColorSpace* colorSpace) {
- return colorSpace == nullptr || colorSpace->isSRGB();
-}
-
bool GraphicsJNI::SetPixels(JNIEnv* env, jintArray srcColors, int srcOffset, int srcStride,
- int x, int y, int width, int height, const SkBitmap& dstBitmap) {
- void* dst = dstBitmap.getPixels();
- FromColorProc proc = ChooseFromColorProc(dstBitmap);
-
- if (NULL == dst || NULL == proc) {
- return false;
- }
-
+ int x, int y, int width, int height, SkBitmap* dstBitmap) {
const jint* array = env->GetIntArrayElements(srcColors, NULL);
const SkColor* src = (const SkColor*)array + srcOffset;
- // reset to to actual choice from caller
- dst = dstBitmap.getAddr(x, y);
+ auto sRGB = SkColorSpace::MakeSRGB();
+ SkImageInfo srcInfo = SkImageInfo::Make(
+ width, height, kBGRA_8888_SkColorType, kUnpremul_SkAlphaType, sRGB);
+ SkPixmap srcPM(srcInfo, src, srcStride * 4);
- SkColorSpace* colorSpace = dstBitmap.colorSpace();
- if (dstBitmap.colorType() == kRGBA_F16_SkColorType || IsColorSpaceSRGB(colorSpace)) {
- // now copy/convert each scanline
- for (int y = 0; y < height; y++) {
- proc(dst, src, width, x, y);
- src += srcStride;
- dst = (char*)dst + dstBitmap.rowBytes();
- }
- } else {
- auto sRGB = SkColorSpace::MakeSRGB();
- auto xform = SkColorSpaceXform::New(sRGB.get(), colorSpace);
-
- std::unique_ptr<SkColor[]> row(new SkColor[width]);
-
- // now copy/convert each scanline
- for (int y = 0; y < height; y++) {
- memcpy(row.get(), src, sizeof(SkColor) * width);
- xform->apply(SkColorSpaceXform::kBGRA_8888_ColorFormat, row.get(),
- SkColorSpaceXform::kBGRA_8888_ColorFormat, row.get(), width,
- SkAlphaType::kUnpremul_SkAlphaType);
-
- proc(dst, row.get(), width, x, y);
- src += srcStride;
- dst = (char*)dst + dstBitmap.rowBytes();
- }
- }
-
- dstBitmap.notifyPixelsChanged();
+ dstBitmap->writePixels(srcPM, x, y);
env->ReleaseIntArrayElements(srcColors, const_cast<jint*>(array), JNI_ABORT);
return true;
@@ -491,90 +328,6 @@
//////////////////// ToColor procs
-typedef void (*ToColorProc)(SkColor dst[], const void* src, int width);
-
-static void ToColor_F16_Alpha(SkColor dst[], const void* src, int width) {
- SkASSERT(width > 0);
- uint64_t* s = (uint64_t*)src;
- do {
- *dst++ = SkPM4f::FromF16((const uint16_t*) s++).unpremul().toSkColor();
- } while (--width != 0);
-}
-
-static void ToColor_F16_Raw(SkColor dst[], const void* src, int width) {
- SkASSERT(width > 0);
- uint64_t* s = (uint64_t*)src;
- do {
- *dst++ = Sk4f_toS32(swizzle_rb(SkHalfToFloat_finite_ftz(*s++)));
- } while (--width != 0);
-}
-
-static void ToColor_S32_Alpha(SkColor dst[], const void* src, int width) {
- SkASSERT(width > 0);
- const SkPMColor* s = (const SkPMColor*)src;
- do {
- *dst++ = SkUnPreMultiply::PMColorToColor(*s++);
- } while (--width != 0);
-}
-
-static void ToColor_S32_Raw(SkColor dst[], const void* src, int width) {
- SkASSERT(width > 0);
- const SkPMColor* s = (const SkPMColor*)src;
- do {
- SkPMColor c = *s++;
- *dst++ = SkColorSetARGB(SkGetPackedA32(c), SkGetPackedR32(c),
- SkGetPackedG32(c), SkGetPackedB32(c));
- } while (--width != 0);
-}
-
-static void ToColor_S32_Opaque(SkColor dst[], const void* src, int width) {
- SkASSERT(width > 0);
- const SkPMColor* s = (const SkPMColor*)src;
- do {
- SkPMColor c = *s++;
- *dst++ = SkColorSetRGB(SkGetPackedR32(c), SkGetPackedG32(c),
- SkGetPackedB32(c));
- } while (--width != 0);
-}
-
-static void ToColor_S4444_Alpha(SkColor dst[], const void* src, int width) {
- SkASSERT(width > 0);
- const SkPMColor16* s = (const SkPMColor16*)src;
- do {
- *dst++ = SkUnPreMultiply::PMColorToColor(SkPixel4444ToPixel32(*s++));
- } while (--width != 0);
-}
-
-static void ToColor_S4444_Raw(SkColor dst[], const void* src, int width) {
- SkASSERT(width > 0);
- const SkPMColor16* s = (const SkPMColor16*)src;
- do {
- SkPMColor c = SkPixel4444ToPixel32(*s++);
- *dst++ = SkColorSetARGB(SkGetPackedA32(c), SkGetPackedR32(c),
- SkGetPackedG32(c), SkGetPackedB32(c));
- } while (--width != 0);
-}
-
-static void ToColor_S4444_Opaque(SkColor dst[], const void* src, int width) {
- SkASSERT(width > 0);
- const SkPMColor16* s = (const SkPMColor16*)src;
- do {
- SkPMColor c = SkPixel4444ToPixel32(*s++);
- *dst++ = SkColorSetRGB(SkGetPackedR32(c), SkGetPackedG32(c),
- SkGetPackedB32(c));
- } while (--width != 0);
-}
-
-static void ToColor_S565(SkColor dst[], const void* src, int width) {
- SkASSERT(width > 0);
- const uint16_t* s = (const uint16_t*)src;
- do {
- uint16_t c = *s++;
- *dst++ = SkColorSetRGB(SkPacked16ToR32(c), SkPacked16ToG32(c),
- SkPacked16ToB32(c));
- } while (--width != 0);
-}
-
static void ToColor_SA8(SkColor dst[], const void* src, int width) {
SkASSERT(width > 0);
const uint8_t* s = (const uint8_t*)src;
@@ -584,52 +337,6 @@
} while (--width != 0);
}
-// can return NULL
-static ToColorProc ChooseToColorProc(const SkBitmap& src) {
- switch (src.colorType()) {
- case kN32_SkColorType:
- switch (src.alphaType()) {
- case kOpaque_SkAlphaType:
- return ToColor_S32_Opaque;
- case kPremul_SkAlphaType:
- return ToColor_S32_Alpha;
- case kUnpremul_SkAlphaType:
- return ToColor_S32_Raw;
- default:
- return NULL;
- }
- case kARGB_4444_SkColorType:
- switch (src.alphaType()) {
- case kOpaque_SkAlphaType:
- return ToColor_S4444_Opaque;
- case kPremul_SkAlphaType:
- return ToColor_S4444_Alpha;
- case kUnpremul_SkAlphaType:
- return ToColor_S4444_Raw;
- default:
- return NULL;
- }
- case kRGB_565_SkColorType:
- return ToColor_S565;
- case kAlpha_8_SkColorType:
- return ToColor_SA8;
- case kRGBA_F16_SkColorType:
- switch (src.alphaType()) {
- case kOpaque_SkAlphaType:
- return ToColor_F16_Raw;
- case kPremul_SkAlphaType:
- return ToColor_F16_Alpha;
- case kUnpremul_SkAlphaType:
- return ToColor_F16_Raw;
- default:
- return NULL;
- }
- default:
- break;
- }
- return NULL;
-}
-
static void ToF16_SA8(void* dst, const void* src, int width) {
SkASSERT(width > 0);
uint64_t* d = (uint64_t*)dst;
@@ -694,7 +401,7 @@
}
if (jColors != NULL) {
- GraphicsJNI::SetPixels(env, jColors, offset, stride, 0, 0, width, height, bitmap);
+ GraphicsJNI::SetPixels(env, jColors, offset, stride, 0, 0, width, height, &bitmap);
}
return createBitmap(env, nativeBitmap.release(), getPremulBitmapCreateFlags(isMutable));
@@ -1271,7 +978,7 @@
if (!bitmapHolder.valid()) return JNI_TRUE;
SkColorSpace* colorSpace = bitmapHolder->info().colorSpace();
- return IsColorSpaceSRGB(colorSpace);
+ return colorSpace == nullptr || colorSpace->isSRGB();
}
static jboolean Bitmap_isSRGBLinear(JNIEnv* env, jobject, jlong bitmapHandle) {
@@ -1330,28 +1037,13 @@
SkBitmap bitmap;
reinterpret_cast<BitmapWrapper*>(bitmapHandle)->getSkBitmap(&bitmap);
- ToColorProc proc = ChooseToColorProc(bitmap);
- if (NULL == proc) {
- return 0;
- }
- const void* src = bitmap.getAddr(x, y);
- if (NULL == src) {
- return 0;
- }
+ auto sRGB = SkColorSpace::MakeSRGB();
+ SkImageInfo dstInfo = SkImageInfo::Make(
+ 1, 1, kBGRA_8888_SkColorType, kUnpremul_SkAlphaType, sRGB);
- SkColor dst[1];
- proc(dst, src, 1);
-
- SkColorSpace* colorSpace = bitmap.colorSpace();
- if (bitmap.colorType() != kRGBA_F16_SkColorType && !IsColorSpaceSRGB(colorSpace)) {
- auto sRGB = SkColorSpace::MakeSRGB();
- auto xform = SkColorSpaceXform::New(colorSpace, sRGB.get());
- xform->apply(SkColorSpaceXform::kBGRA_8888_ColorFormat, &dst[0],
- SkColorSpaceXform::kBGRA_8888_ColorFormat, &dst[0], 1,
- SkAlphaType::kUnpremul_SkAlphaType);
- }
-
- return static_cast<jint>(dst[0]);
+ SkColor dst;
+ bitmap.readPixels(dstInfo, &dst, dstInfo.minRowBytes(), x, y);
+ return static_cast<jint>(dst);
}
static void Bitmap_getPixels(JNIEnv* env, jobject, jlong bitmapHandle,
@@ -1360,41 +1052,12 @@
SkBitmap bitmap;
reinterpret_cast<BitmapWrapper*>(bitmapHandle)->getSkBitmap(&bitmap);
- ToColorProc proc = ChooseToColorProc(bitmap);
- if (NULL == proc) {
- return;
- }
- const void* src = bitmap.getAddr(x, y);
- if (NULL == src) {
- return;
- }
+ auto sRGB = SkColorSpace::MakeSRGB();
+ SkImageInfo dstInfo = SkImageInfo::Make(
+ width, height, kBGRA_8888_SkColorType, kUnpremul_SkAlphaType, sRGB);
jint* dst = env->GetIntArrayElements(pixelArray, NULL);
- SkColor* d = (SkColor*)dst + offset;
-
- SkColorSpace* colorSpace = bitmap.colorSpace();
- if (bitmap.colorType() == kRGBA_F16_SkColorType || IsColorSpaceSRGB(colorSpace)) {
- while (--height >= 0) {
- proc(d, src, width);
- d += stride;
- src = (void*)((const char*)src + bitmap.rowBytes());
- }
- } else {
- auto sRGB = SkColorSpace::MakeSRGB();
- auto xform = SkColorSpaceXform::New(colorSpace, sRGB.get());
-
- while (--height >= 0) {
- proc(d, src, width);
-
- xform->apply(SkColorSpaceXform::kBGRA_8888_ColorFormat, d,
- SkColorSpaceXform::kBGRA_8888_ColorFormat, d, width,
- SkAlphaType::kUnpremul_SkAlphaType);
-
- d += stride;
- src = (void*)((const char*)src + bitmap.rowBytes());
- }
- }
-
+ bitmap.readPixels(dstInfo, dst + offset, stride * 4, x, y);
env->ReleaseIntArrayElements(pixelArray, dst, 0);
}
@@ -1405,26 +1068,13 @@
SkBitmap bitmap;
reinterpret_cast<BitmapWrapper*>(bitmapHandle)->getSkBitmap(&bitmap);
SkColor color = static_cast<SkColor>(colorHandle);
- if (NULL == bitmap.getPixels()) {
- return;
- }
- FromColorProc proc = ChooseFromColorProc(bitmap);
- if (NULL == proc) {
- return;
- }
+ auto sRGB = SkColorSpace::MakeSRGB();
+ SkImageInfo srcInfo = SkImageInfo::Make(
+ 1, 1, kBGRA_8888_SkColorType, kUnpremul_SkAlphaType, sRGB);
+ SkPixmap srcPM(srcInfo, &color, srcInfo.minRowBytes());
- SkColorSpace* colorSpace = bitmap.colorSpace();
- if (bitmap.colorType() != kRGBA_F16_SkColorType && !IsColorSpaceSRGB(colorSpace)) {
- auto sRGB = SkColorSpace::MakeSRGB();
- auto xform = SkColorSpaceXform::New(sRGB.get(), colorSpace);
- xform->apply(SkColorSpaceXform::kBGRA_8888_ColorFormat, &color,
- SkColorSpaceXform::kBGRA_8888_ColorFormat, &color, 1,
- SkAlphaType::kUnpremul_SkAlphaType);
- }
-
- proc(bitmap.getAddr(x, y), &color, 1, x, y);
- bitmap.notifyPixelsChanged();
+ bitmap.writePixels(srcPM, x, y);
}
static void Bitmap_setPixels(JNIEnv* env, jobject, jlong bitmapHandle,
@@ -1433,7 +1083,7 @@
SkBitmap bitmap;
reinterpret_cast<BitmapWrapper*>(bitmapHandle)->getSkBitmap(&bitmap);
GraphicsJNI::SetPixels(env, pixelArray, offset, stride,
- x, y, width, height, bitmap);
+ x, y, width, height, &bitmap);
}
static void Bitmap_copyPixelsToBuffer(JNIEnv* env, jobject,
diff --git a/core/jni/android/graphics/GraphicsJNI.h b/core/jni/android/graphics/GraphicsJNI.h
index 9d85cc2..cee3c46 100644
--- a/core/jni/android/graphics/GraphicsJNI.h
+++ b/core/jni/android/graphics/GraphicsJNI.h
@@ -102,7 +102,7 @@
*/
static bool SetPixels(JNIEnv* env, jintArray colors, int srcOffset,
int srcStride, int x, int y, int width, int height,
- const SkBitmap& dstBitmap);
+ SkBitmap* dstBitmap);
static SkColorSpaceTransferFn getNativeTransferParameters(JNIEnv* env, jobject transferParams);
static SkMatrix44 getNativeXYZMatrix(JNIEnv* env, jfloatArray xyzD50);
diff --git a/core/jni/android_graphics_Canvas.cpp b/core/jni/android_graphics_Canvas.cpp
index db3bfe6..eba4c50 100644
--- a/core/jni/android_graphics_Canvas.cpp
+++ b/core/jni/android_graphics_Canvas.cpp
@@ -462,7 +462,7 @@
return;
}
- if (!GraphicsJNI::SetPixels(env, jcolors, offset, stride, 0, 0, width, height, bitmap)) {
+ if (!GraphicsJNI::SetPixels(env, jcolors, offset, stride, 0, 0, width, height, &bitmap)) {
return;
}
diff --git a/core/jni/android_util_AssetManager.cpp b/core/jni/android_util_AssetManager.cpp
index fa9f445..830ca83 100644
--- a/core/jni/android_util_AssetManager.cpp
+++ b/core/jni/android_util_AssetManager.cpp
@@ -179,6 +179,10 @@
argv[argc++] = AssetManager::PRODUCT_OVERLAY_DIR;
}
+ if (stat(AssetManager::PRODUCT_SERVICES_OVERLAY_DIR, &st) == 0) {
+ argv[argc++] = AssetManager::PRODUCT_SERVICES_OVERLAY_DIR;
+ }
+
// Finally, invoke idmap (if any overlay directory exists)
if (argc > 5) {
execv(AssetManager::IDMAP_BIN, (char* const*)argv);
diff --git a/core/jni/fd_utils.cpp b/core/jni/fd_utils.cpp
index c5904e0..f56f7ec 100644
--- a/core/jni/fd_utils.cpp
+++ b/core/jni/fd_utils.cpp
@@ -87,13 +87,17 @@
static const char* kOverlaySubdir = "/system/vendor/overlay-subdir/";
static const char* kSystemProductOverlayDir = "/system/product/overlay/";
static const char* kProductOverlayDir = "/product/overlay";
+ static const char* kSystemProductServicesOverlayDir = "/system/product_services/overlay/";
+ static const char* kProductServicesOverlayDir = "/product_services/overlay";
static const char* kApkSuffix = ".apk";
if ((android::base::StartsWith(path, kOverlayDir)
|| android::base::StartsWith(path, kOverlaySubdir)
|| android::base::StartsWith(path, kVendorOverlayDir)
|| android::base::StartsWith(path, kSystemProductOverlayDir)
- || android::base::StartsWith(path, kProductOverlayDir))
+ || android::base::StartsWith(path, kProductOverlayDir)
+ || android::base::StartsWith(path, kSystemProductServicesOverlayDir)
+ || android::base::StartsWith(path, kProductServicesOverlayDir))
&& android::base::EndsWith(path, kApkSuffix)
&& path.find("/../") == std::string::npos) {
return true;
diff --git a/core/res/res/values-land/dimens_package_installer.xml b/core/res/res/values-land/dimens_permission_controller.xml
similarity index 100%
rename from core/res/res/values-land/dimens_package_installer.xml
rename to core/res/res/values-land/dimens_permission_controller.xml
diff --git a/core/res/res/values-night/themes_package_installer.xml b/core/res/res/values-night/themes_permission_controller.xml
similarity index 100%
rename from core/res/res/values-night/themes_package_installer.xml
rename to core/res/res/values-night/themes_permission_controller.xml
diff --git a/core/res/res/values-port/dimens_package_installer.xml b/core/res/res/values-port/dimens_permission_controller.xml
similarity index 100%
rename from core/res/res/values-port/dimens_package_installer.xml
rename to core/res/res/values-port/dimens_permission_controller.xml
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/styles_package_installer.xml b/core/res/res/values/styles_permission_controller.xml
similarity index 100%
rename from core/res/res/values/styles_package_installer.xml
rename to core/res/res/values/styles_permission_controller.xml
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/res/res/values/themes_package_installer.xml b/core/res/res/values/themes_permission_controller.xml
similarity index 100%
rename from core/res/res/values/themes_package_installer.xml
rename to core/res/res/values/themes_permission_controller.xml
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/libs/androidfw/AssetManager.cpp b/libs/androidfw/AssetManager.cpp
index fc625bb..843c146 100644
--- a/libs/androidfw/AssetManager.cpp
+++ b/libs/androidfw/AssetManager.cpp
@@ -74,6 +74,7 @@
const char* AssetManager::IDMAP_BIN = "/system/bin/idmap";
const char* AssetManager::OVERLAY_DIR = "/vendor/overlay";
const char* AssetManager::PRODUCT_OVERLAY_DIR = "/product/overlay";
+const char* AssetManager::PRODUCT_SERVICES_OVERLAY_DIR = "/product_services/overlay";
const char* AssetManager::OVERLAY_THEME_DIR_PROPERTY = "ro.boot.vendor.overlay.theme";
const char* AssetManager::TARGET_PACKAGE_NAME = "android";
const char* AssetManager::TARGET_APK_PATH = "/system/framework/framework-res.apk";
diff --git a/libs/androidfw/include/androidfw/AssetManager.h b/libs/androidfw/include/androidfw/AssetManager.h
index 08da731..cdb87bc 100644
--- a/libs/androidfw/include/androidfw/AssetManager.h
+++ b/libs/androidfw/include/androidfw/AssetManager.h
@@ -61,6 +61,7 @@
static const char* IDMAP_BIN;
static const char* OVERLAY_DIR;
static const char* PRODUCT_OVERLAY_DIR;
+ static const char* PRODUCT_SERVICES_OVERLAY_DIR;
/*
* If OVERLAY_THEME_DIR_PROPERTY is set, search for runtime resource overlay
* APKs in OVERLAY_DIR/<value of OVERLAY_THEME_DIR_PROPERTY> in addition to
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/media/OWNERS b/media/OWNERS
index 182f661..1ae2a7b 100644
--- a/media/OWNERS
+++ b/media/OWNERS
@@ -1,5 +1,8 @@
elaurent@google.com
etalvala@google.com
+gkasten@google.com
+hunga@google.com
+jmtrivi@google.com
lajos@google.com
marcone@google.com
sungsoo@google.com
diff --git a/media/jni/audioeffect/android_media_AudioEffect.cpp b/media/jni/audioeffect/android_media_AudioEffect.cpp
index 8c9025b..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);
diff --git a/packages/ExtServices/src/android/ext/services/notification/Assistant.java b/packages/ExtServices/src/android/ext/services/notification/Assistant.java
index f0f31fb..3333e15 100644
--- a/packages/ExtServices/src/android/ext/services/notification/Assistant.java
+++ b/packages/ExtServices/src/android/ext/services/notification/Assistant.java
@@ -316,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);
}
}
@@ -327,17 +327,21 @@
@Override
public void onNotificationsSeen(List<String> keys) {
- if (keys == null) {
- return;
- }
-
- for (String key : keys) {
- NotificationEntry entry = mLiveNotifications.get(key);
-
- if (entry != null) {
- entry.setSeen();
- mAgingHelper.onNotificationSeen(entry);
+ 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);
}
}
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/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/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..f222592 100644
--- a/packages/SettingsLib/src/com/android/settingslib/drawer/TileUtils.java
+++ b/packages/SettingsLib/src/com/android/settingslib/drawer/TileUtils.java
@@ -20,10 +20,8 @@
import android.content.IContentProvider;
import android.content.Intent;
import android.content.pm.ActivityInfo;
-import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
-import android.content.res.Resources;
import android.net.Uri;
import android.os.Bundle;
import android.os.RemoteException;
@@ -43,7 +41,6 @@
public class TileUtils {
- private static final boolean DEBUG = false;
private static final boolean DEBUG_TIMING = false;
private static final String LOG_TAG = "TileUtils";
@@ -70,7 +67,7 @@
/**
* @See {@link #EXTRA_SETTINGS_ACTION}.
*/
- private static final String IA_SETTINGS_ACTION = "com.android.settings.action.IA_SETTINGS";
+ public static final String IA_SETTINGS_ACTION = "com.android.settings.action.IA_SETTINGS";
/**
* Same as #EXTRA_SETTINGS_ACTION but used for the platform Settings activities.
@@ -205,12 +202,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;
@@ -222,16 +216,13 @@
// Only add Settings for this user.
getTilesForAction(context, user, SETTINGS_ACTION, cache, null, tiles, true);
getTilesForAction(context, user, OPERATOR_SETTINGS, cache,
- OPERATOR_DEFAULT_CATEGORY, tiles, false, true);
+ OPERATOR_DEFAULT_CATEGORY, tiles, false);
getTilesForAction(context, user, MANUFACTURER_SETTINGS, cache,
- MANUFACTURER_DEFAULT_CATEGORY, tiles, false, true);
+ MANUFACTURER_DEFAULT_CATEGORY, tiles, false);
}
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);
- }
}
}
@@ -262,30 +253,15 @@
return categories;
}
- private static void getTilesForAction(Context context,
+ @VisibleForTesting
+ static void getTilesForAction(Context context,
UserHandle user, String action, Map<Pair<String, String>, Tile> addedCache,
- String defaultCategory, ArrayList<Tile> outTiles, boolean requireSettings) {
- getTilesForAction(context, user, action, addedCache, defaultCategory, outTiles,
- requireSettings, requireSettings);
- }
-
- private static void getTilesForAction(Context context,
- UserHandle user, String action, Map<Pair<String, String>, Tile> addedCache,
- String defaultCategory, ArrayList<Tile> outTiles, boolean requireSettings,
- boolean usePriority) {
- Intent intent = new Intent(action);
+ String defaultCategory, List<Tile> outTiles, boolean requireSettings) {
+ final Intent intent = new Intent(action);
if (requireSettings) {
intent.setPackage(SETTING_PKG);
}
- getTilesForIntent(context, user, intent, addedCache, defaultCategory, outTiles,
- usePriority);
- }
-
- public static void getTilesForIntent(
- Context context, UserHandle user, Intent intent,
- Map<Pair<String, String>, Tile> addedCache, String defaultCategory, List<Tile> outTiles,
- boolean usePriority) {
- PackageManager pm = context.getPackageManager();
+ final PackageManager pm = context.getPackageManager();
List<ResolveInfo> results = pm.queryIntentActivitiesAsUser(intent,
PackageManager.GET_META_DATA, user.getIdentifier());
for (ResolveInfo resolved : results) {
@@ -312,8 +288,6 @@
Tile tile = addedCache.get(key);
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);
}
@@ -326,52 +300,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
- try {
- Resources res = pm.getResourcesForApplication(applicationInfo.packageName);
- 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));
- } else {
- summary = metaData.getString(META_DATA_PREFERENCE_SUMMARY);
- }
- }
- }
- } 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;
- }
-
- return false;
- }
-
/**
* Gets the icon package name and resource id from content provider.
*
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..8e06f157 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
@@ -16,6 +16,7 @@
package com.android.settingslib.drawer;
+import static com.android.settingslib.drawer.TileUtils.IA_SETTINGS_ACTION;
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;
@@ -39,7 +40,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 +47,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 +78,6 @@
@Mock
private UserManager mUserManager;
@Mock
- private IContentProvider mIContentProvider;
- @Mock
private ContentResolver mContentResolver;
private static final String URI_GET_SUMMARY = "content://authority/text/summary";
@@ -104,15 +100,14 @@
@Test
public void getTilesForIntent_shouldParseCategory() {
final String testCategory = "category1";
- Intent intent = new Intent();
Map<Pair<String, String>, Tile> addedCache = new ArrayMap<>();
List<Tile> outTiles = new ArrayList<>();
List<ResolveInfo> info = new ArrayList<>();
info.add(newInfo(true, testCategory));
- when(mPackageManager.queryIntentActivitiesAsUser(eq(intent), anyInt(), anyInt()))
+ when(mPackageManager.queryIntentActivitiesAsUser(any(Intent.class), anyInt(), anyInt()))
.thenReturn(info);
- TileUtils.getTilesForIntent(mContext, UserHandle.CURRENT, intent, addedCache,
+ TileUtils.getTilesForAction(mContext, UserHandle.CURRENT, IA_SETTINGS_ACTION, addedCache,
null /* defaultCategory */, outTiles, false /* usePriority */);
assertThat(outTiles.size()).isEqualTo(1);
@@ -122,60 +117,37 @@
@Test
public void getTilesForIntent_shouldParseKeyHintForSystemApp() {
String keyHint = "key";
- 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 */, keyHint);
info.add(resolveInfo);
- when(mPackageManager.queryIntentActivitiesAsUser(eq(intent), anyInt(), anyInt()))
+ when(mPackageManager.queryIntentActivitiesAsUser(any(Intent.class), anyInt(), anyInt()))
.thenReturn(info);
- TileUtils.getTilesForIntent(mContext, UserHandle.CURRENT, intent, addedCache,
- null /* defaultCategory */, outTiles, false /* usePriority */);
+ TileUtils.getTilesForAction(mContext, UserHandle.CURRENT, IA_SETTINGS_ACTION, addedCache,
+ null /* defaultCategory */, outTiles, false /* requiresSettings */);
- assertThat(outTiles.size()).isEqualTo(1);
+ assertThat(outTiles).hasSize(1);
assertThat(outTiles.get(0).getKey(mContext)).isEqualTo(keyHint);
}
@Test
public void getTilesForIntent_shouldSkipNonSystemApp() {
final String testCategory = "category1";
- Intent intent = new Intent();
Map<Pair<String, String>, Tile> addedCache = new ArrayMap<>();
List<Tile> outTiles = new ArrayList<>();
List<ResolveInfo> info = new ArrayList<>();
info.add(newInfo(false, testCategory));
- when(mPackageManager.queryIntentActivitiesAsUser(eq(intent), anyInt(), anyInt()))
+ when(mPackageManager.queryIntentActivitiesAsUser(any(Intent.class), anyInt(), anyInt()))
.thenReturn(info);
- TileUtils.getTilesForIntent(mContext, UserHandle.CURRENT, intent, addedCache,
- null /* defaultCategory */, outTiles, false /* usePriority */);
+ TileUtils.getTilesForAction(mContext, UserHandle.CURRENT, IA_SETTINGS_ACTION,
+ addedCache, null /* defaultCategory */, outTiles, false /* requiresSettings */);
- assertThat(outTiles.isEmpty()).isTrue();
- }
-
- @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);
+ assertThat(outTiles).isEmpty();
}
@Test
@@ -189,7 +161,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());
@@ -199,7 +171,6 @@
@Test
public void getTilesForIntent_shouldReadMetadataTitleAsString() {
- Intent intent = new Intent();
Map<Pair<String, String>, Tile> addedCache = new ArrayMap<>();
List<Tile> outTiles = new ArrayList<>();
List<ResolveInfo> info = new ArrayList<>();
@@ -207,19 +178,18 @@
URI_GET_SUMMARY, "my title", 0);
info.add(resolveInfo);
- when(mPackageManager.queryIntentActivitiesAsUser(eq(intent), anyInt(), anyInt()))
+ when(mPackageManager.queryIntentActivitiesAsUser(any(Intent.class), anyInt(), anyInt()))
.thenReturn(info);
- TileUtils.getTilesForIntent(mContext, UserHandle.CURRENT, intent, addedCache,
+ TileUtils.getTilesForAction(mContext, UserHandle.CURRENT, IA_SETTINGS_ACTION, addedCache,
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
public void getTilesForIntent_shouldReadMetadataTitleFromResource() {
- Intent intent = new Intent();
Map<Pair<String, String>, Tile> addedCache = new ArrayMap<>();
List<Tile> outTiles = new ArrayList<>();
List<ResolveInfo> info = new ArrayList<>();
@@ -227,16 +197,16 @@
URI_GET_SUMMARY, null, 123);
info.add(resolveInfo);
- when(mPackageManager.queryIntentActivitiesAsUser(eq(intent), anyInt(), anyInt()))
+ when(mPackageManager.queryIntentActivitiesAsUser(any(Intent.class), anyInt(), anyInt()))
.thenReturn(info);
when(mResources.getString(eq(123)))
.thenReturn("my localized title");
- TileUtils.getTilesForIntent(mContext, UserHandle.CURRENT, intent, addedCache,
+ TileUtils.getTilesForAction(mContext, UserHandle.CURRENT, IA_SETTINGS_ACTION, 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
@@ -245,7 +215,6 @@
@Test
public void getTilesForIntent_shouldNotTintIconIfInSettingsPackage() {
- Intent intent = new Intent();
Map<Pair<String, String>, Tile> addedCache = new ArrayMap<>();
List<Tile> outTiles = new ArrayList<>();
List<ResolveInfo> info = new ArrayList<>();
@@ -255,10 +224,10 @@
resolveInfo.activityInfo.applicationInfo.packageName = "com.android.settings";
info.add(resolveInfo);
- when(mPackageManager.queryIntentActivitiesAsUser(eq(intent), anyInt(), anyInt()))
+ when(mPackageManager.queryIntentActivitiesAsUser(any(Intent.class), anyInt(), anyInt()))
.thenReturn(info);
- TileUtils.getTilesForIntent(mContext, UserHandle.CURRENT, intent, addedCache,
+ TileUtils.getTilesForAction(mContext, UserHandle.CURRENT, IA_SETTINGS_ACTION, addedCache,
null /* defaultCategory */, outTiles, false /* usePriority */);
assertThat(outTiles.get(0).isIconTintable(mContext)).isFalse();
@@ -266,7 +235,6 @@
@Test
public void getTilesForIntent_shouldMarkIconTintableIfMetadataSet() {
- Intent intent = new Intent();
Map<Pair<String, String>, Tile> addedCache = new ArrayMap<>();
List<Tile> outTiles = new ArrayList<>();
List<ResolveInfo> info = new ArrayList<>();
@@ -276,57 +244,17 @@
.putBoolean(TileUtils.META_DATA_PREFERENCE_ICON_TINTABLE, true);
info.add(resolveInfo);
- when(mPackageManager.queryIntentActivitiesAsUser(eq(intent), anyInt(), anyInt()))
+ when(mPackageManager.queryIntentActivitiesAsUser(any(Intent.class), anyInt(), anyInt()))
.thenReturn(info);
- TileUtils.getTilesForIntent(mContext, UserHandle.CURRENT, intent, addedCache,
+ TileUtils.getTilesForAction(mContext, UserHandle.CURRENT, IA_SETTINGS_ACTION, addedCache,
null /* defaultCategory */, outTiles, false /* usePriority */);
assertThat(outTiles.get(0).isIconTintable(mContext)).isTrue();
}
@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<>();
List<Tile> outTiles = new ArrayList<>();
List<ResolveInfo> info = new ArrayList<>();
@@ -334,10 +262,10 @@
URI_GET_SUMMARY);
info.add(resolveInfo);
- when(mPackageManager.queryIntentActivitiesAsUser(eq(intent), anyInt(), anyInt()))
+ when(mPackageManager.queryIntentActivitiesAsUser(any(Intent.class), anyInt(), anyInt()))
.thenReturn(info);
- TileUtils.getTilesForIntent(mContext, UserHandle.CURRENT, intent, addedCache,
+ TileUtils.getTilesForAction(mContext, UserHandle.CURRENT, IA_SETTINGS_ACTION, addedCache,
null /* defaultCategory */, outTiles, false /* usePriority */);
assertThat(outTiles.size()).isEqualTo(1);
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/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/ScreenDecorations.java b/packages/SystemUI/src/com/android/systemui/ScreenDecorations.java
index 9bbcfbc..044cc5c 100644
--- a/packages/SystemUI/src/com/android/systemui/ScreenDecorations.java
+++ b/packages/SystemUI/src/com/android/systemui/ScreenDecorations.java
@@ -94,9 +94,9 @@
private DisplayManager mDisplayManager;
private DisplayManager.DisplayListener mDisplayListener;
- private int mRoundedDefault;
- private int mRoundedDefaultTop;
- private int mRoundedDefaultBottom;
+ @VisibleForTesting protected int mRoundedDefault;
+ @VisibleForTesting protected int mRoundedDefaultTop;
+ @VisibleForTesting protected int mRoundedDefaultBottom;
private View mOverlay;
private View mBottomOverlay;
private float mDensity;
@@ -125,12 +125,7 @@
private void startOnScreenDecorationsThread() {
mRotation = RotationUtils.getExactRotation(mContext);
mWindowManager = mContext.getSystemService(WindowManager.class);
- mRoundedDefault = mContext.getResources().getDimensionPixelSize(
- R.dimen.rounded_corner_radius);
- mRoundedDefaultTop = mContext.getResources().getDimensionPixelSize(
- R.dimen.rounded_corner_radius_top);
- mRoundedDefaultBottom = mContext.getResources().getDimensionPixelSize(
- R.dimen.rounded_corner_radius_bottom);
+ updateRoundedCornerRadii();
if (hasRoundedCorners() || shouldDrawCutout()) {
setupDecorations();
}
@@ -277,6 +272,7 @@
int oldRotation = mRotation;
mPendingRotationChange = false;
updateOrientation();
+ updateRoundedCornerRadii();
if (DEBUG) Log.i(TAG, "onConfigChanged from rot " + oldRotation + " to " + mRotation);
if (shouldDrawCutout() && mOverlay == null) {
setupDecorations();
@@ -309,6 +305,26 @@
}
}
+ private void updateRoundedCornerRadii() {
+ final int newRoundedDefault = mContext.getResources().getDimensionPixelSize(
+ R.dimen.rounded_corner_radius);
+ final int newRoundedDefaultTop = mContext.getResources().getDimensionPixelSize(
+ R.dimen.rounded_corner_radius_top);
+ final int newRoundedDefaultBottom = mContext.getResources().getDimensionPixelSize(
+ R.dimen.rounded_corner_radius_bottom);
+
+ final boolean roundedCornersChanged = mRoundedDefault != newRoundedDefault
+ || mRoundedDefaultBottom != newRoundedDefaultBottom
+ || mRoundedDefaultTop != newRoundedDefaultTop;
+
+ if (roundedCornersChanged) {
+ mRoundedDefault = newRoundedDefault;
+ mRoundedDefaultTop = newRoundedDefaultTop;
+ mRoundedDefaultBottom = newRoundedDefaultBottom;
+ onTuningChanged(SIZE, null);
+ }
+ }
+
private void updateViews() {
View topLeft = mOverlay.findViewById(R.id.left);
View topRight = mOverlay.findViewById(R.id.right);
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 1393f8f..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) {
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/notification/row/NotificationGutsManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationGutsManager.java
index ab47d33..e635976 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationGutsManager.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationGutsManager.java
@@ -28,12 +28,10 @@
import android.content.pm.PackageManager;
import android.content.res.Resources;
import android.net.Uri;
-import android.os.RemoteException;
import android.os.ServiceManager;
import android.os.UserHandle;
import android.provider.Settings;
import android.service.notification.StatusBarNotification;
-import androidx.annotation.VisibleForTesting;
import android.util.ArraySet;
import android.util.Log;
import android.view.HapticFeedbackConstants;
@@ -45,15 +43,17 @@
import com.android.systemui.Dependency;
import com.android.systemui.Dumpable;
import com.android.systemui.plugins.statusbar.NotificationMenuRowPlugin;
-import com.android.systemui.statusbar.notification.NotificationEntryManager;
import com.android.systemui.statusbar.NotificationLockscreenUserManager;
import com.android.systemui.statusbar.NotificationPresenter;
+import com.android.systemui.statusbar.notification.NotificationEntryManager;
import com.android.systemui.statusbar.notification.stack.NotificationListContainer;
import com.android.systemui.statusbar.phone.StatusBar;
import java.io.FileDescriptor;
import java.io.PrintWriter;
+import androidx.annotation.VisibleForTesting;
+
/**
* Handles various NotificationGuts related tasks, such as binding guts to a row, opening and
* closing guts, and keeping track of the currently exposed notification guts.
@@ -147,15 +147,15 @@
}
}
- public void bindGuts(final ExpandableNotificationRow row) {
- bindGuts(row, mGutsMenuItem);
+ public boolean bindGuts(final ExpandableNotificationRow row) {
+ row.inflateGuts();
+ return bindGuts(row, mGutsMenuItem);
}
- private void bindGuts(final ExpandableNotificationRow row,
+ private boolean bindGuts(final ExpandableNotificationRow row,
NotificationMenuRowPlugin.MenuItem item) {
StatusBarNotification sbn = row.getStatusBarNotification();
- row.inflateGuts();
row.setGutsView(item);
row.setTag(sbn.getPackageName());
row.getGuts().setClosedListener((NotificationGuts g) -> {
@@ -176,12 +176,18 @@
});
View gutsView = item.getGutsView();
- if (gutsView instanceof NotificationSnooze) {
- initializeSnoozeView(row, (NotificationSnooze) gutsView);
- } else if (gutsView instanceof AppOpsInfo) {
- initializeAppOpsInfo(row, (AppOpsInfo) gutsView);
- } else if (gutsView instanceof NotificationInfo) {
- initializeNotificationInfo(row, (NotificationInfo) gutsView);
+ try {
+ if (gutsView instanceof NotificationSnooze) {
+ initializeSnoozeView(row, (NotificationSnooze) gutsView);
+ } else if (gutsView instanceof AppOpsInfo) {
+ initializeAppOpsInfo(row, (AppOpsInfo) gutsView);
+ } else if (gutsView instanceof NotificationInfo) {
+ initializeNotificationInfo(row, (NotificationInfo) gutsView);
+ }
+ return true;
+ } catch (Exception e) {
+ Log.e(TAG, "error binding guts", e);
+ return false;
}
}
@@ -240,7 +246,7 @@
@VisibleForTesting
void initializeNotificationInfo(
final ExpandableNotificationRow row,
- NotificationInfo notificationInfoView) {
+ NotificationInfo notificationInfoView) throws Exception {
NotificationGuts guts = row.getGuts();
StatusBarNotification sbn = row.getStatusBarNotification();
String packageName = sbn.getPackageName();
@@ -269,24 +275,21 @@
};
}
- try {
- notificationInfoView.bindNotification(
- pmUser,
- iNotificationManager,
- packageName,
- row.getEntry().channel,
- row.getNumUniqueChannels(),
- sbn,
- mCheckSaveListener,
- onSettingsClick,
- onAppSettingsClick,
- mPresenter.isDeviceProvisioned(),
- row.getIsNonblockable(),
- isForBlockingHelper,
- row.getEntry().userSentiment == USER_SENTIMENT_NEGATIVE);
- } catch (RemoteException e) {
- Log.e(TAG, e.toString());
- }
+ notificationInfoView.bindNotification(
+ pmUser,
+ iNotificationManager,
+ packageName,
+ row.getEntry().channel,
+ row.getNumUniqueChannels(),
+ sbn,
+ mCheckSaveListener,
+ onSettingsClick,
+ onAppSettingsClick,
+ mPresenter.isDeviceProvisioned(),
+ row.getIsNonblockable(),
+ isForBlockingHelper,
+ row.getEntry().userSentiment == USER_SENTIMENT_NEGATIVE);
+
}
/**
@@ -356,8 +359,15 @@
true /* resetMenu */);
return false;
}
- bindGuts(row, menuItem);
+
+ row.inflateGuts();
NotificationGuts guts = row.getGuts();
+ mNotificationGutsExposed = guts;
+ if (!bindGuts(row, menuItem)) {
+ // exception occurred trying to fill in all the data, bail.
+ return false;
+ }
+
// Assume we are a status_bar_notification_row
if (guts == null) {
@@ -378,9 +388,6 @@
+ "window");
return;
}
- closeAndSaveGuts(true /* removeLeavebehind */, true /* force */,
- true /* removeControls */, -1 /* x */, -1 /* y */,
- false /* resetMenu */);
guts.setVisibility(View.VISIBLE);
final boolean needsFalsingProtection =
@@ -396,7 +403,6 @@
row.closeRemoteInput();
mListContainer.onHeightChanged(row, true /* needsAnimation */);
- mNotificationGutsExposed = guts;
mGutsMenuItem = menuItem;
}
});
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/StatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
index 3701eaf..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);
}
}
@@ -4071,7 +4071,7 @@
mGroupManager.setStatusBarState(state);
mHeadsUpManager.setStatusBarState(state);
mFalsingManager.setStatusBarState(state);
- mStatusBarWindowManager.setStatusBarState(state);
+ mStatusBarWindowController.setStatusBarState(state);
mStackScroller.setStatusBarState(state);
updateReportRejectedTouchVisibility();
updateDozing();
@@ -4101,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);
}
}
@@ -4718,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);
@@ -4948,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/systemui/ScreenDecorationsTest.java b/packages/SystemUI/tests/src/com/android/systemui/ScreenDecorationsTest.java
index 644c0b3..cc96917 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/ScreenDecorationsTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/ScreenDecorationsTest.java
@@ -21,6 +21,7 @@
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertThat;
+import static org.junit.Assert.assertEquals;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.ArgumentMatchers.anyString;
@@ -226,4 +227,17 @@
verify(padding).destroy();
}
+ @Test
+ public void testUpdateRoundedCorners() {
+ mContext.getOrCreateTestableResources().addOverride(
+ com.android.internal.R.bool.config_fillMainBuiltInDisplayCutout, false);
+ mContext.getOrCreateTestableResources().addOverride(dimen.rounded_corner_radius, 20);
+
+ mScreenDecorations.start();
+ assertEquals(mScreenDecorations.mRoundedDefault, 20);
+
+ mContext.getOrCreateTestableResources().addOverride(dimen.rounded_corner_radius, 5);
+ mScreenDecorations.onConfigurationChanged(null);
+ assertEquals(mScreenDecorations.mRoundedDefault, 5);
+ }
}
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
index 1b22f09..1ee7094 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/CastControllerImplTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/CastControllerImplTest.java
@@ -6,8 +6,8 @@
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.content.Context;
import android.media.MediaRouter;
import android.media.projection.MediaProjectionInfo;
import android.media.projection.MediaProjectionManager;
@@ -24,6 +24,11 @@
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
@@ -49,15 +54,15 @@
}
@Test
- public void testAddCallback(){
+ public void testAddCallback() {
Callback mockCallback = mock(Callback.class);
mController.addCallback(mockCallback);
- verify(mockCallback,times(1)).onCastDevicesChanged();
+ verify(mockCallback, times(1)).onCastDevicesChanged();
}
@Test
- public void testRemoveCallback(){
+ public void testRemoveCallback() {
Callback mockCallback = mock(Callback.class);
mController.addCallback(mockCallback);
@@ -68,10 +73,54 @@
}
@Test
- public void testRemoveCallbackFromEmptyList(){
+ 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/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java b/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java
index acbb67c..6be9550 100644
--- a/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java
+++ b/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java
@@ -1567,8 +1567,9 @@
}
final long identity = Binder.clearCallingIdentity();
try {
+ final String settingValue = builder.toString();
Settings.Secure.putStringForUser(mContext.getContentResolver(),
- settingName, builder.toString(), userId);
+ settingName, TextUtils.isEmpty(settingValue) ? null : settingValue, userId);
} finally {
Binder.restoreCallingIdentity(identity);
}
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/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/NetworkManagementService.java b/services/core/java/com/android/server/NetworkManagementService.java
index 4b0379e..d829602 100644
--- a/services/core/java/com/android/server/NetworkManagementService.java
+++ b/services/core/java/com/android/server/NetworkManagementService.java
@@ -1227,25 +1227,25 @@
public boolean getIpForwardingEnabled() throws IllegalStateException{
mContext.enforceCallingOrSelfPermission(CONNECTIVITY_INTERNAL, TAG);
- final NativeDaemonEvent event;
try {
- event = mConnector.execute("ipfwd", "status");
- } catch (NativeDaemonConnectorException e) {
- throw e.rethrowAsParcelableException();
+ final boolean isEnabled = mNetdService.ipfwdEnabled();
+ return isEnabled;
+ } catch (RemoteException | ServiceSpecificException e) {
+ throw new IllegalStateException(e);
}
-
- // 211 Forwarding enabled
- event.checkCode(IpFwdStatusResult);
- return event.getMessage().endsWith("enabled");
}
@Override
public void setIpForwardingEnabled(boolean enable) {
mContext.enforceCallingOrSelfPermission(CONNECTIVITY_INTERNAL, TAG);
try {
- mConnector.execute("ipfwd", enable ? "enable" : "disable", "tethering");
- } catch (NativeDaemonConnectorException e) {
- throw e.rethrowAsParcelableException();
+ if (enable) {
+ mNetdService.ipfwdEnableForwarding("tethering");
+ } else {
+ mNetdService.ipfwdDisableForwarding("tethering");
+ }
+ } catch (RemoteException | ServiceSpecificException e) {
+ throw new IllegalStateException(e);
}
}
@@ -1371,11 +1371,14 @@
}
private void modifyInterfaceForward(boolean add, String fromIface, String toIface) {
- final Command cmd = new Command("ipfwd", add ? "add" : "remove", fromIface, toIface);
try {
- mConnector.execute(cmd);
- } catch (NativeDaemonConnectorException e) {
- throw e.rethrowAsParcelableException();
+ if (add) {
+ mNetdService.ipfwdAddInterfaceForward(fromIface, toIface);
+ } else {
+ mNetdService.ipfwdRemoveInterfaceForward(fromIface, toIface);
+ }
+ } catch (RemoteException | ServiceSpecificException e) {
+ throw new IllegalStateException(e);
}
}
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/hdmi/HdmiControlService.java b/services/core/java/com/android/server/hdmi/HdmiControlService.java
index a2eb1c1..c16d3cd 100644
--- a/services/core/java/com/android/server/hdmi/HdmiControlService.java
+++ b/services/core/java/com/android/server/hdmi/HdmiControlService.java
@@ -402,6 +402,8 @@
if (mCecController != null) {
if (mHdmiControlEnabled) {
initializeCec(INITIATED_BY_BOOT_UP);
+ } else {
+ mCecController.setOption(OptionKey.ENABLE_CEC, false);
}
} else {
Slog.i(TAG, "Device does not support HDMI-CEC.");
@@ -2384,6 +2386,7 @@
@ServiceThreadOnly
private void enableHdmiControlService() {
+ mCecController.setOption(OptionKey.ENABLE_CEC, true);
mCecController.setOption(OptionKey.SYSTEM_CEC_CONTROL, true);
mMhlController.setOption(OPTION_MHL_ENABLE, ENABLED);
@@ -2400,6 +2403,7 @@
@Override
public void run() {
mCecController.setOption(OptionKey.ENABLE_CEC, false);
+ mCecController.setOption(OptionKey.SYSTEM_CEC_CONTROL, false);
mMhlController.setOption(OPTION_MHL_ENABLE, DISABLED);
clearLocalDevices();
}
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 dd3e2d4..ce71dd2 100644
--- a/services/core/java/com/android/server/notification/NotificationManagerService.java
+++ b/services/core/java/com/android/server/notification/NotificationManagerService.java
@@ -700,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);
@@ -757,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,
@@ -797,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);
}
@@ -1040,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) {
@@ -5964,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);
}
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/OtaDexoptService.java b/services/core/java/com/android/server/pm/OtaDexoptService.java
index 320affb..cf47d4e 100644
--- a/services/core/java/com/android/server/pm/OtaDexoptService.java
+++ b/services/core/java/com/android/server/pm/OtaDexoptService.java
@@ -365,10 +365,12 @@
continue;
}
- // If the path is in /system, /vendor or /product, ignore. It will have been
- // ota-dexopted into /data/ota and moved into the dalvik-cache already.
- if (pkg.codePath.startsWith("/system") || pkg.codePath.startsWith("/vendor")
- || pkg.codePath.startsWith("/product")) {
+ // If the path is in /system, /vendor, /product or /product_services, ignore. It will
+ // have been ota-dexopted into /data/ota and moved into the dalvik-cache already.
+ if (pkg.codePath.startsWith("/system")
+ || pkg.codePath.startsWith("/vendor")
+ || pkg.codePath.startsWith("/product")
+ || pkg.codePath.startsWith("/product_services")) {
continue;
}
diff --git a/services/core/java/com/android/server/pm/PackageManagerService.java b/services/core/java/com/android/server/pm/PackageManagerService.java
index 2f9c69e..fc2813b 100644
--- a/services/core/java/com/android/server/pm/PackageManagerService.java
+++ b/services/core/java/com/android/server/pm/PackageManagerService.java
@@ -252,6 +252,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;
@@ -444,26 +445,27 @@
private static final int SHELL_UID = Process.SHELL_UID;
private static final int SE_UID = Process.SE_UID;
- static final int SCAN_NO_DEX = 1<<0;
- static final int SCAN_UPDATE_SIGNATURE = 1<<1;
- static final int SCAN_NEW_INSTALL = 1<<2;
- static final int SCAN_UPDATE_TIME = 1<<3;
- static final int SCAN_BOOTING = 1<<4;
- static final int SCAN_REQUIRE_KNOWN = 1<<7;
- static final int SCAN_MOVE = 1<<8;
- static final int SCAN_INITIAL = 1<<9;
- static final int SCAN_CHECK_ONLY = 1<<10;
- static final int SCAN_DONT_KILL_APP = 1<<11;
- static final int SCAN_IGNORE_FROZEN = 1<<12;
- static final int SCAN_FIRST_BOOT_OR_UPGRADE = 1<<13;
- static final int SCAN_AS_INSTANT_APP = 1<<14;
- static final int SCAN_AS_FULL_APP = 1<<15;
- static final int SCAN_AS_VIRTUAL_PRELOAD = 1<<16;
- static final int SCAN_AS_SYSTEM = 1<<17;
- static final int SCAN_AS_PRIVILEGED = 1<<18;
- static final int SCAN_AS_OEM = 1<<19;
- static final int SCAN_AS_VENDOR = 1<<20;
- static final int SCAN_AS_PRODUCT = 1<<21;
+ static final int SCAN_NO_DEX = 1 << 0;
+ static final int SCAN_UPDATE_SIGNATURE = 1 << 1;
+ static final int SCAN_NEW_INSTALL = 1 << 2;
+ static final int SCAN_UPDATE_TIME = 1 << 3;
+ static final int SCAN_BOOTING = 1 << 4;
+ static final int SCAN_REQUIRE_KNOWN = 1 << 7;
+ static final int SCAN_MOVE = 1 << 8;
+ static final int SCAN_INITIAL = 1 << 9;
+ static final int SCAN_CHECK_ONLY = 1 << 10;
+ static final int SCAN_DONT_KILL_APP = 1 << 11;
+ static final int SCAN_IGNORE_FROZEN = 1 << 12;
+ static final int SCAN_FIRST_BOOT_OR_UPGRADE = 1 << 13;
+ static final int SCAN_AS_INSTANT_APP = 1 << 14;
+ static final int SCAN_AS_FULL_APP = 1 << 15;
+ static final int SCAN_AS_VIRTUAL_PRELOAD = 1 << 16;
+ static final int SCAN_AS_SYSTEM = 1 << 17;
+ static final int SCAN_AS_PRIVILEGED = 1 << 18;
+ static final int SCAN_AS_OEM = 1 << 19;
+ static final int SCAN_AS_VENDOR = 1 << 20;
+ static final int SCAN_AS_PRODUCT = 1 << 21;
+ static final int SCAN_AS_PRODUCT_SERVICES = 1 << 22;
@IntDef(flag = true, prefix = { "SCAN_" }, value = {
SCAN_NO_DEX,
@@ -569,6 +571,8 @@
private static final String PRODUCT_OVERLAY_DIR = "/product/overlay";
+ private static final String PRODUCT_SERVICES_OVERLAY_DIR = "/product_services/overlay";
+
/** Canonical intent used to identify what counts as a "web browser" app */
private static final Intent sBrowserIntent;
static {
@@ -2544,9 +2548,10 @@
scanFlags = scanFlags | SCAN_FIRST_BOOT_OR_UPGRADE;
}
- // Collect vendor/product overlay packages. (Do this before scanning any apps.)
- // For security and version matching reason, only consider
- // overlay packages if they reside in the right directory.
+ // Collect vendor/product/product_services overlay packages. (Do this before scanning
+ // any apps.)
+ // For security and version matching reason, only consider overlay packages if they
+ // reside in the right directory.
scanDirTracedLI(new File(VENDOR_OVERLAY_DIR),
mDefParseFlags
| PackageParser.PARSE_IS_SYSTEM_DIR,
@@ -2561,6 +2566,13 @@
| SCAN_AS_SYSTEM
| SCAN_AS_PRODUCT,
0);
+ scanDirTracedLI(new File(PRODUCT_SERVICES_OVERLAY_DIR),
+ mDefParseFlags
+ | PackageParser.PARSE_IS_SYSTEM_DIR,
+ scanFlags
+ | SCAN_AS_SYSTEM
+ | SCAN_AS_PRODUCT_SERVICES,
+ 0);
mParallelPackageParserCallback.findStaticOverlayPackages();
@@ -2672,7 +2684,7 @@
| SCAN_AS_OEM,
0);
- // Collected privileged product packages.
+ // Collected privileged /product packages.
File privilegedProductAppDir = new File(Environment.getProductDirectory(), "priv-app");
try {
privilegedProductAppDir = privilegedProductAppDir.getCanonicalFile();
@@ -2688,7 +2700,7 @@
| SCAN_AS_PRIVILEGED,
0);
- // Collect ordinary product packages.
+ // Collect ordinary /product packages.
File productAppDir = new File(Environment.getProductDirectory(), "app");
try {
productAppDir = productAppDir.getCanonicalFile();
@@ -2703,6 +2715,39 @@
| SCAN_AS_PRODUCT,
0);
+ // Collected privileged /product_services packages.
+ File privilegedProductServicesAppDir =
+ new File(Environment.getProductServicesDirectory(), "priv-app");
+ try {
+ privilegedProductServicesAppDir =
+ privilegedProductServicesAppDir.getCanonicalFile();
+ } catch (IOException e) {
+ // failed to look up canonical path, continue with original one
+ }
+ scanDirTracedLI(privilegedProductServicesAppDir,
+ mDefParseFlags
+ | PackageParser.PARSE_IS_SYSTEM_DIR,
+ scanFlags
+ | SCAN_AS_SYSTEM
+ | SCAN_AS_PRODUCT_SERVICES
+ | SCAN_AS_PRIVILEGED,
+ 0);
+
+ // Collect ordinary /product_services packages.
+ File productServicesAppDir = new File(Environment.getProductServicesDirectory(), "app");
+ try {
+ productServicesAppDir = productServicesAppDir.getCanonicalFile();
+ } catch (IOException e) {
+ // failed to look up canonical path, continue with original one
+ }
+ scanDirTracedLI(productServicesAppDir,
+ mDefParseFlags
+ | PackageParser.PARSE_IS_SYSTEM_DIR,
+ scanFlags
+ | SCAN_AS_SYSTEM
+ | SCAN_AS_PRODUCT_SERVICES,
+ 0);
+
// Prune any system packages that no longer exist.
final List<String> possiblyDeletedUpdatedSystemApps = new ArrayList<>();
// Stub packages must either be replaced with full versions in the /data
@@ -2907,6 +2952,23 @@
scanFlags
| SCAN_AS_SYSTEM
| SCAN_AS_PRODUCT;
+ } else if (FileUtils.contains(privilegedProductServicesAppDir, scanFile)) {
+ reparseFlags =
+ mDefParseFlags |
+ PackageParser.PARSE_IS_SYSTEM_DIR;
+ rescanFlags =
+ scanFlags
+ | SCAN_AS_SYSTEM
+ | SCAN_AS_PRODUCT_SERVICES
+ | SCAN_AS_PRIVILEGED;
+ } else if (FileUtils.contains(productServicesAppDir, scanFile)) {
+ reparseFlags =
+ mDefParseFlags |
+ PackageParser.PARSE_IS_SYSTEM_DIR;
+ rescanFlags =
+ scanFlags
+ | SCAN_AS_SYSTEM
+ | SCAN_AS_PRODUCT_SERVICES;
} else {
Slog.e(TAG, "Ignoring unexpected fallback path " + scanFile);
continue;
@@ -10055,6 +10117,7 @@
* <li>{@link #SCAN_AS_OEM}</li>
* <li>{@link #SCAN_AS_VENDOR}</li>
* <li>{@link #SCAN_AS_PRODUCT}</li>
+ * <li>{@link #SCAN_AS_PRODUCT_SERVICES}</li>
* <li>{@link #SCAN_AS_INSTANT_APP}</li>
* <li>{@link #SCAN_AS_VIRTUAL_PRELOAD}</li>
* </ul>
@@ -10081,6 +10144,10 @@
& ApplicationInfo.PRIVATE_FLAG_PRODUCT) != 0) {
scanFlags |= SCAN_AS_PRODUCT;
}
+ if ((disabledPkgSetting.pkgPrivateFlags
+ & ApplicationInfo.PRIVATE_FLAG_PRODUCT_SERVICES) != 0) {
+ scanFlags |= SCAN_AS_PRODUCT_SERVICES;
+ }
}
if (pkgSetting != null) {
final int userId = ((user == null) ? 0 : user.getIdentifier());
@@ -10923,6 +10990,10 @@
pkg.applicationInfo.privateFlags |= ApplicationInfo.PRIVATE_FLAG_PRODUCT;
}
+ if ((scanFlags & SCAN_AS_PRODUCT_SERVICES) != 0) {
+ pkg.applicationInfo.privateFlags |= ApplicationInfo.PRIVATE_FLAG_PRODUCT_SERVICES;
+ }
+
// Check if the package is signed with the same key as the platform package.
if (PLATFORM_PACKAGE_NAME.equals(pkg.packageName) ||
(platformPkg != null && compareSignatures(
@@ -11879,6 +11950,8 @@
codeRoot = Environment.getOdmDirectory();
} else if (FileUtils.contains(Environment.getProductDirectory(), codePath)) {
codeRoot = Environment.getProductDirectory();
+ } else if (FileUtils.contains(Environment.getProductServicesDirectory(), codePath)) {
+ codeRoot = Environment.getProductServicesDirectory();
} else {
// Unrecognized code path; take its top real segment as the apk root:
// e.g. /something/app/blah.apk => /something
@@ -12709,11 +12782,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()));
@@ -12895,6 +12969,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 {
@@ -12922,6 +12997,7 @@
pkgSetting.setSuspended(suspended, callingPackage, dialogMessage, appExtras,
launcherExtras, userId);
changedPackagesList.add(packageName);
+ changedUids.add(UserHandle.getUid(userId, pkgSetting.appId));
}
}
} finally {
@@ -12930,7 +13006,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);
@@ -13045,12 +13122,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()));
}
}
}
@@ -13058,7 +13137,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);
}
@@ -15207,13 +15287,16 @@
final boolean oem = isOemApp(oldPackage);
final boolean vendor = isVendorApp(oldPackage);
final boolean product = isProductApp(oldPackage);
+ final boolean productServices = isProductServicesApp(oldPackage);
+
final @ParseFlags int systemParseFlags = parseFlags;
final @ScanFlags int systemScanFlags = scanFlags
| SCAN_AS_SYSTEM
| (privileged ? SCAN_AS_PRIVILEGED : 0)
| (oem ? SCAN_AS_OEM : 0)
| (vendor ? SCAN_AS_VENDOR : 0)
- | (product ? SCAN_AS_PRODUCT : 0);
+ | (product ? SCAN_AS_PRODUCT : 0)
+ | (productServices ? SCAN_AS_PRODUCT_SERVICES : 0);
replaceSystemPackageLIF(oldPackage, pkg, systemParseFlags, systemScanFlags,
user, allUsers, installerPackageName, res, installReason);
@@ -16522,6 +16605,11 @@
return (pkg.applicationInfo.privateFlags & ApplicationInfo.PRIVATE_FLAG_PRODUCT) != 0;
}
+ private static boolean isProductServicesApp(PackageParser.Package pkg) {
+ return (pkg.applicationInfo.privateFlags
+ & ApplicationInfo.PRIVATE_FLAG_PRODUCT_SERVICES) != 0;
+ }
+
private static boolean hasDomainURLs(PackageParser.Package pkg) {
return (pkg.applicationInfo.privateFlags & ApplicationInfo.PRIVATE_FLAG_HAS_DOMAIN_URLS) != 0;
}
@@ -17261,10 +17349,13 @@
final File privilegedVendorAppDir = new File(Environment.getVendorDirectory(), "priv-app");
final File privilegedOdmAppDir = new File(Environment.getOdmDirectory(), "priv-app");
final File privilegedProductAppDir = new File(Environment.getProductDirectory(), "priv-app");
+ final File privilegedProductServicesAppDir =
+ new File(Environment.getProductServicesDirectory(), "priv-app");
return path.startsWith(privilegedAppDir.getCanonicalPath())
|| path.startsWith(privilegedVendorAppDir.getCanonicalPath())
|| path.startsWith(privilegedOdmAppDir.getCanonicalPath())
- || path.startsWith(privilegedProductAppDir.getCanonicalPath());
+ || path.startsWith(privilegedProductAppDir.getCanonicalPath())
+ || path.startsWith(privilegedProductServicesAppDir.getCanonicalPath());
} catch (IOException e) {
Slog.e(TAG, "Unable to access code path " + path);
}
@@ -17299,6 +17390,15 @@
return false;
}
+ static boolean locationIsProductServices(String path) {
+ try {
+ return path.startsWith(Environment.getProductServicesDirectory().getCanonicalPath());
+ } catch (IOException e) {
+ Slog.e(TAG, "Unable to access code path " + path);
+ }
+ return false;
+ }
+
/*
* Tries to delete system package.
*/
@@ -17426,6 +17526,9 @@
if (locationIsProduct(codePathString)) {
scanFlags |= SCAN_AS_PRODUCT;
}
+ if (locationIsProductServices(codePathString)) {
+ scanFlags |= SCAN_AS_PRODUCT_SERVICES;
+ }
final File codePath = new File(codePathString);
final PackageParser.Package pkg =
diff --git a/services/core/java/com/android/server/pm/PackageManagerShellCommand.java b/services/core/java/com/android/server/pm/PackageManagerShellCommand.java
index 3834a88..f2c0395 100644
--- a/services/core/java/com/android/server/pm/PackageManagerShellCommand.java
+++ b/services/core/java/com/android/server/pm/PackageManagerShellCommand.java
@@ -25,7 +25,6 @@
import android.accounts.IAccountManager;
import android.app.ActivityManager;
import android.app.ActivityManagerInternal;
-import android.app.Application;
import android.content.ComponentName;
import android.content.Context;
import android.content.IIntentReceiver;
@@ -67,7 +66,6 @@
import android.os.IUserManager;
import android.os.ParcelFileDescriptor;
import android.os.ParcelFileDescriptor.AutoCloseInputStream;
-import android.os.ParcelFileDescriptor.AutoCloseOutputStream;
import android.os.PersistableBundle;
import android.os.Process;
import android.os.RemoteException;
@@ -84,11 +82,17 @@
import android.text.format.DateUtils;
import android.util.ArraySet;
import android.util.PrintWriterPrinter;
+
import com.android.internal.content.PackageHelper;
import com.android.internal.util.ArrayUtils;
import com.android.server.LocalServices;
import com.android.server.SystemConfig;
+
import dalvik.system.DexFile;
+
+import libcore.io.IoUtils;
+import libcore.io.Streams;
+
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
@@ -96,10 +100,6 @@
import java.io.OutputStream;
import java.io.PrintWriter;
import java.net.URISyntaxException;
-import java.nio.file.Files;
-import java.nio.file.Paths;
-import java.nio.file.StandardCopyOption;
-import java.nio.file.attribute.FileAttribute;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
@@ -110,10 +110,7 @@
import java.util.WeakHashMap;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.LinkedBlockingQueue;
-import java.util.concurrent.SynchronousQueue;
import java.util.concurrent.TimeUnit;
-import libcore.io.IoUtils;
-import libcore.io.Streams;
class PackageManagerShellCommand extends ShellCommand {
/** Path for streaming APK content */
@@ -1777,6 +1774,15 @@
}
}
+ private boolean isProductServicesApp(String pkg) {
+ try {
+ final PackageInfo info = mInterface.getPackageInfo(pkg, 0, UserHandle.USER_SYSTEM);
+ return info != null && info.applicationInfo.isProductServices();
+ } catch (RemoteException e) {
+ return false;
+ }
+ }
+
private int runGetPrivappPermissions() {
final String pkg = getNextArg();
if (pkg == null) {
@@ -1789,6 +1795,9 @@
privAppPermissions = SystemConfig.getInstance().getVendorPrivAppPermissions(pkg);
} else if (isProductApp(pkg)) {
privAppPermissions = SystemConfig.getInstance().getProductPrivAppPermissions(pkg);
+ } else if (isProductServicesApp(pkg)) {
+ privAppPermissions = SystemConfig.getInstance()
+ .getProductServicesPrivAppPermissions(pkg);
} else {
privAppPermissions = SystemConfig.getInstance().getPrivAppPermissions(pkg);
}
@@ -1810,6 +1819,9 @@
privAppPermissions = SystemConfig.getInstance().getVendorPrivAppDenyPermissions(pkg);
} else if (isProductApp(pkg)) {
privAppPermissions = SystemConfig.getInstance().getProductPrivAppDenyPermissions(pkg);
+ } else if (isProductServicesApp(pkg)) {
+ privAppPermissions = SystemConfig.getInstance()
+ .getProductServicesPrivAppDenyPermissions(pkg);
} else {
privAppPermissions = SystemConfig.getInstance().getPrivAppDenyPermissions(pkg);
}
diff --git a/services/core/java/com/android/server/pm/PackageSetting.java b/services/core/java/com/android/server/pm/PackageSetting.java
index ea05b74..727fb15 100644
--- a/services/core/java/com/android/server/pm/PackageSetting.java
+++ b/services/core/java/com/android/server/pm/PackageSetting.java
@@ -148,6 +148,10 @@
return (pkgPrivateFlags & ApplicationInfo.PRIVATE_FLAG_PRODUCT) != 0;
}
+ public boolean isProductServices() {
+ return (pkgPrivateFlags & ApplicationInfo.PRIVATE_FLAG_PRODUCT_SERVICES) != 0;
+ }
+
public boolean isForwardLocked() {
return (pkgPrivateFlags & ApplicationInfo.PRIVATE_FLAG_FORWARD_LOCK) != 0;
}
diff --git a/services/core/java/com/android/server/pm/SettingBase.java b/services/core/java/com/android/server/pm/SettingBase.java
index 7c92045..239dc99 100644
--- a/services/core/java/com/android/server/pm/SettingBase.java
+++ b/services/core/java/com/android/server/pm/SettingBase.java
@@ -63,6 +63,7 @@
| ApplicationInfo.PRIVATE_FLAG_OEM
| ApplicationInfo.PRIVATE_FLAG_VENDOR
| ApplicationInfo.PRIVATE_FLAG_PRODUCT
+ | ApplicationInfo.PRIVATE_FLAG_PRODUCT_SERVICES
| ApplicationInfo.PRIVATE_FLAG_FORWARD_LOCK
| ApplicationInfo.PRIVATE_FLAG_REQUIRED_FOR_SYSTEM_USER);
}
diff --git a/services/core/java/com/android/server/pm/Settings.java b/services/core/java/com/android/server/pm/Settings.java
index b84401e..8dd1a0f 100644
--- a/services/core/java/com/android/server/pm/Settings.java
+++ b/services/core/java/com/android/server/pm/Settings.java
@@ -849,7 +849,8 @@
pkgSetting.pkgPrivateFlags &= ~(ApplicationInfo.PRIVATE_FLAG_PRIVILEGED
| ApplicationInfo.PRIVATE_FLAG_OEM
| ApplicationInfo.PRIVATE_FLAG_VENDOR
- | ApplicationInfo.PRIVATE_FLAG_PRODUCT);
+ | ApplicationInfo.PRIVATE_FLAG_PRODUCT
+ | ApplicationInfo.PRIVATE_FLAG_PRODUCT_SERVICES);
pkgSetting.pkgFlags |= pkgFlags & ApplicationInfo.FLAG_SYSTEM;
pkgSetting.pkgPrivateFlags |=
pkgPrivateFlags & ApplicationInfo.PRIVATE_FLAG_PRIVILEGED;
@@ -859,6 +860,8 @@
pkgPrivateFlags & ApplicationInfo.PRIVATE_FLAG_VENDOR;
pkgSetting.pkgPrivateFlags |=
pkgPrivateFlags & ApplicationInfo.PRIVATE_FLAG_PRODUCT;
+ pkgSetting.pkgPrivateFlags |=
+ pkgPrivateFlags & ApplicationInfo.PRIVATE_FLAG_PRODUCT_SERVICES;
pkgSetting.primaryCpuAbiString = primaryCpuAbi;
pkgSetting.secondaryCpuAbiString = secondaryCpuAbi;
if (childPkgNames != null) {
@@ -4455,6 +4458,7 @@
ApplicationInfo.PRIVATE_FLAG_STATIC_SHARED_LIBRARY, "STATIC_SHARED_LIBRARY",
ApplicationInfo.PRIVATE_FLAG_VENDOR, "VENDOR",
ApplicationInfo.PRIVATE_FLAG_PRODUCT, "PRODUCT",
+ ApplicationInfo.PRIVATE_FLAG_PRODUCT_SERVICES, "PRODUCT_SERVICES",
ApplicationInfo.PRIVATE_FLAG_VIRTUAL_PRELOAD, "VIRTUAL_PRELOAD",
};
diff --git a/services/core/java/com/android/server/pm/permission/DefaultPermissionGrantPolicy.java b/services/core/java/com/android/server/pm/permission/DefaultPermissionGrantPolicy.java
index 843cd8a..a78cb33 100644
--- a/services/core/java/com/android/server/pm/permission/DefaultPermissionGrantPolicy.java
+++ b/services/core/java/com/android/server/pm/permission/DefaultPermissionGrantPolicy.java
@@ -25,7 +25,6 @@
import android.app.DownloadManager;
import android.app.admin.DevicePolicyManager;
import android.companion.CompanionDeviceManager;
-import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ApplicationInfo;
@@ -54,7 +53,6 @@
import android.provider.MediaStore;
import android.provider.Telephony.Sms.Intents;
import android.security.Credentials;
-import android.service.textclassifier.TextClassifierService;
import android.telephony.TelephonyManager;
import android.text.TextUtils;
import android.util.ArrayMap;
@@ -1399,6 +1397,11 @@
if (dir.isDirectory() && dir.canRead()) {
Collections.addAll(ret, dir.listFiles());
}
+ dir = new File(Environment.getProductServicesDirectory(),
+ "etc/default-permissions");
+ if (dir.isDirectory() && dir.canRead()) {
+ Collections.addAll(ret, dir.listFiles());
+ }
// For IoT devices, we check the oem partition for default permissions for each app.
if (mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_EMBEDDED, 0)) {
dir = new File(Environment.getOemDirectory(), "etc/default-permissions");
diff --git a/services/core/java/com/android/server/pm/permission/PermissionManagerService.java b/services/core/java/com/android/server/pm/permission/PermissionManagerService.java
index 9dc0b29..c4f90a12 100644
--- a/services/core/java/com/android/server/pm/permission/PermissionManagerService.java
+++ b/services/core/java/com/android/server/pm/permission/PermissionManagerService.java
@@ -1097,6 +1097,10 @@
} else if (pkg.isProduct()) {
wlPermissions =
SystemConfig.getInstance().getProductPrivAppPermissions(pkg.packageName);
+ } else if (pkg.isProductServices()) {
+ wlPermissions =
+ SystemConfig.getInstance().getProductServicesPrivAppPermissions(
+ pkg.packageName);
} else {
wlPermissions = SystemConfig.getInstance().getPrivAppPermissions(pkg.packageName);
}
@@ -1129,6 +1133,9 @@
} else if (pkg.isProduct()) {
deniedPermissions = SystemConfig.getInstance()
.getProductPrivAppDenyPermissions(pkg.packageName);
+ } else if (pkg.isProductServices()) {
+ deniedPermissions = SystemConfig.getInstance()
+ .getProductServicesPrivAppDenyPermissions(pkg.packageName);
} else {
deniedPermissions = SystemConfig.getInstance()
.getPrivAppDenyPermissions(pkg.packageName);
diff --git a/services/core/java/com/android/server/statusbar/StatusBarManagerService.java b/services/core/java/com/android/server/statusbar/StatusBarManagerService.java
index f418ad4..b8c9be7 100644
--- a/services/core/java/com/android/server/statusbar/StatusBarManagerService.java
+++ b/services/core/java/com/android/server/statusbar/StatusBarManagerService.java
@@ -1053,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/RootWindowContainer.java b/services/core/java/com/android/server/wm/RootWindowContainer.java
index a6bda37..d8cbb26 100644
--- a/services/core/java/com/android/server/wm/RootWindowContainer.java
+++ b/services/core/java/com/android/server/wm/RootWindowContainer.java
@@ -16,9 +16,46 @@
package com.android.server.wm;
+import static android.view.Display.DEFAULT_DISPLAY;
+import static android.view.WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON;
+import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_KEYGUARD;
+import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_SUSTAINED_PERFORMANCE_MODE;
+import static android.view.WindowManager.LayoutParams.TYPE_DREAM;
+import static android.view.WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG;
+
+import static com.android.server.policy.WindowManagerPolicy.FINISH_LAYOUT_REDO_ANIM;
+import static com.android.server.policy.WindowManagerPolicy.FINISH_LAYOUT_REDO_LAYOUT;
+import static com.android.server.policy.WindowManagerPolicy.FINISH_LAYOUT_REDO_WALLPAPER;
+import static com.android.server.wm.RootWindowContainerProto.DISPLAYS;
+import static com.android.server.wm.RootWindowContainerProto.WINDOWS;
+import static com.android.server.wm.RootWindowContainerProto.WINDOW_CONTAINER;
+import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_DISPLAY;
+import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_KEEP_SCREEN_ON;
+import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_LAYOUT_REPEATS;
+import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_ORIENTATION;
+import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_WALLPAPER_LIGHT;
+import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_WINDOW_TRACE;
+import static com.android.server.wm.WindowManagerDebugConfig.SHOW_LIGHT_TRANSACTIONS;
+import static com.android.server.wm.WindowManagerDebugConfig.SHOW_SURFACE_ALLOC;
+import static com.android.server.wm.WindowManagerDebugConfig.SHOW_TRANSACTIONS;
+import static com.android.server.wm.WindowManagerDebugConfig.TAG_KEEP_SCREEN_ON;
+import static com.android.server.wm.WindowManagerDebugConfig.TAG_WITH_CLASS_NAME;
+import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM;
+import static com.android.server.wm.WindowManagerService.H.REPORT_LOSING_FOCUS;
+import static com.android.server.wm.WindowManagerService.H.SEND_NEW_CONFIGURATION;
+import static com.android.server.wm.WindowManagerService.H.WINDOW_FREEZE_TIMEOUT;
+import static com.android.server.wm.WindowManagerService.UPDATE_FOCUS_PLACING_SURFACES;
+import static com.android.server.wm.WindowManagerService.UPDATE_FOCUS_WILL_PLACE_SURFACES;
+import static com.android.server.wm.WindowManagerService.WINDOWS_FREEZING_SCREENS_NONE;
+import static com.android.server.wm.WindowManagerService.logSurface;
+import static com.android.server.wm.WindowSurfacePlacer.SET_FORCE_HIDING_CHANGED;
+import static com.android.server.wm.WindowSurfacePlacer.SET_ORIENTATION_CHANGE_COMPLETE;
+import static com.android.server.wm.WindowSurfacePlacer.SET_UPDATE_ROTATION;
+import static com.android.server.wm.WindowSurfacePlacer.SET_WALLPAPER_ACTION_PENDING;
+import static com.android.server.wm.WindowSurfacePlacer.SET_WALLPAPER_MAY_CHANGE;
+
import android.annotation.CallSuper;
import android.content.res.Configuration;
-import android.graphics.Rect;
import android.hardware.power.V1_0.PowerHint;
import android.os.Binder;
import android.os.Debug;
@@ -26,7 +63,6 @@
import android.os.IBinder;
import android.os.Looper;
import android.os.Message;
-import android.os.ParcelFileDescriptor;
import android.os.PowerManager;
import android.os.RemoteException;
import android.os.UserHandle;
@@ -43,51 +79,11 @@
import com.android.internal.util.ArrayUtils;
import com.android.server.EventLogTags;
-import java.io.FileDescriptor;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
import java.util.function.Consumer;
-import static android.view.Display.DEFAULT_DISPLAY;
-import static android.view.Display.INVALID_DISPLAY;
-import static android.view.WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON;
-import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_KEYGUARD;
-import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_SUSTAINED_PERFORMANCE_MODE;
-import static android.view.WindowManager.LayoutParams.TYPE_DREAM;
-import static android.view.WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG;
-
-import static com.android.server.policy.WindowManagerPolicy.FINISH_LAYOUT_REDO_ANIM;
-import static com.android.server.policy.WindowManagerPolicy.FINISH_LAYOUT_REDO_LAYOUT;
-import static com.android.server.policy.WindowManagerPolicy.FINISH_LAYOUT_REDO_WALLPAPER;
-import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_DISPLAY;
-import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_KEEP_SCREEN_ON;
-import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_LAYOUT_REPEATS;
-import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_ORIENTATION;
-import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_WALLPAPER_LIGHT;
-import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_WINDOW_TRACE;
-import static com.android.server.wm.WindowManagerDebugConfig.SHOW_LIGHT_TRANSACTIONS;
-import static com.android.server.wm.WindowManagerDebugConfig.SHOW_SURFACE_ALLOC;
-import static com.android.server.wm.WindowManagerDebugConfig.SHOW_TRANSACTIONS;
-import static com.android.server.wm.WindowManagerDebugConfig.TAG_KEEP_SCREEN_ON;
-import static com.android.server.wm.WindowManagerDebugConfig.TAG_WITH_CLASS_NAME;
-import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM;
-import static com.android.server.wm.WindowManagerService.H.REPORT_LOSING_FOCUS;
-import static com.android.server.wm.WindowManagerService.H.SEND_NEW_CONFIGURATION;
-import static com.android.server.wm.WindowManagerService.UPDATE_FOCUS_PLACING_SURFACES;
-import static com.android.server.wm.WindowManagerService.UPDATE_FOCUS_WILL_PLACE_SURFACES;
-import static com.android.server.wm.WindowManagerService.WINDOWS_FREEZING_SCREENS_NONE;
-import static com.android.server.wm.WindowManagerService.H.WINDOW_FREEZE_TIMEOUT;
-import static com.android.server.wm.WindowManagerService.logSurface;
-import static com.android.server.wm.WindowSurfacePlacer.SET_FORCE_HIDING_CHANGED;
-import static com.android.server.wm.WindowSurfacePlacer.SET_ORIENTATION_CHANGE_COMPLETE;
-import static com.android.server.wm.WindowSurfacePlacer.SET_UPDATE_ROTATION;
-import static com.android.server.wm.WindowSurfacePlacer.SET_WALLPAPER_ACTION_PENDING;
-import static com.android.server.wm.WindowSurfacePlacer.SET_WALLPAPER_MAY_CHANGE;
-import static com.android.server.wm.RootWindowContainerProto.DISPLAYS;
-import static com.android.server.wm.RootWindowContainerProto.WINDOWS;
-import static com.android.server.wm.RootWindowContainerProto.WINDOW_CONTAINER;
-
/** Root {@link WindowContainer} for the device. */
class RootWindowContainer extends WindowContainer<DisplayContent> {
private static final String TAG = TAG_WITH_CLASS_NAME ? "RootWindowContainer" : TAG_WM;
@@ -301,6 +297,18 @@
return null;
}
+ /** Returns the window token for the input binder if it exist in the system. */
+ WindowToken getWindowToken(IBinder binder) {
+ for (int i = mChildren.size() - 1; i >= 0; --i) {
+ final DisplayContent dc = mChildren.get(i);
+ final WindowToken wtoken = dc.getWindowToken(binder);
+ if (wtoken != null) {
+ return wtoken;
+ }
+ }
+ return null;
+ }
+
/** Returns the display object the input window token is currently mapped on. */
DisplayContent getWindowTokenDisplay(WindowToken token) {
if (token == null) {
diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java
index 8a57143..158d09a 100644
--- a/services/core/java/com/android/server/wm/WindowManagerService.java
+++ b/services/core/java/com/android/server/wm/WindowManagerService.java
@@ -1151,7 +1151,7 @@
throw new IllegalStateException("Display has not been initialialized");
}
- final DisplayContent displayContent = getDisplayContentOrCreate(displayId);
+ final DisplayContent displayContent = getDisplayContentOrCreate(displayId, attrs.token);
if (displayContent == null) {
Slog.w(TAG_WM, "Attempted to add window to a display that does not exist: "
@@ -1540,9 +1540,20 @@
* that corresponds to a display just added to DisplayManager has not yet been created. This
* usually means that the call of this method was initiated from outside of Activity or Window
* Manager. In most cases the regular getter should be used.
+ * @param displayId The preferred display Id.
+ * @param token The window token associated with the window we are trying to get display for.
+ * if not null then the display of the window token will be returned. Set to null
+ * is there isn't an a token associated with the request.
* @see RootWindowContainer#getDisplayContent(int)
*/
- private DisplayContent getDisplayContentOrCreate(int displayId) {
+ private DisplayContent getDisplayContentOrCreate(int displayId, IBinder token) {
+ if (token != null) {
+ final WindowToken wToken = mRoot.getWindowToken(token);
+ if (wToken != null) {
+ return wToken.getDisplayContent();
+ }
+ }
+
DisplayContent displayContent = mRoot.getDisplayContent(displayId);
// Create an instance if possible instead of waiting for the ActivityManagerService to drive
@@ -2092,12 +2103,9 @@
}
if (focusMayChange) {
- //System.out.println("Focus may change: " + win.mAttrs.getTitle());
- if (updateFocusedWindowLocked(UPDATE_FOCUS_WILL_PLACE_SURFACES,
- false /*updateInputWindows*/)) {
+ if (updateFocusedWindowLocked(UPDATE_FOCUS_NORMAL, true /*updateInputWindows*/)) {
imMayMove = false;
}
- //System.out.println("Relayout " + win + ": focus=" + mCurrentFocus);
}
// updateFocusedWindowLocked() already assigned layers so we only need to
@@ -7070,7 +7078,7 @@
final long token = Binder.clearCallingIdentity();
try {
synchronized (mWindowMap) {
- final DisplayContent dc = getDisplayContentOrCreate(displayId);
+ final DisplayContent dc = getDisplayContentOrCreate(displayId, null);
if (dc == null) {
throw new IllegalArgumentException(
"Trying to register a non existent display.");
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/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/SmsManager.java b/telephony/java/android/telephony/SmsManager.java
index 9565507..ea408bf 100644
--- a/telephony/java/android/telephony/SmsManager.java
+++ b/telephony/java/android/telephony/SmsManager.java
@@ -274,6 +274,17 @@
private static final int SMS_PICK = 2;
/**
+ * 3gpp2 SMS priority is not specified
+ * @hide
+ */
+ public static final int SMS_MESSAGE_PRIORITY_NOT_SPECIFIED = -1;
+ /**
+ * 3gpp SMS period is not specified
+ * @hide
+ */
+ public static final int SMS_MESSAGE_PERIOD_NOT_SPECIFIED = -1;
+
+ /**
* Send a text based SMS.
*
* <p class="note"><strong>Note:</strong> Using this method requires that your app has the
@@ -464,11 +475,11 @@
}
if (priority < 0x00 || priority > 0x03) {
- throw new IllegalArgumentException("Invalid priority");
+ priority = SMS_MESSAGE_PRIORITY_NOT_SPECIFIED;
}
if (validityPeriod < 0x05 || validityPeriod > 0x09b0a0) {
- throw new IllegalArgumentException("Invalid validity period");
+ validityPeriod = SMS_MESSAGE_PERIOD_NOT_SPECIFIED;
}
try {
@@ -728,7 +739,8 @@
ArrayList<PendingIntent> sentIntents, ArrayList<PendingIntent> deliveryIntents,
int priority, boolean expectMore, int validityPeriod) {
sendMultipartTextMessageInternal(destinationAddress, scAddress, parts, sentIntents,
- deliveryIntents, true /* persistMessage*/);
+ deliveryIntents, true /* persistMessage*/, priority, expectMore,
+ validityPeriod);
}
private void sendMultipartTextMessageInternal(
@@ -743,11 +755,11 @@
}
if (priority < 0x00 || priority > 0x03) {
- throw new IllegalArgumentException("Invalid priority");
+ priority = SMS_MESSAGE_PRIORITY_NOT_SPECIFIED;
}
if (validityPeriod < 0x05 || validityPeriod > 0x09b0a0) {
- throw new IllegalArgumentException("Invalid validity period");
+ validityPeriod = SMS_MESSAGE_PERIOD_NOT_SPECIFIED;
}
if (parts.size() > 1) {
diff --git a/tests/libs-permissions/Android.mk b/tests/libs-permissions/Android.mk
index eb38623..f4250c8 100644
--- a/tests/libs-permissions/Android.mk
+++ b/tests/libs-permissions/Android.mk
@@ -13,3 +13,17 @@
LOCAL_MODULE_PATH := $(TARGET_OUT_PRODUCT_ETC)/permissions
LOCAL_SRC_FILES:= product/com.android.test.libs.product.xml
include $(BUILD_PREBUILT)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := com.android.test.libs.product_services
+LOCAL_PRODUCT_SERVICES_MODULE := true
+LOCAL_SRC_FILES := $(call all-java-files-under, product_services/java)
+LOCAL_REQUIRED_MODULES := com.android.test.libs.product_services.xml
+include $(BUILD_JAVA_LIBRARY)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := com.android.test.libs.product_services.xml
+LOCAL_MODULE_CLASS := ETC
+LOCAL_MODULE_PATH := $(TARGET_OUT_PRODUCT_SERVICES_ETC)/permissions
+LOCAL_SRC_FILES:= product_services/com.android.test.libs.product_services.xml
+include $(BUILD_PREBUILT)
diff --git a/tests/libs-permissions/product_services/com.android.test.libs.product_services.xml b/tests/libs-permissions/product_services/com.android.test.libs.product_services.xml
new file mode 100644
index 0000000..082a9be
--- /dev/null
+++ b/tests/libs-permissions/product_services/com.android.test.libs.product_services.xml
@@ -0,0 +1,20 @@
+<?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.
+-->
+
+<permissions>
+ <library name="com.android.test.libs.product_services"
+ file="/product_services/framework/com.android.test.libs.product_services.jar" />
+</permissions>
diff --git a/tests/libs-permissions/product_services/java/com/android/test/libs/product_services/LibsProductServicesTest.java b/tests/libs-permissions/product_services/java/com/android/test/libs/product_services/LibsProductServicesTest.java
new file mode 100644
index 0000000..dcbdae8
--- /dev/null
+++ b/tests/libs-permissions/product_services/java/com/android/test/libs/product_services/LibsProductServicesTest.java
@@ -0,0 +1,29 @@
+/*
+ * 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.test.libs.product_services;
+
+/**
+ * Test class for product_services libs.
+ */
+public class LibsProductServicesTest {
+
+ /**
+ * Dummy method for testing.
+ */
+ public static void test() {
+ }
+}
diff --git a/tests/privapp-permissions/Android.mk b/tests/privapp-permissions/Android.mk
index 9795188..1149b8a 100644
--- a/tests/privapp-permissions/Android.mk
+++ b/tests/privapp-permissions/Android.mk
@@ -46,3 +46,19 @@
LOCAL_MODULE_PATH := $(TARGET_OUT_PRODUCT_ETC)/permissions
LOCAL_SRC_FILES:= product/privapp-permissions-test.xml
include $(BUILD_PREBUILT)
+
+include $(CLEAR_VARS)
+LOCAL_PACKAGE_NAME := ProductServicesPrivAppPermissionTest
+LOCAL_SDK_VERSION := current
+LOCAL_PRIVILEGED_MODULE := true
+LOCAL_MANIFEST_FILE := product_services/AndroidManifest.xml
+LOCAL_PRODUCT_SERVICES_MODULE := true
+LOCAL_REQUIRED_MODULES := product_servicesprivapp-permissions-test.xml
+include $(BUILD_PACKAGE)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := product_servicesprivapp-permissions-test.xml
+LOCAL_MODULE_CLASS := ETC
+LOCAL_MODULE_PATH := $(TARGET_OUT_PRODUCT_SERVICES_ETC)/permissions
+LOCAL_SRC_FILES:= product_services/privapp-permissions-test.xml
+include $(BUILD_PREBUILT)
diff --git a/tests/privapp-permissions/product_services/AndroidManifest.xml b/tests/privapp-permissions/product_services/AndroidManifest.xml
new file mode 100644
index 0000000..511ddee
--- /dev/null
+++ b/tests/privapp-permissions/product_services/AndroidManifest.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ * Copyright (C) 2018 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.framework.permission.privapp.tests.product_services">
+
+ <!-- MANAGE_USB is signature|privileged -->
+ <uses-permission android:name="android.permission.MANAGE_USB"/>
+</manifest>
diff --git a/tests/privapp-permissions/product_services/privapp-permissions-test.xml b/tests/privapp-permissions/product_services/privapp-permissions-test.xml
new file mode 100644
index 0000000..43baebb
--- /dev/null
+++ b/tests/privapp-permissions/product_services/privapp-permissions-test.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<permissions>
+ <privapp-permissions package="com.android.framework.permission.privapp.tests.product_services">
+ <permission name="android.permission.MANAGE_USB"/>
+ </privapp-permissions>
+</permissions>