diff options
215 files changed, 3240 insertions, 1908 deletions
diff --git a/Android.bp b/Android.bp index 028e8a45fd03..158644096a0d 100644 --- a/Android.bp +++ b/Android.bp @@ -801,6 +801,40 @@ java_library_host { }, } +// ==== java proto device library (for test only) ============================== +java_library { + name: "platformprotosnano", + proto: { + type: "nano", + output_params: ["store_unknown_fields=true"], + include_dirs: ["external/protobuf/src"], + }, + + sdk_version: "current", + srcs: [ + "core/proto/**/*.proto", + "libs/incident/proto/android/os/**/*.proto", + ], +} + +// ==== java proto device library (for test only) ============================== +java_library { + name: "platformprotoslite", + proto: { + type: "lite", + include_dirs: ["external/protobuf/src"], + }, + + srcs: [ + "core/proto/**/*.proto", + "libs/incident/proto/android/os/**/*.proto", + ], + // Protos have lots of MissingOverride and similar. + errorprone: { + javacflags: ["-XepDisableAllChecks"], + }, +} + // ==== c++ proto device library ============================== cc_library { name: "libplatformprotos", @@ -1022,10 +1056,6 @@ doc_defaults { ":openjdk_javadoc_files", ":non_openjdk_javadoc_files", ":android_icu4j_src_files_for_docs", - ":gen-ojluni-jaif-annotated-srcs", - ], - exclude_srcs: [ - ":annotated_ojluni_files", ], srcs_lib: "framework", srcs_lib_whitelist_dirs: frameworks_base_subdirs, @@ -1072,13 +1102,9 @@ doc_defaults { ":openjdk_javadoc_files", ":non_openjdk_javadoc_files", ":android_icu4j_src_files_for_docs", - ":gen-ojluni-jaif-annotated-srcs", "test-mock/src/**/*.java", "test-runner/src/**/*.java", ], - exclude_srcs: [ - ":annotated_ojluni_files", - ], srcs_lib: "framework", srcs_lib_whitelist_dirs: frameworks_base_subdirs, srcs_lib_whitelist_pkgs: packages_to_document, @@ -1457,10 +1483,6 @@ doc_defaults { ":openjdk_javadoc_files", ":non_openjdk_javadoc_files", ":android_icu4j_src_files_for_docs", - ":gen-ojluni-jaif-annotated-srcs", - ], - exclude_srcs: [ - ":annotated_ojluni_files", ], srcs_lib: "framework", srcs_lib_whitelist_dirs: frameworks_base_subdirs, diff --git a/Android.mk b/Android.mk index edbb94ddb22a..29454e4ae304 100644 --- a/Android.mk +++ b/Android.mk @@ -321,36 +321,6 @@ $(OUT_DOCS)/offline-sdk-timestamp: $(OUT_DOCS)/offline-sdk-docs-docs.zip $(hide) mkdir -p $(OUT_DOCS)/offline-sdk ( unzip -qo $< -d $(OUT_DOCS)/offline-sdk && touch -f $@ ) || exit 1 -# ==== java proto device library (for test only) ============================== -include $(CLEAR_VARS) -LOCAL_MODULE := platformprotosnano -LOCAL_MODULE_TAGS := tests -LOCAL_PROTOC_OPTIMIZE_TYPE := nano -LOCAL_PROTOC_FLAGS := \ - -Iexternal/protobuf/src -LOCAL_PROTO_JAVA_OUTPUT_PARAMS := \ - store_unknown_fields = true -LOCAL_SDK_VERSION := current -LOCAL_SRC_FILES := \ - $(call all-proto-files-under, core/proto) \ - $(call all-proto-files-under, libs/incident/proto/android/os) -include $(BUILD_STATIC_JAVA_LIBRARY) - - -# ==== java proto device library (for test only) ============================== -include $(CLEAR_VARS) -LOCAL_MODULE := platformprotoslite -LOCAL_MODULE_TAGS := tests -LOCAL_PROTOC_OPTIMIZE_TYPE := lite -LOCAL_PROTOC_FLAGS := \ - -Iexternal/protobuf/src -LOCAL_SRC_FILES := \ - $(call all-proto-files-under, core/proto) \ - $(call all-proto-files-under, libs/incident/proto/android/os) -# Protos have lots of MissingOverride and similar. -LOCAL_ERROR_PRONE_FLAGS := -XepDisableAllChecks -include $(BUILD_STATIC_JAVA_LIBRARY) - # ==== hiddenapi lists ======================================= include $(CLEAR_VARS) diff --git a/api/current.txt b/api/current.txt index 300ab3af79c4..fc595ac49a2c 100644 --- a/api/current.txt +++ b/api/current.txt @@ -39005,6 +39005,7 @@ package android.service.autofill { 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 @@ package android.service.autofill { 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 @@ package android.service.autofill { 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 35c6c4802439..1657de5624f3 100644 --- a/api/test-current.txt +++ b/api/test-current.txt @@ -998,6 +998,10 @@ package android.service.autofill { 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 @@ package android.service.autofill { 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 @@ package android.service.autofill { method public abstract android.view.autofill.AutofillValue findRawValueByAutofillId(android.view.autofill.AutofillId); } + public final class VisibilitySetterAction extends android.service.autofill.InternalOnClickAction implements android.service.autofill.OnClickAction android.os.Parcelable { + method public void onClick(android.view.ViewGroup); + } + } package android.service.notification { diff --git a/config/hiddenapi-light-greylist.txt b/config/hiddenapi-light-greylist.txt index c84142ae2141..3a96cd3f3eca 100644 --- a/config/hiddenapi-light-greylist.txt +++ b/config/hiddenapi-light-greylist.txt @@ -455,6 +455,59 @@ Landroid/database/IContentObserver$Stub;->asInterface(Landroid/os/IBinder;)Landr 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$Stub;->asInterface(Landroid/os/IBinder;)La Landroid/webkit/IWebViewUpdateService;->getCurrentWebViewPackageName()Ljava/lang/String; Landroid/webkit/IWebViewUpdateService;->getValidWebViewPackages()[Landroid/webkit/WebViewProviderInfo; Landroid/webkit/IWebViewUpdateService;->isFallbackPackage(Ljava/lang/String;)Z -Landroid/widget/AbsListView$FlingRunnable;->endFling()V -Landroid/widget/AbsListView$FlingRunnable;->mScroller:Landroid/widget/OverScroller; -Landroid/widget/AbsListView$FlingRunnable;->start(I)V -Landroid/widget/AbsListView$LayoutParams;->scrappedFromPosition:I -Landroid/widget/AbsListView$LayoutParams;->viewType:I -Landroid/widget/AbsListView$RecycleBin;->clear()V -Landroid/widget/AbsListView$RecycleBin;->mRecyclerListener:Landroid/widget/AbsListView$RecyclerListener; -Landroid/widget/AbsListView$SavedState;->firstId:J -Landroid/widget/AbsListView$SavedState;->viewTop:I -Landroid/widget/AbsListView;->canScrollDown()Z -Landroid/widget/AbsListView;->canScrollUp()Z -Landroid/widget/AbsListView;->findMotionRow(I)I -Landroid/widget/AbsListView;->invokeOnItemScrollListener()V -Landroid/widget/AbsListView;->isVerticalScrollBarHidden()Z -Landroid/widget/AbsListView;->mActivePointerId:I -Landroid/widget/AbsListView;->mAdapter:Landroid/widget/ListAdapter; -Landroid/widget/AbsListView;->mChoiceActionMode:Landroid/view/ActionMode; -Landroid/widget/AbsListView;->mContextMenuInfo:Landroid/view/ContextMenu$ContextMenuInfo; -Landroid/widget/AbsListView;->mDataSetObserver:Landroid/widget/AbsListView$AdapterDataSetObserver; -Landroid/widget/AbsListView;->mEdgeGlowBottom:Landroid/widget/EdgeEffect; -Landroid/widget/AbsListView;->mEdgeGlowTop:Landroid/widget/EdgeEffect; -Landroid/widget/AbsListView;->mFastScroll:Landroid/widget/FastScroller; -Landroid/widget/AbsListView;->mFlingRunnable:Landroid/widget/AbsListView$FlingRunnable; -Landroid/widget/AbsListView;->mIsChildViewEnabled:Z -Landroid/widget/AbsListView;->mLayoutMode:I -Landroid/widget/AbsListView;->mMaximumVelocity:I -Landroid/widget/AbsListView;->mMotionPosition:I -Landroid/widget/AbsListView;->mMotionY:I -Landroid/widget/AbsListView;->mOnScrollListener:Landroid/widget/AbsListView$OnScrollListener; -Landroid/widget/AbsListView;->mOverflingDistance:I -Landroid/widget/AbsListView;->mOverscrollDistance:I -Landroid/widget/AbsListView;->mPendingCheckForLongPress:Landroid/widget/AbsListView$CheckForLongPress; -Landroid/widget/AbsListView;->mPendingCheckForTap:Landroid/widget/AbsListView$CheckForTap; -Landroid/widget/AbsListView;->mPopup:Landroid/widget/PopupWindow; -Landroid/widget/AbsListView;->mPositionScroller:Landroid/widget/AbsListView$AbsPositionScroller; -Landroid/widget/AbsListView;->mRecycler:Landroid/widget/AbsListView$RecycleBin; -Landroid/widget/AbsListView;->mSelectionBottomPadding:I -Landroid/widget/AbsListView;->mSelectionTopPadding:I -Landroid/widget/AbsListView;->mSelector:Landroid/graphics/drawable/Drawable; -Landroid/widget/AbsListView;->mSelectorPosition:I -Landroid/widget/AbsListView;->mSelectorRect:Landroid/graphics/Rect; -Landroid/widget/AbsListView;->mTouchMode:I -Landroid/widget/AbsListView;->mTouchSlop:I -Landroid/widget/AbsListView;->mVelocityTracker:Landroid/view/VelocityTracker; -Landroid/widget/AbsListView;->performLongPress(Landroid/view/View;IJ)Z -Landroid/widget/AbsListView;->performLongPress(Landroid/view/View;IJFF)Z -Landroid/widget/AbsListView;->positionSelector(ILandroid/view/View;ZFF)V -Landroid/widget/AbsListView;->reportScrollStateChange(I)V -Landroid/widget/AbsListView;->resurrectSelectionIfNeeded()Z -Landroid/widget/AbsListView;->smoothScrollBy(IIZZ)V -Landroid/widget/AbsListView;->trackMotionScroll(II)Z -Landroid/widget/AbsListView;->updateSelectorState()V -Landroid/widget/AbsSeekBar;->drawThumb(Landroid/graphics/Canvas;)V -Landroid/widget/AbsSeekBar;->mDisabledAlpha:F -Landroid/widget/AbsSeekBar;->mIsDragging:Z -Landroid/widget/AbsSeekBar;->mIsUserSeekable:Z -Landroid/widget/AbsSeekBar;->mSplitTrack:Z -Landroid/widget/AbsSeekBar;->mThumb:Landroid/graphics/drawable/Drawable; -Landroid/widget/AbsSeekBar;->mTouchProgressOffset:F -Landroid/widget/AbsSeekBar;->trackTouchEvent(Landroid/view/MotionEvent;)V -Landroid/widget/ActionMenuPresenter;->dismissPopupMenus()Z -Landroid/widget/ActionMenuPresenter;->isOverflowMenuShowing()Z -Landroid/widget/ActionMenuPresenter;->onRestoreInstanceState(Landroid/os/Parcelable;)V -Landroid/widget/ActionMenuPresenter;->onSaveInstanceState()Landroid/os/Parcelable; -Landroid/widget/ActionMenuView$ActionMenuChildView;->needsDividerBefore()Z -Landroid/widget/ActionMenuView$LayoutParams;->cellsUsed:I -Landroid/widget/ActionMenuView$LayoutParams;->expandable:Z -Landroid/widget/ActionMenuView$LayoutParams;->expanded:Z -Landroid/widget/ActionMenuView$LayoutParams;->extraPixels:I -Landroid/widget/ActionMenuView$LayoutParams;->isOverflowButton:Z -Landroid/widget/ActionMenuView$LayoutParams;->preventEdgeOffset:Z -Landroid/widget/ActionMenuView;->hasDividerBeforeChildAt(I)Z -Landroid/widget/ActionMenuView;->isOverflowMenuShowPending()Z -Landroid/widget/ActionMenuView;->isOverflowReserved()Z -Landroid/widget/ActionMenuView;->peekMenu()Lcom/android/internal/view/menu/MenuBuilder; -Landroid/widget/ActionMenuView;->setExpandedActionViewsExclusive(Z)V -Landroid/widget/ActionMenuView;->setMenuCallbacks(Lcom/android/internal/view/menu/MenuPresenter$Callback;Lcom/android/internal/view/menu/MenuBuilder$Callback;)V -Landroid/widget/ActivityChooserModel;->chooseActivity(I)Landroid/content/Intent; -Landroid/widget/ActivityChooserModel;->get(Landroid/content/Context;Ljava/lang/String;)Landroid/widget/ActivityChooserModel; -Landroid/widget/ActivityChooserModel;->getActivity(I)Landroid/content/pm/ResolveInfo; -Landroid/widget/ActivityChooserModel;->getActivityCount()I -Landroid/widget/ActivityChooserModel;->setIntent(Landroid/content/Intent;)V -Landroid/widget/ActivityChooserModel;->setOnChooseActivityListener(Landroid/widget/ActivityChooserModel$OnChooseActivityListener;)V -Landroid/widget/ActivityChooserView;->setExpandActivityOverflowButtonDrawable(Landroid/graphics/drawable/Drawable;)V -Landroid/widget/AdapterView;->mDataChanged:Z -Landroid/widget/AdapterView;->mFirstPosition:I -Landroid/widget/AdapterView;->mNeedSync:Z -Landroid/widget/AdapterView;->mNextSelectedPosition:I -Landroid/widget/AdapterView;->mNextSelectedRowId:J -Landroid/widget/AdapterView;->mOldSelectedPosition:I -Landroid/widget/AdapterView;->mOnItemClickListener:Landroid/widget/AdapterView$OnItemClickListener; -Landroid/widget/AdapterView;->mOnItemSelectedListener:Landroid/widget/AdapterView$OnItemSelectedListener; -Landroid/widget/AdapterView;->mSelectedPosition:I -Landroid/widget/AdapterView;->mSyncPosition:I -Landroid/widget/AdapterView;->selectionChanged()V -Landroid/widget/AdapterView;->setNextSelectedPositionInt(I)V -Landroid/widget/AdapterView;->setSelectedPositionInt(I)V -Landroid/widget/AnalogClock;->mDial:Landroid/graphics/drawable/Drawable; -Landroid/widget/AnalogClock;->mHourHand:Landroid/graphics/drawable/Drawable; -Landroid/widget/AnalogClock;->mMinuteHand:Landroid/graphics/drawable/Drawable; -Landroid/widget/AppSecurityPermissions;-><init>(Landroid/content/Context;Ljava/lang/String;)V -Landroid/widget/AppSecurityPermissions;->getPermissionCount()I -Landroid/widget/AppSecurityPermissions;->getPermissionsView()Landroid/view/View; -Landroid/widget/ArrayAdapter;->mLock:Ljava/lang/Object; -Landroid/widget/ArrayAdapter;->mObjects:Ljava/util/List; -Landroid/widget/ArrayAdapter;->mOriginalValues:Ljava/util/ArrayList; -Landroid/widget/AutoCompleteTextView;->doAfterTextChanged()V -Landroid/widget/AutoCompleteTextView;->doBeforeTextChanged()V -Landroid/widget/AutoCompleteTextView;->ensureImeVisible(Z)V -Landroid/widget/AutoCompleteTextView;->isInputMethodNotNeeded()Z -Landroid/widget/AutoCompleteTextView;->mHintView:Landroid/widget/TextView; -Landroid/widget/AutoCompleteTextView;->mObserver:Landroid/widget/AutoCompleteTextView$PopupDataSetObserver; -Landroid/widget/AutoCompleteTextView;->mPassThroughClickListener:Landroid/widget/AutoCompleteTextView$PassThroughClickListener; -Landroid/widget/AutoCompleteTextView;->mPopup:Landroid/widget/ListPopupWindow; -Landroid/widget/AutoCompleteTextView;->setDropDownAlwaysVisible(Z)V -Landroid/widget/AutoCompleteTextView;->setDropDownAnimationStyle(I)V -Landroid/widget/AutoCompleteTextView;->setDropDownDismissedOnCompletion(Z)V -Landroid/widget/AutoCompleteTextView;->setForceIgnoreOutsideTouch(Z)V -Landroid/widget/AutoCompleteTextView;->showDropDownAfterLayout()V -Landroid/widget/BaseAdapter;->mDataSetObservable:Landroid/database/DataSetObservable; -Landroid/widget/CalendarView;->mDelegate:Landroid/widget/CalendarView$CalendarViewDelegate; -Landroid/widget/CheckedTextView;->mCheckMarkDrawable:Landroid/graphics/drawable/Drawable; -Landroid/widget/CheckedTextView;->mCheckMarkGravity:I -Landroid/widget/CompoundButton;->mBroadcasting:Z -Landroid/widget/CompoundButton;->mButtonDrawable:Landroid/graphics/drawable/Drawable; -Landroid/widget/CompoundButton;->mOnCheckedChangeListener:Landroid/widget/CompoundButton$OnCheckedChangeListener; -Landroid/widget/CursorAdapter;->mChangeObserver:Landroid/widget/CursorAdapter$ChangeObserver; -Landroid/widget/CursorAdapter;->mContext:Landroid/content/Context; -Landroid/widget/CursorAdapter;->mCursor:Landroid/database/Cursor; -Landroid/widget/CursorAdapter;->mDataSetObserver:Landroid/database/DataSetObserver; -Landroid/widget/CursorAdapter;->mDataValid:Z -Landroid/widget/CursorAdapter;->mRowIDColumn:I -Landroid/widget/DatePicker;->mDelegate:Landroid/widget/DatePicker$DatePickerDelegate; -Landroid/widget/DatePicker;->setValidationCallback(Landroid/widget/DatePicker$ValidationCallback;)V -Landroid/widget/DateTimeView;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V -Landroid/widget/DateTimeView;->setTime(J)V -Landroid/widget/DateTimeView;->update()V -Landroid/widget/EdgeEffect;->mGlowScaleY:F -Landroid/widget/EdgeEffect;->mPaint:Landroid/graphics/Paint; -Landroid/widget/Editor$InputContentType;->privateImeOptions:Ljava/lang/String; -Landroid/widget/Editor;->invalidateTextDisplayList()V -Landroid/widget/Editor;->mCreatedWithASelection:Z -Landroid/widget/Editor;->mInsertionControllerEnabled:Z -Landroid/widget/Editor;->mSelectHandleCenter:Landroid/graphics/drawable/Drawable; -Landroid/widget/Editor;->mSelectHandleLeft:Landroid/graphics/drawable/Drawable; -Landroid/widget/Editor;->mSelectHandleRight:Landroid/graphics/drawable/Drawable; -Landroid/widget/Editor;->mSelectionControllerEnabled:Z -Landroid/widget/Editor;->mShowCursor:J -Landroid/widget/Editor;->mShowSoftInputOnFocus:Z -Landroid/widget/ExpandableListView;->GROUP_STATE_SETS:[[I -Landroid/widget/ExpandableListView;->mChildDivider:Landroid/graphics/drawable/Drawable; -Landroid/widget/ExpandableListView;->mConnector:Landroid/widget/ExpandableListConnector; -Landroid/widget/ExpandableListView;->mGroupIndicator:Landroid/graphics/drawable/Drawable; -Landroid/widget/ExpandableListView;->mIndicatorLeft:I -Landroid/widget/ExpandableListView;->mIndicatorRight:I -Landroid/widget/ExpandableListView;->mOnChildClickListener:Landroid/widget/ExpandableListView$OnChildClickListener; -Landroid/widget/ExpandableListView;->mOnGroupClickListener:Landroid/widget/ExpandableListView$OnGroupClickListener; -Landroid/widget/ExpandableListView;->mOnGroupCollapseListener:Landroid/widget/ExpandableListView$OnGroupCollapseListener; -Landroid/widget/ExpandableListView;->mOnGroupExpandListener:Landroid/widget/ExpandableListView$OnGroupExpandListener; -Landroid/widget/FastScroller;-><init>(Landroid/widget/AbsListView;I)V -Landroid/widget/FastScroller;->mContainerRect:Landroid/graphics/Rect; -Landroid/widget/FastScroller;->mHeaderCount:I -Landroid/widget/FastScroller;->mLongList:Z -Landroid/widget/FastScroller;->mMinimumTouchTarget:I -Landroid/widget/FastScroller;->mThumbDrawable:Landroid/graphics/drawable/Drawable; -Landroid/widget/FastScroller;->mThumbImage:Landroid/widget/ImageView; -Landroid/widget/FastScroller;->mTrackDrawable:Landroid/graphics/drawable/Drawable; -Landroid/widget/FastScroller;->mTrackImage:Landroid/widget/ImageView; -Landroid/widget/FastScroller;->onInterceptTouchEvent(Landroid/view/MotionEvent;)Z -Landroid/widget/FastScroller;->onSizeChanged(IIII)V -Landroid/widget/FastScroller;->onTouchEvent(Landroid/view/MotionEvent;)Z -Landroid/widget/FastScroller;->remove()V -Landroid/widget/FastScroller;->setState(I)V -Landroid/widget/Filter;->setDelayer(Landroid/widget/Filter$Delayer;)V -Landroid/widget/FrameLayout;->mForegroundPaddingBottom:I -Landroid/widget/FrameLayout;->mForegroundPaddingLeft:I -Landroid/widget/FrameLayout;->mForegroundPaddingRight:I -Landroid/widget/FrameLayout;->mForegroundPaddingTop:I -Landroid/widget/FrameLayout;->mMeasureAllChildren:Z -Landroid/widget/Gallery$FlingRunnable;->startUsingVelocity(I)V -Landroid/widget/Gallery;->fillToGalleryLeft()V -Landroid/widget/Gallery;->fillToGalleryRight()V -Landroid/widget/Gallery;->getCenterOfGallery()I -Landroid/widget/Gallery;->getCenterOfView(Landroid/view/View;)I -Landroid/widget/Gallery;->makeAndAddView(IIIZ)Landroid/view/View; -Landroid/widget/Gallery;->mDownTouchPosition:I -Landroid/widget/Gallery;->mDownTouchView:Landroid/view/View; -Landroid/widget/Gallery;->mFlingRunnable:Landroid/widget/Gallery$FlingRunnable; -Landroid/widget/Gallery;->mGestureDetector:Landroid/view/GestureDetector; -Landroid/widget/Gallery;->moveDirection(I)Z -Landroid/widget/Gallery;->mSelectedChild:Landroid/view/View; -Landroid/widget/Gallery;->mSpacing:I -Landroid/widget/Gallery;->trackMotionScroll(I)V -Landroid/widget/GridLayout;->UNDEFINED_ALIGNMENT:Landroid/widget/GridLayout$Alignment; -Landroid/widget/GridView;->determineColumns(I)Z -Landroid/widget/GridView;->fillDown(II)Landroid/view/View; -Landroid/widget/GridView;->fillUp(II)Landroid/view/View; -Landroid/widget/GridView;->mColumnWidth:I -Landroid/widget/GridView;->mHorizontalSpacing:I -Landroid/widget/GridView;->mNumColumns:I -Landroid/widget/GridView;->mRequestedColumnWidth:I -Landroid/widget/GridView;->mRequestedHorizontalSpacing:I -Landroid/widget/GridView;->mRequestedNumColumns:I -Landroid/widget/GridView;->mVerticalSpacing:I -Landroid/widget/GridView;->sequenceScroll(I)Z -Landroid/widget/HeaderViewListAdapter;->mAdapter:Landroid/widget/ListAdapter; -Landroid/widget/HeaderViewListAdapter;->mFooterViewInfos:Ljava/util/ArrayList; -Landroid/widget/HeaderViewListAdapter;->mHeaderViewInfos:Ljava/util/ArrayList; -Landroid/widget/HorizontalScrollView;->mChildToScrollTo:Landroid/view/View; -Landroid/widget/HorizontalScrollView;->mEdgeGlowLeft:Landroid/widget/EdgeEffect; -Landroid/widget/HorizontalScrollView;->mEdgeGlowRight:Landroid/widget/EdgeEffect; -Landroid/widget/HorizontalScrollView;->mIsBeingDragged:Z -Landroid/widget/HorizontalScrollView;->mLastMotionX:I -Landroid/widget/HorizontalScrollView;->mOverflingDistance:I -Landroid/widget/HorizontalScrollView;->mOverscrollDistance:I -Landroid/widget/HorizontalScrollView;->mScroller:Landroid/widget/OverScroller; -Landroid/widget/HorizontalScrollView;->mVelocityTracker:Landroid/view/VelocityTracker; -Landroid/widget/HorizontalScrollView;->recycleVelocityTracker()V -Landroid/widget/ImageView;->animateTransform(Landroid/graphics/Matrix;)V -Landroid/widget/ImageView;->mAdjustViewBounds:Z -Landroid/widget/ImageView;->mAlpha:I -Landroid/widget/ImageView;->mCropToPadding:Z -Landroid/widget/ImageView;->mDrawable:Landroid/graphics/drawable/Drawable; -Landroid/widget/ImageView;->mDrawableHeight:I -Landroid/widget/ImageView;->mDrawableWidth:I -Landroid/widget/ImageView;->mDrawMatrix:Landroid/graphics/Matrix; -Landroid/widget/ImageView;->mMaxHeight:I -Landroid/widget/ImageView;->mMaxWidth:I -Landroid/widget/ImageView;->mRecycleableBitmapDrawable:Landroid/graphics/drawable/BitmapDrawable; -Landroid/widget/ImageView;->mResource:I -Landroid/widget/ImageView;->mUri:Landroid/net/Uri; -Landroid/widget/ImageView;->resizeFromDrawable()V -Landroid/widget/ImageView;->resolveUri()V -Landroid/widget/ImageView;->scaleTypeToScaleToFit(Landroid/widget/ImageView$ScaleType;)Landroid/graphics/Matrix$ScaleToFit; -Landroid/widget/ImageView;->setImageResourceAsync(I)Ljava/lang/Runnable; -Landroid/widget/ImageView;->setImageURIAsync(Landroid/net/Uri;)Ljava/lang/Runnable; -Landroid/widget/ImageView;->updateDrawable(Landroid/graphics/drawable/Drawable;)V -Landroid/widget/LinearLayout$LayoutParams;->encodeProperties(Landroid/view/ViewHierarchyEncoder;)V -Landroid/widget/LinearLayout;->INDEX_BOTTOM:I -Landroid/widget/LinearLayout;->INDEX_TOP:I -Landroid/widget/LinearLayout;->mDivider:Landroid/graphics/drawable/Drawable; -Landroid/widget/LinearLayout;->mGravity:I -Landroid/widget/LinearLayout;->mMaxAscent:[I -Landroid/widget/LinearLayout;->mMaxDescent:[I -Landroid/widget/LinearLayout;->mTotalLength:I -Landroid/widget/LinearLayout;->mUseLargestChild:Z -Landroid/widget/ListPopupWindow;->buildDropDown()I -Landroid/widget/ListPopupWindow;->isDropDownAlwaysVisible()Z -Landroid/widget/ListPopupWindow;->mDropDownList:Landroid/widget/DropDownListView; -Landroid/widget/ListPopupWindow;->mPopup:Landroid/widget/PopupWindow; -Landroid/widget/ListPopupWindow;->setDropDownAlwaysVisible(Z)V -Landroid/widget/ListPopupWindow;->setForceIgnoreOutsideTouch(Z)V -Landroid/widget/ListPopupWindow;->setListItemExpandMax(I)V -Landroid/widget/ListView;->arrowScroll(I)Z -Landroid/widget/ListView;->correctTooHigh(I)V -Landroid/widget/ListView;->correctTooLow(I)V -Landroid/widget/ListView;->fillDown(II)Landroid/view/View; -Landroid/widget/ListView;->fillSpecific(II)Landroid/view/View; -Landroid/widget/ListView;->fillUp(II)Landroid/view/View; -Landroid/widget/ListView;->getHeightForPosition(I)I -Landroid/widget/ListView;->isDirectChildHeaderOrFooter(Landroid/view/View;)Z -Landroid/widget/ListView;->makeAndAddView(IIZIZ)Landroid/view/View; -Landroid/widget/ListView;->mAreAllItemsSelectable:Z -Landroid/widget/ListView;->mDivider:Landroid/graphics/drawable/Drawable; -Landroid/widget/ListView;->mDividerHeight:I -Landroid/widget/ListView;->measureHeightOfChildren(IIIII)I -Landroid/widget/ListView;->mFooterViewInfos:Ljava/util/ArrayList; -Landroid/widget/ListView;->mHeaderViewInfos:Ljava/util/ArrayList; -Landroid/widget/ListView;->scrollListItemsBy(I)V -Landroid/widget/ListView;->setSelectionInt(I)V -Landroid/widget/ListView;->trackMotionScroll(II)Z -Landroid/widget/MediaController;->mAnchor:Landroid/view/View; -Landroid/widget/MediaController;->mContext:Landroid/content/Context; -Landroid/widget/MediaController;->mCurrentTime:Landroid/widget/TextView; -Landroid/widget/MediaController;->mDecor:Landroid/view/View; -Landroid/widget/MediaController;->mDecorLayoutParams:Landroid/view/WindowManager$LayoutParams; -Landroid/widget/MediaController;->mEndTime:Landroid/widget/TextView; -Landroid/widget/MediaController;->mFfwdButton:Landroid/widget/ImageButton; -Landroid/widget/MediaController;->mFfwdListener:Landroid/view/View$OnClickListener; -Landroid/widget/MediaController;->mNextButton:Landroid/widget/ImageButton; -Landroid/widget/MediaController;->mPauseButton:Landroid/widget/ImageButton; -Landroid/widget/MediaController;->mPlayer:Landroid/widget/MediaController$MediaPlayerControl; -Landroid/widget/MediaController;->mPrevButton:Landroid/widget/ImageButton; -Landroid/widget/MediaController;->mProgress:Landroid/widget/ProgressBar; -Landroid/widget/MediaController;->mRewButton:Landroid/widget/ImageButton; -Landroid/widget/MediaController;->mRewListener:Landroid/view/View$OnClickListener; -Landroid/widget/MediaController;->mRoot:Landroid/view/View; -Landroid/widget/MediaController;->mSeekListener:Landroid/widget/SeekBar$OnSeekBarChangeListener; -Landroid/widget/MediaController;->mShowing:Z -Landroid/widget/MediaController;->mWindow:Landroid/view/Window; -Landroid/widget/MediaController;->mWindowManager:Landroid/view/WindowManager; -Landroid/widget/MediaController;->updatePausePlay()V -Landroid/widget/NumberPicker;->changeValueByOne(Z)V -Landroid/widget/NumberPicker;->getTwoDigitFormatter()Landroid/widget/NumberPicker$Formatter; -Landroid/widget/NumberPicker;->initializeSelectorWheelIndices()V -Landroid/widget/NumberPicker;->mFlingScroller:Landroid/widget/Scroller; -Landroid/widget/NumberPicker;->mInputText:Landroid/widget/EditText; -Landroid/widget/NumberPicker;->mMaximumFlingVelocity:I -Landroid/widget/NumberPicker;->mMaxValue:I -Landroid/widget/NumberPicker;->mMinHeight:I -Landroid/widget/NumberPicker;->mMinWidth:I -Landroid/widget/NumberPicker;->mOnValueChangeListener:Landroid/widget/NumberPicker$OnValueChangeListener; -Landroid/widget/NumberPicker;->mSelectionDivider:Landroid/graphics/drawable/Drawable; -Landroid/widget/NumberPicker;->mSelectionDividerHeight:I -Landroid/widget/NumberPicker;->mSelectorIndices:[I -Landroid/widget/NumberPicker;->mSelectorWheelPaint:Landroid/graphics/Paint; -Landroid/widget/NumberPicker;->mTextSize:I -Landroid/widget/NumberPicker;->SELECTOR_MIDDLE_ITEM_INDEX:I -Landroid/widget/NumberPicker;->SELECTOR_WHEEL_ITEM_COUNT:I -Landroid/widget/OverScroller$SplineOverScroller;->mCurrVelocity:F -Landroid/widget/OverScroller;-><init>(Landroid/content/Context;Landroid/view/animation/Interpolator;Z)V -Landroid/widget/OverScroller;->extendDuration(I)V -Landroid/widget/OverScroller;->isScrollingInDirection(FF)Z -Landroid/widget/OverScroller;->mInterpolator:Landroid/view/animation/Interpolator; -Landroid/widget/OverScroller;->mScrollerY:Landroid/widget/OverScroller$SplineOverScroller; -Landroid/widget/OverScroller;->setInterpolator(Landroid/view/animation/Interpolator;)V -Landroid/widget/PopupMenu;->mContext:Landroid/content/Context; -Landroid/widget/PopupMenu;->mPopup:Lcom/android/internal/view/menu/MenuPopupHelper; -Landroid/widget/PopupWindow;->computeAnimationResource()I -Landroid/widget/PopupWindow;->createPopupLayoutParams(Landroid/os/IBinder;)Landroid/view/WindowManager$LayoutParams; -Landroid/widget/PopupWindow;->invokePopup(Landroid/view/WindowManager$LayoutParams;)V -Landroid/widget/PopupWindow;->mAboveAnchor:Z -Landroid/widget/PopupWindow;->mAboveAnchorBackgroundDrawable:Landroid/graphics/drawable/Drawable; -Landroid/widget/PopupWindow;->mAnchor:Ljava/lang/ref/WeakReference; -Landroid/widget/PopupWindow;->mAnimationStyle:I -Landroid/widget/PopupWindow;->mBackgroundView:Landroid/view/View; -Landroid/widget/PopupWindow;->mBelowAnchorBackgroundDrawable:Landroid/graphics/drawable/Drawable; -Landroid/widget/PopupWindow;->mContentView:Landroid/view/View; -Landroid/widget/PopupWindow;->mContext:Landroid/content/Context; -Landroid/widget/PopupWindow;->mDecorView:Landroid/widget/PopupWindow$PopupDecorView; -Landroid/widget/PopupWindow;->mHeightMode:I -Landroid/widget/PopupWindow;->mIsDropdown:Z -Landroid/widget/PopupWindow;->mIsShowing:Z -Landroid/widget/PopupWindow;->mLastHeight:I -Landroid/widget/PopupWindow;->mLastWidth:I -Landroid/widget/PopupWindow;->mLayoutInScreen:Z -Landroid/widget/PopupWindow;->mNotTouchModal:Z -Landroid/widget/PopupWindow;->mOnDismissListener:Landroid/widget/PopupWindow$OnDismissListener; -Landroid/widget/PopupWindow;->mOnScrollChangedListener:Landroid/view/ViewTreeObserver$OnScrollChangedListener; -Landroid/widget/PopupWindow;->mOverlapAnchor:Z -Landroid/widget/PopupWindow;->mTouchInterceptor:Landroid/view/View$OnTouchListener; -Landroid/widget/PopupWindow;->mWidthMode:I -Landroid/widget/PopupWindow;->mWindowLayoutType:I -Landroid/widget/PopupWindow;->mWindowManager:Landroid/view/WindowManager; -Landroid/widget/PopupWindow;->preparePopup(Landroid/view/WindowManager$LayoutParams;)V -Landroid/widget/PopupWindow;->setAllowScrollingAnchorParent(Z)V -Landroid/widget/PopupWindow;->setClipToScreenEnabled(Z)V -Landroid/widget/PopupWindow;->setEpicenterBounds(Landroid/graphics/Rect;)V -Landroid/widget/PopupWindow;->setLayoutInScreenEnabled(Z)V -Landroid/widget/PopupWindow;->setLayoutInsetDecor(Z)V -Landroid/widget/PopupWindow;->setTouchModal(Z)V -Landroid/widget/PopupWindow;->showAtLocation(Landroid/os/IBinder;III)V -Landroid/widget/PopupWindow;->updateAboveAnchor(Z)V -Landroid/widget/ProgressBar;->mCurrentDrawable:Landroid/graphics/drawable/Drawable; -Landroid/widget/ProgressBar;->mDuration:I -Landroid/widget/ProgressBar;->mIndeterminate:Z -Landroid/widget/ProgressBar;->mMaxHeight:I -Landroid/widget/ProgressBar;->mMinHeight:I -Landroid/widget/ProgressBar;->mMinWidth:I -Landroid/widget/ProgressBar;->mMirrorForRtl:Z -Landroid/widget/ProgressBar;->mOnlyIndeterminate:Z -Landroid/widget/ProgressBar;->refreshProgress(IIZZ)V -Landroid/widget/ProgressBar;->setProgressInternal(IZZ)Z -Landroid/widget/ProgressBar;->startAnimation()V -Landroid/widget/ProgressBar;->stopAnimation()V -Landroid/widget/ProgressBar;->tileify(Landroid/graphics/drawable/Drawable;Z)Landroid/graphics/drawable/Drawable; -Landroid/widget/QuickContactBadge;->mOverlay:Landroid/graphics/drawable/Drawable; -Landroid/widget/RadioGroup;->mChildOnCheckedChangeListener:Landroid/widget/CompoundButton$OnCheckedChangeListener; -Landroid/widget/RadioGroup;->mOnCheckedChangeListener:Landroid/widget/RadioGroup$OnCheckedChangeListener; -Landroid/widget/RatingBar;->mOnRatingBarChangeListener:Landroid/widget/RatingBar$OnRatingBarChangeListener; Landroid/widget/RelativeLayout$DependencyGraph$Node;-><init>()V -Landroid/widget/RelativeLayout$LayoutParams;->mBottom:I -Landroid/widget/RelativeLayout$LayoutParams;->mLeft:I -Landroid/widget/RelativeLayout$LayoutParams;->mRight:I -Landroid/widget/RelativeLayout$LayoutParams;->mTop:I -Landroid/widget/RelativeLayout;->mGravity:I -Landroid/widget/RemoteViews$Action;->mergeBehavior()I -Landroid/widget/RemoteViews$Action;->viewId:I -Landroid/widget/RemoteViews$BitmapCache;->mBitmaps:Ljava/util/ArrayList; -Landroid/widget/RemoteViews$BitmapReflectionAction;->bitmap:Landroid/graphics/Bitmap; -Landroid/widget/RemoteViews$BitmapReflectionAction;->methodName:Ljava/lang/String; Landroid/widget/RemoteViews$OnClickHandler;-><init>()V -Landroid/widget/RemoteViews$OnClickHandler;->onClickHandler(Landroid/view/View;Landroid/app/PendingIntent;Landroid/content/Intent;)Z -Landroid/widget/RemoteViews$ReflectionAction;->methodName:Ljava/lang/String; -Landroid/widget/RemoteViews$ReflectionAction;->value:Ljava/lang/Object; -Landroid/widget/RemoteViews$SetOnClickPendingIntent;->pendingIntent:Landroid/app/PendingIntent; -Landroid/widget/RemoteViews$SetPendingIntentTemplate;->pendingIntentTemplate:Landroid/app/PendingIntent; -Landroid/widget/RemoteViews$ViewGroupActionAdd;->mNestedViews:Landroid/widget/RemoteViews; -Landroid/widget/RemoteViews;->addView(ILandroid/widget/RemoteViews;I)V -Landroid/widget/RemoteViews;->estimateMemoryUsage()I -Landroid/widget/RemoteViews;->mActions:Ljava/util/ArrayList; -Landroid/widget/RemoteViews;->mApplication:Landroid/content/pm/ApplicationInfo; -Landroid/widget/RemoteViews;->mBitmapCache:Landroid/widget/RemoteViews$BitmapCache; -Landroid/widget/RemoteViews;->mergeRemoteViews(Landroid/widget/RemoteViews;)V -Landroid/widget/RemoteViews;->mLayoutId:I -Landroid/widget/RemoteViews;->mPortrait:Landroid/widget/RemoteViews; -Landroid/widget/RemoteViews;->setIsWidgetCollectionChild(Z)V -Landroid/widget/RemoteViews;->setRemoteAdapter(ILjava/util/ArrayList;I)V -Landroid/widget/RemoteViewsAdapter;->getRemoteViewsServiceIntent()Landroid/content/Intent; -Landroid/widget/RemoteViewsAdapter;->isDataReady()Z -Landroid/widget/RemoteViewsAdapter;->mCache:Landroid/widget/RemoteViewsAdapter$FixedSizeRemoteViewsCache; -Landroid/widget/RemoteViewsAdapter;->mWorkerThread:Landroid/os/HandlerThread; -Landroid/widget/RemoteViewsAdapter;->saveRemoteViewsCache()V -Landroid/widget/RemoteViewsAdapter;->setRemoteViewsOnClickHandler(Landroid/widget/RemoteViews$OnClickHandler;)V -Landroid/widget/RemoteViewsAdapter;->setVisibleRangeHint(II)V Landroid/widget/ScrollBarDrawable;-><init>()V -Landroid/widget/ScrollBarDrawable;->mVerticalThumb:Landroid/graphics/drawable/Drawable; -Landroid/widget/ScrollBarDrawable;->setHorizontalThumbDrawable(Landroid/graphics/drawable/Drawable;)V -Landroid/widget/ScrollBarDrawable;->setVerticalThumbDrawable(Landroid/graphics/drawable/Drawable;)V -Landroid/widget/Scroller;->DECELERATION_RATE:F -Landroid/widget/Scroller;->INFLEXION:F -Landroid/widget/Scroller;->mDeceleration:F -Landroid/widget/Scroller;->mDuration:I -Landroid/widget/Scroller;->mInterpolator:Landroid/view/animation/Interpolator; -Landroid/widget/Scroller;->mPhysicalCoeff:F -Landroid/widget/ScrollView;->canScroll()Z -Landroid/widget/ScrollView;->endDrag()V -Landroid/widget/ScrollView;->mChildToScrollTo:Landroid/view/View; -Landroid/widget/ScrollView;->mEdgeGlowBottom:Landroid/widget/EdgeEffect; -Landroid/widget/ScrollView;->mEdgeGlowTop:Landroid/widget/EdgeEffect; -Landroid/widget/ScrollView;->mFlingStrictSpan:Landroid/os/StrictMode$Span; -Landroid/widget/ScrollView;->mIsBeingDragged:Z -Landroid/widget/ScrollView;->mLastMotionY:I -Landroid/widget/ScrollView;->mLastScroll:J -Landroid/widget/ScrollView;->mMinimumVelocity:I -Landroid/widget/ScrollView;->mOverflingDistance:I -Landroid/widget/ScrollView;->mOverscrollDistance:I -Landroid/widget/ScrollView;->mScroller:Landroid/widget/OverScroller; -Landroid/widget/ScrollView;->mVelocityTracker:Landroid/view/VelocityTracker; -Landroid/widget/SearchView$SearchAutoComplete;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V -Landroid/widget/SearchView;->mClearingFocus:Z -Landroid/widget/SearchView;->mCloseButton:Landroid/widget/ImageView; -Landroid/widget/SearchView;->mCollapsedImeOptions:I -Landroid/widget/SearchView;->mExpandedInActionView:Z -Landroid/widget/SearchView;->mIconified:Z -Landroid/widget/SearchView;->mIconifiedByDefault:Z -Landroid/widget/SearchView;->mOnClickListener:Landroid/view/View$OnClickListener; -Landroid/widget/SearchView;->mOnItemClickListener:Landroid/widget/AdapterView$OnItemClickListener; -Landroid/widget/SearchView;->mOnQueryChangeListener:Landroid/widget/SearchView$OnQueryTextListener; -Landroid/widget/SearchView;->mSearchButton:Landroid/widget/ImageView; -Landroid/widget/SearchView;->mSearchEditFrame:Landroid/view/View; -Landroid/widget/SearchView;->mSearchHintIcon:Landroid/graphics/drawable/Drawable; -Landroid/widget/SearchView;->mSearchPlate:Landroid/view/View; -Landroid/widget/SearchView;->mSearchSrcTextView:Landroid/widget/SearchView$SearchAutoComplete; -Landroid/widget/SearchView;->mSubmitArea:Landroid/view/View; -Landroid/widget/SearchView;->mSuggestionsAdapter:Landroid/widget/CursorAdapter; -Landroid/widget/SearchView;->mUserQuery:Ljava/lang/CharSequence; -Landroid/widget/SearchView;->mVoiceButton:Landroid/widget/ImageView; -Landroid/widget/SearchView;->mVoiceButtonEnabled:Z -Landroid/widget/SearchView;->onCloseClicked()V -Landroid/widget/SearchView;->setQuery(Ljava/lang/CharSequence;)V -Landroid/widget/SearchView;->updateSubmitArea()V -Landroid/widget/SearchView;->updateSubmitButton(Z)V -Landroid/widget/SearchView;->updateViewsVisibility(Z)V -Landroid/widget/SeekBar;->mOnSeekBarChangeListener:Landroid/widget/SeekBar$OnSeekBarChangeListener; -Landroid/widget/SeekBar;->onProgressRefresh(FZI)V -Landroid/widget/SimpleAdapter;->mData:Ljava/util/List; -Landroid/widget/SimpleCursorAdapter;->mFrom:[I -Landroid/widget/SimpleCursorAdapter;->mTo:[I -Landroid/widget/SlidingDrawer;->mTopOffset:I -Landroid/widget/SlidingDrawer;->mTouchDelta:I -Landroid/widget/SlidingDrawer;->mTracking:Z -Landroid/widget/SlidingDrawer;->mVelocityTracker:Landroid/view/VelocityTracker; -Landroid/widget/SlidingDrawer;->prepareContent()V -Landroid/widget/SlidingDrawer;->prepareTracking(I)V -Landroid/widget/Spinner$DialogPopup;->isShowing()Z -Landroid/widget/Spinner$SpinnerPopup;->isShowing()Z -Landroid/widget/Spinner;->mForwardingListener:Landroid/widget/ForwardingListener; -Landroid/widget/Spinner;->mPopup:Landroid/widget/Spinner$SpinnerPopup; -Landroid/widget/Spinner;->setOnItemClickListenerInt(Landroid/widget/AdapterView$OnItemClickListener;)V -Landroid/widget/Switch;->cancelPositionAnimator()V -Landroid/widget/Switch;->mOffLayout:Landroid/text/Layout; -Landroid/widget/Switch;->mOnLayout:Landroid/text/Layout; -Landroid/widget/Switch;->mSwitchHeight:I -Landroid/widget/Switch;->mSwitchMinWidth:I -Landroid/widget/Switch;->mSwitchWidth:I -Landroid/widget/Switch;->mThumbDrawable:Landroid/graphics/drawable/Drawable; -Landroid/widget/Switch;->mThumbWidth:I -Landroid/widget/Switch;->mTrackDrawable:Landroid/graphics/drawable/Drawable; -Landroid/widget/Switch;->setThumbPosition(F)V -Landroid/widget/TabHost$IntentContentStrategy;->getContentView()Landroid/view/View; -Landroid/widget/TabHost$IntentContentStrategy;->tabClosed()V -Landroid/widget/TabHost$TabSpec;->mContentStrategy:Landroid/widget/TabHost$ContentStrategy; -Landroid/widget/TabHost$TabSpec;->mIndicatorStrategy:Landroid/widget/TabHost$IndicatorStrategy; -Landroid/widget/TabHost;->mCurrentTab:I -Landroid/widget/TabHost;->mOnTabChangeListener:Landroid/widget/TabHost$OnTabChangeListener; -Landroid/widget/TabHost;->mTabSpecs:Ljava/util/List; -Landroid/widget/TabWidget;->mDrawBottomStrips:Z -Landroid/widget/TabWidget;->mSelectedTab:I -Landroid/widget/TabWidget;->setTabSelectionListener(Landroid/widget/TabWidget$OnTabSelectionChanged;)V -Landroid/widget/TextClock;->getFormat()Ljava/lang/CharSequence; -Landroid/widget/TextClock;->onTimeChanged()V -Landroid/widget/TextView$SavedState;->text:Ljava/lang/CharSequence; -Landroid/widget/TextView;->assumeLayout()V -Landroid/widget/TextView;->bringTextIntoView()Z -Landroid/widget/TextView;->canPaste()Z -Landroid/widget/TextView;->checkForRelayout()V -Landroid/widget/TextView;->compressText(F)Z -Landroid/widget/TextView;->createEditorIfNeeded()V -Landroid/widget/TextView;->deleteText_internal(II)V -Landroid/widget/TextView;->getHintLayout()Landroid/text/Layout; -Landroid/widget/TextView;->getHorizontallyScrolling()Z -Landroid/widget/TextView;->getIterableTextForAccessibility()Ljava/lang/CharSequence; -Landroid/widget/TextView;->getLayoutAlignment()Landroid/text/Layout$Alignment; -Landroid/widget/TextView;->getLineAtCoordinate(F)I -Landroid/widget/TextView;->getTextDirectionHeuristic()Landroid/text/TextDirectionHeuristic; -Landroid/widget/TextView;->getTextForAccessibility()Ljava/lang/CharSequence; -Landroid/widget/TextView;->getTextServicesLocale(Z)Ljava/util/Locale; -Landroid/widget/TextView;->getTransformedText(II)Ljava/lang/CharSequence; -Landroid/widget/TextView;->getUpdatedHighlightPath()Landroid/graphics/Path; -Landroid/widget/TextView;->getVerticalOffset(Z)I -Landroid/widget/TextView;->isSingleLine()Z -Landroid/widget/TextView;->isTextEditable()Z -Landroid/widget/TextView;->LINES:I -Landroid/widget/TextView;->makeNewLayout(IILandroid/text/BoringLayout$Metrics;Landroid/text/BoringLayout$Metrics;IZ)V -Landroid/widget/TextView;->mAllowTransformationLengthChange:Z -Landroid/widget/TextView;->mBoring:Landroid/text/BoringLayout$Metrics; -Landroid/widget/TextView;->mBufferType:Landroid/widget/TextView$BufferType; -Landroid/widget/TextView;->mChangeWatcher:Landroid/widget/TextView$ChangeWatcher; -Landroid/widget/TextView;->mCharWrapper:Landroid/widget/TextView$CharWrapper; -Landroid/widget/TextView;->mCurHintTextColor:I -Landroid/widget/TextView;->mCursorDrawableRes:I -Landroid/widget/TextView;->mCurTextColor:I -Landroid/widget/TextView;->mDesiredHeightAtMeasure:I -Landroid/widget/TextView;->mDrawables:Landroid/widget/TextView$Drawables; -Landroid/widget/TextView;->mEditableFactory:Landroid/text/Editable$Factory; -Landroid/widget/TextView;->mEditor:Landroid/widget/Editor; -Landroid/widget/TextView;->mGravity:I -Landroid/widget/TextView;->mHighlightColor:I -Landroid/widget/TextView;->mHighlightPaint:Landroid/graphics/Paint; -Landroid/widget/TextView;->mHighlightPathBogus:Z -Landroid/widget/TextView;->mHintBoring:Landroid/text/BoringLayout$Metrics; -Landroid/widget/TextView;->mHintLayout:Landroid/text/Layout; -Landroid/widget/TextView;->mHorizontallyScrolling:Z -Landroid/widget/TextView;->mIncludePad:Z -Landroid/widget/TextView;->mLayout:Landroid/text/Layout; -Landroid/widget/TextView;->mListeners:Ljava/util/ArrayList; -Landroid/widget/TextView;->mMarquee:Landroid/widget/TextView$Marquee; -Landroid/widget/TextView;->mMarqueeFadeMode:I -Landroid/widget/TextView;->mMaximum:I -Landroid/widget/TextView;->mMaxMode:I -Landroid/widget/TextView;->mMaxWidth:I -Landroid/widget/TextView;->mMaxWidthMode:I -Landroid/widget/TextView;->mMinimum:I -Landroid/widget/TextView;->mMinMode:I -Landroid/widget/TextView;->mMinWidth:I -Landroid/widget/TextView;->mMinWidthMode:I -Landroid/widget/TextView;->mOldMaximum:I -Landroid/widget/TextView;->mOldMaxMode:I -Landroid/widget/TextView;->mRestartMarquee:Z -Landroid/widget/TextView;->mSavedHintLayout:Landroid/text/BoringLayout; -Landroid/widget/TextView;->mSavedLayout:Landroid/text/BoringLayout; -Landroid/widget/TextView;->mSavedMarqueeModeLayout:Landroid/text/Layout; -Landroid/widget/TextView;->mShadowDx:F -Landroid/widget/TextView;->mShadowDy:F -Landroid/widget/TextView;->mShadowRadius:F -Landroid/widget/TextView;->mSingleLine:Z -Landroid/widget/TextView;->mSpacingAdd:F -Landroid/widget/TextView;->mSpacingMult:F -Landroid/widget/TextView;->mSpannableFactory:Landroid/text/Spannable$Factory; -Landroid/widget/TextView;->mText:Ljava/lang/CharSequence; -Landroid/widget/TextView;->mTextDir:Landroid/text/TextDirectionHeuristic; -Landroid/widget/TextView;->mTextPaint:Landroid/text/TextPaint; -Landroid/widget/TextView;->mTextSelectHandleLeftRes:I -Landroid/widget/TextView;->mTextSelectHandleRes:I -Landroid/widget/TextView;->mTextSelectHandleRightRes:I -Landroid/widget/TextView;->mTransformed:Ljava/lang/CharSequence; -Landroid/widget/TextView;->mUserSetTextScaleX:Z -Landroid/widget/TextView;->nullLayouts()V -Landroid/widget/TextView;->setInputType(IZ)V -Landroid/widget/TextView;->setRawTextSize(FZ)V -Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;Landroid/widget/TextView$BufferType;ZI)V -Landroid/widget/TextView;->startMarquee()V -Landroid/widget/TextView;->startStopMarquee(Z)V -Landroid/widget/TextView;->stopTextActionMode()V -Landroid/widget/TextView;->updateTextServicesLocaleLocked()V -Landroid/widget/TextView;->viewportToContentVerticalOffset()I -Landroid/widget/TimePicker;->mDelegate:Landroid/widget/TimePicker$TimePickerDelegate; -Landroid/widget/Toast$TN;->handleHide()V -Landroid/widget/Toast$TN;->mGravity:I -Landroid/widget/Toast$TN;->mNextView:Landroid/view/View; -Landroid/widget/Toast$TN;->mParams:Landroid/view/WindowManager$LayoutParams; -Landroid/widget/Toast$TN;->mView:Landroid/view/View; -Landroid/widget/Toast$TN;->mY:I -Landroid/widget/Toast$TN;->show(Landroid/os/IBinder;)V -Landroid/widget/Toast;->getService()Landroid/app/INotificationManager; -Landroid/widget/Toast;->getWindowParams()Landroid/view/WindowManager$LayoutParams; -Landroid/widget/Toast;->mDuration:I -Landroid/widget/Toast;->mTN:Landroid/widget/Toast$TN; -Landroid/widget/Toast;->sService:Landroid/app/INotificationManager; -Landroid/widget/Toolbar;->mNavButtonView:Landroid/widget/ImageButton; -Landroid/widget/Toolbar;->mTitleMarginBottom:I -Landroid/widget/Toolbar;->mTitleMarginEnd:I -Landroid/widget/Toolbar;->mTitleMarginStart:I -Landroid/widget/Toolbar;->mTitleMarginTop:I -Landroid/widget/Toolbar;->mTitleTextView:Landroid/widget/TextView; -Landroid/widget/VideoView2$OnViewTypeChangedListener;->onViewTypeChanged(Landroid/view/View;I)V -Landroid/widget/VideoView2;->getMediaController()Landroid/media/session/MediaController; -Landroid/widget/VideoView2;->setOnViewTypeChangedListener(Landroid/widget/VideoView2$OnViewTypeChangedListener;)V -Landroid/widget/VideoView2;->setVideoPath(Ljava/lang/String;)V -Landroid/widget/VideoView;->mCurrentBufferPercentage:I -Landroid/widget/VideoView;->mCurrentState:I -Landroid/widget/VideoView;->mErrorListener:Landroid/media/MediaPlayer$OnErrorListener; -Landroid/widget/VideoView;->mHeaders:Ljava/util/Map; -Landroid/widget/VideoView;->mMediaController:Landroid/widget/MediaController; -Landroid/widget/VideoView;->mMediaPlayer:Landroid/media/MediaPlayer; -Landroid/widget/VideoView;->mPreparedListener:Landroid/media/MediaPlayer$OnPreparedListener; -Landroid/widget/VideoView;->mSHCallback:Landroid/view/SurfaceHolder$Callback; -Landroid/widget/VideoView;->mSurfaceHolder:Landroid/view/SurfaceHolder; -Landroid/widget/VideoView;->mTargetState:I -Landroid/widget/VideoView;->mUri:Landroid/net/Uri; -Landroid/widget/VideoView;->mVideoHeight:I -Landroid/widget/VideoView;->mVideoWidth:I -Landroid/widget/VideoView;->release(Z)V -Landroid/widget/VideoView;->STATE_IDLE:I -Landroid/widget/ViewAnimator;->mFirstTime:Z -Landroid/widget/ViewAnimator;->mWhichChild:I -Landroid/widget/ViewAnimator;->showOnly(IZ)V -Landroid/widget/ViewFlipper;->mUserPresent:Z -Landroid/widget/ViewFlipper;->updateRunning(Z)V -Landroid/widget/ZoomControls;->mZoomIn:Landroid/widget/ZoomButton; -Landroid/widget/ZoomControls;->mZoomOut:Landroid/widget/ZoomButton; Lcom/android/ims/ImsConfigListener$Stub;-><init>()V Lcom/android/ims/internal/IImsCallSession$Stub;-><init>()V Lcom/android/ims/internal/IImsCallSession$Stub;->asInterface(Landroid/os/IBinder;)Lcom/android/ims/internal/IImsCallSession; @@ -2311,48 +1745,6 @@ Lcom/android/ims/internal/IImsVideoCallCallback;->receiveSessionModifyResponse(I Lcom/android/ims/internal/IImsVideoCallProvider$Stub;-><init>()V Lcom/android/ims/internal/IImsVideoCallProvider;->setCallback(Lcom/android/ims/internal/IImsVideoCallCallback;)V Lcom/android/ims/internal/uce/uceservice/IUceListener$Stub;-><init>()V -Lcom/android/internal/app/AlertController$AlertParams;-><init>(Landroid/content/Context;)V -Lcom/android/internal/app/AlertController$AlertParams;->apply(Lcom/android/internal/app/AlertController;)V -Lcom/android/internal/app/AlertController$AlertParams;->mAdapter:Landroid/widget/ListAdapter; -Lcom/android/internal/app/AlertController$AlertParams;->mCancelable:Z -Lcom/android/internal/app/AlertController$AlertParams;->mCheckedItem:I -Lcom/android/internal/app/AlertController$AlertParams;->mCheckedItems:[Z -Lcom/android/internal/app/AlertController$AlertParams;->mContext:Landroid/content/Context; -Lcom/android/internal/app/AlertController$AlertParams;->mCursor:Landroid/database/Cursor; -Lcom/android/internal/app/AlertController$AlertParams;->mCustomTitleView:Landroid/view/View; -Lcom/android/internal/app/AlertController$AlertParams;->mIcon:Landroid/graphics/drawable/Drawable; -Lcom/android/internal/app/AlertController$AlertParams;->mInflater:Landroid/view/LayoutInflater; -Lcom/android/internal/app/AlertController$AlertParams;->mIsCheckedColumn:Ljava/lang/String; -Lcom/android/internal/app/AlertController$AlertParams;->mIsMultiChoice:Z -Lcom/android/internal/app/AlertController$AlertParams;->mIsSingleChoice:Z -Lcom/android/internal/app/AlertController$AlertParams;->mItems:[Ljava/lang/CharSequence; -Lcom/android/internal/app/AlertController$AlertParams;->mLabelColumn:Ljava/lang/String; -Lcom/android/internal/app/AlertController$AlertParams;->mNeutralButtonListener:Landroid/content/DialogInterface$OnClickListener; -Lcom/android/internal/app/AlertController$AlertParams;->mNeutralButtonText:Ljava/lang/CharSequence; -Lcom/android/internal/app/AlertController$AlertParams;->mOnCancelListener:Landroid/content/DialogInterface$OnCancelListener; -Lcom/android/internal/app/AlertController$AlertParams;->mOnCheckboxClickListener:Landroid/content/DialogInterface$OnMultiChoiceClickListener; -Lcom/android/internal/app/AlertController$AlertParams;->mOnClickListener:Landroid/content/DialogInterface$OnClickListener; -Lcom/android/internal/app/AlertController$AlertParams;->mOnDismissListener:Landroid/content/DialogInterface$OnDismissListener; -Lcom/android/internal/app/AlertController$AlertParams;->mOnItemSelectedListener:Landroid/widget/AdapterView$OnItemSelectedListener; -Lcom/android/internal/app/AlertController$AlertParams;->mOnKeyListener:Landroid/content/DialogInterface$OnKeyListener; -Lcom/android/internal/app/AlertController$RecycleListView;-><init>(Landroid/content/Context;)V -Lcom/android/internal/app/AlertController$RecycleListView;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V -Lcom/android/internal/app/AlertController;-><init>(Landroid/content/Context;Landroid/content/DialogInterface;Landroid/view/Window;)V -Lcom/android/internal/app/AlertController;->getListView()Landroid/widget/ListView; -Lcom/android/internal/app/AlertController;->installContent()V -Lcom/android/internal/app/AlertController;->mCustomTitleView:Landroid/view/View; -Lcom/android/internal/app/AlertController;->mForceInverseBackground:Z -Lcom/android/internal/app/AlertController;->mTitle:Ljava/lang/CharSequence; -Lcom/android/internal/app/AlertController;->mView:Landroid/view/View; -Lcom/android/internal/app/AlertController;->onKeyDown(ILandroid/view/KeyEvent;)Z -Lcom/android/internal/app/AlertController;->onKeyUp(ILandroid/view/KeyEvent;)Z -Lcom/android/internal/app/AlertController;->setButton(ILjava/lang/CharSequence;Landroid/content/DialogInterface$OnClickListener;Landroid/os/Message;)V -Lcom/android/internal/app/AlertController;->setCustomTitle(Landroid/view/View;)V -Lcom/android/internal/app/AlertController;->setIcon(I)V -Lcom/android/internal/app/AlertController;->setIcon(Landroid/graphics/drawable/Drawable;)V -Lcom/android/internal/app/AlertController;->setMessage(Ljava/lang/CharSequence;)V -Lcom/android/internal/app/AlertController;->setTitle(Ljava/lang/CharSequence;)V -Lcom/android/internal/app/AlertController;->setView(Landroid/view/View;)V Lcom/android/internal/app/IAppOpsCallback$Stub;-><init>()V Lcom/android/internal/app/IAppOpsService$Stub$Proxy;-><init>(Landroid/os/IBinder;)V Lcom/android/internal/app/IAppOpsService$Stub$Proxy;->checkOperation(IILjava/lang/String;)I @@ -2423,181 +1815,13 @@ Lcom/android/internal/backup/IBackupTransport;->initializeDevice()I Lcom/android/internal/backup/IBackupTransport;->requestBackupTime()J Lcom/android/internal/backup/IBackupTransport;->startRestore(J[Landroid/content/pm/PackageInfo;)I Lcom/android/internal/backup/IBackupTransport;->transportDirName()Ljava/lang/String; -Lcom/android/internal/content/PackageMonitor;->isPackageDisappearing(Ljava/lang/String;)I -Lcom/android/internal/content/PackageMonitor;->isPackageModified(Ljava/lang/String;)Z -Lcom/android/internal/content/PackageMonitor;->onPackageChanged(Ljava/lang/String;I[Ljava/lang/String;)Z -Lcom/android/internal/content/PackageMonitor;->onPackageRemoved(Ljava/lang/String;I)V -Lcom/android/internal/content/PackageMonitor;->register(Landroid/content/Context;Landroid/os/Looper;Z)V -Lcom/android/internal/content/ReferrerIntent;-><init>(Landroid/content/Intent;Ljava/lang/String;)V -Lcom/android/internal/content/ReferrerIntent;->mReferrer:Ljava/lang/String; Lcom/android/internal/location/ILocationProvider$Stub;-><init>()V Lcom/android/internal/logging/MetricsLogger;-><init>()V -Lcom/android/internal/logging/MetricsLogger;->write(Landroid/metrics/LogMaker;)V Lcom/android/internal/net/LegacyVpnInfo;-><init>()V -Lcom/android/internal/net/LegacyVpnInfo;->CREATOR:Landroid/os/Parcelable$Creator; -Lcom/android/internal/net/LegacyVpnInfo;->key:Ljava/lang/String; -Lcom/android/internal/net/LegacyVpnInfo;->state:I Lcom/android/internal/net/VpnConfig;-><init>()V -Lcom/android/internal/net/VpnProfile;-><init>(Landroid/os/Parcel;)V -Lcom/android/internal/net/VpnProfile;->decode(Ljava/lang/String;[B)Lcom/android/internal/net/VpnProfile; -Lcom/android/internal/net/VpnProfile;->key:Ljava/lang/String; -Lcom/android/internal/net/VpnProfile;->name:Ljava/lang/String; -Lcom/android/internal/net/VpnProfile;->saveLogin:Z -Lcom/android/internal/net/VpnProfile;->server:Ljava/lang/String; -Lcom/android/internal/net/VpnProfile;->type:I -Lcom/android/internal/net/VpnProfile;->username:Ljava/lang/String; -Lcom/android/internal/os/AtomicFile;-><init>(Ljava/io/File;)V -Lcom/android/internal/os/AtomicFile;->failWrite(Ljava/io/FileOutputStream;)V -Lcom/android/internal/os/AtomicFile;->finishWrite(Ljava/io/FileOutputStream;)V -Lcom/android/internal/os/AtomicFile;->getBaseFile()Ljava/io/File; -Lcom/android/internal/os/AtomicFile;->openAppend()Ljava/io/FileOutputStream; -Lcom/android/internal/os/AtomicFile;->openRead()Ljava/io/FileInputStream; -Lcom/android/internal/os/AtomicFile;->readFully()[B -Lcom/android/internal/os/AtomicFile;->startWrite()Ljava/io/FileOutputStream; -Lcom/android/internal/os/AtomicFile;->truncate()V -Lcom/android/internal/os/BatterySipper$DrainType;->APP:Lcom/android/internal/os/BatterySipper$DrainType; Lcom/android/internal/os/BatterySipper$DrainType;->values()[Lcom/android/internal/os/BatterySipper$DrainType; -Lcom/android/internal/os/BatterySipper;-><init>(Lcom/android/internal/os/BatterySipper$DrainType;Landroid/os/BatteryStats$Uid;D)V -Lcom/android/internal/os/BatterySipper;->add(Lcom/android/internal/os/BatterySipper;)V -Lcom/android/internal/os/BatterySipper;->cpuFgTimeMs:J -Lcom/android/internal/os/BatterySipper;->cpuPowerMah:D -Lcom/android/internal/os/BatterySipper;->cpuTimeMs:J -Lcom/android/internal/os/BatterySipper;->drainType:Lcom/android/internal/os/BatterySipper$DrainType; -Lcom/android/internal/os/BatterySipper;->getPackages()[Ljava/lang/String; -Lcom/android/internal/os/BatterySipper;->getUid()I -Lcom/android/internal/os/BatterySipper;->gpsTimeMs:J -Lcom/android/internal/os/BatterySipper;->mPackages:[Ljava/lang/String; -Lcom/android/internal/os/BatterySipper;->packageWithHighestDrain:Ljava/lang/String; -Lcom/android/internal/os/BatterySipper;->totalPowerMah:D -Lcom/android/internal/os/BatterySipper;->uidObj:Landroid/os/BatteryStats$Uid; -Lcom/android/internal/os/BatterySipper;->usageTimeMs:J -Lcom/android/internal/os/BatterySipper;->userId:I -Lcom/android/internal/os/BatterySipper;->wakeLockTimeMs:J -Lcom/android/internal/os/BatterySipper;->wifiRunningTimeMs:J -Lcom/android/internal/os/BatteryStatsHelper;-><init>(Landroid/content/Context;)V -Lcom/android/internal/os/BatteryStatsHelper;-><init>(Landroid/content/Context;Z)V -Lcom/android/internal/os/BatteryStatsHelper;-><init>(Landroid/content/Context;ZZ)V -Lcom/android/internal/os/BatteryStatsHelper;->clearStats()V -Lcom/android/internal/os/BatteryStatsHelper;->create(Landroid/os/Bundle;)V -Lcom/android/internal/os/BatteryStatsHelper;->dropFile(Landroid/content/Context;Ljava/lang/String;)V -Lcom/android/internal/os/BatteryStatsHelper;->getBatteryBroadcast()Landroid/content/Intent; -Lcom/android/internal/os/BatteryStatsHelper;->getMaxPower()D -Lcom/android/internal/os/BatteryStatsHelper;->getStats()Landroid/os/BatteryStats; -Lcom/android/internal/os/BatteryStatsHelper;->getTotalPower()D -Lcom/android/internal/os/BatteryStatsHelper;->getUsageList()Ljava/util/List; -Lcom/android/internal/os/BatteryStatsHelper;->load()V -Lcom/android/internal/os/BatteryStatsHelper;->mBatteryInfo:Lcom/android/internal/app/IBatteryStats; -Lcom/android/internal/os/BatteryStatsHelper;->mPowerProfile:Lcom/android/internal/os/PowerProfile; -Lcom/android/internal/os/BatteryStatsHelper;->mUsageList:Ljava/util/List; -Lcom/android/internal/os/BatteryStatsHelper;->refreshStats(II)V -Lcom/android/internal/os/BatteryStatsHelper;->refreshStats(ILandroid/util/SparseArray;)V -Lcom/android/internal/os/BatteryStatsHelper;->refreshStats(ILjava/util/List;)V -Lcom/android/internal/os/BatteryStatsHelper;->storeState()V -Lcom/android/internal/os/BatteryStatsImpl$Counter;->mCount:Ljava/util/concurrent/atomic/AtomicInteger; -Lcom/android/internal/os/BatteryStatsImpl$StopwatchTimer;->detach()V -Lcom/android/internal/os/BatteryStatsImpl$Timer;->getCountLocked(I)I -Lcom/android/internal/os/BatteryStatsImpl$Timer;->getTotalTimeLocked(JI)J -Lcom/android/internal/os/BatteryStatsImpl$Timer;->writeTimerToParcel(Landroid/os/Parcel;Lcom/android/internal/os/BatteryStatsImpl$Timer;J)V -Lcom/android/internal/os/BatteryStatsImpl$Uid$Pkg$Serv;->getBatteryStats()Lcom/android/internal/os/BatteryStatsImpl; -Lcom/android/internal/os/BatteryStatsImpl$Uid$Pkg$Serv;->startLaunchedLocked()V -Lcom/android/internal/os/BatteryStatsImpl$Uid$Pkg$Serv;->startRunningLocked()V -Lcom/android/internal/os/BatteryStatsImpl$Uid$Pkg$Serv;->stopLaunchedLocked()V -Lcom/android/internal/os/BatteryStatsImpl$Uid$Pkg$Serv;->stopRunningLocked()V -Lcom/android/internal/os/BatteryStatsImpl$Uid$Proc;->addCpuTimeLocked(II)V -Lcom/android/internal/os/BatteryStatsImpl$Uid$Proc;->addForegroundTimeLocked(J)V -Lcom/android/internal/os/BatteryStatsImpl$Uid$Proc;->getForegroundTime(I)J -Lcom/android/internal/os/BatteryStatsImpl$Uid$Proc;->getStarts(I)I -Lcom/android/internal/os/BatteryStatsImpl$Uid$Proc;->getSystemTime(I)J -Lcom/android/internal/os/BatteryStatsImpl$Uid$Proc;->getUserTime(I)J -Lcom/android/internal/os/BatteryStatsImpl$Uid$Proc;->incStartsLocked()V -Lcom/android/internal/os/BatteryStatsImpl$Uid$Sensor;->getHandle()I -Lcom/android/internal/os/BatteryStatsImpl$Uid$Sensor;->getSensorTime()Lcom/android/internal/os/BatteryStatsImpl$Timer; -Lcom/android/internal/os/BatteryStatsImpl$Uid$Wakelock;->getWakeTime(I)Lcom/android/internal/os/BatteryStatsImpl$Timer; -Lcom/android/internal/os/BatteryStatsImpl$Uid;->getProcessStats()Landroid/util/ArrayMap; -Lcom/android/internal/os/BatteryStatsImpl$Uid;->getSensorStats()Landroid/util/SparseArray; -Lcom/android/internal/os/BatteryStatsImpl$Uid;->getUid()I -Lcom/android/internal/os/BatteryStatsImpl$Uid;->getWakelockStats()Landroid/util/ArrayMap; -Lcom/android/internal/os/BatteryStatsImpl$Uid;->getWifiRunningTime(JI)J -Lcom/android/internal/os/BatteryStatsImpl$Uid;->getWifiScanTime(JI)J -Lcom/android/internal/os/BatteryStatsImpl;-><init>(Landroid/os/Parcel;)V -Lcom/android/internal/os/BatteryStatsImpl;->computeBatteryRealtime(JI)J -Lcom/android/internal/os/BatteryStatsImpl;->computeBatteryTimeRemaining(J)J -Lcom/android/internal/os/BatteryStatsImpl;->computeBatteryUptime(JI)J -Lcom/android/internal/os/BatteryStatsImpl;->CREATOR:Landroid/os/Parcelable$Creator; -Lcom/android/internal/os/BatteryStatsImpl;->getAwakeTimeBattery()J -Lcom/android/internal/os/BatteryStatsImpl;->getAwakeTimePlugged()J -Lcom/android/internal/os/BatteryStatsImpl;->getBatteryRealtime(J)J -Lcom/android/internal/os/BatteryStatsImpl;->getDischargeAmount(I)I -Lcom/android/internal/os/BatteryStatsImpl;->getDischargeAmountScreenOff()I -Lcom/android/internal/os/BatteryStatsImpl;->getDischargeAmountScreenOn()I -Lcom/android/internal/os/BatteryStatsImpl;->getGlobalWifiRunningTime(JI)J -Lcom/android/internal/os/BatteryStatsImpl;->getKernelWakelockStats()Ljava/util/Map; -Lcom/android/internal/os/BatteryStatsImpl;->getMobileRadioActiveTime(JI)J -Lcom/android/internal/os/BatteryStatsImpl;->getNetworkActivityBytes(II)J -Lcom/android/internal/os/BatteryStatsImpl;->getNextHistoryLocked(Landroid/os/BatteryStats$HistoryItem;)Z -Lcom/android/internal/os/BatteryStatsImpl;->getPackageStatsLocked(ILjava/lang/String;)Lcom/android/internal/os/BatteryStatsImpl$Uid$Pkg; -Lcom/android/internal/os/BatteryStatsImpl;->getPhoneDataConnectionCount(II)I -Lcom/android/internal/os/BatteryStatsImpl;->getPhoneDataConnectionTime(IJI)J -Lcom/android/internal/os/BatteryStatsImpl;->getPhoneSignalStrengthCount(II)I -Lcom/android/internal/os/BatteryStatsImpl;->getProcessStatsLocked(ILjava/lang/String;)Lcom/android/internal/os/BatteryStatsImpl$Uid$Proc; -Lcom/android/internal/os/BatteryStatsImpl;->getScreenOnTime(JI)J -Lcom/android/internal/os/BatteryStatsImpl;->getServiceStatsLocked(ILjava/lang/String;Ljava/lang/String;)Lcom/android/internal/os/BatteryStatsImpl$Uid$Pkg$Serv; -Lcom/android/internal/os/BatteryStatsImpl;->getUidStats()Landroid/util/SparseArray; -Lcom/android/internal/os/BatteryStatsImpl;->getUidStatsLocked(I)Lcom/android/internal/os/BatteryStatsImpl$Uid; -Lcom/android/internal/os/BatteryStatsImpl;->isOnBattery()Z -Lcom/android/internal/os/BatteryStatsImpl;->mFullTimers:Ljava/util/ArrayList; -Lcom/android/internal/os/BatteryStatsImpl;->mPartialTimers:Ljava/util/ArrayList; -Lcom/android/internal/os/BatteryStatsImpl;->mWindowTimers:Ljava/util/ArrayList; -Lcom/android/internal/os/BatteryStatsImpl;->noteAudioOffLocked(I)V -Lcom/android/internal/os/BatteryStatsImpl;->noteAudioOnLocked(I)V -Lcom/android/internal/os/BatteryStatsImpl;->noteFullWifiLockAcquiredLocked(I)V -Lcom/android/internal/os/BatteryStatsImpl;->noteFullWifiLockReleasedLocked(I)V -Lcom/android/internal/os/BatteryStatsImpl;->notePhoneDataConnectionStateLocked(IZ)V -Lcom/android/internal/os/BatteryStatsImpl;->notePhoneOffLocked()V -Lcom/android/internal/os/BatteryStatsImpl;->notePhoneOnLocked()V -Lcom/android/internal/os/BatteryStatsImpl;->notePhoneSignalStrengthLocked(Landroid/telephony/SignalStrength;)V -Lcom/android/internal/os/BatteryStatsImpl;->noteScreenBrightnessLocked(I)V -Lcom/android/internal/os/BatteryStatsImpl;->noteUserActivityLocked(II)V -Lcom/android/internal/os/BatteryStatsImpl;->noteVideoOffLocked(I)V -Lcom/android/internal/os/BatteryStatsImpl;->noteVideoOnLocked(I)V -Lcom/android/internal/os/BatteryStatsImpl;->noteWifiMulticastDisabledLocked(I)V -Lcom/android/internal/os/BatteryStatsImpl;->noteWifiMulticastEnabledLocked(I)V -Lcom/android/internal/os/BatteryStatsImpl;->readLocked()V -Lcom/android/internal/os/BatteryStatsImpl;->removeUidStatsLocked(I)V -Lcom/android/internal/os/BatteryStatsImpl;->startIteratingHistoryLocked()Z -Lcom/android/internal/os/FuseAppLoop;->onCommand(IJJJI[B)V -Lcom/android/internal/os/FuseAppLoop;->onOpen(JJ)[B -Lcom/android/internal/os/HandlerCaller;->obtainMessage(I)Landroid/os/Message; -Lcom/android/internal/os/HandlerCaller;->obtainMessageIO(IILjava/lang/Object;)Landroid/os/Message; -Lcom/android/internal/os/HandlerCaller;->obtainMessageIOO(IILjava/lang/Object;Ljava/lang/Object;)Landroid/os/Message; -Lcom/android/internal/os/HandlerCaller;->obtainMessageO(ILjava/lang/Object;)Landroid/os/Message; -Lcom/android/internal/os/HandlerCaller;->obtainMessageOO(ILjava/lang/Object;Ljava/lang/Object;)Landroid/os/Message; -Lcom/android/internal/os/HandlerCaller;->obtainMessageOOO(ILjava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Landroid/os/Message; -Lcom/android/internal/os/HandlerCaller;->sendMessage(Landroid/os/Message;)V Lcom/android/internal/os/IDropBoxManagerService$Stub;->asInterface(Landroid/os/IBinder;)Lcom/android/internal/os/IDropBoxManagerService; Lcom/android/internal/os/IDropBoxManagerService;->getNextEntry(Ljava/lang/String;JLjava/lang/String;)Landroid/os/DropBoxManager$Entry; -Lcom/android/internal/os/PowerProfile;-><init>(Landroid/content/Context;)V -Lcom/android/internal/os/PowerProfile;->getAveragePower(Ljava/lang/String;)D -Lcom/android/internal/os/PowerProfile;->getAveragePower(Ljava/lang/String;I)D -Lcom/android/internal/os/PowerProfile;->getBatteryCapacity()D -Lcom/android/internal/os/PowerProfile;->getNumCpuClusters()I -Lcom/android/internal/os/PowerProfile;->getNumSpeedStepsInCpuCluster(I)I -Lcom/android/internal/os/PowerProfile;->POWER_BLUETOOTH_AT_CMD:Ljava/lang/String; -Lcom/android/internal/os/PowerProfile;->POWER_BLUETOOTH_ON:Ljava/lang/String; -Lcom/android/internal/os/PowerProfile;->POWER_CPU_ACTIVE:Ljava/lang/String; -Lcom/android/internal/os/PowerProfile;->POWER_CPU_IDLE:Ljava/lang/String; -Lcom/android/internal/os/PowerProfile;->POWER_GPS_ON:Ljava/lang/String; -Lcom/android/internal/os/PowerProfile;->POWER_RADIO_ACTIVE:Ljava/lang/String; -Lcom/android/internal/os/PowerProfile;->POWER_RADIO_ON:Ljava/lang/String; -Lcom/android/internal/os/PowerProfile;->POWER_RADIO_SCANNING:Ljava/lang/String; -Lcom/android/internal/os/PowerProfile;->POWER_SCREEN_FULL:Ljava/lang/String; -Lcom/android/internal/os/PowerProfile;->POWER_SCREEN_ON:Ljava/lang/String; -Lcom/android/internal/os/PowerProfile;->POWER_WIFI_ACTIVE:Ljava/lang/String; -Lcom/android/internal/os/PowerProfile;->POWER_WIFI_ON:Ljava/lang/String; -Lcom/android/internal/os/PowerProfile;->POWER_WIFI_SCAN:Ljava/lang/String; -Lcom/android/internal/os/SomeArgs;->arg1:Ljava/lang/Object; -Lcom/android/internal/os/SomeArgs;->argi2:I -Lcom/android/internal/os/SomeArgs;->argi3:I Lcom/android/internal/policy/IKeyguardService$Stub;->asInterface(Landroid/os/IBinder;)Lcom/android/internal/policy/IKeyguardService; Lcom/android/internal/policy/IKeyguardService;->doKeyguardTimeout(Landroid/os/Bundle;)V Lcom/android/internal/policy/IKeyguardService;->setKeyguardEnabled(Z)V @@ -3253,34 +2477,8 @@ Lcom/android/internal/telephony/SmsRawData;-><init>([B)V Lcom/android/internal/telephony/SmsRawData;->CREATOR:Landroid/os/Parcelable$Creator; Lcom/android/internal/telephony/SmsRawData;->getBytes()[B Lcom/android/internal/textservice/ITextServicesManager$Stub$Proxy;-><init>(Landroid/os/IBinder;)V -Lcom/android/internal/util/AsyncChannel;->cmdToString(I)Ljava/lang/String; -Lcom/android/internal/util/AsyncChannel;->CMD_CHANNEL_FULL_CONNECTION:I -Lcom/android/internal/util/AsyncChannel;->CMD_CHANNEL_HALF_CONNECTED:I -Lcom/android/internal/util/AsyncChannel;->connected(Landroid/content/Context;Landroid/os/Handler;Landroid/os/Messenger;)V -Lcom/android/internal/util/AsyncChannel;->connectSync(Landroid/content/Context;Landroid/os/Handler;Landroid/os/Messenger;)I -Lcom/android/internal/util/AsyncChannel;->disconnect()V -Lcom/android/internal/util/AsyncChannel;->replyToMessage(Landroid/os/Message;I)V -Lcom/android/internal/util/AsyncChannel;->replyToMessage(Landroid/os/Message;II)V -Lcom/android/internal/util/AsyncChannel;->replyToMessage(Landroid/os/Message;IIILjava/lang/Object;)V -Lcom/android/internal/util/AsyncChannel;->replyToMessage(Landroid/os/Message;ILjava/lang/Object;)V -Lcom/android/internal/util/AsyncChannel;->replyToMessage(Landroid/os/Message;Landroid/os/Message;)V -Lcom/android/internal/util/AsyncChannel;->sendMessage(I)V -Lcom/android/internal/util/AsyncChannel;->sendMessage(II)V -Lcom/android/internal/util/AsyncChannel;->sendMessage(III)V -Lcom/android/internal/util/AsyncChannel;->sendMessage(IIILjava/lang/Object;)V -Lcom/android/internal/util/AsyncChannel;->sendMessageSynchronously(III)Landroid/os/Message; -Lcom/android/internal/util/AsyncChannel;->sendMessageSynchronously(Landroid/os/Message;)Landroid/os/Message; -Lcom/android/internal/util/AsyncChannel;->STATUS_SUCCESSFUL:I -Lcom/android/internal/util/FastPrintWriter;-><init>(Ljava/io/OutputStream;)V Lcom/android/internal/util/HexDump;->toHexString([BZ)Ljava/lang/String; -Lcom/android/internal/util/XmlUtils;->convertValueToBoolean(Ljava/lang/CharSequence;Z)Z -Lcom/android/internal/util/XmlUtils;->convertValueToInt(Ljava/lang/CharSequence;I)I -Lcom/android/internal/util/XmlUtils;->readMapXml(Ljava/io/InputStream;)Ljava/util/HashMap; -Lcom/android/internal/util/XmlUtils;->skipCurrentTag(Lorg/xmlpull/v1/XmlPullParser;)V -Lcom/android/internal/util/XmlUtils;->writeMapXml(Ljava/util/Map;Ljava/io/OutputStream;)V Lcom/android/internal/view/BaseIWindow;-><init>()V -Lcom/android/internal/view/IInputConnectionWrapper;->mInputConnection:Landroid/view/inputmethod/InputConnection; -Lcom/android/internal/view/IInputConnectionWrapper;->mLock:Ljava/lang/Object; Lcom/android/internal/view/IInputMethod$Stub;->asInterface(Landroid/os/IBinder;)Lcom/android/internal/view/IInputMethod; Lcom/android/internal/view/IInputMethod;->attachToken(Landroid/os/IBinder;)V Lcom/android/internal/view/IInputMethod;->bindInput(Landroid/view/inputmethod/InputBinding;)V @@ -3297,53 +2495,6 @@ Lcom/android/internal/view/IInputMethodManager$Stub;->asInterface(Landroid/os/IB Lcom/android/internal/view/IInputMethodManager;->addClient(Lcom/android/internal/view/IInputMethodClient;Lcom/android/internal/view/IInputContext;II)V Lcom/android/internal/view/IInputMethodManager;->removeClient(Lcom/android/internal/view/IInputMethodClient;)V Lcom/android/internal/view/IInputMethodSession$Stub;->asInterface(Landroid/os/IBinder;)Lcom/android/internal/view/IInputMethodSession; -Lcom/android/internal/view/InputBindResult;->CREATOR:Landroid/os/Parcelable$Creator; -Lcom/android/internal/view/InputBindResult;->method:Lcom/android/internal/view/IInputMethodSession; -Lcom/android/internal/view/menu/ActionMenuItemView;->hasText()Z -Lcom/android/internal/view/menu/MenuBuilder$Callback;->onMenuItemSelected(Lcom/android/internal/view/menu/MenuBuilder;Landroid/view/MenuItem;)Z -Lcom/android/internal/view/menu/MenuBuilder$Callback;->onMenuModeChange(Lcom/android/internal/view/menu/MenuBuilder;)V -Lcom/android/internal/view/menu/MenuBuilder;-><init>(Landroid/content/Context;)V -Lcom/android/internal/view/menu/MenuBuilder;->addMenuPresenter(Lcom/android/internal/view/menu/MenuPresenter;)V -Lcom/android/internal/view/menu/MenuBuilder;->addMenuPresenter(Lcom/android/internal/view/menu/MenuPresenter;Landroid/content/Context;)V -Lcom/android/internal/view/menu/MenuBuilder;->collapseItemActionView(Lcom/android/internal/view/menu/MenuItemImpl;)Z -Lcom/android/internal/view/menu/MenuBuilder;->getContext()Landroid/content/Context; -Lcom/android/internal/view/menu/MenuBuilder;->getHeaderIcon()Landroid/graphics/drawable/Drawable; -Lcom/android/internal/view/menu/MenuBuilder;->getHeaderTitle()Ljava/lang/CharSequence; -Lcom/android/internal/view/menu/MenuBuilder;->getNonActionItems()Ljava/util/ArrayList; -Lcom/android/internal/view/menu/MenuBuilder;->getRootMenu()Lcom/android/internal/view/menu/MenuBuilder; -Lcom/android/internal/view/menu/MenuBuilder;->getVisibleItems()Ljava/util/ArrayList; -Lcom/android/internal/view/menu/MenuBuilder;->mContext:Landroid/content/Context; -Lcom/android/internal/view/menu/MenuBuilder;->removeMenuPresenter(Lcom/android/internal/view/menu/MenuPresenter;)V -Lcom/android/internal/view/menu/MenuBuilder;->setCallback(Lcom/android/internal/view/menu/MenuBuilder$Callback;)V -Lcom/android/internal/view/menu/MenuBuilder;->setCurrentMenuInfo(Landroid/view/ContextMenu$ContextMenuInfo;)V -Lcom/android/internal/view/menu/MenuBuilder;->setDefaultShowAsAction(I)Lcom/android/internal/view/menu/MenuBuilder; -Lcom/android/internal/view/menu/MenuBuilder;->setOptionalIconsVisible(Z)V -Lcom/android/internal/view/menu/MenuBuilder;->startDispatchingItemsChanged()V -Lcom/android/internal/view/menu/MenuBuilder;->stopDispatchingItemsChanged()V -Lcom/android/internal/view/menu/MenuItemImpl;->invoke()Z -Lcom/android/internal/view/menu/MenuItemImpl;->isActionButton()Z -Lcom/android/internal/view/menu/MenuItemImpl;->mIconResId:I -Lcom/android/internal/view/menu/MenuItemImpl;->requestsActionButton()Z -Lcom/android/internal/view/menu/MenuItemImpl;->requiresActionButton()Z -Lcom/android/internal/view/menu/MenuItemImpl;->setActionViewExpanded(Z)V -Lcom/android/internal/view/menu/MenuItemImpl;->setExclusiveCheckable(Z)V -Lcom/android/internal/view/menu/MenuItemImpl;->setMenuInfo(Landroid/view/ContextMenu$ContextMenuInfo;)V -Lcom/android/internal/view/menu/MenuPopupHelper;-><init>(Landroid/content/Context;Lcom/android/internal/view/menu/MenuBuilder;)V -Lcom/android/internal/view/menu/MenuPopupHelper;-><init>(Landroid/content/Context;Lcom/android/internal/view/menu/MenuBuilder;Landroid/view/View;)V -Lcom/android/internal/view/menu/MenuPopupHelper;->dismiss()V -Lcom/android/internal/view/menu/MenuPopupHelper;->getPopup()Lcom/android/internal/view/menu/MenuPopup; -Lcom/android/internal/view/menu/MenuPopupHelper;->mForceShowIcon:Z -Lcom/android/internal/view/menu/MenuPopupHelper;->setAnchorView(Landroid/view/View;)V -Lcom/android/internal/view/menu/MenuPopupHelper;->setForceShowIcon(Z)V -Lcom/android/internal/view/menu/MenuPopupHelper;->setGravity(I)V -Lcom/android/internal/view/menu/MenuPopupHelper;->show()V -Lcom/android/internal/view/menu/MenuPopupHelper;->tryShow()Z -Lcom/android/internal/view/menu/MenuPresenter$Callback;->onOpenSubMenu(Lcom/android/internal/view/menu/MenuBuilder;)Z -Lcom/android/internal/view/menu/MenuView$ItemView;->getItemData()Lcom/android/internal/view/menu/MenuItemImpl; -Lcom/android/internal/view/menu/MenuView;->getWindowAnimations()I -Lcom/android/internal/view/menu/SubMenuBuilder;->getRootMenu()Lcom/android/internal/view/menu/MenuBuilder; -Lcom/android/internal/view/menu/SubMenuBuilder;->setCallback(Lcom/android/internal/view/menu/MenuBuilder$Callback;)V -Lcom/android/internal/widget/CachingIconView;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V Lcom/android/internal/widget/ILockSettings$Stub;->asInterface(Landroid/os/IBinder;)Lcom/android/internal/widget/ILockSettings; Lcom/android/internal/widget/ILockSettings;->getBoolean(Ljava/lang/String;ZI)Z Lcom/android/internal/widget/ILockSettings;->getLong(Ljava/lang/String;JI)J @@ -3363,16 +2514,6 @@ Lcom/android/internal/widget/IRemoteViewsFactory;->hasStableIds()Z Lcom/android/internal/widget/IRemoteViewsFactory;->isCreated()Z Lcom/android/internal/widget/IRemoteViewsFactory;->onDataSetChanged()V Lcom/android/internal/widget/ScrollBarUtils;->getThumbLength(IIII)I -Lcom/android/internal/widget/ScrollingTabContainerView;-><init>(Landroid/content/Context;)V -Lcom/android/internal/widget/ScrollingTabContainerView;->addTab(Landroid/app/ActionBar$Tab;IZ)V -Lcom/android/internal/widget/ScrollingTabContainerView;->addTab(Landroid/app/ActionBar$Tab;Z)V -Lcom/android/internal/widget/ScrollingTabContainerView;->animateToTab(I)V -Lcom/android/internal/widget/ScrollingTabContainerView;->animateToVisibility(I)V -Lcom/android/internal/widget/ScrollingTabContainerView;->removeAllTabs()V -Lcom/android/internal/widget/ScrollingTabContainerView;->removeTabAt(I)V -Lcom/android/internal/widget/ScrollingTabContainerView;->setAllowCollapse(Z)V -Lcom/android/internal/widget/ScrollingTabContainerView;->setTabSelected(I)V -Lcom/android/internal/widget/ScrollingTabContainerView;->updateTab(I)V Lcom/android/okhttp/Connection;->getSocket()Ljava/net/Socket; Lcom/android/okhttp/ConnectionPool;->connections:Ljava/util/Deque; Lcom/android/okhttp/ConnectionPool;->keepAliveDurationNs:J diff --git a/config/hiddenapi-vendor-list.txt b/config/hiddenapi-vendor-list.txt index 435f9bbd4e51..9e6abe425d3e 100644 --- a/config/hiddenapi-vendor-list.txt +++ b/config/hiddenapi-vendor-list.txt @@ -166,7 +166,6 @@ Landroid/view/IWindowManager;->getStableInsets(ILandroid/graphics/Rect;)V Landroid/view/IWindowManager;->overridePendingAppTransitionMultiThumbFuture(Landroid/view/IAppTransitionAnimationSpecsFuture;Landroid/os/IRemoteCallback;Z)V Landroid/view/IWindowManager;->overridePendingAppTransitionRemote(Landroid/view/RemoteAnimationAdapter;)V Landroid/view/IWindowManager;->setNavBarVirtualKeyHapticFeedbackEnabled(Z)V -Landroid/widget/ListView;->lookForSelectablePosition(IZ)I Lcom/android/ims/ImsConfigListener;->onSetFeatureResponse(IIII)V Lcom/android/ims/internal/IImsCallSessionListener;->callSessionConferenceStateUpdated(Lcom/android/ims/internal/IImsCallSession;Landroid/telephony/ims/ImsConferenceState;)V Lcom/android/ims/internal/IImsCallSessionListener;->callSessionHandover(Lcom/android/ims/internal/IImsCallSession;IILandroid/telephony/ims/ImsReasonInfo;)V @@ -249,19 +248,8 @@ Lcom/android/ims/internal/uce/uceservice/IUceService;->getServiceStatus()Z Lcom/android/ims/internal/uce/uceservice/IUceService;->isServiceStarted()Z Lcom/android/ims/internal/uce/uceservice/IUceService;->startService(Lcom/android/ims/internal/uce/uceservice/IUceListener;)Z Lcom/android/ims/internal/uce/uceservice/IUceService;->stopService()Z -Lcom/android/internal/app/AlertController$AlertParams;->mIconId:I -Lcom/android/internal/app/AlertController$AlertParams;->mMessage:Ljava/lang/CharSequence; -Lcom/android/internal/app/AlertController$AlertParams;->mNegativeButtonListener:Landroid/content/DialogInterface$OnClickListener; -Lcom/android/internal/app/AlertController$AlertParams;->mNegativeButtonText:Ljava/lang/CharSequence; -Lcom/android/internal/app/AlertController$AlertParams;->mPositiveButtonListener:Landroid/content/DialogInterface$OnClickListener; -Lcom/android/internal/app/AlertController$AlertParams;->mPositiveButtonText:Ljava/lang/CharSequence; -Lcom/android/internal/app/AlertController$AlertParams;->mTitle:Ljava/lang/CharSequence; -Lcom/android/internal/app/AlertController$AlertParams;->mView:Landroid/view/View; -Lcom/android/internal/app/AlertController;->getButton(I)Landroid/widget/Button; Lcom/android/internal/app/IAppOpsService;->finishOperation(Landroid/os/IBinder;IILjava/lang/String;)V Lcom/android/internal/content/PackageMonitor;-><init>()V -Lcom/android/internal/content/PackageMonitor;->register(Landroid/content/Context;Landroid/os/Looper;Landroid/os/UserHandle;Z)V -Lcom/android/internal/content/PackageMonitor;->unregister()V Lcom/android/internal/location/ILocationProvider$Stub;->asInterface(Landroid/os/IBinder;)Lcom/android/internal/location/ILocationProvider; Lcom/android/internal/location/ILocationProvider;->disable()V Lcom/android/internal/location/ILocationProvider;->enable()V @@ -270,21 +258,6 @@ Lcom/android/internal/location/ILocationProvider;->getStatus(Landroid/os/Bundle; Lcom/android/internal/location/ILocationProvider;->getStatusUpdateTime()J Lcom/android/internal/location/ILocationProvider;->sendExtraCommand(Ljava/lang/String;Landroid/os/Bundle;)Z Lcom/android/internal/location/ILocationProvider;->setRequest(Lcom/android/internal/location/ProviderRequest;Landroid/os/WorkSource;)V -Lcom/android/internal/location/ProviderRequest;-><init>()V -Lcom/android/internal/location/ProviderRequest;->interval:J -Lcom/android/internal/location/ProviderRequest;->locationRequests:Ljava/util/List; -Lcom/android/internal/location/ProviderRequest;->reportLocation:Z -Lcom/android/internal/os/BatteryStatsImpl;->getDischargeCurrentLevel()I -Lcom/android/internal/os/BatteryStatsImpl;->getDischargeStartLevel()I -Lcom/android/internal/os/BatteryStatsImpl;->getPhoneOnTime(JI)J -Lcom/android/internal/os/BatteryStatsImpl;->getPhoneSignalScanningTime(JI)J -Lcom/android/internal/os/BatteryStatsImpl;->getPhoneSignalStrengthTime(IJI)J -Lcom/android/internal/os/BatteryStatsImpl;->getScreenBrightnessTime(IJI)J -Lcom/android/internal/os/BatteryStatsImpl;->getWifiOnTime(JI)J -Lcom/android/internal/os/SomeArgs;->arg2:Ljava/lang/Object; -Lcom/android/internal/os/SomeArgs;->arg3:Ljava/lang/Object; -Lcom/android/internal/os/SomeArgs;->obtain()Lcom/android/internal/os/SomeArgs; -Lcom/android/internal/os/SomeArgs;->recycle()V Lcom/android/internal/R$styleable;->NumberPicker:[I Lcom/android/internal/R$styleable;->TwoLineListItem:[I Lcom/android/internal/telephony/GsmAlphabet;->gsm7BitPackedToString([BII)Ljava/lang/String; @@ -298,14 +271,6 @@ Lcom/android/internal/telephony/OperatorInfo;->getOperatorAlphaLong()Ljava/lang/ Lcom/android/internal/telephony/OperatorInfo;->getOperatorAlphaShort()Ljava/lang/String; Lcom/android/internal/telephony/OperatorInfo;->getOperatorNumeric()Ljava/lang/String; Lcom/android/internal/telephony/OperatorInfo;->getState()Lcom/android/internal/telephony/OperatorInfo$State; -Lcom/android/internal/util/AsyncChannel;-><init>()V -Lcom/android/internal/util/AsyncChannel;->connect(Landroid/content/Context;Landroid/os/Handler;Landroid/os/Messenger;)V -Lcom/android/internal/util/AsyncChannel;->sendMessage(Landroid/os/Message;)V -Lcom/android/internal/util/IndentingPrintWriter;-><init>(Ljava/io/Writer;Ljava/lang/String;)V -Lcom/android/internal/util/IndentingPrintWriter;->decreaseIndent()Lcom/android/internal/util/IndentingPrintWriter; -Lcom/android/internal/util/IndentingPrintWriter;->increaseIndent()Lcom/android/internal/util/IndentingPrintWriter; -Lcom/android/internal/util/XmlUtils;->beginDocument(Lorg/xmlpull/v1/XmlPullParser;Ljava/lang/String;)V -Lcom/android/internal/util/XmlUtils;->nextElement(Lorg/xmlpull/v1/XmlPullParser;)V Ljava/lang/System;->arraycopy([BI[BII)V Ljava/net/Inet4Address;->ALL:Ljava/net/InetAddress; Ljava/net/Inet4Address;->ANY:Ljava/net/InetAddress; diff --git a/core/java/android/app/job/JobSnapshot.java b/core/java/android/app/job/JobSnapshot.java index d6cc70dc3631..ceeaab7c5e6e 100644 --- a/core/java/android/app/job/JobSnapshot.java +++ b/core/java/android/app/job/JobSnapshot.java @@ -50,6 +50,14 @@ public class JobSnapshot implements Parcelable { } /** + * Returning JobInfo bound to this snapshot + * @return JobInfo of this snapshot + */ + public JobInfo getJobInfo() { + return mJob; + } + + /** * Is this job actually runnable at this moment? */ public boolean isRunnable() { @@ -77,7 +85,7 @@ public class JobSnapshot implements Parcelable { */ public boolean isRequireDeviceIdleSatisfied() { return !mJob.isRequireDeviceIdle() - || satisfied(JobInfo.CONSTRAINT_FLAG_BATTERY_NOT_LOW); + || satisfied(JobInfo.CONSTRAINT_FLAG_DEVICE_IDLE); } public boolean isRequireStorageNotLowSatisfied() { diff --git a/core/java/android/bluetooth/BluetoothAdapter.java b/core/java/android/bluetooth/BluetoothAdapter.java index 3c22905550ca..4c655b5ac027 100644 --- a/core/java/android/bluetooth/BluetoothAdapter.java +++ b/core/java/android/bluetooth/BluetoothAdapter.java @@ -446,6 +446,12 @@ public final class BluetoothAdapter { */ public static final int IO_CAPABILITY_UNKNOWN = 255; + /** @hide */ + @IntDef({IO_CAPABILITY_OUT, IO_CAPABILITY_IO, IO_CAPABILITY_IN, IO_CAPABILITY_NONE, + IO_CAPABILITY_KBDISP}) + @Retention(RetentionPolicy.SOURCE) + public @interface IoCapability {} + /** * Broadcast Action: The local Bluetooth adapter has started the remote * device discovery process. @@ -1292,6 +1298,7 @@ public final class BluetoothAdapter { * @hide */ @RequiresPermission(Manifest.permission.BLUETOOTH_ADMIN) + @IoCapability public int getIoCapability() { if (getState() != STATE_ON) return BluetoothAdapter.IO_CAPABILITY_UNKNOWN; try { @@ -1319,7 +1326,7 @@ public final class BluetoothAdapter { * @hide */ @RequiresPermission(Manifest.permission.BLUETOOTH_PRIVILEGED) - public boolean setIoCapability(int capability) { + public boolean setIoCapability(@IoCapability int capability) { if (getState() != STATE_ON) return false; try { mServiceLock.readLock().lock(); @@ -1342,6 +1349,7 @@ public final class BluetoothAdapter { * @hide */ @RequiresPermission(Manifest.permission.BLUETOOTH_ADMIN) + @IoCapability public int getLeIoCapability() { if (getState() != STATE_ON) return BluetoothAdapter.IO_CAPABILITY_UNKNOWN; try { @@ -1369,7 +1377,7 @@ public final class BluetoothAdapter { * @hide */ @RequiresPermission(Manifest.permission.BLUETOOTH_PRIVILEGED) - public boolean setLeIoCapability(int capability) { + public boolean setLeIoCapability(@IoCapability int capability) { if (getState() != STATE_ON) return false; try { mServiceLock.readLock().lock(); diff --git a/core/java/android/hardware/biometrics/BiometricPrompt.java b/core/java/android/hardware/biometrics/BiometricPrompt.java index bad418acc653..02bcff546b10 100644 --- a/core/java/android/hardware/biometrics/BiometricPrompt.java +++ b/core/java/android/hardware/biometrics/BiometricPrompt.java @@ -69,6 +69,7 @@ public class BiometricPrompt implements BiometricAuthenticator, BiometricConstan * @hide */ public static final int HIDE_DIALOG_DELAY = 2000; // ms + /** * @hide */ diff --git a/core/java/android/hardware/camera2/CameraCharacteristics.java b/core/java/android/hardware/camera2/CameraCharacteristics.java index f7d1b8df9284..35584ae21869 100644 --- a/core/java/android/hardware/camera2/CameraCharacteristics.java +++ b/core/java/android/hardware/camera2/CameraCharacteristics.java @@ -773,7 +773,6 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri * @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 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri * @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 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri * @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 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri * @hide */ @Deprecated - @UnsupportedAppUsage public static final Key<Byte> QUIRKS_USE_PARTIAL_RESULT = new Key<Byte>("android.quirks.usePartialResult", byte.class); @@ -1538,7 +1534,6 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri * @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 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri * @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 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri * @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 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri * <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 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri * <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 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri * @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 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri * @hide */ @Deprecated - @UnsupportedAppUsage public static final Key<int[]> SCALER_AVAILABLE_FORMATS = new Key<int[]>("android.scaler.availableFormats", int[].class); @@ -1924,7 +1913,6 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri * @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 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri * @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 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri * @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 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri * @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 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri * @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 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri * @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 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri * @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 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri * @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 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri * @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 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri * @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 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri * @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 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri * @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 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri * @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 47bef1256db9..4a20468276d3 100644 --- a/core/java/android/hardware/camera2/CaptureRequest.java +++ b/core/java/android/hardware/camera2/CaptureRequest.java @@ -2140,7 +2140,6 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>> * <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 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>> * <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 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>> * <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 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>> * <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 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>> * @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 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>> * @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 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>> * @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 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>> * <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 007794f0183f..3c6c11d24c7c 100644 --- a/core/java/android/hardware/camera2/CaptureResult.java +++ b/core/java/android/hardware/camera2/CaptureResult.java @@ -2464,7 +2464,6 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> { * <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 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> { * <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 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> { * <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 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> { * @hide */ @Deprecated - @UnsupportedAppUsage public static final Key<Boolean> QUIRKS_PARTIAL_RESULT = new Key<Boolean>("android.quirks.partialResult", boolean.class); @@ -3144,7 +3140,6 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> { * @hide */ @Deprecated - @UnsupportedAppUsage public static final Key<Integer> REQUEST_FRAME_COUNT = new Key<Integer>("android.request.frameCount", int.class); @@ -3158,7 +3153,6 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> { * <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 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> { * @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 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> { * @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 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> { * @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 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> { * @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 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> { * @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 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> { * @hide */ @Deprecated - @UnsupportedAppUsage public static final Key<float[]> STATISTICS_PREDICTED_COLOR_GAINS = new Key<float[]>("android.statistics.predictedColorGains", float[].class); @@ -4000,7 +3988,6 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> { * @hide */ @Deprecated - @UnsupportedAppUsage public static final Key<Rational[]> STATISTICS_PREDICTED_COLOR_TRANSFORM = new Key<Rational[]>("android.statistics.predictedColorTransform", Rational[].class); @@ -4143,7 +4130,6 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> { * @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 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> { * <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 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> { * <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 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> { * @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 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> { * @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 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> { * @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 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> { * <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 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> { * @see #SYNC_FRAME_NUMBER_UNKNOWN * @hide */ - @UnsupportedAppUsage public static final Key<Long> SYNC_FRAME_NUMBER = new Key<Long>("android.sync.frameNumber", long.class); diff --git a/core/java/android/hardware/fingerprint/FingerprintManager.java b/core/java/android/hardware/fingerprint/FingerprintManager.java index bf5ab9060fec..15868f12eb64 100644 --- a/core/java/android/hardware/fingerprint/FingerprintManager.java +++ b/core/java/android/hardware/fingerprint/FingerprintManager.java @@ -1162,24 +1162,9 @@ public class FingerprintManager implements BiometricFingerprintConstants { @Override // binder call public void onError(long deviceId, int error, int vendorCode) { if (mExecutor != null) { - // BiometricPrompt case - if (error == FingerprintManager.FINGERPRINT_ERROR_USER_CANCELED - || error == FingerprintManager.FINGERPRINT_ERROR_CANCELED) { - // User tapped somewhere to cancel, or authentication was cancelled by the app - // or got kicked out. The prompt is already gone, so send the error immediately. - mExecutor.execute(() -> { - sendErrorResult(deviceId, error, vendorCode); - }); - } else { - // User got an error that needs to be displayed on the dialog, post a delayed - // runnable on the FingerprintManager handler that sends the error message after - // FingerprintDialog.HIDE_DIALOG_DELAY to send the error to the application. - mHandler.postDelayed(() -> { - mExecutor.execute(() -> { - sendErrorResult(deviceId, error, vendorCode); - }); - }, BiometricPrompt.HIDE_DIALOG_DELAY); - } + mExecutor.execute(() -> { + sendErrorResult(deviceId, error, vendorCode); + }); } else { mHandler.obtainMessage(MSG_ERROR, error, vendorCode, deviceId).sendToTarget(); } diff --git a/core/java/android/os/Debug.java b/core/java/android/os/Debug.java index e6069644caa5..6ddcbe0b3b64 100644 --- a/core/java/android/os/Debug.java +++ b/core/java/android/os/Debug.java @@ -1752,13 +1752,13 @@ public final class Debug public static native long getPss(); /** - * Retrieves the PSS memory used by the process as given by the - * smaps. Optionally supply a long array of 2 entries to also - * receive the Uss and SwapPss of the process, and another array to also - * retrieve the separate memtrack size. + * Retrieves the PSS memory used by the process as given by the smaps. Optionally supply a long + * array of up to 3 entries to also receive (up to 3 values in order): the Uss and SwapPss and + * Rss (only filled in as of {@link android.os.Build.VERSION_CODES#P}) of the process, and + * another array to also retrieve the separate memtrack size. * @hide */ - public static native long getPss(int pid, long[] outUssSwapPss, long[] outMemtrack); + public static native long getPss(int pid, long[] outUssSwapPssRss, long[] outMemtrack); /** @hide */ public static final int MEMINFO_TOTAL = 0; diff --git a/core/java/android/service/autofill/CustomDescription.java b/core/java/android/service/autofill/CustomDescription.java index fb468a8dad6f..b1ae7a5b5d33 100644 --- a/core/java/android/service/autofill/CustomDescription.java +++ b/core/java/android/service/autofill/CustomDescription.java @@ -20,11 +20,13 @@ import static android.view.autofill.Helper.sDebug; 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 @@ public final class CustomDescription implements Parcelable { 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 @@ public final class CustomDescription implements Parcelable { return mUpdates; } + /** @hide */ + @Nullable + @TestApi + public SparseArray<InternalOnClickAction> getActions() { + return mActions; + } + /** * Builder for {@link CustomDescription} objects. */ @@ -124,6 +135,7 @@ public final class CustomDescription implements Parcelable { 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 @@ public final class CustomDescription implements Parcelable { * * @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 @@ public final class CustomDescription implements Parcelable { * 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 @@ public final class CustomDescription implements Parcelable { } /** + * 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 @@ public final class CustomDescription implements Parcelable { .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 @@ public final class CustomDescription implements Parcelable { 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 @@ public final class CustomDescription implements Parcelable { 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 @@ public final class CustomDescription implements Parcelable { 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 000000000000..6dc49b627369 --- /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 {@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 d77e41e3f022..ccffc70381df 100644 --- a/core/java/android/service/autofill/InternalSanitizer.java +++ b/core/java/android/service/autofill/InternalSanitizer.java @@ -35,8 +35,6 @@ public abstract class InternalSanitizer implements Sanitizer, Parcelable { * * @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 c9864a0e5711..0dba2b9bb9a6 100644 --- a/core/java/android/service/autofill/InternalTransformation.java +++ b/core/java/android/service/autofill/InternalTransformation.java @@ -44,8 +44,6 @@ public abstract class InternalTransformation implements Transformation, Parcelab * @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 @@ public abstract class InternalTransformation implements Transformation, Parcelab * @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 e08bb6c1a2e0..4bea98d0d8bb 100644 --- a/core/java/android/service/autofill/InternalValidator.java +++ b/core/java/android/service/autofill/InternalValidator.java @@ -33,9 +33,6 @@ public abstract class InternalValidator implements Validator, Parcelable { * * @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/packages/PackageInstaller/src/com/android/packageinstaller/OverlayTouchActivity.java b/core/java/android/service/autofill/OnClickAction.java index 1fdbd97089a3..7439b003c070 100644 --- a/packages/PackageInstaller/src/com/android/packageinstaller/OverlayTouchActivity.java +++ b/core/java/android/service/autofill/OnClickAction.java @@ -13,17 +13,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.android.packageinstaller; +package android.service.autofill; -import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS; - -import android.app.Activity; -import android.os.Bundle; - -class OverlayTouchActivity extends Activity { - @Override - protected void onCreate(Bundle savedInstanceState) { - getWindow().addPrivateFlags(PRIVATE_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS); - super.onCreate(savedInstanceState); - } +/** + * Class used to define an action to be performed when a child view in a + * {@link android.widget.RemoteViews presentation} is clicked. + * + * <p>Typically used to switch the visibility of other views in a + * {@link CustomDescription custom save UI}. + */ +public interface OnClickAction { } diff --git a/core/java/android/service/autofill/UserData.java b/core/java/android/service/autofill/UserData.java index 55aecddf8365..fccb85b957fa 100644 --- a/core/java/android/service/autofill/UserData.java +++ b/core/java/android/service/autofill/UserData.java @@ -145,6 +145,9 @@ public final class UserData implements Parcelable { // Non-persistent array used to limit the number of unique ids. private final ArraySet<String> mUniqueCategoryIds; + // Non-persistent array used to ignore duplaicated value/category pairs. + private final ArraySet<String> mUniqueValueCategoryPairs; + /** * Creates a new builder for the user data used for <a href="#FieldClassification">field @@ -185,6 +188,7 @@ public final class UserData implements Parcelable { final int maxUserDataSize = getMaxUserDataSize(); mCategoryIds = new ArrayList<>(maxUserDataSize); mValues = new ArrayList<>(maxUserDataSize); + mUniqueValueCategoryPairs = new ArraySet<>(maxUserDataSize); mUniqueCategoryIds = new ArraySet<>(getMaxCategoryCount()); addMapping(value, categoryId); @@ -222,7 +226,8 @@ public final class UserData implements Parcelable { * @throws IllegalStateException if: * <ul> * <li>{@link #build()} already called</li> - * <li>the {@code value} has already been added</li> + * <li>the {@code value} has already been added (<b>Note: </b> this restriction was + * lifted on Android {@link android.os.Build.VERSION_CODES#Q} and later)</li> * <li>the number of unique {@code categoryId} values added so far is more than * {@link UserData#getMaxCategoryCount()}</li> * <li>the number of {@code values} added so far is is more than @@ -248,12 +253,8 @@ public final class UserData implements Parcelable { // New category - check size Preconditions.checkState(mUniqueCategoryIds.size() < getMaxCategoryCount(), "already added " + mUniqueCategoryIds.size() + " unique category ids"); - } - Preconditions.checkState(!mValues.contains(value), - // Don't include value on message because it could contain PII - "already has entry with same value"); Preconditions.checkState(mValues.size() < getMaxUserDataSize(), "already added " + mValues.size() + " elements"); addMapping(value, categoryId); @@ -262,9 +263,16 @@ public final class UserData implements Parcelable { } private void addMapping(@NonNull String value, @NonNull String categoryId) { + final String pair = value + ":" + categoryId; + if (mUniqueValueCategoryPairs.contains(pair)) { + // Don't include value on message because it could contain PII + Log.w(TAG, "Ignoring entry with same value / category"); + return; + } mCategoryIds.add(categoryId); mValues.add(value); mUniqueCategoryIds.add(categoryId); + mUniqueValueCategoryPairs.add(pair); } private String checkNotEmpty(@NonNull String name, @Nullable String value) { diff --git a/core/java/android/service/autofill/VisibilitySetterAction.java b/core/java/android/service/autofill/VisibilitySetterAction.java new file mode 100644 index 000000000000..cdd710258ba0 --- /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}. + * @throw {@link 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}. + * @throw {@link IllegalArgumentException} if visibility is not one of {@link View#VISIBLE}, + * {@link View#INVISIBLE}, or {@link View#GONE}. + */ + public Builder setVisibility(@IdRes int id, @Visibility int visibility) { + throwIfDestroyed(); + switch (visibility) { + case View.VISIBLE: + case View.INVISIBLE: + case View.GONE: + mVisibilities.put(id, visibility); + return this; + } + throw new IllegalArgumentException("Invalid visibility: " + visibility); + } + + /** + * Creates a new {@link VisibilitySetterAction} instance. + */ + public VisibilitySetterAction build() { + throwIfDestroyed(); + mDestroyed = true; + return new VisibilitySetterAction(this); + } + + private void throwIfDestroyed() { + Preconditions.checkState(!mDestroyed, "Already called build()"); + } + } + + ///////////////////////////////////// + // Object "contract" methods. // + ///////////////////////////////////// + @Override + public String toString() { + if (!sDebug) return super.toString(); + + return "VisibilitySetterAction: [" + mVisibilities + "]"; + } + + ///////////////////////////////////// + // Parcelable "contract" methods. // + ///////////////////////////////////// + @Override + public int describeContents() { + return 0; + } + + @Override + public void writeToParcel(Parcel parcel, int flags) { + parcel.writeSparseIntArray(mVisibilities); + } + + public static final Parcelable.Creator<VisibilitySetterAction> CREATOR = + new Parcelable.Creator<VisibilitySetterAction>() { + @Override + public VisibilitySetterAction createFromParcel(Parcel parcel) { + // Always go through the builder to ensure the data ingested by + // the system obeys the contract of the builder to avoid attacks + final SparseIntArray visibilities = parcel.readSparseIntArray(); + Builder builder = null; + for (int i = 0; i < visibilities.size(); i++) { + final int id = visibilities.keyAt(i); + final int visibility = visibilities.valueAt(i); + if (builder == null) { + builder = new Builder(id, visibility); + } else { + builder.setVisibility(id, visibility); + } + } + return builder == null ? null : builder.build(); + } + + @Override + public VisibilitySetterAction[] newArray(int size) { + return new VisibilitySetterAction[size]; + } + }; +} diff --git a/core/java/android/service/notification/INotificationListener.aidl b/core/java/android/service/notification/INotificationListener.aidl index 2dff7161a068..d8bd00281ba5 100644 --- a/core/java/android/service/notification/INotificationListener.aidl +++ b/core/java/android/service/notification/INotificationListener.aidl @@ -18,6 +18,7 @@ package android.service.notification; import android.app.NotificationChannel; import android.app.NotificationChannelGroup; +import android.content.pm.ParceledListSlice; import android.os.UserHandle; import android.service.notification.NotificationStats; import android.service.notification.IStatusBarNotificationHolder; @@ -45,4 +46,5 @@ oneway interface INotificationListener // assistants only void onNotificationEnqueuedWithChannel(in IStatusBarNotificationHolder notificationHolder, in NotificationChannel channel); void onNotificationSnoozedUntilContext(in IStatusBarNotificationHolder notificationHolder, String snoozeCriterionId); + void onNotificationsSeen(in List<String> keys); } diff --git a/core/java/android/service/notification/NotificationAssistantService.java b/core/java/android/service/notification/NotificationAssistantService.java index 3853fc54773f..3b820ca1e165 100644 --- a/core/java/android/service/notification/NotificationAssistantService.java +++ b/core/java/android/service/notification/NotificationAssistantService.java @@ -149,6 +149,14 @@ public abstract class NotificationAssistantService extends NotificationListenerS } /** + * Implement this to know when a user has seen notifications, as triggered by + * {@link #setNotificationsShown(String[])}. + */ + public void onNotificationsSeen(List<String> keys) { + + } + + /** * Updates a notification. N.B. this won’t cause * an existing notification to alert, but might allow a future update to * this notification to alert. @@ -236,11 +244,20 @@ public abstract class NotificationAssistantService extends NotificationListenerS mHandler.obtainMessage(MyHandler.MSG_ON_NOTIFICATION_SNOOZED, args).sendToTarget(); } + + @Override + public void onNotificationsSeen(List<String> keys) { + SomeArgs args = SomeArgs.obtain(); + args.arg1 = keys; + mHandler.obtainMessage(MyHandler.MSG_ON_NOTIFICATIONS_SEEN, + args).sendToTarget(); + } } private final class MyHandler extends Handler { public static final int MSG_ON_NOTIFICATION_ENQUEUED = 1; public static final int MSG_ON_NOTIFICATION_SNOOZED = 2; + public static final int MSG_ON_NOTIFICATIONS_SEEN = 3; public MyHandler(Looper looper) { super(looper, null, false); @@ -275,6 +292,13 @@ public abstract class NotificationAssistantService extends NotificationListenerS onNotificationSnoozedUntilContext(sbn, snoozeCriterionId); break; } + case MSG_ON_NOTIFICATIONS_SEEN: { + SomeArgs args = (SomeArgs) msg.obj; + List<String> keys = (List<String>) args.arg1; + args.recycle(); + onNotificationsSeen(keys); + break; + } } } } diff --git a/core/java/android/service/notification/NotificationListenerService.java b/core/java/android/service/notification/NotificationListenerService.java index 98da5694456d..1b588f470971 100644 --- a/core/java/android/service/notification/NotificationListenerService.java +++ b/core/java/android/service/notification/NotificationListenerService.java @@ -1332,6 +1332,12 @@ public abstract class NotificationListenerService extends Service { } @Override + public void onNotificationsSeen(List<String> keys) + throws RemoteException { + // no-op in the listener + } + + @Override public void onNotificationSnoozedUntilContext( IStatusBarNotificationHolder notificationHolder, String snoozeCriterionId) throws RemoteException { diff --git a/core/java/android/transition/Scene.java b/core/java/android/transition/Scene.java index 15ad7deb4b24..2c858cde17a4 100644 --- a/core/java/android/transition/Scene.java +++ b/core/java/android/transition/Scene.java @@ -35,7 +35,8 @@ public final class Scene { private int mLayoutId = -1; private ViewGroup mSceneRoot; private View mLayout; // alternative to layoutId - Runnable mEnterAction, mExitAction; + Runnable mEnterAction; + Runnable mExitAction; /** * Returns a Scene described by the resource file associated with the given @@ -265,4 +266,4 @@ public final class Scene { boolean isCreatedFromLayoutResource() { return (mLayoutId > 0); } -}
\ No newline at end of file +} diff --git a/core/java/android/widget/AbsListView.java b/core/java/android/widget/AbsListView.java index 1475cc9f08b0..07096e815d15 100644 --- a/core/java/android/widget/AbsListView.java +++ b/core/java/android/widget/AbsListView.java @@ -20,6 +20,7 @@ import android.annotation.ColorInt; 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 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te /** * Controls CHOICE_MODE_MULTIPLE_MODAL. null when inactive. */ + @UnsupportedAppUsage ActionMode mChoiceActionMode; /** @@ -276,16 +278,19 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te /** * 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 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te /** * 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 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te /** * The selection's top padding */ + @UnsupportedAppUsage int mSelectionTopPadding = 0; /** @@ -347,6 +357,7 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te /** * The selection's bottom padding */ + @UnsupportedAppUsage int mSelectionBottomPadding = 0; /** @@ -379,6 +390,7 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te /** * The position of the view that received the down motion event */ + @UnsupportedAppUsage int mMotionPosition; /** @@ -399,12 +411,14 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te /** * 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 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te /** * 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 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te /** * 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 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te */ int mResurrectToPosition = INVALID_POSITION; + @UnsupportedAppUsage private ContextMenuInfo mContextMenuInfo = null; /** @@ -547,11 +567,13 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te /** * 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 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te /** * The select child's view (from the adapter's getView) is enabled. */ + @UnsupportedAppUsage private boolean mIsChildViewEnabled; /** @@ -606,6 +629,7 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te /** * Helper object that renders and controls the fast scroll thumb. */ + @UnsupportedAppUsage private FastScroller mFastScroll; /** @@ -616,6 +640,7 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te private boolean mGlobalLayoutListenerAddedFilter; + @UnsupportedAppUsage private int mTouchSlop; private float mDensityScale; @@ -627,6 +652,7 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te private Runnable mClearScrollingCache; Runnable mPositionScrollAfterLayout; private int mMinimumVelocity; + @UnsupportedAppUsage private int mMaximumVelocity; private float mVelocityScale = 1.0f; @@ -651,6 +677,7 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te * 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 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te /** * 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 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te /** * 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 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te * @hide */ @Override + @UnsupportedAppUsage protected boolean isVerticalScrollBarHidden() { return isFastScrollEnabled(); } @@ -1469,6 +1501,7 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te /** * 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 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te static class SavedState extends BaseSavedState { long selectedId; + @UnsupportedAppUsage long firstId; + @UnsupportedAppUsage int viewTop; int position; int height; @@ -2228,6 +2263,7 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te } } + @UnsupportedAppUsage private boolean canScrollUp() { boolean canScrollUp; // 0th element is not visible @@ -2244,6 +2280,7 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te return canScrollUp; } + @UnsupportedAppUsage private boolean canScrollDown() { boolean canScrollDown; int count = getChildCount(); @@ -2571,6 +2608,7 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te 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 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te mScrollDown = down; } + @UnsupportedAppUsage void updateSelectorState() { final Drawable selector = mSelector; if (selector != null && selector.isStateful()) { @@ -3219,6 +3258,7 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te return false; } + @UnsupportedAppUsage boolean performLongPress(final View child, final int longPressPosition, final long longPressId) { return performLongPress( @@ -3229,6 +3269,7 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te 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 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te * * @param newState The new scroll state. */ + @UnsupportedAppUsage void reportScrollStateChange(int newState) { if (newState != mLastScrollState) { if (mOnScrollListener != null) { @@ -4574,6 +4616,7 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te /** * Tracks the decay of a fling scroll */ + @UnsupportedAppUsage private final OverScroller mScroller; /** @@ -4618,6 +4661,7 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te mScroller = new OverScroller(getContext()); } + @UnsupportedAppUsage void start(int initialVelocity) { int initialY = initialVelocity < 0 ? Integer.MAX_VALUE : 0; mLastFlingY = initialY; @@ -4695,6 +4739,7 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te postOnAnimation(this); } + @UnsupportedAppUsage void endFling() { mTouchMode = TOUCH_MODE_REST; @@ -4949,6 +4994,7 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te smoothScrollBy(distance, duration, false, false); } + @UnsupportedAppUsage void smoothScrollBy(int distance, int duration, boolean linear, boolean suppressEndFlingStateChangeCall) { if (mFlingRunnable == null) { @@ -5091,6 +5137,7 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te * @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 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te * @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 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te * 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 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te @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 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te * scrap heap. * @hide */ + @UnsupportedAppUsage int scrappedFromPosition; /** @@ -6617,6 +6668,7 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te * @see android.widget.AbsListView.RecyclerListener */ class RecycleBin { + @UnsupportedAppUsage private RecyclerListener mRecyclerListener; /** @@ -6698,6 +6750,7 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te /** * 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 61a58733479f..a85c5854d05a 100644 --- a/core/java/android/widget/AbsSeekBar.java +++ b/core/java/android/widget/AbsSeekBar.java @@ -18,6 +18,7 @@ package android.widget; 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 @@ import com.android.internal.R; 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 @@ public abstract class AbsSeekBar extends ProgressBar { 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 @@ public abstract class AbsSeekBar extends ProgressBar { 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 @@ public abstract class AbsSeekBar extends ProgressBar { /** * Draw the thumb. */ + @UnsupportedAppUsage void drawThumb(Canvas canvas) { if (mThumb != null) { final int saveCount = canvas.save(); @@ -834,6 +842,7 @@ public abstract class AbsSeekBar extends ProgressBar { } } + @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 46269c667a8f..eb20a76754ea 100644 --- a/core/java/android/widget/ActionMenuPresenter.java +++ b/core/java/android/widget/ActionMenuPresenter.java @@ -22,6 +22,7 @@ import android.animation.ObjectAnimator; 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 @@ public class ActionMenuPresenter extends BaseMenuPresenter * 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 @@ public class ActionMenuPresenter extends BaseMenuPresenter /** * @return true if the overflow menu is currently showing */ + @UnsupportedAppUsage public boolean isOverflowMenuShowing() { return mOverflowPopup != null && mOverflowPopup.isShowing(); } @@ -766,6 +769,7 @@ public class ActionMenuPresenter extends BaseMenuPresenter } @Override + @UnsupportedAppUsage public Parcelable onSaveInstanceState() { SavedState state = new SavedState(); state.openSubMenuId = mOpenSubMenuId; @@ -773,6 +777,7 @@ public class ActionMenuPresenter extends BaseMenuPresenter } @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 c4bbdb005fe0..7e58622db3b8 100644 --- a/core/java/android/widget/ActionMenuView.java +++ b/core/java/android/widget/ActionMenuView.java @@ -18,6 +18,7 @@ package android.widget; 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 @@ public class ActionMenuView extends LinearLayout implements MenuBuilder.ItemInvo } /** @hide */ + @UnsupportedAppUsage public boolean isOverflowReserved() { return mReserveOverflow; } @@ -655,6 +657,7 @@ public class ActionMenuView extends LinearLayout implements MenuBuilder.ItemInvo * 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 @@ public class ActionMenuView extends LinearLayout implements MenuBuilder.ItemInvo * 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 @@ public class ActionMenuView extends LinearLayout implements MenuBuilder.ItemInvo } /** @hide */ + @UnsupportedAppUsage public boolean isOverflowMenuShowPending() { return mPresenter != null && mPresenter.isOverflowMenuShowPending(); } @@ -714,6 +719,7 @@ public class ActionMenuView extends LinearLayout implements MenuBuilder.ItemInvo * @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 @@ public class ActionMenuView extends LinearLayout implements MenuBuilder.ItemInvo } /** @hide */ + @UnsupportedAppUsage public void setExpandedActionViewsExclusive(boolean exclusive) { mPresenter.setExpandedActionViewsExclusive(exclusive); } @@ -783,6 +790,7 @@ public class ActionMenuView extends LinearLayout implements MenuBuilder.ItemInvo /** @hide */ public interface ActionMenuChildView { + @UnsupportedAppUsage public boolean needsDividerBefore(); public boolean needsDividerAfter(); } @@ -790,25 +798,31 @@ public class ActionMenuView extends LinearLayout implements MenuBuilder.ItemInvo 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 75c857ccc374..f5bf7598aa5a 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 @@ public class ActivityChooserModel extends DataSetObservable { * * @return The model. */ + @UnsupportedAppUsage public static ActivityChooserModel get(Context context, String historyFileName) { synchronized (sRegistryLock) { ActivityChooserModel dataModel = sDataModelRegistry.get(historyFileName); @@ -376,6 +378,7 @@ public class ActivityChooserModel extends DataSetObservable { * * @param intent The intent. */ + @UnsupportedAppUsage public void setIntent(Intent intent) { synchronized (mInstanceLock) { if (mIntent == intent) { @@ -405,6 +408,7 @@ public class ActivityChooserModel extends DataSetObservable { * * @see #setIntent(Intent) */ + @UnsupportedAppUsage public int getActivityCount() { synchronized (mInstanceLock) { ensureConsistentState(); @@ -420,6 +424,7 @@ public class ActivityChooserModel extends DataSetObservable { * @see ActivityResolveInfo * @see #setIntent(Intent) */ + @UnsupportedAppUsage public ResolveInfo getActivity(int index) { synchronized (mInstanceLock) { ensureConsistentState(); @@ -467,6 +472,7 @@ public class ActivityChooserModel extends DataSetObservable { * @see HistoricalRecord * @see OnChooseActivityListener */ + @UnsupportedAppUsage public Intent chooseActivity(int index) { synchronized (mInstanceLock) { if (mIntent == null) { @@ -507,6 +513,7 @@ public class ActivityChooserModel extends DataSetObservable { * * @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 121a8c5f0251..58715eefc25e 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 @@ public class ActivityChooserView extends ViewGroup implements ActivityChooserMod * * @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 4e77f0bf59b6..dd6c923e7f47 100644 --- a/core/java/android/widget/AdapterView.java +++ b/core/java/android/widget/AdapterView.java @@ -18,6 +18,7 @@ package android.widget; 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 @@ public abstract class AdapterView<T extends Adapter> extends ViewGroup { * The position of the first child displayed */ @ViewDebug.ExportedProperty(category = "scrolling") + @UnsupportedAppUsage int mFirstPosition = 0; /** @@ -79,6 +81,7 @@ public abstract class AdapterView<T extends Adapter> extends ViewGroup { /** * Position from which to start looking for mSyncRowId */ + @UnsupportedAppUsage int mSyncPosition; /** @@ -94,6 +97,7 @@ public abstract class AdapterView<T extends Adapter> extends ViewGroup { /** * True if we need to sync to mSyncRowId */ + @UnsupportedAppUsage boolean mNeedSync = false; /** @@ -131,11 +135,13 @@ public abstract class AdapterView<T extends Adapter> extends ViewGroup { /** * 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 @@ public abstract class AdapterView<T extends Adapter> extends ViewGroup { /** * True if the data has changed since the last layout */ + @UnsupportedAppUsage boolean mDataChanged; /** @@ -153,17 +160,20 @@ public abstract class AdapterView<T extends Adapter> extends ViewGroup { * 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 @@ public abstract class AdapterView<T extends Adapter> extends ViewGroup { /** * The last selected position we used when notifying */ + @UnsupportedAppUsage int mOldSelectedPosition = INVALID_POSITION; /** @@ -900,6 +911,7 @@ public abstract class AdapterView<T extends Adapter> extends ViewGroup { } } + @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 @@ public abstract class AdapterView<T extends Adapter> extends ViewGroup { * 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 @@ public abstract class AdapterView<T extends Adapter> extends ViewGroup { * @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 bde5f7fd5129..795b03493efb 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 @@ import java.util.TimeZone; 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 e6f948f2d969..b754d84fbaf8 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 @@ public class AppSecurityPermissions { mNewPermPrefix = mContext.getText(R.string.perms_new_perm_prefix); } + @UnsupportedAppUsage public AppSecurityPermissions(Context context, String packageName) { this(context); mPackageName = packageName; @@ -418,6 +420,7 @@ public class AppSecurityPermissions { } } + @UnsupportedAppUsage public int getPermissionCount() { return getPermissionCount(WHICH_ALL); } @@ -438,6 +441,7 @@ public class AppSecurityPermissions { 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 f18f2172b455..c3c2c0db9a77 100644 --- a/core/java/android/widget/ArrayAdapter.java +++ b/core/java/android/widget/ArrayAdapter.java @@ -21,6 +21,7 @@ import android.annotation.IdRes; 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 @@ public class ArrayAdapter<T> extends BaseAdapter implements Filterable, ThemedSp * 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 @@ public class ArrayAdapter<T> extends BaseAdapter implements Filterable, ThemedSp * 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 @@ public class ArrayAdapter<T> extends BaseAdapter implements Filterable, ThemedSp // 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 49741d4d111e..71d13a9acdca 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 @@ public class AutoCompleteTextView extends EditText implements Filter.FilterListe /** 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 @@ public class AutoCompleteTextView extends EditText implements Filter.FilterListe // 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 @@ public class AutoCompleteTextView extends EditText implements Filter.FilterListe * * @hide Pending API council approval */ + @UnsupportedAppUsage public void setDropDownAnimationStyle(int animationStyle) { mPopup.setAnimationStyle(animationStyle); } @@ -566,6 +572,7 @@ public class AutoCompleteTextView extends EditText implements Filter.FilterListe * * @hide Pending API council approval */ + @UnsupportedAppUsage public void setDropDownAlwaysVisible(boolean dropDownAlwaysVisible) { mPopup.setDropDownAlwaysVisible(dropDownAlwaysVisible); } @@ -587,6 +594,7 @@ public class AutoCompleteTextView extends EditText implements Filter.FilterListe * * @hide Pending API council approval */ + @UnsupportedAppUsage public void setDropDownDismissedOnCompletion(boolean dropDownDismissedOnCompletion) { mDropDownDismissedOnCompletion = dropDownDismissedOnCompletion; } @@ -866,6 +874,7 @@ public class AutoCompleteTextView extends EditText implements Filter.FilterListe } } + @UnsupportedAppUsage void doBeforeTextChanged() { if (mBlockCompletion) return; @@ -875,6 +884,7 @@ public class AutoCompleteTextView extends EditText implements Filter.FilterListe if (DEBUG) Log.v(TAG, "before text changed: open=" + mOpenBefore); } + @UnsupportedAppUsage void doAfterTextChanged() { if (mBlockCompletion) return; @@ -1171,6 +1181,7 @@ public class AutoCompleteTextView extends EditText implements Filter.FilterListe * * @hide internal used only by SearchDialog */ + @UnsupportedAppUsage public void showDropDownAfterLayout() { mPopup.postShow(); } @@ -1181,6 +1192,7 @@ public class AutoCompleteTextView extends EditText implements Filter.FilterListe * 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 @@ public class AutoCompleteTextView extends EditText implements Filter.FilterListe /** * @hide internal used only here and SearchDialog */ + @UnsupportedAppUsage public boolean isInputMethodNotNeeded() { return mPopup.getInputMethodMode() == ListPopupWindow.INPUT_METHOD_NOT_NEEDED; } @@ -1225,6 +1238,7 @@ public class AutoCompleteTextView extends EditText implements Filter.FilterListe * * @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 5838cc15cf92..7b9365b08a41 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 @@ import android.view.ViewGroup; * 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 db50e343b775..2ff815d6e309 100644 --- a/core/java/android/widget/CalendarView.java +++ b/core/java/android/widget/CalendarView.java @@ -23,6 +23,7 @@ import android.annotation.NonNull; 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 @@ public class CalendarView extends FrameLayout { 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 92bfd56d8988..1472b01b7af4 100644 --- a/core/java/android/widget/CheckedTextView.java +++ b/core/java/android/widget/CheckedTextView.java @@ -19,6 +19,7 @@ package android.widget; 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 @@ public class CheckedTextView extends TextView implements Checkable { private boolean mChecked; private int mCheckMarkResource; + @UnsupportedAppUsage private Drawable mCheckMarkDrawable; private ColorStateList mCheckMarkTintList = null; private PorterDuff.Mode mCheckMarkTintMode = null; @@ -61,6 +63,7 @@ public class CheckedTextView extends TextView implements Checkable { 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 0762b15626f7..8d094898d909 100644 --- a/core/java/android/widget/CompoundButton.java +++ b/core/java/android/widget/CompoundButton.java @@ -19,6 +19,7 @@ package android.widget; 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 @@ public abstract class CompoundButton extends Button implements Checkable { 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 9fb98db54e72..cc8b55009316 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 @@ public abstract class CursorAdapter extends BaseAdapter implements Filterable, * 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 @@ public abstract class CursorAdapter extends BaseAdapter implements Filterable, * 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 @@ public abstract class CursorAdapter extends BaseAdapter implements Filterable, * 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 b2b93faf6656..df53795941ab 100644 --- a/core/java/android/widget/DatePicker.java +++ b/core/java/android/widget/DatePicker.java @@ -19,6 +19,7 @@ package android.widget; 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 @@ public class DatePicker extends FrameLayout { @Retention(RetentionPolicy.SOURCE) public @interface DatePickerMode {} + @UnsupportedAppUsage private final DatePickerDelegate mDelegate; @DatePickerMode @@ -329,6 +331,7 @@ public class DatePicker extends FrameLayout { * @param callback the callback, may be null * @hide */ + @UnsupportedAppUsage public void setValidationCallback(@Nullable ValidationCallback callback) { mDelegate.setValidationCallback(callback); } diff --git a/core/java/android/widget/DateTimeView.java b/core/java/android/widget/DateTimeView.java index 2b1e900d8ee1..bf2762a6d727 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.MINUTE_IN_MILLIS; 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 @@ public class DateTimeView extends TextView { this(context, null); } + @UnsupportedAppUsage public DateTimeView(Context context, AttributeSet attrs) { super(context, attrs); final TypedArray a = context.obtainStyledAttributes(attrs, @@ -124,6 +126,7 @@ public class DateTimeView extends TextView { } @android.view.RemotableViewMethod + @UnsupportedAppUsage public void setTime(long time) { Time t = new Time(); t.set(time); @@ -149,6 +152,7 @@ public class DateTimeView extends TextView { } } + @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 f9f5901a6651..7e42862558e4 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 @@ public class EdgeEffect { private static final float RADIUS_FACTOR = 0.6f; private float mGlowAlpha; + @UnsupportedAppUsage private float mGlowScaleY; private float mGlowAlphaStart; @@ -106,6 +108,7 @@ public class EdgeEffect { 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 058736a71b5c..47ce90b358fe 100644 --- a/core/java/android/widget/Editor.java +++ b/core/java/android/widget/Editor.java @@ -21,6 +21,7 @@ import android.animation.ValueAnimator; 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 @@ public class Editor { 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 @@ public class Editor { boolean mDiscardNextActionUp; boolean mIgnoreActionUpEvent; + @UnsupportedAppUsage private long mShowCursor; private boolean mRenderCursorRegardlessTiming; private Blink mBlink; @@ -289,6 +293,7 @@ public class Editor { private boolean mShowErrorAfterAttach; boolean mInBatchEditControllers; + @UnsupportedAppUsage boolean mShowSoftInputOnFocus = true; private boolean mPreserveSelection; private boolean mRestartActionModeOnNextRefresh; @@ -304,8 +309,11 @@ public class Editor { 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 @@ public class Editor { 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 @@ public class Editor { } } + @UnsupportedAppUsage void invalidateTextDisplayList() { if (mTextRenderNodes != null) { for (int i = 0; i < mTextRenderNodes.length; i++) { @@ -6299,6 +6309,7 @@ public class Editor { 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 8d9848d41c59..33d15394332e 100644 --- a/core/java/android/widget/ExpandableListView.java +++ b/core/java/android/widget/ExpandableListView.java @@ -18,6 +18,7 @@ package android.widget; 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 @@ public class ExpandableListView extends ListView { 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 @@ public class ExpandableListView extends ListView { 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 @@ public class ExpandableListView extends ListView { {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 @@ public class ExpandableListView extends ListView { {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 @@ public class ExpandableListView extends ListView { void onGroupCollapse(int groupPosition); } + @UnsupportedAppUsage private OnGroupCollapseListener mOnGroupCollapseListener; public void setOnGroupCollapseListener( @@ -811,6 +819,7 @@ public class ExpandableListView extends ListView { void onGroupExpand(int groupPosition); } + @UnsupportedAppUsage private OnGroupExpandListener mOnGroupExpandListener; public void setOnGroupExpandListener( @@ -837,6 +846,7 @@ public class ExpandableListView extends ListView { long id); } + @UnsupportedAppUsage private OnGroupClickListener mOnGroupClickListener; public void setOnGroupClickListener(OnGroupClickListener onGroupClickListener) { @@ -864,6 +874,7 @@ public class ExpandableListView extends ListView { 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 198bf2722d99..2c09185fdf62 100644 --- a/core/java/android/widget/FastScroller.java +++ b/core/java/android/widget/FastScroller.java @@ -23,6 +23,7 @@ import android.animation.AnimatorSet; 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 @@ class FastScroller { 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 @@ class FastScroller { private final int[] mPreviewResId = new int[2]; /** The minimum touch target size in pixels. */ + @UnsupportedAppUsage private final int mMinimumTouchTarget; /** @@ -133,7 +138,9 @@ class FastScroller { /** 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 @@ class FastScroller { 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 @@ class FastScroller { 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 @@ class FastScroller { } }; + @UnsupportedAppUsage public FastScroller(AbsListView listView, int styleResId) { mList = listView; mOldItemCount = listView.getCount(); @@ -392,6 +402,7 @@ class FastScroller { /** * Removes this FastScroller overlay from the host view. */ + @UnsupportedAppUsage public void remove() { mOverlay.remove(mTrackImage); mOverlay.remove(mThumbImage); @@ -507,6 +518,7 @@ class FastScroller { return mWidth; } + @UnsupportedAppUsage public void onSizeChanged(int w, int h, int oldw, int oldh) { updateLayout(); } @@ -816,6 +828,7 @@ class FastScroller { mThumbRange = max - min; } + @UnsupportedAppUsage private void setState(int state) { mList.removeCallbacks(mDeferHide); @@ -1380,6 +1393,7 @@ class FastScroller { cancelFling(); } + @UnsupportedAppUsage public boolean onInterceptTouchEvent(MotionEvent ev) { if (!isEnabled()) { return false; @@ -1449,6 +1463,7 @@ class FastScroller { 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 d90154027327..16f4ee2b51d6 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 @@ public abstract class Filter { * @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 dc8ee01391b8..865f52082f28 100644 --- a/core/java/android/widget/FrameLayout.java +++ b/core/java/android/widget/FrameLayout.java @@ -20,6 +20,7 @@ import android.annotation.AttrRes; 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 @@ public class FrameLayout extends ViewGroup { 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 7655f3df93f3..ea1bfc2854c2 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 @@ public class Gallery extends AbsSpinner implements GestureDetector.OnGestureList /** * Horizontal spacing between items. */ + @UnsupportedAppUsage private int mSpacing = 0; /** @@ -103,21 +105,25 @@ public class Gallery extends AbsSpinner implements GestureDetector.OnGestureList /** * 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 @@ public class Gallery extends AbsSpinner implements GestureDetector.OnGestureList /** * The currently selected item's child. */ + @UnsupportedAppUsage private View mSelectedChild; /** @@ -380,6 +387,7 @@ public class Gallery extends AbsSpinner implements GestureDetector.OnGestureList * * @param deltaX Change in X from the previous event. */ + @UnsupportedAppUsage void trackMotionScroll(int deltaX) { if (getChildCount() == 0) { @@ -472,6 +480,7 @@ public class Gallery extends AbsSpinner implements GestureDetector.OnGestureList /** * @return The center of this Gallery. */ + @UnsupportedAppUsage private int getCenterOfGallery() { return (getWidth() - mPaddingLeft - mPaddingRight) / 2 + mPaddingLeft; } @@ -479,6 +488,7 @@ public class Gallery extends AbsSpinner implements GestureDetector.OnGestureList /** * @return The center of the given view. */ + @UnsupportedAppUsage private static int getCenterOfView(View view) { return view.getLeft() + view.getWidth() / 2; } @@ -696,6 +706,7 @@ public class Gallery extends AbsSpinner implements GestureDetector.OnGestureList updateSelectedItemMetadata(); } + @UnsupportedAppUsage private void fillToGalleryLeft() { if (mIsRtl) { fillToGalleryLeftRtl(); @@ -767,6 +778,7 @@ public class Gallery extends AbsSpinner implements GestureDetector.OnGestureList } } + @UnsupportedAppUsage private void fillToGalleryRight() { if (mIsRtl) { fillToGalleryRightRtl(); @@ -851,6 +863,7 @@ public class Gallery extends AbsSpinner implements GestureDetector.OnGestureList * 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 @@ public class Gallery extends AbsSpinner implements GestureDetector.OnGestureList return super.onKeyUp(keyCode, event); } + @UnsupportedAppUsage boolean moveDirection(int direction) { direction = isLayoutRtl() ? -direction : direction; int targetPosition = mSelectedPosition + direction; @@ -1468,6 +1482,7 @@ public class Gallery extends AbsSpinner implements GestureDetector.OnGestureList 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 4b76c18e3b83..13c086c89d8f 100644 --- a/core/java/android/widget/GridLayout.java +++ b/core/java/android/widget/GridLayout.java @@ -31,6 +31,7 @@ import static java.lang.Math.max; 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 @@ public class GridLayout extends ViewGroup { } } + @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 1ec9b2f043b5..9ccd3211768d 100644 --- a/core/java/android/widget/GridView.java +++ b/core/java/android/widget/GridView.java @@ -18,6 +18,7 @@ package android.widget; 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 class GridView extends AbsListView { */ 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 @@ public class GridView extends AbsListView { * @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 @@ public class GridView extends AbsListView { * * @return The view that is currently selected */ + @UnsupportedAppUsage private View fillUp(int pos, int nextBottom) { View selectedView = null; @@ -965,6 +975,7 @@ public class GridView extends AbsListView { return sel; } + @UnsupportedAppUsage private boolean determineColumns(int availableSpace) { final int requestedHorizontalSpacing = mRequestedHorizontalSpacing; final int stretchMode = mStretchMode; @@ -1884,6 +1895,7 @@ public class GridView extends AbsListView { * 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 f9d8f920f883..10d50b811289 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 @@ import java.util.ArrayList; */ 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 0bf246042e00..bf9dffd52e33 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 @@ public class HorizontalScrollView extends FrameLayout { 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 @@ public class HorizontalScrollView extends FrameLayout { * 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 @@ public class HorizontalScrollView extends FrameLayout { * 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 @@ public class HorizontalScrollView extends FrameLayout { private int mMinimumVelocity; private int mMaximumVelocity; + @UnsupportedAppUsage private int mOverscrollDistance; + @UnsupportedAppUsage private int mOverflingDistance; private float mHorizontalScrollFactor; @@ -437,6 +447,7 @@ public class HorizontalScrollView extends FrameLayout { } } + @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 51e481d8445b..0fef9a54a2ff 100644 --- a/core/java/android/widget/ImageView.java +++ b/core/java/android/widget/ImageView.java @@ -20,6 +20,7 @@ import android.annotation.DrawableRes; 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 @@ public class ImageView extends View { 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 @@ public class ImageView extends View { 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 @@ public class ImageView extends View { 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 @@ public class ImageView extends View { } /** @hide **/ + @UnsupportedAppUsage public Runnable setImageResourceAsync(@DrawableRes int resId) { Drawable d = null; if (resId != 0) { @@ -540,6 +554,7 @@ public class ImageView extends View { } /** @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 @@ public class ImageView extends View { } } + @UnsupportedAppUsage private void resolveUri() { if (mDrawable != null) { return; @@ -974,6 +990,7 @@ public class ImageView extends View { } } + @UnsupportedAppUsage private void updateDrawable(Drawable d) { if (d != mRecycleableBitmapDrawable && mRecycleableBitmapDrawable != null) { mRecycleableBitmapDrawable.setBitmap(null); @@ -1018,6 +1035,7 @@ public class ImageView extends View { } } + @UnsupportedAppUsage private void resizeFromDrawable() { final Drawable d = mDrawable; if (d != null) { @@ -1049,6 +1067,7 @@ public class ImageView extends View { 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 @@ public class ImageView extends View { } /** @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 40f9652c4c9b..452e9036cc54 100644 --- a/core/java/android/widget/LinearLayout.java +++ b/core/java/android/widget/LinearLayout.java @@ -19,6 +19,7 @@ package android.widget; 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 @@ public class LinearLayout extends ViewGroup { @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 @@ public class LinearLayout extends ViewGroup { /** @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 adf366a49c8c..f9564b44e825 100644 --- a/core/java/android/widget/ListPopupWindow.java +++ b/core/java/android/widget/ListPopupWindow.java @@ -20,6 +20,7 @@ import android.annotation.AttrRes; 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 @@ public class ListPopupWindow implements ShowableListMenu { private Context mContext; private ListAdapter mAdapter; + @UnsupportedAppUsage private DropDownListView mDropDownList; private int mDropDownHeight = ViewGroup.LayoutParams.WRAP_CONTENT; @@ -115,6 +117,7 @@ public class ListPopupWindow implements ShowableListMenu { private boolean mModal; + @UnsupportedAppUsage PopupWindow mPopup; /** @@ -310,6 +313,7 @@ public class ListPopupWindow implements ShowableListMenu { * * @hide Used only by AutoCompleteTextView to handle some internal special cases. */ + @UnsupportedAppUsage public void setForceIgnoreOutsideTouch(boolean forceIgnoreOutsideTouch) { mForceIgnoreOutsideTouch = forceIgnoreOutsideTouch; } @@ -325,6 +329,7 @@ public class ListPopupWindow implements ShowableListMenu { * * @hide Only used by AutoCompleteTextView under special conditions. */ + @UnsupportedAppUsage public void setDropDownAlwaysVisible(boolean dropDownAlwaysVisible) { mDropDownAlwaysVisible = dropDownAlwaysVisible; } @@ -334,6 +339,7 @@ public class ListPopupWindow implements ShowableListMenu { * * @hide Only used by AutoCompleteTextView under special conditions. */ + @UnsupportedAppUsage public boolean isDropDownAlwaysVisible() { return mDropDownAlwaysVisible; } @@ -898,6 +904,7 @@ public class ListPopupWindow implements ShowableListMenu { * * @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 @@ public class ListPopupWindow implements ShowableListMenu { * * @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 fc9e8e70c20a..ee04bcfddb27 100644 --- a/core/java/android/widget/ListView.java +++ b/core/java/android/widget/ListView.java @@ -19,6 +19,7 @@ package android.widget; 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 class ListView extends AbsListView { 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 @@ public class ListView extends AbsListView { private boolean mHeaderDividersEnabled; private boolean mFooterDividersEnabled; + @UnsupportedAppUsage private boolean mAreAllItemsSelectable = true; private boolean mItemsCanFocus = false; @@ -772,6 +778,7 @@ public class ListView extends AbsListView { * @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 @@ public class ListView extends AbsListView { * * @return The view that is currently selected */ + @UnsupportedAppUsage private View fillUp(int pos, int nextBottom) { View selectedView = null; @@ -1382,6 +1390,7 @@ public class ListView extends AbsListView { * 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 @@ public class ListView extends AbsListView { * @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 @@ public class ListView extends AbsListView { * * @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 @@ public class ListView extends AbsListView { * * @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 @@ public class ListView extends AbsListView { } @Override + @UnsupportedAppUsage boolean trackMotionScroll(int deltaY, int incrementalDeltaY) { final boolean result = super.trackMotionScroll(deltaY, incrementalDeltaY); removeUnusedFixedViews(mHeaderViewInfos); @@ -2000,6 +2013,7 @@ public class ListView extends AbsListView { * @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 @@ public class ListView extends AbsListView { * 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 @@ public class ListView extends AbsListView { * @param position the position of the item to select */ @Override + @UnsupportedAppUsage void setSelectionInt(int position) { setNextSelectedPositionInt(position); boolean awakeScrollbars = false; @@ -2229,6 +2245,7 @@ public class ListView extends AbsListView { * 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 @@ public class ListView extends AbsListView { * * @return whether selection was moved */ + @UnsupportedAppUsage boolean arrowScroll(int direction) { try { mInLayout = true; @@ -3235,6 +3253,7 @@ public class ListView extends AbsListView { * * @param amount The amount (positive or negative) to scroll. */ + @UnsupportedAppUsage private void scrollListItemsBy(int amount) { offsetChildrenTopAndBottom(amount); @@ -4001,6 +4020,7 @@ public class ListView extends AbsListView { } @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 8e04f1cd9f5b..82d77c528564 100644 --- a/core/java/android/widget/MediaController.java +++ b/core/java/android/widget/MediaController.java @@ -16,6 +16,7 @@ package android.widget; +import android.annotation.UnsupportedAppUsage; import android.content.Context; import android.content.res.Resources; import android.graphics.PixelFormat; @@ -68,16 +69,29 @@ import java.util.Locale; */ public class MediaController extends FrameLayout { + @UnsupportedAppUsage private MediaPlayerControl mPlayer; + @UnsupportedAppUsage private final Context mContext; + @UnsupportedAppUsage private View mAnchor; + @UnsupportedAppUsage private View mRoot; + @UnsupportedAppUsage private WindowManager mWindowManager; + @UnsupportedAppUsage private Window mWindow; + @UnsupportedAppUsage private View mDecor; + @UnsupportedAppUsage private WindowManager.LayoutParams mDecorLayoutParams; + @UnsupportedAppUsage private ProgressBar mProgress; - private TextView mEndTime, mCurrentTime; + @UnsupportedAppUsage + private TextView mEndTime; + @UnsupportedAppUsage + private TextView mCurrentTime; + @UnsupportedAppUsage private boolean mShowing; private boolean mDragging; private static final int sDefaultTimeout = 3000; @@ -87,10 +101,15 @@ public class MediaController extends FrameLayout { private View.OnClickListener mNextListener, mPrevListener; StringBuilder mFormatBuilder; Formatter mFormatter; + @UnsupportedAppUsage private ImageButton mPauseButton; + @UnsupportedAppUsage private ImageButton mFfwdButton; + @UnsupportedAppUsage private ImageButton mRewButton; + @UnsupportedAppUsage private ImageButton mNextButton; + @UnsupportedAppUsage private ImageButton mPrevButton; private CharSequence mPlayDescription; private CharSequence mPauseDescription; @@ -535,6 +554,7 @@ public class MediaController extends FrameLayout { } }; + @UnsupportedAppUsage private void updatePausePlay() { if (mRoot == null || mPauseButton == null) return; @@ -568,6 +588,7 @@ public class MediaController extends FrameLayout { // The second scenario involves the user operating the scroll ball, in this // case there WON'T BE onStartTrackingTouch/onStopTrackingTouch notifications, // we will simply apply the updated position without suspending regular updates. + @UnsupportedAppUsage private final OnSeekBarChangeListener mSeekListener = new OnSeekBarChangeListener() { @Override public void onStartTrackingTouch(SeekBar bar) { @@ -641,6 +662,7 @@ public class MediaController extends FrameLayout { return MediaController.class.getName(); } + @UnsupportedAppUsage private final View.OnClickListener mRewListener = new View.OnClickListener() { @Override public void onClick(View v) { @@ -653,6 +675,7 @@ public class MediaController extends FrameLayout { } }; + @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 d98b865debc6..b6ed22c293f6 100644 --- a/core/java/android/widget/NumberPicker.java +++ b/core/java/android/widget/NumberPicker.java @@ -19,6 +19,7 @@ package android.widget; 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 @@ public class NumberPicker extends LinearLayout { /** * The number of items show in the selector wheel. */ + @UnsupportedAppUsage private static final int SELECTOR_WHEEL_ITEM_COUNT = 3; /** @@ -108,6 +110,7 @@ public class NumberPicker extends LinearLayout { /** * 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 @@ public class NumberPicker extends LinearLayout { /** * @hide */ + @UnsupportedAppUsage public static final Formatter getTwoDigitFormatter() { return sTwoDigitFormatter; } @@ -221,6 +225,7 @@ public class NumberPicker extends LinearLayout { /** * The text for showing the current value. */ + @UnsupportedAppUsage private final EditText mInputText; /** @@ -231,6 +236,7 @@ public class NumberPicker extends LinearLayout { /** * The min height of this widget. */ + @UnsupportedAppUsage private final int mMinHeight; /** @@ -241,6 +247,7 @@ public class NumberPicker extends LinearLayout { /** * The max width of this widget. */ + @UnsupportedAppUsage private final int mMinWidth; /** @@ -256,6 +263,7 @@ public class NumberPicker extends LinearLayout { /** * The height of the text. */ + @UnsupportedAppUsage private final int mTextSize; /** @@ -276,6 +284,7 @@ public class NumberPicker extends LinearLayout { /** * Upper value of the range of numbers allowed for the NumberPicker */ + @UnsupportedAppUsage private int mMaxValue; /** @@ -286,6 +295,7 @@ public class NumberPicker extends LinearLayout { /** * Listener to be notified upon current value change. */ + @UnsupportedAppUsage private OnValueChangeListener mOnValueChangeListener; /** @@ -311,11 +321,13 @@ public class NumberPicker extends LinearLayout { /** * 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 @@ public class NumberPicker extends LinearLayout { /** * The {@link Scroller} responsible for flinging the selector. */ + @UnsupportedAppUsage private final Scroller mFlingScroller; /** @@ -402,6 +415,7 @@ public class NumberPicker extends LinearLayout { /** * @see ViewConfiguration#getScaledMaximumFlingVelocity() */ + @UnsupportedAppUsage private int mMaximumFlingVelocity; /** @@ -422,11 +436,13 @@ public class NumberPicker extends LinearLayout { /** * 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 @@ public class NumberPicker extends LinearLayout { * 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 @@ public class NumberPicker extends LinearLayout { * * @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 99387896913a..e7a96bea18fe 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 @@ public class OverScroller { private int mMode; private final SplineOverScroller mScrollerX; + @UnsupportedAppUsage private final SplineOverScroller mScrollerY; + @UnsupportedAppUsage private Interpolator mInterpolator; private final boolean mFlywheel; @@ -68,6 +71,7 @@ public class OverScroller { * @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 @@ public class OverScroller { this(context, interpolator, flywheel); } + @UnsupportedAppUsage void setInterpolator(Interpolator interpolator) { if (interpolator == null) { mInterpolator = new Scroller.ViscousFluidInterpolator(); @@ -250,6 +255,7 @@ public class OverScroller { * to begin a new animation. */ @Deprecated + @UnsupportedAppUsage public void extendDuration(int extend) { mScrollerX.extendDuration(extend); mScrollerY.extendDuration(extend); @@ -530,6 +536,7 @@ public class OverScroller { /** * @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 @@ public class OverScroller { 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 59bbc3b8056e..d82e56c94d2a 100644 --- a/core/java/android/widget/PopupMenu.java +++ b/core/java/android/widget/PopupMenu.java @@ -18,6 +18,7 @@ package android.widget; 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 @@ import com.android.internal.view.menu.ShowableListMenu; * 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 9553cf5e119c..0da47fd802b3 100644 --- a/core/java/android/widget/PopupWindow.java +++ b/core/java/android/widget/PopupWindow.java @@ -24,6 +24,7 @@ import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_WILL_NOT_REPL 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 @@ public class PopupWindow { 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 @@ public class PopupWindow { */ 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 @@ public class PopupWindow { 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 @@ public class PopupWindow { } }; + @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 @@ public class PopupWindow { private int mAnchorXoff; private int mAnchorYoff; private int mAnchoredGravity; + @UnsupportedAppUsage private boolean mOverlapAnchor; private boolean mPopupViewInitialLayoutDirectionInherited; @@ -466,6 +490,7 @@ public class PopupWindow { * @see #getTransitionEpicenter() * @hide */ + @UnsupportedAppUsage public void setEpicenterBounds(Rect bounds) { mEpicenterBounds = bounds; } @@ -845,6 +870,7 @@ public class PopupWindow { * @param enabled True to clip to the screen. * @hide */ + @UnsupportedAppUsage public void setClipToScreenEnabled(boolean enabled) { mClipToScreen = enabled; } @@ -855,6 +881,7 @@ public class PopupWindow { * * @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 @@ public class PopupWindow { * @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 @@ public class PopupWindow { * the way that decor views behave for full-screen windows. * @hide */ + @UnsupportedAppUsage public void setLayoutInsetDecor(boolean enabled) { mLayoutInsetDecor = enabled; } @@ -996,6 +1025,7 @@ public class PopupWindow { * other windows behind it. * @hide */ + @UnsupportedAppUsage public void setTouchModal(boolean touchModal) { mNotTouchModal = !touchModal; } @@ -1181,6 +1211,7 @@ public class PopupWindow { * @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 @@ public class PopupWindow { } /** @hide */ + @UnsupportedAppUsage protected final void updateAboveAnchor(boolean aboveAnchor) { if (aboveAnchor != mAboveAnchor) { mAboveAnchor = aboveAnchor; @@ -1328,6 +1360,7 @@ public class PopupWindow { * * @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 @@ public class PopupWindow { * * @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 @@ public class PopupWindow { * * @hide */ + @UnsupportedAppUsage protected final WindowManager.LayoutParams createPopupLayoutParams(IBinder token) { final WindowManager.LayoutParams p = new WindowManager.LayoutParams(); @@ -1552,6 +1587,7 @@ public class PopupWindow { 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 e7c3a47348d0..1fc72f5ea032 100644 --- a/core/java/android/widget/ProgressBar.java +++ b/core/java/android/widget/ProgressBar.java @@ -20,6 +20,7 @@ import android.animation.ObjectAnimator; 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 @@ public class ProgressBar extends View { /** 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 @@ public class ProgressBar extends View { 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 @@ public class ProgressBar extends View { private Drawable mIndeterminateDrawable; private Drawable mProgressDrawable; + @UnsupportedAppUsage private Drawable mCurrentDrawable; private ProgressTintInfo mProgressTintInfo; @@ -206,6 +214,7 @@ public class ProgressBar extends View { /** 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 @@ public class ProgressBar extends View { * 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 @@ public class ProgressBar extends View { // Stub method. } + @UnsupportedAppUsage private synchronized void refreshProgress(int id, int progress, boolean fromUser, boolean animate) { if (mUiThreadId == Thread.currentThread().getId()) { @@ -1401,6 +1412,7 @@ public class ProgressBar extends View { } @android.view.RemotableViewMethod + @UnsupportedAppUsage synchronized boolean setProgressInternal(int progress, boolean fromUser, boolean animate) { if (mIndeterminate) { // Not applicable. @@ -1599,6 +1611,7 @@ public class ProgressBar extends View { /** * <p>Start the indeterminate progress animation.</p> */ + @UnsupportedAppUsage void startAnimation() { if (getVisibility() != VISIBLE || getWindowVisibility() != VISIBLE) { return; @@ -1638,6 +1651,7 @@ public class ProgressBar extends View { /** * <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 8f6b0d538e32..c1a217c6dc89 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 @@ public class QuickContactBadge extends ImageView implements OnClickListener { 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 c98714799742..327a5c1d2527 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 @@ public class RadioGroup extends LinearLayout { // 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 70b70bcb36ea..d343d499a712 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 @@ public class RatingBar extends AbsSeekBar { 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 d1de498d71ed..74051e2d5a1a 100644 --- a/core/java/android/widget/RelativeLayout.java +++ b/core/java/android/widget/RelativeLayout.java @@ -19,6 +19,7 @@ package android.widget; 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 @@ public class RelativeLayout extends ViewGroup { 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 @@ public class RelativeLayout extends ViewGroup { 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 22c840b3bf7e..8fa8ef88a3ad 100644 --- a/core/java/android/widget/RemoteViews.java +++ b/core/java/android/widget/RemoteViews.java @@ -22,6 +22,7 @@ import android.annotation.ColorInt; 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 @@ public class RemoteViews implements Parcelable, Filter { * * @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 @@ public class RemoteViews implements Parcelable, Filter { * RemoteViews. */ private RemoteViews mLandscape = null; + @UnsupportedAppUsage private RemoteViews mPortrait = null; /** @@ -360,6 +366,7 @@ public class RemoteViews implements Parcelable, Filter { 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 @@ public class RemoteViews implements Parcelable, Filter { // Do nothing } + @UnsupportedAppUsage public int mergeBehavior() { return MERGE_REPLACE; } @@ -457,6 +465,7 @@ public class RemoteViews implements Parcelable, Filter { // Nothing to visit by default } + @UnsupportedAppUsage int viewId; } @@ -489,6 +498,7 @@ public class RemoteViews implements Parcelable, Filter { * * @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 @@ public class RemoteViews implements Parcelable, Filter { return SET_PENDING_INTENT_TEMPLATE_TAG; } + @UnsupportedAppUsage PendingIntent pendingIntentTemplate; } @@ -963,6 +974,7 @@ public class RemoteViews implements Parcelable, Filter { return SET_ON_CLICK_PENDING_INTENT_TAG; } + @UnsupportedAppUsage PendingIntent pendingIntent; } @@ -1154,6 +1166,7 @@ public class RemoteViews implements Parcelable, Filter { private static class BitmapCache { + @UnsupportedAppUsage ArrayList<Bitmap> mBitmaps; int mBitmapMemory = -1; @@ -1205,7 +1218,9 @@ public class RemoteViews implements Parcelable, Filter { private class BitmapReflectionAction extends Action { int bitmapId; + @UnsupportedAppUsage Bitmap bitmap; + @UnsupportedAppUsage String methodName; BitmapReflectionAction(int viewId, String methodName, Bitmap bitmap) { @@ -1271,8 +1286,10 @@ public class RemoteViews implements Parcelable, Filter { 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 @@ public class RemoteViews implements Parcelable, Filter { * ViewGroup methods that are related to adding Views. */ private class ViewGroupActionAdd extends Action { + @UnsupportedAppUsage private RemoteViews mNestedViews; private int mIndex; @@ -2421,6 +2439,7 @@ public class RemoteViews implements Parcelable, Filter { * 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 @@ public class RemoteViews implements Parcelable, Filter { * Returns an estimate of the bitmap heap memory usage for this RemoteViews. */ /** @hide */ + @UnsupportedAppUsage public int estimateMemoryUsage() { return mBitmapCache.getBitmapMemory(); } @@ -2494,6 +2514,7 @@ public class RemoteViews implements Parcelable, Filter { * * @hide */ + @UnsupportedAppUsage public void addView(int viewId, RemoteViews nestedView, int index) { addAction(new ViewGroupActionAdd(viewId, nestedView, index)); } @@ -2941,6 +2962,7 @@ public class RemoteViews implements Parcelable, Filter { * * @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 e5ae0ca0070c..d17c7c58ee74 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 @@ public class RemoteViewsAdapter extends BaseAdapter implements Handler.Callback private final Executor mAsyncViewLoadExecutor; private OnClickHandler mRemoteViewsOnClickHandler; + @UnsupportedAppUsage private final FixedSizeRemoteViewsCache mCache; private int mVisibleWindowLowerBound; private int mVisibleWindowUpperBound; @@ -107,6 +109,7 @@ public class RemoteViewsAdapter extends BaseAdapter implements Handler.Callback // 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 @@ public class RemoteViewsAdapter extends BaseAdapter implements Handler.Callback } } + @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 @@ public class RemoteViewsAdapter extends BaseAdapter implements Handler.Callback } } + @UnsupportedAppUsage public Intent getRemoteViewsServiceIntent() { return mIntent; } @@ -1067,6 +1074,7 @@ public class RemoteViewsAdapter extends BaseAdapter implements Handler.Callback * 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 2ae38c9aa3fb..e91f87e7ec3d 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 @@ import com.android.internal.widget.ScrollBarUtils; 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 @@ public class ScrollBarDrawable extends Drawable implements Drawable.Callback { } } + @UnsupportedAppUsage public void setVerticalThumbDrawable(Drawable thumb) { if (mVerticalThumb != null) { mVerticalThumb.setCallback(null); @@ -242,6 +245,7 @@ public class ScrollBarDrawable extends Drawable implements Drawable.Callback { 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 97d32f1266af..4658d7353355 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 @@ public class ScrollView extends FrameLayout { 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 @@ public class ScrollView extends FrameLayout { * 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 @@ public class ScrollView extends FrameLayout { * 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 @@ public class ScrollView extends FrameLayout { 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 @@ public class ScrollView extends FrameLayout { * These are no-ops on user builds. */ private StrictMode.Span mScrollStrictSpan = null; // aka "drag" + @UnsupportedAppUsage private StrictMode.Span mFlingStrictSpan = null; /** @@ -294,6 +307,7 @@ public class ScrollView extends FrameLayout { /** * @return Returns true this ScrollView can be scrolled */ + @UnsupportedAppUsage private boolean canScroll() { View child = getChildAt(0); if (child != null) { @@ -1644,6 +1658,7 @@ public class ScrollView extends FrameLayout { } } + @UnsupportedAppUsage private void endDrag() { mIsBeingDragged = false; diff --git a/core/java/android/widget/Scroller.java b/core/java/android/widget/Scroller.java index 357c9c36936b..229eaf0f8ff6 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 @@ import android.view.animation.Interpolator; * }</pre> */ public class Scroller { + @UnsupportedAppUsage private final Interpolator mInterpolator; private int mMode; @@ -77,6 +79,7 @@ public class Scroller { private int mCurrX; private int mCurrY; private long mStartTime; + @UnsupportedAppUsage private int mDuration; private float mDurationReciprocal; private float mDeltaX; @@ -94,7 +97,9 @@ public class Scroller { 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 @@ public class Scroller { 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 225497b74d06..5b5950dce1f4 100644 --- a/core/java/android/widget/SearchView.java +++ b/core/java/android/widget/SearchView.java @@ -19,6 +19,7 @@ package android.widget; 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 @@ public class SearchView extends LinearLayout implements CollapsibleActionView { */ 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 @@ public class SearchView extends LinearLayout implements CollapsibleActionView { 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 @@ public class SearchView extends LinearLayout implements CollapsibleActionView { 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 @@ public class SearchView extends LinearLayout implements CollapsibleActionView { .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 @@ public class SearchView extends LinearLayout implements CollapsibleActionView { return (mSubmitButtonEnabled || mVoiceButtonEnabled) && !isIconified(); } + @UnsupportedAppUsage private void updateSubmitButton(boolean hasText) { int visibility = GONE; if (mSubmitButtonEnabled && isSubmitAreaEnabled() && hasFocus() @@ -907,6 +927,7 @@ public class SearchView extends LinearLayout implements CollapsibleActionView { mGoButton.setVisibility(visibility); } + @UnsupportedAppUsage private void updateSubmitArea() { int visibility = GONE; if (isSubmitAreaEnabled() @@ -962,6 +983,7 @@ public class SearchView extends LinearLayout implements CollapsibleActionView { setQuery(queryText); } + @UnsupportedAppUsage private final OnClickListener mOnClickListener = new OnClickListener() { public void onClick(View v) { @@ -1270,6 +1292,7 @@ public class SearchView extends LinearLayout implements CollapsibleActionView { mSearchSrcTextView.dismissDropDown(); } + @UnsupportedAppUsage private void onCloseClicked() { CharSequence text = mSearchSrcTextView.getText(); if (TextUtils.isEmpty(text)) { @@ -1467,6 +1490,7 @@ public class SearchView extends LinearLayout implements CollapsibleActionView { return false; } + @UnsupportedAppUsage private final OnItemClickListener mOnItemClickListener = new OnItemClickListener() { /** @@ -1566,6 +1590,7 @@ public class SearchView extends LinearLayout implements CollapsibleActionView { /** * 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 @@ public class SearchView extends LinearLayout implements CollapsibleActionView { 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 f9aced09adcf..e8cf1e855a33 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 @@ public class SeekBar extends AbsSeekBar { void onStopTrackingTouch(SeekBar seekBar); } + @UnsupportedAppUsage private OnSeekBarChangeListener mOnSeekBarChangeListener; public SeekBar(Context context) { @@ -88,6 +90,7 @@ public class SeekBar extends AbsSeekBar { } @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 91901178e81e..a27354dc2bac 100644 --- a/core/java/android/widget/SimpleAdapter.java +++ b/core/java/android/widget/SimpleAdapter.java @@ -18,6 +18,7 @@ package android.widget; 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 @@ public class SimpleAdapter extends BaseAdapter implements Filterable, ThemedSpin 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 3dd0a9546909..b670e6c83f9d 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 @@ public class SimpleCursorAdapter extends ResourceCursorAdapter { * 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 9f483972cc63..8011c3aef494 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 @@ public class SlidingDrawer extends ViewGroup { 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 @@ public class SlidingDrawer extends ViewGroup { private float mAnimationPosition; private long mAnimationLastTime; private long mCurrentAnimationTime; + @UnsupportedAppUsage private int mTouchDelta; private boolean mAnimating; private boolean mAllowSingleTap; @@ -555,6 +560,7 @@ public class SlidingDrawer extends ViewGroup { stopTracking(notifyScrollListener); } + @UnsupportedAppUsage private void prepareTracking(int position) { mTracking = true; mVelocityTracker = VelocityTracker.obtain(); @@ -646,6 +652,7 @@ public class SlidingDrawer extends ViewGroup { } } + @UnsupportedAppUsage private void prepareContent() { if (mAnimating) { return; diff --git a/core/java/android/widget/Spinner.java b/core/java/android/widget/Spinner.java index ddf0e74efb59..1705ba8c38e8 100644 --- a/core/java/android/widget/Spinner.java +++ b/core/java/android/widget/Spinner.java @@ -19,6 +19,7 @@ package android.widget; 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 @@ public class Spinner extends AbsSpinner implements OnClickListener { 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 @@ public class Spinner extends AbsSpinner implements OnClickListener { /** * @hide internal use only */ + @UnsupportedAppUsage public void setOnItemClickListenerInt(OnItemClickListener l) { super.setOnItemClickListener(l); } @@ -1069,6 +1073,7 @@ public class Spinner extends AbsSpinner implements OnClickListener { /** * @return true if the popup is showing, false otherwise. */ + @UnsupportedAppUsage public boolean isShowing(); /** @@ -1099,6 +1104,7 @@ public class Spinner extends AbsSpinner implements OnClickListener { } } + @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 604575fae463..8bfc151b1a83 100644 --- a/core/java/android/widget/Switch.java +++ b/core/java/android/widget/Switch.java @@ -21,6 +21,7 @@ import android.annotation.DrawableRes; 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 @@ public class Switch extends CompoundButton { 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 @@ public class Switch extends CompoundButton { private boolean mHasTrackTintMode = false; private int mThumbTextPadding; + @UnsupportedAppUsage private int mSwitchMinWidth; private int mSwitchPadding; private boolean mSplitTrack; @@ -127,18 +131,21 @@ public class Switch extends CompoundButton { * 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 @@ public class Switch extends CompoundButton { private TextPaint mTextPaint; private ColorStateList mTextColors; + @UnsupportedAppUsage private Layout mOnLayout; + @UnsupportedAppUsage private Layout mOffLayout; private TransformationMethod2 mSwitchTransformationMethod; private ObjectAnimator mPositionAnimator; @@ -1050,6 +1059,7 @@ public class Switch extends CompoundButton { mPositionAnimator.start(); } + @UnsupportedAppUsage private void cancelPositionAnimator() { if (mPositionAnimator != null) { mPositionAnimator.cancel(); @@ -1065,6 +1075,7 @@ public class Switch extends CompoundButton { * * @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 8696d0d5df7f..b1fcbc33bbc9 100644 --- a/core/java/android/widget/TabHost.java +++ b/core/java/android/widget/TabHost.java @@ -18,6 +18,7 @@ package android.widget; 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 @@ public class TabHost extends FrameLayout implements ViewTreeObserver.OnTouchMode 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 @@ public class TabHost extends FrameLayout implements ViewTreeObserver.OnTouchMode * {@hide} */ protected LocalActivityManager mLocalActivityManager = null; + @UnsupportedAppUsage private OnTabChangeListener mOnTabChangeListener; private OnKeyListener mTabKeyListener; @@ -504,7 +508,9 @@ mTabHost.addTab(TAB_TAG_1, "Hello, world!", "Tab 1"); private final @NonNull String mTag; + @UnsupportedAppUsage private IndicatorStrategy mIndicatorStrategy; + @UnsupportedAppUsage private ContentStrategy mContentStrategy; /** @@ -767,6 +773,7 @@ mTabHost.addTab(TAB_TAG_1, "Hello, world!", "Tab 1"); 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 @@ mTabHost.addTab(TAB_TAG_1, "Hello, world!", "Tab 1"); 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 f8b6837e2d39..a90741b48684 100644 --- a/core/java/android/widget/TabWidget.java +++ b/core/java/android/widget/TabWidget.java @@ -18,6 +18,7 @@ package android.widget; 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 @@ public class TabWidget extends LinearLayout implements OnFocusChangeListener { 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 @@ public class TabWidget extends LinearLayout implements OnFocusChangeListener { @Nullable private Drawable mRightStrip; + @UnsupportedAppUsage private boolean mDrawBottomStrips = true; private boolean mStripMoved; @@ -541,6 +544,7 @@ public class TabWidget extends LinearLayout implements OnFocusChangeListener { * 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 d8a9ccad3f2e..4865808b3531 100644 --- a/core/java/android/widget/TextClock.java +++ b/core/java/android/widget/TextClock.java @@ -21,6 +21,7 @@ import static android.widget.RemoteViews.RemoteView; 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 @@ public class TextClock extends TextView { * * @hide */ + @UnsupportedAppUsage public CharSequence getFormat() { return mFormat; } @@ -623,6 +625,7 @@ public class TextClock extends TextView { /** * 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 3941d6a28b4a..31b1d9924e05 100644 --- a/core/java/android/widget/TextView.java +++ b/core/java/android/widget/TextView.java @@ -34,6 +34,7 @@ import android.annotation.Px; 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 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener */ 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 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener 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 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener } } + @UnsupportedAppUsage Drawables mDrawables; + @UnsupportedAppUsage private CharWrapper mCharWrapper; + @UnsupportedAppUsage private Marquee mMarquee; + @UnsupportedAppUsage private boolean mRestartMarquee; private int mMarqueeRepeatLimit = 3; @@ -640,37 +653,49 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener * 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 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener /* 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 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener 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 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener // 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 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener * {@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 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener * @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 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener shouldRequestLayout); } + @UnsupportedAppUsage private void setRawTextSize(float size, boolean shouldRequestLayout) { if (size != mTextPaint.getTextSize()) { mTextPaint.setTextSize(size); @@ -4776,6 +4833,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener * @attr ref android.R.styleable#TextView_scrollHorizontally * @hide */ + @UnsupportedAppUsage public boolean getHorizontallyScrolling() { return mHorizontallyScrolling; } @@ -5637,6 +5695,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener } } + @UnsupportedAppUsage private void setText(CharSequence text, BufferType type, boolean notifyBefore, int oldlen) { mTextSetFromXmlOrResourceId = false; @@ -5982,6 +6041,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener return mHint; } + @UnsupportedAppUsage boolean isSingleLine() { return mSingleLine; } @@ -6150,6 +6210,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener 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 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener 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 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener return drawableState; } + @UnsupportedAppUsage private Path getUpdatedHighlightPath() { Path highlight = null; Paint highlightPaint = mHighlightPaint; @@ -8135,6 +8198,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener /** @hide */ @VisibleForTesting + @UnsupportedAppUsage public void nullLayouts() { if (mLayout instanceof BoringLayout && mSavedLayout == null) { mSavedLayout = (BoringLayout) mLayout; @@ -8155,6 +8219,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener * 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 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener physicalWidth, false); } + @UnsupportedAppUsage private Layout.Alignment getLayoutAlignment() { Layout.Alignment alignment; switch (getTextAlignment()) { @@ -8230,6 +8296,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener * {@hide} */ @VisibleForTesting + @UnsupportedAppUsage public void makeNewLayout(int wantWidth, int hintWidth, BoringLayout.Metrics boring, BoringLayout.Metrics hintBoring, @@ -8454,6 +8521,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener return result; } + @UnsupportedAppUsage private boolean compressText(float width) { if (isHardwareAccelerated()) return false; @@ -8922,6 +8990,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener * 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 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener /** * Returns true if anything changed. */ + @UnsupportedAppUsage private boolean bringTextIntoView() { Layout layout = isShowingHint() ? mHintLayout : mLayout; int line = 0; @@ -9364,6 +9434,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener return getCompoundPaddingLeft() - mScrollX; } + @UnsupportedAppUsage int viewportToContentVerticalOffset() { int offset = getExtendedPaddingTop() - mScrollY; if ((mGravity & Gravity.VERTICAL_GRAVITY_MASK) != Gravity.TOP) { @@ -9649,6 +9720,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener && mSavedMarqueeModeLayout.getLineWidth(0) > width)); } + @UnsupportedAppUsage private void startMarquee() { // Do not ellipsize EditText if (getKeyListener() != null) return; @@ -9691,6 +9763,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener } } + @UnsupportedAppUsage private void startStopMarquee(boolean start) { if (mEllipsize == TextUtils.TruncateAt.MARQUEE) { if (start) { @@ -10235,6 +10308,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener * @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 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener || (isTextSelectable() && mText instanceof Spannable && isEnabled()); } + @UnsupportedAppUsage private Locale getTextServicesLocale(boolean allowNullLocale) { // Start fetching the text services locale asynchronously. updateTextServicesLocaleAsync(); @@ -10576,6 +10651,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener }); } + @UnsupportedAppUsage private void updateTextServicesLocaleLocked() { final TextServicesManager textServicesManager = (TextServicesManager) mContext.getSystemService(Context.TEXT_SERVICES_MANAGER_SERVICE); @@ -11254,6 +11330,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener * 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 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener return false; } + @UnsupportedAppUsage CharSequence getTransformedText(int start, int end) { return removeSuggestionSpans(mTransformed.subSequence(start, end)); } @@ -11692,6 +11770,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener /** * @hide */ + @UnsupportedAppUsage protected void stopTextActionMode() { if (mEditor != null) { mEditor.stopTextActionMode(); @@ -11755,6 +11834,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener return mDeviceProvisionedState == DEVICE_PROVISIONED_YES; } + @UnsupportedAppUsage boolean canPaste() { return (mText instanceof Editable && mEditor != null && mEditor.mKeyListener != null @@ -11894,6 +11974,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener return x; } + @UnsupportedAppUsage int getLineAtCoordinate(float y) { y -= getTotalPaddingTop(); // Clamp the position to inside of the view. @@ -11970,6 +12051,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener * @return the current {@link TextDirectionHeuristic}. * @hide */ + @UnsupportedAppUsage protected TextDirectionHeuristic getTextDirectionHeuristic() { if (hasPasswordTransformationMethod()) { // passwords fields should be LTR @@ -12081,6 +12163,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener * 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 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener * 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 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener * @hide */ @Override + @UnsupportedAppUsage public CharSequence getIterableTextForAccessibility() { return mText; } @@ -12240,6 +12325,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener 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 cfec3f2f603a..6a5c8cc9fac2 100644 --- a/core/java/android/widget/TimePicker.java +++ b/core/java/android/widget/TimePicker.java @@ -20,6 +20,7 @@ import android.annotation.IntDef; 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 @@ public class TimePicker extends FrameLayout { @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 f6071d86b905..3fbc819123c3 100644 --- a/core/java/android/widget/Toast.java +++ b/core/java/android/widget/Toast.java @@ -20,6 +20,7 @@ import android.annotation.IntDef; 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 class Toast { public static final int LENGTH_LONG = 1; final Context mContext; + @UnsupportedAppUsage final TN mTN; + @UnsupportedAppUsage int mDuration; View mNextView; @@ -253,6 +256,7 @@ public class Toast { * Gets the LayoutParams for the Toast window. * @hide */ + @UnsupportedAppUsage public WindowManager.LayoutParams getWindowParams() { return mTN.mParams; } @@ -336,8 +340,10 @@ public class Toast { // 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 @@ public class Toast { } 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 @@ public class Toast { 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 @@ public class Toast { * 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 @@ public class Toast { 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 79c19029d425..1bbd7e89ef21 100644 --- a/core/java/android/widget/Toolbar.java +++ b/core/java/android/widget/Toolbar.java @@ -24,6 +24,7 @@ import android.annotation.Nullable; 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 @@ public class Toolbar extends ViewGroup { 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 @@ public class Toolbar extends ViewGroup { 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 58a2b0f00877..14881eb60721 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 @@ public class VideoView extends SurfaceView // 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 @@ public class VideoView extends SurfaceView 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 @@ public class VideoView extends SurfaceView // 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 @@ public class VideoView extends SurfaceView } }; + @UnsupportedAppUsage MediaPlayer.OnPreparedListener mPreparedListener = new MediaPlayer.OnPreparedListener() { public void onPrepared(MediaPlayer mp) { mCurrentState = STATE_PREPARED; @@ -551,6 +564,7 @@ public class VideoView extends SurfaceView } }; + @UnsupportedAppUsage private MediaPlayer.OnErrorListener mErrorListener = new MediaPlayer.OnErrorListener() { public boolean onError(MediaPlayer mp, int framework_err, int impl_err) { @@ -655,6 +669,7 @@ public class VideoView extends SurfaceView mOnInfoListener = l; } + @UnsupportedAppUsage SurfaceHolder.Callback mSHCallback = new SurfaceHolder.Callback() { public void surfaceChanged(SurfaceHolder holder, int format, @@ -690,6 +705,7 @@ public class VideoView extends SurfaceView /* * 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 388eae2ad400..0724294a4e22 100644 --- a/core/java/android/widget/VideoView2.java +++ b/core/java/android/widget/VideoView2.java @@ -19,6 +19,7 @@ package android.widget; 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 @@ public class VideoView2 extends ViewGroupHelper<VideoView2Provider> { * @throws IllegalStateException if interal MediaSession is not created yet. * @hide TODO: remove */ + @UnsupportedAppUsage public MediaController getMediaController() { return mProvider.getMediaController_impl(); } @@ -285,6 +287,7 @@ public class VideoView2 extends ViewGroupHelper<VideoView2Provider> { * * @hide TODO remove */ + @UnsupportedAppUsage public void setVideoPath(String path) { mProvider.setVideoPath_impl(path); } @@ -380,6 +383,7 @@ public class VideoView2 extends ViewGroupHelper<VideoView2Provider> { * @hide */ @VisibleForTesting + @UnsupportedAppUsage public void setOnViewTypeChangedListener(OnViewTypeChangedListener l) { mProvider.setOnViewTypeChangedListener_impl(l); } @@ -410,6 +414,7 @@ public class VideoView2 extends ViewGroupHelper<VideoView2Provider> { * <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 1580f515eee1..598a40779cd1 100644 --- a/core/java/android/widget/ViewAnimator.java +++ b/core/java/android/widget/ViewAnimator.java @@ -18,6 +18,7 @@ package android.widget; 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 @@ import android.view.animation.AnimationUtils; */ public class ViewAnimator extends FrameLayout { + @UnsupportedAppUsage int mWhichChild = 0; + @UnsupportedAppUsage boolean mFirstTime = true; boolean mAnimateFirstTime = true; @@ -147,6 +150,7 @@ public class ViewAnimator extends FrameLayout { * @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 e769d71b66eb..5e72b2eee9ae 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 @@ public class ViewFlipper extends ViewAnimator { 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 @@ public class ViewFlipper extends ViewAnimator { * 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 66c052be6100..dd6a27b8f1e4 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 @@ import com.android.internal.R; @Widget public class ZoomControls extends LinearLayout { + @UnsupportedAppUsage private final ZoomButton mZoomIn; + @UnsupportedAppUsage private final ZoomButton mZoomOut; public ZoomControls(Context context) { diff --git a/core/java/com/android/internal/app/AlertController.java b/core/java/com/android/internal/app/AlertController.java index 732172111b80..d7031eaed4d8 100644 --- a/core/java/com/android/internal/app/AlertController.java +++ b/core/java/com/android/internal/app/AlertController.java @@ -21,6 +21,7 @@ import static android.view.ViewGroup.LayoutParams.MATCH_PARENT; import com.android.internal.R; import android.annotation.Nullable; +import android.annotation.UnsupportedAppUsage; import android.app.AlertDialog; import android.content.Context; import android.content.DialogInterface; @@ -71,9 +72,11 @@ public class AlertController { private final DialogInterface mDialogInterface; protected final Window mWindow; + @UnsupportedAppUsage private CharSequence mTitle; protected CharSequence mMessage; protected ListView mListView; + @UnsupportedAppUsage private View mView; private int mViewLayoutResId; @@ -107,8 +110,10 @@ public class AlertController { private MovementMethod mMessageMovementMethod; @Layout.HyphenationFrequency private Integer mMessageHyphenationFrequency; + @UnsupportedAppUsage private View mCustomTitleView; + @UnsupportedAppUsage private boolean mForceInverseBackground; private ListAdapter mAdapter; @@ -198,6 +203,7 @@ public class AlertController { } } + @UnsupportedAppUsage protected AlertController(Context context, DialogInterface di, Window window) { mContext = context; mDialogInterface = di; @@ -258,6 +264,7 @@ public class AlertController { installContent(); } + @UnsupportedAppUsage public void installContent() { int contentView = selectContentView(); mWindow.setContentView(contentView); @@ -275,6 +282,7 @@ public class AlertController { return mAlertDialogLayout; } + @UnsupportedAppUsage public void setTitle(CharSequence title) { mTitle = title; if (mTitleView != null) { @@ -285,10 +293,12 @@ public class AlertController { /** * @see AlertDialog.Builder#setCustomTitle(View) */ + @UnsupportedAppUsage public void setCustomTitle(View customTitleView) { mCustomTitleView = customTitleView; } + @UnsupportedAppUsage public void setMessage(CharSequence message) { mMessage = message; if (mMessageView != null) { @@ -323,6 +333,7 @@ public class AlertController { /** * Set the view to display in the dialog. */ + @UnsupportedAppUsage public void setView(View view) { mView = view; mViewLayoutResId = 0; @@ -362,6 +373,7 @@ public class AlertController { * @param listener The {@link DialogInterface.OnClickListener} to use. * @param msg The {@link Message} to be sent when clicked. */ + @UnsupportedAppUsage public void setButton(int whichButton, CharSequence text, DialogInterface.OnClickListener listener, Message msg) { @@ -397,6 +409,7 @@ public class AlertController { * @param resId the resource identifier of the drawable to use as the icon, * or 0 for no icon */ + @UnsupportedAppUsage public void setIcon(int resId) { mIcon = null; mIconId = resId; @@ -416,6 +429,7 @@ public class AlertController { * * @param icon the drawable to use as the icon or null for no icon */ + @UnsupportedAppUsage public void setIcon(Drawable icon) { mIcon = icon; mIconId = 0; @@ -446,10 +460,12 @@ public class AlertController { mForceInverseBackground = forceInverseBackground; } + @UnsupportedAppUsage public ListView getListView() { return mListView; } + @UnsupportedAppUsage public Button getButton(int whichButton) { switch (whichButton) { case DialogInterface.BUTTON_POSITIVE: @@ -464,11 +480,13 @@ public class AlertController { } @SuppressWarnings({"UnusedDeclaration"}) + @UnsupportedAppUsage public boolean onKeyDown(int keyCode, KeyEvent event) { return mScrollView != null && mScrollView.executeKeyEvent(event); } @SuppressWarnings({"UnusedDeclaration"}) + @UnsupportedAppUsage public boolean onKeyUp(int keyCode, KeyEvent event) { return mScrollView != null && mScrollView.executeKeyEvent(event); } @@ -932,10 +950,12 @@ public class AlertController { boolean mRecycleOnMeasure = true; + @UnsupportedAppUsage public RecycleListView(Context context) { this(context, null); } + @UnsupportedAppUsage public RecycleListView(Context context, AttributeSet attrs) { super(context, attrs); @@ -964,44 +984,74 @@ public class AlertController { } public static class AlertParams { + @UnsupportedAppUsage public final Context mContext; + @UnsupportedAppUsage public final LayoutInflater mInflater; + @UnsupportedAppUsage public int mIconId = 0; + @UnsupportedAppUsage public Drawable mIcon; public int mIconAttrId = 0; + @UnsupportedAppUsage public CharSequence mTitle; + @UnsupportedAppUsage public View mCustomTitleView; + @UnsupportedAppUsage public CharSequence mMessage; + @UnsupportedAppUsage public CharSequence mPositiveButtonText; + @UnsupportedAppUsage public DialogInterface.OnClickListener mPositiveButtonListener; + @UnsupportedAppUsage public CharSequence mNegativeButtonText; + @UnsupportedAppUsage public DialogInterface.OnClickListener mNegativeButtonListener; + @UnsupportedAppUsage public CharSequence mNeutralButtonText; + @UnsupportedAppUsage public DialogInterface.OnClickListener mNeutralButtonListener; + @UnsupportedAppUsage public boolean mCancelable; + @UnsupportedAppUsage public DialogInterface.OnCancelListener mOnCancelListener; + @UnsupportedAppUsage public DialogInterface.OnDismissListener mOnDismissListener; + @UnsupportedAppUsage public DialogInterface.OnKeyListener mOnKeyListener; + @UnsupportedAppUsage public CharSequence[] mItems; + @UnsupportedAppUsage public ListAdapter mAdapter; + @UnsupportedAppUsage public DialogInterface.OnClickListener mOnClickListener; public int mViewLayoutResId; + @UnsupportedAppUsage public View mView; public int mViewSpacingLeft; public int mViewSpacingTop; public int mViewSpacingRight; public int mViewSpacingBottom; public boolean mViewSpacingSpecified = false; + @UnsupportedAppUsage public boolean[] mCheckedItems; + @UnsupportedAppUsage public boolean mIsMultiChoice; + @UnsupportedAppUsage public boolean mIsSingleChoice; + @UnsupportedAppUsage public int mCheckedItem = -1; + @UnsupportedAppUsage public DialogInterface.OnMultiChoiceClickListener mOnCheckboxClickListener; + @UnsupportedAppUsage public Cursor mCursor; + @UnsupportedAppUsage public String mLabelColumn; + @UnsupportedAppUsage public String mIsCheckedColumn; public boolean mForceInverseBackground; + @UnsupportedAppUsage public AdapterView.OnItemSelectedListener mOnItemSelectedListener; public OnPrepareListViewListener mOnPrepareListViewListener; public boolean mRecycleOnMeasure = true; @@ -1019,12 +1069,14 @@ public class AlertController { void onPrepareListView(ListView listView); } + @UnsupportedAppUsage public AlertParams(Context context) { mContext = context; mCancelable = true; mInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); } + @UnsupportedAppUsage public void apply(AlertController dialog) { if (mCustomTitleView != null) { dialog.setCustomTitle(mCustomTitleView); diff --git a/core/java/com/android/internal/content/PackageMonitor.java b/core/java/com/android/internal/content/PackageMonitor.java index 3f8fd9bbf0c0..c928f3f39f03 100644 --- a/core/java/com/android/internal/content/PackageMonitor.java +++ b/core/java/com/android/internal/content/PackageMonitor.java @@ -16,6 +16,7 @@ package com.android.internal.content; +import android.annotation.UnsupportedAppUsage; import android.app.Activity; import android.content.Context; import android.content.Intent; @@ -70,10 +71,12 @@ public abstract class PackageMonitor extends android.content.BroadcastReceiver { String[] mTempArray = new String[1]; + @UnsupportedAppUsage public void register(Context context, Looper thread, boolean externalStorage) { register(context, thread, null, externalStorage); } + @UnsupportedAppUsage public void register(Context context, Looper thread, UserHandle user, boolean externalStorage) { register(context, user, externalStorage, @@ -107,6 +110,7 @@ public abstract class PackageMonitor extends android.content.BroadcastReceiver { return mRegisteredHandler; } + @UnsupportedAppUsage public void unregister() { if (mRegisteredContext == null) { throw new IllegalStateException("Not registered"); @@ -134,6 +138,7 @@ public abstract class PackageMonitor extends android.content.BroadcastReceiver { /** * Called when a package is really removed (and not replaced). */ + @UnsupportedAppUsage public void onPackageRemoved(String packageName, int uid) { } @@ -167,6 +172,7 @@ public abstract class PackageMonitor extends android.content.BroadcastReceiver { * default implementation returns true if this is a change to the entire * package. */ + @UnsupportedAppUsage public boolean onPackageChanged(String packageName, int uid, String[] components) { if (components != null) { for (String name : components) { @@ -246,6 +252,7 @@ public abstract class PackageMonitor extends android.content.BroadcastReceiver { return mAppearingPackages != null; } + @UnsupportedAppUsage public int isPackageDisappearing(String packageName) { if (mDisappearingPackages != null) { for (int i=mDisappearingPackages.length-1; i>=0; i--) { @@ -265,6 +272,7 @@ public abstract class PackageMonitor extends android.content.BroadcastReceiver { return mChangeType == PACKAGE_UPDATING; } + @UnsupportedAppUsage public boolean isPackageModified(String packageName) { if (mModifiedPackages != null) { for (int i=mModifiedPackages.length-1; i>=0; i--) { diff --git a/core/java/com/android/internal/content/ReferrerIntent.java b/core/java/com/android/internal/content/ReferrerIntent.java index 76dcc9bba91c..6d05f7e72a7a 100644 --- a/core/java/com/android/internal/content/ReferrerIntent.java +++ b/core/java/com/android/internal/content/ReferrerIntent.java @@ -16,6 +16,7 @@ package com.android.internal.content; +import android.annotation.UnsupportedAppUsage; import android.content.Intent; import android.os.Parcel; @@ -25,8 +26,10 @@ import java.util.Objects; * Subclass of Intent that also contains referrer (as a package name) information. */ public class ReferrerIntent extends Intent { + @UnsupportedAppUsage public final String mReferrer; + @UnsupportedAppUsage public ReferrerIntent(Intent baseIntent, String referrer) { super(baseIntent); mReferrer = referrer; diff --git a/core/java/com/android/internal/logging/MetricsLogger.java b/core/java/com/android/internal/logging/MetricsLogger.java index a48292925830..e99e39e1284c 100644 --- a/core/java/com/android/internal/logging/MetricsLogger.java +++ b/core/java/com/android/internal/logging/MetricsLogger.java @@ -15,6 +15,7 @@ */ package com.android.internal.logging; +import android.annotation.UnsupportedAppUsage; import android.content.Context; import android.metrics.LogMaker; import android.os.Build; @@ -47,6 +48,7 @@ public class MetricsLogger { public static final int VIEW_UNKNOWN = MetricsEvent.VIEW_UNKNOWN; public static final int LOGTAG = EventLogTags.SYSUI_MULTI_ACTION; + @UnsupportedAppUsage public void write(LogMaker content) { if (content.getType() == MetricsEvent.TYPE_UNKNOWN) { content.setType(MetricsEvent.TYPE_ACTION); diff --git a/core/java/com/android/internal/net/LegacyVpnInfo.java b/core/java/com/android/internal/net/LegacyVpnInfo.java index d6f6d0bac1a0..9ee97108ce49 100644 --- a/core/java/com/android/internal/net/LegacyVpnInfo.java +++ b/core/java/com/android/internal/net/LegacyVpnInfo.java @@ -16,6 +16,7 @@ package com.android.internal.net; +import android.annotation.UnsupportedAppUsage; import android.app.PendingIntent; import android.net.NetworkInfo; import android.os.Parcel; @@ -38,7 +39,9 @@ public class LegacyVpnInfo implements Parcelable { public static final int STATE_TIMEOUT = 4; public static final int STATE_FAILED = 5; + @UnsupportedAppUsage public String key; + @UnsupportedAppUsage public int state = -1; public PendingIntent intent; @@ -54,6 +57,7 @@ public class LegacyVpnInfo implements Parcelable { out.writeParcelable(intent, flags); } + @UnsupportedAppUsage public static final Parcelable.Creator<LegacyVpnInfo> CREATOR = new Parcelable.Creator<LegacyVpnInfo>() { @Override diff --git a/core/java/com/android/internal/net/VpnConfig.java b/core/java/com/android/internal/net/VpnConfig.java index 5ce5bcd15710..fd03b3f16348 100644 --- a/core/java/com/android/internal/net/VpnConfig.java +++ b/core/java/com/android/internal/net/VpnConfig.java @@ -16,6 +16,7 @@ package com.android.internal.net; +import android.annotation.UnsupportedAppUsage; import android.app.PendingIntent; import android.content.ComponentName; import android.content.Context; diff --git a/core/java/com/android/internal/net/VpnProfile.java b/core/java/com/android/internal/net/VpnProfile.java index b46bfef49f00..bc4b5fe3ff17 100644 --- a/core/java/com/android/internal/net/VpnProfile.java +++ b/core/java/com/android/internal/net/VpnProfile.java @@ -16,6 +16,7 @@ package com.android.internal.net; +import android.annotation.UnsupportedAppUsage; import android.os.Parcel; import android.os.Parcelable; import android.text.TextUtils; @@ -45,10 +46,15 @@ public class VpnProfile implements Cloneable, Parcelable { public static final int TYPE_MAX = 5; // Entity fields. + @UnsupportedAppUsage public final String key; // -1 + @UnsupportedAppUsage public String name = ""; // 0 + @UnsupportedAppUsage public int type = TYPE_PPTP; // 1 + @UnsupportedAppUsage public String server = ""; // 2 + @UnsupportedAppUsage public String username = ""; // 3 public String password = ""; // 4 public String dnsServers = ""; // 5 @@ -63,12 +69,14 @@ public class VpnProfile implements Cloneable, Parcelable { public String ipsecServerCert = "";// 14 // Helper fields. + @UnsupportedAppUsage public boolean saveLogin = false; public VpnProfile(String key) { this.key = key; } + @UnsupportedAppUsage public VpnProfile(Parcel in) { key = in.readString(); name = in.readString(); @@ -110,6 +118,7 @@ public class VpnProfile implements Cloneable, Parcelable { out.writeInt(saveLogin ? 1 : 0); } + @UnsupportedAppUsage public static VpnProfile decode(String key, byte[] value) { try { if (key == null) { diff --git a/core/java/com/android/internal/os/AtomicFile.java b/core/java/com/android/internal/os/AtomicFile.java index 5a83f33c8750..e177fe303253 100644 --- a/core/java/com/android/internal/os/AtomicFile.java +++ b/core/java/com/android/internal/os/AtomicFile.java @@ -16,6 +16,7 @@ package com.android.internal.os; +import android.annotation.UnsupportedAppUsage; import android.os.FileUtils; import android.util.Log; @@ -44,15 +45,18 @@ public final class AtomicFile { private final File mBaseName; private final File mBackupName; + @UnsupportedAppUsage public AtomicFile(File baseName) { mBaseName = baseName; mBackupName = new File(baseName.getPath() + ".bak"); } + @UnsupportedAppUsage public File getBaseFile() { return mBaseName; } + @UnsupportedAppUsage public FileOutputStream startWrite() throws IOException { // Rename the current file so it may be used as a backup during the next read if (mBaseName.exists()) { @@ -86,6 +90,7 @@ public final class AtomicFile { return str; } + @UnsupportedAppUsage public void finishWrite(FileOutputStream str) { if (str != null) { FileUtils.sync(str); @@ -98,6 +103,7 @@ public final class AtomicFile { } } + @UnsupportedAppUsage public void failWrite(FileOutputStream str) { if (str != null) { FileUtils.sync(str); @@ -111,6 +117,7 @@ public final class AtomicFile { } } + @UnsupportedAppUsage public FileOutputStream openAppend() throws IOException { try { return new FileOutputStream(mBaseName, true); @@ -119,6 +126,7 @@ public final class AtomicFile { } } + @UnsupportedAppUsage public void truncate() throws IOException { try { FileOutputStream fos = new FileOutputStream(mBaseName); @@ -139,6 +147,7 @@ public final class AtomicFile { mBackupName.delete(); } + @UnsupportedAppUsage public FileInputStream openRead() throws FileNotFoundException { if (mBackupName.exists()) { mBaseName.delete(); @@ -147,6 +156,7 @@ public final class AtomicFile { return new FileInputStream(mBaseName); } + @UnsupportedAppUsage public byte[] readFully() throws IOException { FileInputStream stream = openRead(); try { diff --git a/core/java/com/android/internal/os/BatterySipper.java b/core/java/com/android/internal/os/BatterySipper.java index 5abc6d4f76b1..0baf73cc024a 100644 --- a/core/java/com/android/internal/os/BatterySipper.java +++ b/core/java/com/android/internal/os/BatterySipper.java @@ -15,6 +15,7 @@ */ package com.android.internal.os; +import android.annotation.UnsupportedAppUsage; import android.os.BatteryStats.Uid; import java.util.List; @@ -23,8 +24,11 @@ import java.util.List; * Contains power usage of an application, system service, or hardware type. */ public class BatterySipper implements Comparable<BatterySipper> { + @UnsupportedAppUsage public int userId; + @UnsupportedAppUsage public Uid uidObj; + @UnsupportedAppUsage public DrainType drainType; /** @@ -53,6 +57,7 @@ public class BatterySipper implements Comparable<BatterySipper> { /** * Total power before smearing */ + @UnsupportedAppUsage public double totalPowerMah; /** @@ -65,6 +70,7 @@ public class BatterySipper implements Comparable<BatterySipper> { /** * Generic usage time in milliseconds. */ + @UnsupportedAppUsage public long usageTimeMs; /** @@ -76,12 +82,17 @@ public class BatterySipper implements Comparable<BatterySipper> { public long audioTimeMs; public long bluetoothRunningTimeMs; public long cameraTimeMs; + @UnsupportedAppUsage public long cpuFgTimeMs; + @UnsupportedAppUsage public long cpuTimeMs; public long flashlightTimeMs; + @UnsupportedAppUsage public long gpsTimeMs; public long videoTimeMs; + @UnsupportedAppUsage public long wakeLockTimeMs; + @UnsupportedAppUsage public long wifiRunningTimeMs; public long mobileRxPackets; @@ -99,7 +110,9 @@ public class BatterySipper implements Comparable<BatterySipper> { public long btTxBytes; public double percent; public double noCoveragePercent; + @UnsupportedAppUsage public String[] mPackages; + @UnsupportedAppUsage public String packageWithHighestDrain; // Measured in mAh (milli-ampere per hour). @@ -107,6 +120,7 @@ public class BatterySipper implements Comparable<BatterySipper> { public double audioPowerMah; public double bluetoothPowerMah; public double cameraPowerMah; + @UnsupportedAppUsage public double cpuPowerMah; public double flashlightPowerMah; public double gpsPowerMah; @@ -118,6 +132,7 @@ public class BatterySipper implements Comparable<BatterySipper> { public enum DrainType { AMBIENT_DISPLAY, + @UnsupportedAppUsage APP, BLUETOOTH, CAMERA, @@ -133,6 +148,7 @@ public class BatterySipper implements Comparable<BatterySipper> { WIFI, } + @UnsupportedAppUsage public BatterySipper(DrainType drainType, Uid uid, double value) { this.totalPowerMah = value; this.drainType = drainType; @@ -162,10 +178,12 @@ public class BatterySipper implements Comparable<BatterySipper> { /** * Gets a list of packages associated with the current user */ + @UnsupportedAppUsage public String[] getPackages() { return mPackages; } + @UnsupportedAppUsage public int getUid() { // Bail out if the current sipper is not an App sipper. if (uidObj == null) { @@ -177,6 +195,7 @@ public class BatterySipper implements Comparable<BatterySipper> { /** * Add stats from other to this BatterySipper. */ + @UnsupportedAppUsage public void add(BatterySipper other) { totalPowerMah += other.totalPowerMah; usageTimeMs += other.usageTimeMs; diff --git a/core/java/com/android/internal/os/BatteryStatsHelper.java b/core/java/com/android/internal/os/BatteryStatsHelper.java index 061011b41a4b..ead98e7eee3c 100644 --- a/core/java/com/android/internal/os/BatteryStatsHelper.java +++ b/core/java/com/android/internal/os/BatteryStatsHelper.java @@ -16,6 +16,7 @@ package com.android.internal.os; +import android.annotation.UnsupportedAppUsage; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; @@ -75,9 +76,11 @@ public class BatteryStatsHelper { final private boolean mCollectBatteryBroadcast; final private boolean mWifiOnly; + @UnsupportedAppUsage private IBatteryStats mBatteryInfo; private BatteryStats mStats; private Intent mBatteryBroadcast; + @UnsupportedAppUsage private PowerProfile mPowerProfile; private String[] mSystemPackageArray; @@ -87,6 +90,7 @@ public class BatteryStatsHelper { /** * List of apps using power. */ + @UnsupportedAppUsage private final List<BatterySipper> mUsageList = new ArrayList<>(); /** @@ -166,14 +170,17 @@ public class BatteryStatsHelper { profile.getAveragePower(PowerProfile.POWER_BLUETOOTH_CONTROLLER_TX) != 0; } + @UnsupportedAppUsage public BatteryStatsHelper(Context context) { this(context, true); } + @UnsupportedAppUsage public BatteryStatsHelper(Context context, boolean collectBatteryBroadcast) { this(context, collectBatteryBroadcast, checkWifiOnly(context)); } + @UnsupportedAppUsage public BatteryStatsHelper(Context context, boolean collectBatteryBroadcast, boolean wifiOnly) { mContext = context; mCollectBatteryBroadcast = collectBatteryBroadcast; @@ -241,6 +248,7 @@ public class BatteryStatsHelper { ServiceManager.getService(BatteryStats.SERVICE_NAME))); } + @UnsupportedAppUsage public static void dropFile(Context context, String fname) { makeFilePath(context, fname).delete(); } @@ -250,10 +258,12 @@ public class BatteryStatsHelper { } /** Clears the current stats and forces recreating for future use. */ + @UnsupportedAppUsage public void clearStats() { mStats = null; } + @UnsupportedAppUsage public BatteryStats getStats() { if (mStats == null) { load(); @@ -261,6 +271,7 @@ public class BatteryStatsHelper { return mStats; } + @UnsupportedAppUsage public Intent getBatteryBroadcast() { if (mBatteryBroadcast == null && mCollectBatteryBroadcast) { load(); @@ -277,6 +288,7 @@ public class BatteryStatsHelper { mStats = stats; } + @UnsupportedAppUsage public void create(Bundle icicle) { if (icicle != null) { mStats = sStatsXfer; @@ -287,6 +299,7 @@ public class BatteryStatsHelper { mPowerProfile = new PowerProfile(mContext); } + @UnsupportedAppUsage public void storeState() { sStatsXfer = mStats; sBatteryBroadcastXfer = mBatteryBroadcast; @@ -323,6 +336,7 @@ public class BatteryStatsHelper { /** * Refreshes the power usage list. */ + @UnsupportedAppUsage public void refreshStats(int statsType, int asUser) { SparseArray<UserHandle> users = new SparseArray<>(1); users.put(asUser, new UserHandle(asUser)); @@ -332,6 +346,7 @@ public class BatteryStatsHelper { /** * Refreshes the power usage list. */ + @UnsupportedAppUsage public void refreshStats(int statsType, List<UserHandle> asUsers) { final int n = asUsers.size(); SparseArray<UserHandle> users = new SparseArray<>(n); @@ -345,6 +360,7 @@ public class BatteryStatsHelper { /** * Refreshes the power usage list. */ + @UnsupportedAppUsage public void refreshStats(int statsType, SparseArray<UserHandle> asUsers) { refreshStats(statsType, asUsers, SystemClock.elapsedRealtime() * 1000, SystemClock.uptimeMillis() * 1000); @@ -783,6 +799,7 @@ public class BatteryStatsHelper { return bs; } + @UnsupportedAppUsage public List<BatterySipper> getUsageList() { return mUsageList; } @@ -799,6 +816,7 @@ public class BatteryStatsHelper { return mStatsType; } + @UnsupportedAppUsage public double getMaxPower() { return mMaxPower; } @@ -807,6 +825,7 @@ public class BatteryStatsHelper { return mMaxRealPower; } + @UnsupportedAppUsage public double getTotalPower() { return mTotalPower; } @@ -1017,6 +1036,7 @@ public class BatteryStatsHelper { mServicepackageArray = array; } + @UnsupportedAppUsage private void load() { if (mBatteryInfo == null) { return; diff --git a/core/java/com/android/internal/os/BatteryStatsImpl.java b/core/java/com/android/internal/os/BatteryStatsImpl.java index f314872f4cd2..c65dd6fc1bb2 100644 --- a/core/java/com/android/internal/os/BatteryStatsImpl.java +++ b/core/java/com/android/internal/os/BatteryStatsImpl.java @@ -18,6 +18,7 @@ package com.android.internal.os; import android.annotation.NonNull; import android.annotation.Nullable; +import android.annotation.UnsupportedAppUsage; import android.app.ActivityManager; import android.bluetooth.BluetoothActivityEnergyInfo; import android.bluetooth.UidTraffic; @@ -602,8 +603,11 @@ public class BatteryStatsImpl extends BatteryStats { // In order to do this, we must refresh each timer whenever the number of active timers // changes. @VisibleForTesting + @UnsupportedAppUsage protected ArrayList<StopwatchTimer> mPartialTimers = new ArrayList<>(); + @UnsupportedAppUsage final ArrayList<StopwatchTimer> mFullTimers = new ArrayList<>(); + @UnsupportedAppUsage final ArrayList<StopwatchTimer> mWindowTimers = new ArrayList<>(); final ArrayList<StopwatchTimer> mDrawTimers = new ArrayList<>(); final SparseArray<ArrayList<StopwatchTimer>> mSensorTimers = new SparseArray<>(); @@ -982,6 +986,7 @@ public class BatteryStatsImpl extends BatteryStats { */ private final HashMap<String, SamplingTimer> mKernelWakelockStats = new HashMap<>(); + @UnsupportedAppUsage public Map<String, ? extends Timer> getKernelWakelockStats() { return mKernelWakelockStats; } @@ -1298,6 +1303,7 @@ public class BatteryStatsImpl extends BatteryStats { * State for keeping track of counting information. */ public static class Counter extends BatteryStats.Counter implements TimeBaseObs { + @UnsupportedAppUsage final AtomicInteger mCount = new AtomicInteger(); final TimeBase mTimeBase; int mLoadedCount; @@ -1853,6 +1859,7 @@ public class BatteryStatsImpl extends BatteryStats { * @param out the Parcel to be written to. * @param timer a Timer, or null. */ + @UnsupportedAppUsage public static void writeTimerToParcel(Parcel out, Timer timer, long elapsedRealtimeUs) { if (timer == null) { out.writeInt(0); // indicates null @@ -1864,6 +1871,7 @@ public class BatteryStatsImpl extends BatteryStats { } @Override + @UnsupportedAppUsage public long getTotalTimeLocked(long elapsedRealtimeUs, int which) { long val = computeRunTimeLocked(mTimeBase.getRealtime(elapsedRealtimeUs)); if (which == STATS_SINCE_UNPLUGGED) { @@ -1876,6 +1884,7 @@ public class BatteryStatsImpl extends BatteryStats { } @Override + @UnsupportedAppUsage public int getCountLocked(int which) { int val = computeCurrentCountLocked(); if (which == STATS_SINCE_UNPLUGGED) { @@ -2651,6 +2660,7 @@ public class BatteryStatsImpl extends BatteryStats { } @Override + @UnsupportedAppUsage public void detach() { super.detach(); if (mTimerPool != null) { @@ -4931,6 +4941,7 @@ public class BatteryStatsImpl extends BatteryStats { } } + @UnsupportedAppUsage public void noteScreenBrightnessLocked(int brightness) { // Bin the brightness. int bin = brightness / (256/NUM_SCREEN_BRIGHTNESS_BINS); @@ -4954,6 +4965,7 @@ public class BatteryStatsImpl extends BatteryStats { } } + @UnsupportedAppUsage public void noteUserActivityLocked(int uid, int event) { if (mOnBatteryInternal) { uid = mapUid(uid); @@ -5188,6 +5200,7 @@ public class BatteryStatsImpl extends BatteryStats { } } + @UnsupportedAppUsage public void notePhoneOnLocked() { if (!mPhoneOn) { final long elapsedRealtime = mClocks.elapsedRealtime(); @@ -5201,6 +5214,7 @@ public class BatteryStatsImpl extends BatteryStats { } } + @UnsupportedAppUsage public void notePhoneOffLocked() { if (mPhoneOn) { final long elapsedRealtime = mClocks.elapsedRealtime(); @@ -5370,12 +5384,14 @@ public class BatteryStatsImpl extends BatteryStats { updateAllPhoneStateLocked(state, simState, mPhoneSignalStrengthBinRaw); } + @UnsupportedAppUsage public void notePhoneSignalStrengthLocked(SignalStrength signalStrength) { // Bin the strength. int bin = signalStrength.getLevel(); updateAllPhoneStateLocked(mPhoneServiceStateRaw, mPhoneSimStateRaw, bin); } + @UnsupportedAppUsage public void notePhoneDataConnectionStateLocked(int dataType, boolean hasData) { // BatteryStats uses 0 to represent no network type. // Telephony does not have a concept of no network type, and uses 0 to represent unknown. @@ -5434,6 +5450,7 @@ public class BatteryStatsImpl extends BatteryStats { } } + @UnsupportedAppUsage public void noteAudioOnLocked(int uid) { uid = mapUid(uid); final long elapsedRealtime = mClocks.elapsedRealtime(); @@ -5449,6 +5466,7 @@ public class BatteryStatsImpl extends BatteryStats { getUidStatsLocked(uid).noteAudioTurnedOnLocked(elapsedRealtime); } + @UnsupportedAppUsage public void noteAudioOffLocked(int uid) { if (mAudioOnNesting == 0) { return; @@ -5466,6 +5484,7 @@ public class BatteryStatsImpl extends BatteryStats { getUidStatsLocked(uid).noteAudioTurnedOffLocked(elapsedRealtime); } + @UnsupportedAppUsage public void noteVideoOnLocked(int uid) { uid = mapUid(uid); final long elapsedRealtime = mClocks.elapsedRealtime(); @@ -5481,6 +5500,7 @@ public class BatteryStatsImpl extends BatteryStats { getUidStatsLocked(uid).noteVideoTurnedOnLocked(elapsedRealtime); } + @UnsupportedAppUsage public void noteVideoOffLocked(int uid) { if (mVideoOnNesting == 0) { return; @@ -5956,6 +5976,7 @@ public class BatteryStatsImpl extends BatteryStats { int mWifiFullLockNesting = 0; + @UnsupportedAppUsage public void noteFullWifiLockAcquiredLocked(int uid) { final long elapsedRealtime = mClocks.elapsedRealtime(); final long uptime = mClocks.uptimeMillis(); @@ -5969,6 +5990,7 @@ public class BatteryStatsImpl extends BatteryStats { getUidStatsLocked(uid).noteFullWifiLockAcquiredLocked(elapsedRealtime); } + @UnsupportedAppUsage public void noteFullWifiLockReleasedLocked(int uid) { final long elapsedRealtime = mClocks.elapsedRealtime(); final long uptime = mClocks.uptimeMillis(); @@ -6024,6 +6046,7 @@ public class BatteryStatsImpl extends BatteryStats { int mWifiMulticastNesting = 0; + @UnsupportedAppUsage public void noteWifiMulticastEnabledLocked(int uid) { uid = mapUid(uid); final long elapsedRealtime = mClocks.elapsedRealtime(); @@ -6044,6 +6067,7 @@ public class BatteryStatsImpl extends BatteryStats { getUidStatsLocked(uid).noteWifiMulticastEnabledLocked(elapsedRealtime); } + @UnsupportedAppUsage public void noteWifiMulticastDisabledLocked(int uid) { uid = mapUid(uid); final long elapsedRealtime = mClocks.elapsedRealtime(); @@ -6240,6 +6264,7 @@ public class BatteryStatsImpl extends BatteryStats { } } + @UnsupportedAppUsage @Override public long getScreenOnTime(long elapsedRealtimeUs, int which) { return mScreenOnTimer.getTotalTimeLocked(elapsedRealtimeUs, which); } @@ -6256,6 +6281,7 @@ public class BatteryStatsImpl extends BatteryStats { return mScreenDozeTimer.getCountLocked(which); } + @UnsupportedAppUsage @Override public long getScreenBrightnessTime(int brightnessBin, long elapsedRealtimeUs, int which) { return mScreenBrightnessTimer[brightnessBin].getTotalTimeLocked( @@ -6365,6 +6391,7 @@ public class BatteryStatsImpl extends BatteryStats { return (long) energyUsedMaMs; } + @UnsupportedAppUsage @Override public long getPhoneOnTime(long elapsedRealtimeUs, int which) { return mPhoneOnTimer.getTotalTimeLocked(elapsedRealtimeUs, which); } @@ -6373,12 +6400,14 @@ public class BatteryStatsImpl extends BatteryStats { return mPhoneOnTimer.getCountLocked(which); } + @UnsupportedAppUsage @Override public long getPhoneSignalStrengthTime(int strengthBin, long elapsedRealtimeUs, int which) { return mPhoneSignalStrengthsTimer[strengthBin].getTotalTimeLocked( elapsedRealtimeUs, which); } + @UnsupportedAppUsage @Override public long getPhoneSignalScanningTime( long elapsedRealtimeUs, int which) { return mPhoneSignalScanningTimer.getTotalTimeLocked( @@ -6389,6 +6418,7 @@ public class BatteryStatsImpl extends BatteryStats { return mPhoneSignalScanningTimer; } + @UnsupportedAppUsage @Override public int getPhoneSignalStrengthCount(int strengthBin, int which) { return mPhoneSignalStrengthsTimer[strengthBin].getCountLocked(which); } @@ -6397,12 +6427,14 @@ public class BatteryStatsImpl extends BatteryStats { return mPhoneSignalStrengthsTimer[strengthBin]; } + @UnsupportedAppUsage @Override public long getPhoneDataConnectionTime(int dataType, long elapsedRealtimeUs, int which) { return mPhoneDataConnectionsTimer[dataType].getTotalTimeLocked( elapsedRealtimeUs, which); } + @UnsupportedAppUsage @Override public int getPhoneDataConnectionCount(int dataType, int which) { return mPhoneDataConnectionsTimer[dataType].getCountLocked(which); } @@ -6411,6 +6443,7 @@ public class BatteryStatsImpl extends BatteryStats { return mPhoneDataConnectionsTimer[dataType]; } + @UnsupportedAppUsage @Override public long getMobileRadioActiveTime(long elapsedRealtimeUs, int which) { return mMobileRadioActiveTimer.getTotalTimeLocked(elapsedRealtimeUs, which); } @@ -6441,6 +6474,7 @@ public class BatteryStatsImpl extends BatteryStats { return mWifiMulticastWakelockTimer.getCountLocked(which); } + @UnsupportedAppUsage @Override public long getWifiOnTime(long elapsedRealtimeUs, int which) { return mWifiOnTimer.getTotalTimeLocked(elapsedRealtimeUs, which); } @@ -6449,6 +6483,7 @@ public class BatteryStatsImpl extends BatteryStats { return mWifiActiveTimer.getTotalTimeLocked(elapsedRealtimeUs, which); } + @UnsupportedAppUsage @Override public long getGlobalWifiRunningTime(long elapsedRealtimeUs, int which) { return mGlobalWifiRunningTimer.getTotalTimeLocked(elapsedRealtimeUs, which); } @@ -6546,6 +6581,7 @@ public class BatteryStatsImpl extends BatteryStats { } @Override + @UnsupportedAppUsage public long getNetworkActivityBytes(int type, int which) { if (type >= 0 && type < mNetworkByteActivityCounters.length) { return mNetworkByteActivityCounters[type].getCountLocked(which); @@ -6588,6 +6624,7 @@ public class BatteryStatsImpl extends BatteryStats { return mOnBattery; } + @UnsupportedAppUsage @Override public SparseArray<? extends BatteryStats.Uid> getUidStats() { return mUidStats; } @@ -7005,6 +7042,7 @@ public class BatteryStatsImpl extends BatteryStats { } @Override + @UnsupportedAppUsage public ArrayMap<String, ? extends BatteryStats.Uid.Wakelock> getWakelockStats() { return mWakelockStats.getMap(); } @@ -7030,11 +7068,13 @@ public class BatteryStatsImpl extends BatteryStats { } @Override + @UnsupportedAppUsage public SparseArray<? extends BatteryStats.Uid.Sensor> getSensorStats() { return mSensorStats; } @Override + @UnsupportedAppUsage public ArrayMap<String, ? extends BatteryStats.Uid.Proc> getProcessStats() { return mProcessStats; } @@ -7045,6 +7085,7 @@ public class BatteryStatsImpl extends BatteryStats { } @Override + @UnsupportedAppUsage public int getUid() { return mUid; } @@ -7432,6 +7473,7 @@ public class BatteryStatsImpl extends BatteryStats { } @Override + @UnsupportedAppUsage public long getWifiRunningTime(long elapsedRealtimeUs, int which) { if (mWifiRunningTimer == null) { return 0; @@ -7448,6 +7490,7 @@ public class BatteryStatsImpl extends BatteryStats { } @Override + @UnsupportedAppUsage public long getWifiScanTime(long elapsedRealtimeUs, int which) { if (mWifiScanTimer == null) { return 0; @@ -8893,6 +8936,7 @@ public class BatteryStatsImpl extends BatteryStats { } @Override + @UnsupportedAppUsage public Timer getWakeTime(int type) { switch (type) { case WAKE_TYPE_FULL: return mTimerFull; @@ -8962,6 +9006,7 @@ public class BatteryStatsImpl extends BatteryStats { } @Override + @UnsupportedAppUsage public Timer getSensorTime() { return mTimer; } @@ -8975,6 +9020,7 @@ public class BatteryStatsImpl extends BatteryStats { } @Override + @UnsupportedAppUsage public int getHandle() { return mHandle; } @@ -9231,6 +9277,7 @@ public class BatteryStatsImpl extends BatteryStats { readExcessivePowerFromParcelLocked(in); } + @UnsupportedAppUsage public void addCpuTimeLocked(int utime, int stime) { addCpuTimeLocked(utime, stime, mBsi.mOnBatteryTimeBase.isRunning()); } @@ -9242,10 +9289,12 @@ public class BatteryStatsImpl extends BatteryStats { } } + @UnsupportedAppUsage public void addForegroundTimeLocked(long ttime) { mForegroundTime += ttime; } + @UnsupportedAppUsage public void incStartsLocked() { mStarts++; } @@ -9264,6 +9313,7 @@ public class BatteryStatsImpl extends BatteryStats { } @Override + @UnsupportedAppUsage public long getUserTime(int which) { long val = mUserTime; if (which == STATS_CURRENT) { @@ -9275,6 +9325,7 @@ public class BatteryStatsImpl extends BatteryStats { } @Override + @UnsupportedAppUsage public long getSystemTime(int which) { long val = mSystemTime; if (which == STATS_CURRENT) { @@ -9286,6 +9337,7 @@ public class BatteryStatsImpl extends BatteryStats { } @Override + @UnsupportedAppUsage public long getForegroundTime(int which) { long val = mForegroundTime; if (which == STATS_CURRENT) { @@ -9297,6 +9349,7 @@ public class BatteryStatsImpl extends BatteryStats { } @Override + @UnsupportedAppUsage public int getStarts(int which) { int val = mStarts; if (which == STATS_CURRENT) { @@ -9621,6 +9674,7 @@ public class BatteryStatsImpl extends BatteryStats { return mStartTime + batteryUptime - mRunningSince; } + @UnsupportedAppUsage public void startLaunchedLocked() { if (!mLaunched) { mLaunches++; @@ -9629,6 +9683,7 @@ public class BatteryStatsImpl extends BatteryStats { } } + @UnsupportedAppUsage public void stopLaunchedLocked() { if (mLaunched) { long time = mBsi.getBatteryUptimeLocked() - mLaunchedSince; @@ -9641,6 +9696,7 @@ public class BatteryStatsImpl extends BatteryStats { } } + @UnsupportedAppUsage public void startRunningLocked() { if (!mRunning) { mStarts++; @@ -9649,6 +9705,7 @@ public class BatteryStatsImpl extends BatteryStats { } } + @UnsupportedAppUsage public void stopRunningLocked() { if (mRunning) { long time = mBsi.getBatteryUptimeLocked() - mRunningSince; @@ -9661,6 +9718,7 @@ public class BatteryStatsImpl extends BatteryStats { } } + @UnsupportedAppUsage public BatteryStatsImpl getBatteryStats() { return mBsi; } @@ -10160,6 +10218,7 @@ public class BatteryStatsImpl extends BatteryStats { mUserInfoProvider = userInfoProvider; } + @UnsupportedAppUsage public BatteryStatsImpl(Parcel p) { this(new SystemClocks(), p); } @@ -10601,6 +10660,7 @@ public class BatteryStatsImpl extends BatteryStats { } @Override + @UnsupportedAppUsage public boolean startIteratingHistoryLocked() { mBatteryStatsHistory.startIteratingHistory(); mReadOverflow = false; @@ -10641,6 +10701,7 @@ public class BatteryStatsImpl extends BatteryStats { } @Override + @UnsupportedAppUsage public boolean getNextHistoryLocked(HistoryItem out) { Parcel p = mBatteryStatsHistory.getNextParcel(out); if (p == null) { @@ -10674,6 +10735,7 @@ public class BatteryStatsImpl extends BatteryStats { return mStartCount; } + @UnsupportedAppUsage public boolean isOnBattery() { return mOnBattery; } @@ -12694,10 +12756,12 @@ public class BatteryStatsImpl extends BatteryStats { } } + @UnsupportedAppUsage public long getAwakeTimeBattery() { return computeBatteryUptime(getBatteryUptimeLocked(), STATS_CURRENT); } + @UnsupportedAppUsage public long getAwakeTimePlugged() { return (mClocks.uptimeMillis() * 1000) - getAwakeTimeBattery(); } @@ -12723,11 +12787,13 @@ public class BatteryStatsImpl extends BatteryStats { } @Override + @UnsupportedAppUsage public long computeBatteryUptime(long curTime, int which) { return mOnBatteryTimeBase.computeUptime(curTime, which); } @Override + @UnsupportedAppUsage public long computeBatteryRealtime(long curTime, int which) { return mOnBatteryTimeBase.computeRealtime(curTime, which); } @@ -12781,6 +12847,7 @@ public class BatteryStatsImpl extends BatteryStats { } @Override + @UnsupportedAppUsage public long computeBatteryTimeRemaining(long curTime) { if (!mOnBattery) { return -1; @@ -12979,11 +13046,13 @@ public class BatteryStatsImpl extends BatteryStats { } @Override + @UnsupportedAppUsage public long getBatteryRealtime(long curTime) { return mOnBatteryTimeBase.getRealtime(curTime); } @Override + @UnsupportedAppUsage public int getDischargeStartLevel() { synchronized(this) { return getDischargeStartLevelLocked(); @@ -12995,6 +13064,7 @@ public class BatteryStatsImpl extends BatteryStats { } @Override + @UnsupportedAppUsage public int getDischargeCurrentLevel() { synchronized(this) { return getDischargeCurrentLevelLocked(); @@ -13028,6 +13098,7 @@ public class BatteryStatsImpl extends BatteryStats { } @Override + @UnsupportedAppUsage public int getDischargeAmount(int which) { int dischargeAmount = which == STATS_SINCE_CHARGED ? getHighDischargeAmountSinceCharge() @@ -13039,6 +13110,7 @@ public class BatteryStatsImpl extends BatteryStats { } @Override + @UnsupportedAppUsage public int getDischargeAmountScreenOn() { synchronized(this) { int val = mDischargeAmountScreenOn; @@ -13063,6 +13135,7 @@ public class BatteryStatsImpl extends BatteryStats { } @Override + @UnsupportedAppUsage public int getDischargeAmountScreenOff() { synchronized(this) { int val = mDischargeAmountScreenOff; @@ -13115,6 +13188,7 @@ public class BatteryStatsImpl extends BatteryStats { /** * Retrieve the statistics object for a particular uid, creating if needed. */ + @UnsupportedAppUsage public Uid getUidStatsLocked(int uid) { Uid u = mUidStats.get(uid); if (u == null) { @@ -13159,6 +13233,7 @@ public class BatteryStatsImpl extends BatteryStats { /** * Remove the statistics object for a particular uid. */ + @UnsupportedAppUsage public void removeUidStatsLocked(int uid) { final Uid u = mUidStats.get(uid); if (u != null) { @@ -13172,6 +13247,7 @@ public class BatteryStatsImpl extends BatteryStats { * Retrieve the statistics object for a particular process, creating * if needed. */ + @UnsupportedAppUsage public Uid.Proc getProcessStatsLocked(int uid, String name) { uid = mapUid(uid); Uid u = getUidStatsLocked(uid); @@ -13182,6 +13258,7 @@ public class BatteryStatsImpl extends BatteryStats { * Retrieve the statistics object for a particular process, creating * if needed. */ + @UnsupportedAppUsage public Uid.Pkg getPackageStatsLocked(int uid, String pkg) { uid = mapUid(uid); Uid u = getUidStatsLocked(uid); @@ -13192,6 +13269,7 @@ public class BatteryStatsImpl extends BatteryStats { * Retrieve the statistics object for a particular service, creating * if needed. */ + @UnsupportedAppUsage public Uid.Pkg.Serv getServiceStatsLocked(int uid, String pkg, String name) { uid = mapUid(uid); Uid u = getUidStatsLocked(uid); @@ -13523,6 +13601,7 @@ public class BatteryStatsImpl extends BatteryStats { } } + @UnsupportedAppUsage public void readLocked() { if (mDailyFile != null) { readDailyStatsLocked(); @@ -15146,6 +15225,7 @@ public class BatteryStatsImpl extends BatteryStats { } } + @UnsupportedAppUsage public static final Parcelable.Creator<BatteryStatsImpl> CREATOR = new Parcelable.Creator<BatteryStatsImpl>() { public BatteryStatsImpl createFromParcel(Parcel in) { diff --git a/core/java/com/android/internal/os/FuseAppLoop.java b/core/java/com/android/internal/os/FuseAppLoop.java index 67fbe5e76745..d08930b007ff 100644 --- a/core/java/com/android/internal/os/FuseAppLoop.java +++ b/core/java/com/android/internal/os/FuseAppLoop.java @@ -18,6 +18,7 @@ package com.android.internal.os; import android.annotation.NonNull; import android.annotation.Nullable; +import android.annotation.UnsupportedAppUsage; import android.os.ProxyFileDescriptorCallback; import android.os.Handler; import android.os.Message; @@ -226,6 +227,7 @@ public class FuseAppLoop implements Handler.Callback { // Called by JNI. @SuppressWarnings("unused") + @UnsupportedAppUsage private void onCommand(int command, long unique, long inode, long offset, int size, byte[] data) { synchronized (mLock) { @@ -254,6 +256,7 @@ public class FuseAppLoop implements Handler.Callback { // Called by JNI. @SuppressWarnings("unused") + @UnsupportedAppUsage private byte[] onOpen(long unique, long inode) { synchronized (mLock) { try { diff --git a/core/java/com/android/internal/os/HandlerCaller.java b/core/java/com/android/internal/os/HandlerCaller.java index ae7c5f230e22..c8bfa1b02e22 100644 --- a/core/java/com/android/internal/os/HandlerCaller.java +++ b/core/java/com/android/internal/os/HandlerCaller.java @@ -16,11 +16,18 @@ package com.android.internal.os; +import android.annotation.UnsupportedAppUsage; import android.content.Context; import android.os.Handler; import android.os.Looper; import android.os.Message; +/** + * @deprecated Use {@link com.android.internal.util.function.pooled.PooledLambda#obtainMessage} + * to achieve the same effect of storing multiple values in a message with the added typesafety + * and code continuity benefits. + */ +@Deprecated public class HandlerCaller { final Looper mMainLooper; final Handler mH; @@ -82,6 +89,7 @@ public class HandlerCaller { mH.removeMessages(what, obj); } + @UnsupportedAppUsage public void sendMessage(Message msg) { mH.sendMessage(msg); } @@ -106,6 +114,7 @@ public class HandlerCaller { return args; } + @UnsupportedAppUsage public Message obtainMessage(int what) { return mH.obtainMessage(what); } @@ -121,6 +130,7 @@ public class HandlerCaller { return mH.obtainMessage(what, arg1 ? 1 : 0, 0, args); } + @UnsupportedAppUsage public Message obtainMessageO(int what, Object arg1) { return mH.obtainMessage(what, 0, 0, arg1); } @@ -133,6 +143,7 @@ public class HandlerCaller { return mH.obtainMessage(what, arg1, arg2); } + @UnsupportedAppUsage public Message obtainMessageIO(int what, int arg1, Object arg2) { return mH.obtainMessage(what, arg1, 0, arg2); } @@ -149,6 +160,7 @@ public class HandlerCaller { return mH.obtainMessage(what, arg1, arg2, args); } + @UnsupportedAppUsage public Message obtainMessageIOO(int what, int arg1, Object arg2, Object arg3) { SomeArgs args = SomeArgs.obtain(); args.arg1 = arg2; @@ -183,6 +195,7 @@ public class HandlerCaller { return mH.obtainMessage(what, arg1, arg2, args); } + @UnsupportedAppUsage public Message obtainMessageOO(int what, Object arg1, Object arg2) { SomeArgs args = SomeArgs.obtain(); args.arg1 = arg1; @@ -190,6 +203,7 @@ public class HandlerCaller { return mH.obtainMessage(what, 0, 0, args); } + @UnsupportedAppUsage public Message obtainMessageOOO(int what, Object arg1, Object arg2, Object arg3) { SomeArgs args = SomeArgs.obtain(); args.arg1 = arg1; diff --git a/core/java/com/android/internal/os/PowerProfile.java b/core/java/com/android/internal/os/PowerProfile.java index 246a50f6ceac..997b722681ba 100644 --- a/core/java/com/android/internal/os/PowerProfile.java +++ b/core/java/com/android/internal/os/PowerProfile.java @@ -17,6 +17,7 @@ package com.android.internal.os; +import android.annotation.UnsupportedAppUsage; import android.content.Context; import android.content.res.Resources; import android.content.res.XmlResourceParser; @@ -57,22 +58,27 @@ public class PowerProfile { * + core_power.cluster1 * num running cores in cluster 1 */ public static final String POWER_CPU_SUSPEND = "cpu.suspend"; + @UnsupportedAppUsage public static final String POWER_CPU_IDLE = "cpu.idle"; + @UnsupportedAppUsage public static final String POWER_CPU_ACTIVE = "cpu.active"; /** * Power consumption when WiFi driver is scanning for networks. */ + @UnsupportedAppUsage public static final String POWER_WIFI_SCAN = "wifi.scan"; /** * Power consumption when WiFi driver is on. */ + @UnsupportedAppUsage public static final String POWER_WIFI_ON = "wifi.on"; /** * Power consumption when WiFi driver is transmitting/receiving. */ + @UnsupportedAppUsage public static final String POWER_WIFI_ACTIVE = "wifi.active"; // @@ -101,6 +107,7 @@ public class PowerProfile { /** * Power consumption when GPS is on. */ + @UnsupportedAppUsage public static final String POWER_GPS_ON = "gps.on"; /** @@ -115,6 +122,7 @@ public class PowerProfile { * @deprecated */ @Deprecated + @UnsupportedAppUsage public static final String POWER_BLUETOOTH_ON = "bluetooth.on"; /** @@ -131,6 +139,7 @@ public class PowerProfile { * @deprecated */ @Deprecated + @UnsupportedAppUsage public static final String POWER_BLUETOOTH_AT_CMD = "bluetooth.at"; /** @@ -141,27 +150,32 @@ public class PowerProfile { /** * Power consumption when screen is on, not including the backlight power. */ + @UnsupportedAppUsage public static final String POWER_SCREEN_ON = "screen.on"; /** * Power consumption when cell radio is on but not on a call. */ + @UnsupportedAppUsage public static final String POWER_RADIO_ON = "radio.on"; /** * Power consumption when cell radio is hunting for a signal. */ + @UnsupportedAppUsage public static final String POWER_RADIO_SCANNING = "radio.scanning"; /** * Power consumption when talking on the phone. */ + @UnsupportedAppUsage public static final String POWER_RADIO_ACTIVE = "radio.active"; /** * Power consumption at full backlight brightness. If the backlight is at * 50% brightness, then this should be multiplied by 0.5 */ + @UnsupportedAppUsage public static final String POWER_SCREEN_FULL = "screen.full"; /** @@ -224,6 +238,7 @@ public class PowerProfile { private static final Object sLock = new Object(); @VisibleForTesting + @UnsupportedAppUsage public PowerProfile(Context context) { this(context, false); } @@ -371,6 +386,7 @@ public class PowerProfile { } } + @UnsupportedAppUsage public int getNumCpuClusters() { return mCpuClusters.length; } @@ -379,6 +395,7 @@ public class PowerProfile { return mCpuClusters[cluster].numCpus; } + @UnsupportedAppUsage public int getNumSpeedStepsInCpuCluster(int cluster) { if (cluster < 0 || cluster >= mCpuClusters.length) { return 0; // index out of bound @@ -442,6 +459,7 @@ public class PowerProfile { * @param type the subsystem type * @return the average current in milliAmps. */ + @UnsupportedAppUsage public double getAveragePower(String type) { return getAveragePowerOrDefault(type, 0); } @@ -455,6 +473,7 @@ public class PowerProfile { * If there is no data for multiple levels, the level is ignored. * @return the average current in milliAmps. */ + @UnsupportedAppUsage public double getAveragePower(String type, int level) { if (sPowerItemMap.containsKey(type)) { return sPowerItemMap.get(type); @@ -478,6 +497,7 @@ public class PowerProfile { * * @return the battery capacity in mAh */ + @UnsupportedAppUsage public double getBatteryCapacity() { return getAveragePower(POWER_BATTERY_CAPACITY); } diff --git a/core/java/com/android/internal/os/SomeArgs.java b/core/java/com/android/internal/os/SomeArgs.java index d9aa32532ccd..b9d53c1b5884 100644 --- a/core/java/com/android/internal/os/SomeArgs.java +++ b/core/java/com/android/internal/os/SomeArgs.java @@ -16,6 +16,8 @@ package com.android.internal.os; +import android.annotation.UnsupportedAppUsage; + /** * Helper class for passing more arguments though a message * and avoiding allocation of a custom class for wrapping the @@ -40,8 +42,11 @@ public final class SomeArgs { static final int WAIT_FINISHED = 2; int mWaitState = WAIT_NONE; + @UnsupportedAppUsage public Object arg1; + @UnsupportedAppUsage public Object arg2; + @UnsupportedAppUsage public Object arg3; public Object arg4; public Object arg5; @@ -50,7 +55,9 @@ public final class SomeArgs { public Object arg8; public Object arg9; public int argi1; + @UnsupportedAppUsage public int argi2; + @UnsupportedAppUsage public int argi3; public int argi4; public int argi5; @@ -60,6 +67,7 @@ public final class SomeArgs { /* do nothing - reduce visibility */ } + @UnsupportedAppUsage public static SomeArgs obtain() { synchronized (sPoolLock) { if (sPoolSize > 0) { @@ -85,6 +93,7 @@ public final class SomeArgs { } } + @UnsupportedAppUsage public void recycle() { if (mInPool) { throw new IllegalStateException("Already recycled."); diff --git a/core/java/com/android/internal/util/AsyncChannel.java b/core/java/com/android/internal/util/AsyncChannel.java index e760f2526701..69297b5582a5 100644 --- a/core/java/com/android/internal/util/AsyncChannel.java +++ b/core/java/com/android/internal/util/AsyncChannel.java @@ -16,6 +16,7 @@ package com.android.internal.util; +import android.annotation.UnsupportedAppUsage; import android.content.ComponentName; import android.content.Context; import android.content.Intent; @@ -105,6 +106,7 @@ public class AsyncChannel { * msg.obj == the AsyncChannel * msg.replyTo == dstMessenger if successful */ + @UnsupportedAppUsage public static final int CMD_CHANNEL_HALF_CONNECTED = BASE + 0; /** @@ -114,6 +116,7 @@ public class AsyncChannel { * * msg.replyTo = srcMessenger. */ + @UnsupportedAppUsage public static final int CMD_CHANNEL_FULL_CONNECTION = BASE + 1; /** @@ -159,6 +162,7 @@ public class AsyncChannel { sCmdToString[CMD_CHANNEL_DISCONNECT - BASE] = "CMD_CHANNEL_DISCONNECT"; sCmdToString[CMD_CHANNEL_DISCONNECTED - BASE] = "CMD_CHANNEL_DISCONNECTED"; } + @UnsupportedAppUsage protected static String cmdToString(int cmd) { cmd -= BASE; if ((cmd >= 0) && (cmd < sCmdToString.length)) { @@ -169,6 +173,7 @@ public class AsyncChannel { } /** Successful status always 0, !0 is an unsuccessful status */ + @UnsupportedAppUsage public static final int STATUS_SUCCESSFUL = 0; /** Error attempting to bind on a connect */ @@ -204,6 +209,7 @@ public class AsyncChannel { /** * AsyncChannel constructor */ + @UnsupportedAppUsage public AsyncChannel() { } @@ -255,6 +261,7 @@ public class AsyncChannel { * * @return STATUS_SUCCESSFUL on success any other value is an error. */ + @UnsupportedAppUsage public int connectSync(Context srcContext, Handler srcHandler, Messenger dstMessenger) { if (DBG) log("halfConnectSync srcHandler to the dstMessenger E"); @@ -370,6 +377,7 @@ public class AsyncChannel { * @param srcHandler * @param dstMessenger */ + @UnsupportedAppUsage public void connect(Context srcContext, Handler srcHandler, Messenger dstMessenger) { if (DBG) log("connect srcHandler to the dstMessenger E"); @@ -392,6 +400,7 @@ public class AsyncChannel { * @param srcHandler * @param dstMessenger */ + @UnsupportedAppUsage public void connected(Context srcContext, Handler srcHandler, Messenger dstMessenger) { if (DBG) log("connected srcHandler to the dstMessenger E"); @@ -446,6 +455,7 @@ public class AsyncChannel { /** * Disconnect */ + @UnsupportedAppUsage public void disconnect() { if ((mConnection != null) && (mSrcContext != null)) { mSrcContext.unbindService(mConnection); @@ -475,6 +485,7 @@ public class AsyncChannel { * * @param msg */ + @UnsupportedAppUsage public void sendMessage(Message msg) { msg.replyTo = mSrcMessenger; try { @@ -489,6 +500,7 @@ public class AsyncChannel { * * @param what */ + @UnsupportedAppUsage public void sendMessage(int what) { Message msg = Message.obtain(); msg.what = what; @@ -501,6 +513,7 @@ public class AsyncChannel { * @param what * @param arg1 */ + @UnsupportedAppUsage public void sendMessage(int what, int arg1) { Message msg = Message.obtain(); msg.what = what; @@ -515,6 +528,7 @@ public class AsyncChannel { * @param arg1 * @param arg2 */ + @UnsupportedAppUsage public void sendMessage(int what, int arg1, int arg2) { Message msg = Message.obtain(); msg.what = what; @@ -531,6 +545,7 @@ public class AsyncChannel { * @param arg2 * @param obj */ + @UnsupportedAppUsage public void sendMessage(int what, int arg1, int arg2, Object obj) { Message msg = Message.obtain(); msg.what = what; @@ -559,6 +574,7 @@ public class AsyncChannel { * @param srcMsg * @param dstMsg */ + @UnsupportedAppUsage public void replyToMessage(Message srcMsg, Message dstMsg) { try { dstMsg.replyTo = mSrcMessenger; @@ -575,6 +591,7 @@ public class AsyncChannel { * @param srcMsg * @param what */ + @UnsupportedAppUsage public void replyToMessage(Message srcMsg, int what) { Message msg = Message.obtain(); msg.what = what; @@ -588,6 +605,7 @@ public class AsyncChannel { * @param what * @param arg1 */ + @UnsupportedAppUsage public void replyToMessage(Message srcMsg, int what, int arg1) { Message msg = Message.obtain(); msg.what = what; @@ -620,6 +638,7 @@ public class AsyncChannel { * @param arg2 * @param obj */ + @UnsupportedAppUsage public void replyToMessage(Message srcMsg, int what, int arg1, int arg2, Object obj) { Message msg = Message.obtain(); msg.what = what; @@ -636,6 +655,7 @@ public class AsyncChannel { * @param what * @param obj */ + @UnsupportedAppUsage public void replyToMessage(Message srcMsg, int what, Object obj) { Message msg = Message.obtain(); msg.what = what; @@ -649,6 +669,7 @@ public class AsyncChannel { * @param msg to send * @return reply message or null if an error. */ + @UnsupportedAppUsage public Message sendMessageSynchronously(Message msg) { Message resultMsg = SyncMessenger.sendMessageSynchronously(mDstMessenger, msg); return resultMsg; @@ -690,6 +711,7 @@ public class AsyncChannel { * @param arg2 * @return reply message or null if an error. */ + @UnsupportedAppUsage public Message sendMessageSynchronously(int what, int arg1, int arg2) { Message msg = Message.obtain(); msg.what = what; diff --git a/core/java/com/android/internal/util/FastPrintWriter.java b/core/java/com/android/internal/util/FastPrintWriter.java index cc2c4cfe0e4a..981fbaaa9880 100644 --- a/core/java/com/android/internal/util/FastPrintWriter.java +++ b/core/java/com/android/internal/util/FastPrintWriter.java @@ -16,6 +16,7 @@ package com.android.internal.util; +import android.annotation.UnsupportedAppUsage; import android.util.Log; import android.util.Printer; @@ -77,6 +78,7 @@ public class FastPrintWriter extends PrintWriter { * @throws NullPointerException * if {@code out} is {@code null}. */ + @UnsupportedAppUsage public FastPrintWriter(OutputStream out) { this(out, false, 8192); } diff --git a/core/java/com/android/internal/util/IndentingPrintWriter.java b/core/java/com/android/internal/util/IndentingPrintWriter.java index e453866b05af..03a555edf4a8 100644 --- a/core/java/com/android/internal/util/IndentingPrintWriter.java +++ b/core/java/com/android/internal/util/IndentingPrintWriter.java @@ -16,6 +16,7 @@ package com.android.internal.util; +import android.annotation.UnsupportedAppUsage; import java.io.PrintWriter; import java.io.Writer; import java.util.Arrays; @@ -47,6 +48,7 @@ public class IndentingPrintWriter extends PrintWriter { private char[] mSingleChar = new char[1]; + @UnsupportedAppUsage public IndentingPrintWriter(Writer writer, String singleIndent) { this(writer, singleIndent, -1); } @@ -72,12 +74,14 @@ public class IndentingPrintWriter extends PrintWriter { return this; } + @UnsupportedAppUsage public IndentingPrintWriter increaseIndent() { mIndentBuilder.append(mSingleIndent); mCurrentIndent = null; return this; } + @UnsupportedAppUsage public IndentingPrintWriter decreaseIndent() { mIndentBuilder.delete(0, mSingleIndent.length()); mCurrentIndent = null; diff --git a/core/java/com/android/internal/util/JournaledFile.java b/core/java/com/android/internal/util/JournaledFile.java index 5372fc0e28a1..258db2a1fc48 100644 --- a/core/java/com/android/internal/util/JournaledFile.java +++ b/core/java/com/android/internal/util/JournaledFile.java @@ -16,6 +16,8 @@ package com.android.internal.util; +import android.annotation.UnsupportedAppUsage; + import java.io.File; import java.io.IOException; @@ -33,6 +35,7 @@ public class JournaledFile { File mTemp; boolean mWriting; + @UnsupportedAppUsage public JournaledFile(File real, File temp) { mReal = real; mTemp = temp; @@ -44,6 +47,7 @@ public class JournaledFile { * it to the real one. If there is both a real file and a temp one, assumes that the * temp one isn't fully written and deletes it. */ + @UnsupportedAppUsage public File chooseForRead() { File result; if (mReal.exists()) { @@ -68,6 +72,7 @@ public class JournaledFile { * <p> * Call {@link #commit} to commit the changes, or {@link #rollback} to forget the changes. */ + @UnsupportedAppUsage public File chooseForWrite() { if (mWriting) { throw new IllegalStateException("uncommitted write already in progress"); @@ -95,6 +100,7 @@ public class JournaledFile { /** * Commit changes. */ + @UnsupportedAppUsage public void commit() { if (!mWriting) { throw new IllegalStateException("no file to commit"); @@ -106,6 +112,7 @@ public class JournaledFile { /** * Roll back changes. */ + @UnsupportedAppUsage public void rollback() { if (!mWriting) { throw new IllegalStateException("no file to roll back"); diff --git a/core/java/com/android/internal/util/XmlUtils.java b/core/java/com/android/internal/util/XmlUtils.java index 3188d3005cae..5da587bea22e 100644 --- a/core/java/com/android/internal/util/XmlUtils.java +++ b/core/java/com/android/internal/util/XmlUtils.java @@ -16,6 +16,7 @@ package com.android.internal.util; +import android.annotation.UnsupportedAppUsage; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.Bitmap.CompressFormat; @@ -48,6 +49,7 @@ public class XmlUtils { private static final String STRING_ARRAY_SEPARATOR = ":"; + @UnsupportedAppUsage public static void skipCurrentTag(XmlPullParser parser) throws XmlPullParserException, IOException { int outerDepth = parser.getDepth(); @@ -71,6 +73,7 @@ public class XmlUtils { return defaultValue; } + @UnsupportedAppUsage public static final boolean convertValueToBoolean(CharSequence value, boolean defaultValue) { @@ -87,6 +90,7 @@ public class XmlUtils { return result; } + @UnsupportedAppUsage public static final int convertValueToInt(CharSequence charSeq, int defaultValue) { @@ -183,6 +187,7 @@ public class XmlUtils { * @see #writeValueXml * @see #readMapXml */ + @UnsupportedAppUsage public static final void writeMapXml(Map val, OutputStream out) throws XmlPullParserException, java.io.IOException { XmlSerializer serializer = new FastXmlSerializer(); @@ -732,6 +737,7 @@ public class XmlUtils { * #see #writeMapXml */ @SuppressWarnings("unchecked") + @UnsupportedAppUsage public static final HashMap<String, ?> readMapXml(InputStream in) throws XmlPullParserException, java.io.IOException { @@ -1550,6 +1556,7 @@ public class XmlUtils { } } + @UnsupportedAppUsage public static final void beginDocument(XmlPullParser parser, String firstElementName) throws XmlPullParserException, IOException { int type; @@ -1568,6 +1575,7 @@ public class XmlUtils { } } + @UnsupportedAppUsage public static final void nextElement(XmlPullParser parser) throws XmlPullParserException, IOException { int type; diff --git a/core/java/com/android/internal/view/BaseIWindow.java b/core/java/com/android/internal/view/BaseIWindow.java index 7178a0d677af..e3490f1fba7e 100644 --- a/core/java/com/android/internal/view/BaseIWindow.java +++ b/core/java/com/android/internal/view/BaseIWindow.java @@ -16,6 +16,7 @@ package com.android.internal.view; +import android.annotation.UnsupportedAppUsage; import android.graphics.Rect; import android.hardware.input.InputManager; import android.os.Bundle; diff --git a/core/java/com/android/internal/view/IInputConnectionWrapper.java b/core/java/com/android/internal/view/IInputConnectionWrapper.java index 28291aefd036..189c8d5913d0 100644 --- a/core/java/com/android/internal/view/IInputConnectionWrapper.java +++ b/core/java/com/android/internal/view/IInputConnectionWrapper.java @@ -21,6 +21,7 @@ import com.android.internal.os.SomeArgs; import android.annotation.NonNull; import android.annotation.Nullable; +import android.annotation.UnsupportedAppUsage; import android.os.Bundle; import android.os.Handler; import android.os.Looper; @@ -67,10 +68,12 @@ public abstract class IInputConnectionWrapper extends IInputContext.Stub { @GuardedBy("mLock") @Nullable + @UnsupportedAppUsage private InputConnection mInputConnection; private Looper mMainLooper; private Handler mH; + @UnsupportedAppUsage private Object mLock = new Object(); @GuardedBy("mLock") private boolean mFinished = false; diff --git a/core/java/com/android/internal/view/InputBindResult.java b/core/java/com/android/internal/view/InputBindResult.java index f05bd32ba2cd..9d4383f40266 100644 --- a/core/java/com/android/internal/view/InputBindResult.java +++ b/core/java/com/android/internal/view/InputBindResult.java @@ -19,6 +19,7 @@ package com.android.internal.view; import static java.lang.annotation.RetentionPolicy.SOURCE; import android.annotation.IntDef; +import android.annotation.UnsupportedAppUsage; import android.content.ComponentName; import android.content.Intent; import android.content.ServiceConnection; @@ -151,6 +152,7 @@ public final class InputBindResult implements Parcelable { /** * The input method service. */ + @UnsupportedAppUsage public final IInputMethodSession method; /** @@ -230,6 +232,7 @@ public final class InputBindResult implements Parcelable { /** * Used to make this class parcelable. */ + @UnsupportedAppUsage public static final Parcelable.Creator<InputBindResult> CREATOR = new Parcelable.Creator<InputBindResult>() { @Override diff --git a/core/java/com/android/internal/view/menu/ActionMenuItemView.java b/core/java/com/android/internal/view/menu/ActionMenuItemView.java index 92e1d80ebdbe..eb94db33ba1a 100644 --- a/core/java/com/android/internal/view/menu/ActionMenuItemView.java +++ b/core/java/com/android/internal/view/menu/ActionMenuItemView.java @@ -16,6 +16,7 @@ package com.android.internal.view.menu; +import android.annotation.UnsupportedAppUsage; import android.content.Context; import android.content.res.Configuration; import android.content.res.Resources; @@ -224,6 +225,7 @@ public class ActionMenuItemView extends TextView updateTextButtonVisibility(); } + @UnsupportedAppUsage public boolean hasText() { return !TextUtils.isEmpty(getText()); } diff --git a/core/java/com/android/internal/view/menu/MenuBuilder.java b/core/java/com/android/internal/view/menu/MenuBuilder.java index 48485e0d95f6..0e07ca79faf7 100644 --- a/core/java/com/android/internal/view/menu/MenuBuilder.java +++ b/core/java/com/android/internal/view/menu/MenuBuilder.java @@ -18,6 +18,7 @@ package com.android.internal.view.menu; import android.annotation.NonNull; +import android.annotation.UnsupportedAppUsage; import android.content.ComponentName; import android.content.Context; import android.content.Intent; @@ -64,6 +65,7 @@ public class MenuBuilder implements Menu { 0, /* SELECTED_ALTERNATIVE */ }; + @UnsupportedAppUsage private final Context mContext; private final Resources mResources; @@ -173,6 +175,7 @@ public class MenuBuilder implements Menu { * @param item The menu item that is selected * @return whether the menu item selection was handled */ + @UnsupportedAppUsage public boolean onMenuItemSelected(MenuBuilder menu, MenuItem item); /** @@ -180,6 +183,7 @@ public class MenuBuilder implements Menu { * * @param menu the menu that has changed modes */ + @UnsupportedAppUsage public void onMenuModeChange(MenuBuilder menu); } @@ -190,6 +194,7 @@ public class MenuBuilder implements Menu { public boolean invokeItem(MenuItemImpl item); } + @UnsupportedAppUsage public MenuBuilder(Context context) { mContext = context; mResources = context.getResources(); @@ -205,6 +210,7 @@ public class MenuBuilder implements Menu { setShortcutsVisibleInner(true); } + @UnsupportedAppUsage public MenuBuilder setDefaultShowAsAction(int defaultShowAsAction) { mDefaultShowAsAction = defaultShowAsAction; return this; @@ -217,6 +223,7 @@ public class MenuBuilder implements Menu { * * @param presenter The presenter to add */ + @UnsupportedAppUsage public void addMenuPresenter(MenuPresenter presenter) { addMenuPresenter(presenter, mContext); } @@ -230,6 +237,7 @@ public class MenuBuilder implements Menu { * @param presenter The presenter to add * @param menuContext The context used to inflate menu items */ + @UnsupportedAppUsage public void addMenuPresenter(MenuPresenter presenter, Context menuContext) { mPresenters.add(new WeakReference<MenuPresenter>(presenter)); presenter.initForMenu(menuContext, this); @@ -242,6 +250,7 @@ public class MenuBuilder implements Menu { * * @param presenter The presenter to remove */ + @UnsupportedAppUsage public void removeMenuPresenter(MenuPresenter presenter) { for (WeakReference<MenuPresenter> ref : mPresenters) { final MenuPresenter item = ref.get(); @@ -401,6 +410,7 @@ public class MenuBuilder implements Menu { return ACTION_VIEW_STATES_KEY; } + @UnsupportedAppUsage public void setCallback(Callback cb) { mCallback = cb; } @@ -768,6 +778,7 @@ public class MenuBuilder implements Menu { return mResources; } + @UnsupportedAppUsage public Context getContext() { return mContext; } @@ -1004,6 +1015,7 @@ public class MenuBuilder implements Menu { * {@link #startDispatchingItemsChanged()} is called. Useful when * many menu operations are going to be performed as a batch. */ + @UnsupportedAppUsage public void stopDispatchingItemsChanged() { if (!mPreventDispatchingItemsChanged) { mPreventDispatchingItemsChanged = true; @@ -1011,6 +1023,7 @@ public class MenuBuilder implements Menu { } } + @UnsupportedAppUsage public void startDispatchingItemsChanged() { mPreventDispatchingItemsChanged = false; @@ -1041,6 +1054,7 @@ public class MenuBuilder implements Menu { } @NonNull + @UnsupportedAppUsage public ArrayList<MenuItemImpl> getVisibleItems() { if (!mIsVisibleItemsStale) return mVisibleItems; @@ -1131,6 +1145,7 @@ public class MenuBuilder implements Menu { return mActionItems; } + @UnsupportedAppUsage public ArrayList<MenuItemImpl> getNonActionItems() { flagActionItems(); return mNonActionItems; @@ -1235,10 +1250,12 @@ public class MenuBuilder implements Menu { return this; } + @UnsupportedAppUsage public CharSequence getHeaderTitle() { return mHeaderTitle; } + @UnsupportedAppUsage public Drawable getHeaderIcon() { return mHeaderIcon; } @@ -1251,6 +1268,7 @@ public class MenuBuilder implements Menu { * Gets the root menu (if this is a submenu, find its root menu). * @return The root menu. */ + @UnsupportedAppUsage public MenuBuilder getRootMenu() { return this; } @@ -1262,10 +1280,12 @@ public class MenuBuilder implements Menu { * * @param menuInfo The extra menu information to add. */ + @UnsupportedAppUsage public void setCurrentMenuInfo(ContextMenuInfo menuInfo) { mCurrentMenuInfo = menuInfo; } + @UnsupportedAppUsage void setOptionalIconsVisible(boolean visible) { mOptionalIconsVisible = visible; } @@ -1296,6 +1316,7 @@ public class MenuBuilder implements Menu { return expanded; } + @UnsupportedAppUsage public boolean collapseItemActionView(MenuItemImpl item) { if (mPresenters.isEmpty() || mExpandedItem != item) return false; diff --git a/core/java/com/android/internal/view/menu/MenuItemImpl.java b/core/java/com/android/internal/view/menu/MenuItemImpl.java index 0c5ea6327dff..994a9c117ce9 100644 --- a/core/java/com/android/internal/view/menu/MenuItemImpl.java +++ b/core/java/com/android/internal/view/menu/MenuItemImpl.java @@ -19,6 +19,7 @@ package com.android.internal.view.menu; import com.android.internal.view.menu.MenuView.ItemView; import android.annotation.Nullable; +import android.annotation.UnsupportedAppUsage; import android.content.ActivityNotFoundException; import android.content.Context; import android.content.Intent; @@ -67,6 +68,7 @@ public final class MenuItemImpl implements MenuItem { * needed (if the Drawable isn't already obtained--only one of the two is * needed). */ + @UnsupportedAppUsage private int mIconResId = NO_ICON; private ColorStateList mIconTintList = null; @@ -139,6 +141,7 @@ public final class MenuItemImpl implements MenuItem { * * @return true if the invocation was handled, false otherwise */ + @UnsupportedAppUsage public boolean invoke() { if (mClickListener != null && mClickListener.onMenuItemClick(this)) { @@ -565,6 +568,7 @@ public final class MenuItemImpl implements MenuItem { return this; } + @UnsupportedAppUsage public void setExclusiveCheckable(boolean exclusive) { mFlags = (mFlags & ~EXCLUSIVE) | (exclusive ? EXCLUSIVE : 0); } @@ -638,6 +642,7 @@ public final class MenuItemImpl implements MenuItem { return mTitle != null ? mTitle.toString() : null; } + @UnsupportedAppUsage void setMenuInfo(ContextMenuInfo menuInfo) { mMenuInfo = menuInfo; } @@ -657,14 +662,17 @@ public final class MenuItemImpl implements MenuItem { return mMenu.getOptionalIconsVisible(); } + @UnsupportedAppUsage public boolean isActionButton() { return (mFlags & IS_ACTION) == IS_ACTION; } + @UnsupportedAppUsage public boolean requestsActionButton() { return (mShowAsAction & SHOW_AS_ACTION_IF_ROOM) == SHOW_AS_ACTION_IF_ROOM; } + @UnsupportedAppUsage public boolean requiresActionButton() { return (mShowAsAction & SHOW_AS_ACTION_ALWAYS) == SHOW_AS_ACTION_ALWAYS; } @@ -806,6 +814,7 @@ public final class MenuItemImpl implements MenuItem { return false; } + @UnsupportedAppUsage public void setActionViewExpanded(boolean isExpanded) { mIsActionViewExpanded = isExpanded; mMenu.onItemsChanged(false); diff --git a/core/java/com/android/internal/view/menu/MenuPopupHelper.java b/core/java/com/android/internal/view/menu/MenuPopupHelper.java index 324f923674eb..e6d34600485c 100644 --- a/core/java/com/android/internal/view/menu/MenuPopupHelper.java +++ b/core/java/com/android/internal/view/menu/MenuPopupHelper.java @@ -22,6 +22,7 @@ import android.annotation.AttrRes; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.StyleRes; +import android.annotation.UnsupportedAppUsage; import android.content.Context; import android.graphics.Point; import android.graphics.Rect; @@ -49,16 +50,19 @@ public class MenuPopupHelper implements MenuHelper { // Mutable cached popup menu properties. private View mAnchorView; private int mDropDownGravity = Gravity.START; + @UnsupportedAppUsage private boolean mForceShowIcon; private Callback mPresenterCallback; private MenuPopup mPopup; private OnDismissListener mOnDismissListener; + @UnsupportedAppUsage public MenuPopupHelper(@NonNull Context context, @NonNull MenuBuilder menu) { this(context, menu, null, false, com.android.internal.R.attr.popupMenuStyle, 0); } + @UnsupportedAppUsage public MenuPopupHelper(@NonNull Context context, @NonNull MenuBuilder menu, @NonNull View anchorView) { this(context, menu, anchorView, false, com.android.internal.R.attr.popupMenuStyle, 0); @@ -92,6 +96,7 @@ public class MenuPopupHelper implements MenuHelper { * * @param anchor the view to which the popup window should be anchored */ + @UnsupportedAppUsage public void setAnchorView(@NonNull View anchor) { mAnchorView = anchor; } @@ -105,6 +110,7 @@ public class MenuPopupHelper implements MenuHelper { * @param forceShowIcon {@code true} to force icons to be shown, or * {@code false} for icons to be optionally shown */ + @UnsupportedAppUsage public void setForceShowIcon(boolean forceShowIcon) { mForceShowIcon = forceShowIcon; if (mPopup != null) { @@ -119,6 +125,7 @@ public class MenuPopupHelper implements MenuHelper { * * @param gravity alignment of the popup relative to the anchor */ + @UnsupportedAppUsage public void setGravity(int gravity) { mDropDownGravity = gravity; } @@ -130,6 +137,7 @@ public class MenuPopupHelper implements MenuHelper { return mDropDownGravity; } + @UnsupportedAppUsage public void show() { if (!tryShow()) { throw new IllegalStateException("MenuPopupHelper cannot be used without an anchor"); @@ -143,6 +151,7 @@ public class MenuPopupHelper implements MenuHelper { } @NonNull + @UnsupportedAppUsage public MenuPopup getPopup() { if (mPopup == null) { mPopup = createPopup(); @@ -156,6 +165,7 @@ public class MenuPopupHelper implements MenuHelper { * @return {@code true} if the popup was shown or was already showing prior to calling this * method, {@code false} otherwise */ + @UnsupportedAppUsage public boolean tryShow() { if (isShowing()) { return true; @@ -280,6 +290,7 @@ public class MenuPopupHelper implements MenuHelper { * Dismisses the popup, if showing. */ @Override + @UnsupportedAppUsage public void dismiss() { if (isShowing()) { mPopup.dismiss(); diff --git a/core/java/com/android/internal/view/menu/MenuPresenter.java b/core/java/com/android/internal/view/menu/MenuPresenter.java index 65bdc096bc07..c5df8ad6edc6 100644 --- a/core/java/com/android/internal/view/menu/MenuPresenter.java +++ b/core/java/com/android/internal/view/menu/MenuPresenter.java @@ -18,6 +18,7 @@ package com.android.internal.view.menu; import android.annotation.NonNull; import android.annotation.Nullable; +import android.annotation.UnsupportedAppUsage; import android.content.Context; import android.os.Parcelable; import android.view.ViewGroup; @@ -47,6 +48,7 @@ public interface MenuPresenter { * @return true if the Callback will handle presenting the submenu, false if * the presenter should attempt to do so. */ + @UnsupportedAppUsage public boolean onOpenSubMenu(MenuBuilder subMenu); } diff --git a/core/java/com/android/internal/view/menu/MenuView.java b/core/java/com/android/internal/view/menu/MenuView.java index 407caae42dbf..67a55308938d 100644 --- a/core/java/com/android/internal/view/menu/MenuView.java +++ b/core/java/com/android/internal/view/menu/MenuView.java @@ -19,6 +19,7 @@ package com.android.internal.view.menu; import com.android.internal.view.menu.MenuBuilder; import com.android.internal.view.menu.MenuItemImpl; +import android.annotation.UnsupportedAppUsage; import android.graphics.drawable.Drawable; /** @@ -40,6 +41,7 @@ public interface MenuView { * Returns the default animations to be used for this menu when entering/exiting. * @return A resource ID for the default animations to be used for this menu. */ + @UnsupportedAppUsage public int getWindowAnimations(); /** @@ -61,6 +63,7 @@ public interface MenuView { * Gets the item data that this view is displaying. * @return the item data, or null if there is not one */ + @UnsupportedAppUsage public MenuItemImpl getItemData(); /** diff --git a/core/java/com/android/internal/view/menu/SubMenuBuilder.java b/core/java/com/android/internal/view/menu/SubMenuBuilder.java index 897440ebf893..cf6d9746bb93 100644 --- a/core/java/com/android/internal/view/menu/SubMenuBuilder.java +++ b/core/java/com/android/internal/view/menu/SubMenuBuilder.java @@ -16,6 +16,7 @@ package com.android.internal.view.menu; +import android.annotation.UnsupportedAppUsage; import android.content.Context; import android.graphics.drawable.Drawable; import android.view.Menu; @@ -67,11 +68,13 @@ public class SubMenuBuilder extends MenuBuilder implements SubMenu { } @Override + @UnsupportedAppUsage public void setCallback(Callback callback) { mParentMenu.setCallback(callback); } @Override + @UnsupportedAppUsage public MenuBuilder getRootMenu() { return mParentMenu.getRootMenu(); } diff --git a/core/java/com/android/internal/widget/CachingIconView.java b/core/java/com/android/internal/widget/CachingIconView.java index f3b6552be8ac..35bff6d7c430 100644 --- a/core/java/com/android/internal/widget/CachingIconView.java +++ b/core/java/com/android/internal/widget/CachingIconView.java @@ -18,6 +18,7 @@ package com.android.internal.widget; import android.annotation.DrawableRes; import android.annotation.Nullable; +import android.annotation.UnsupportedAppUsage; import android.content.Context; import android.content.res.Configuration; import android.graphics.Bitmap; @@ -44,6 +45,7 @@ public class CachingIconView extends ImageView { private boolean mForceHidden; private int mDesiredVisibility; + @UnsupportedAppUsage public CachingIconView(Context context, @Nullable AttributeSet attrs) { super(context, attrs); } diff --git a/core/java/com/android/internal/widget/ScrollingTabContainerView.java b/core/java/com/android/internal/widget/ScrollingTabContainerView.java index 311bfac6e883..5d48ab910439 100644 --- a/core/java/com/android/internal/widget/ScrollingTabContainerView.java +++ b/core/java/com/android/internal/widget/ScrollingTabContainerView.java @@ -20,6 +20,7 @@ import com.android.internal.view.ActionBarPolicy; import android.animation.Animator; import android.animation.ObjectAnimator; import android.animation.TimeInterpolator; +import android.annotation.UnsupportedAppUsage; import android.app.ActionBar; import android.content.Context; import android.content.res.Configuration; @@ -67,6 +68,7 @@ public class ScrollingTabContainerView extends HorizontalScrollView private static final int FADE_DURATION = 200; + @UnsupportedAppUsage public ScrollingTabContainerView(Context context) { super(context); setHorizontalScrollBarEnabled(false); @@ -134,6 +136,7 @@ public class ScrollingTabContainerView extends HorizontalScrollView return mTabSpinner != null && mTabSpinner.getParent() == this; } + @UnsupportedAppUsage public void setAllowCollapse(boolean allowCollapse) { mAllowCollapse = allowCollapse; } @@ -169,6 +172,7 @@ public class ScrollingTabContainerView extends HorizontalScrollView return false; } + @UnsupportedAppUsage public void setTabSelected(int position) { mSelectedTabIndex = position; final int tabCount = mTabLayout.getChildCount(); @@ -220,6 +224,7 @@ public class ScrollingTabContainerView extends HorizontalScrollView mStackedTabMaxWidth = abp.getStackedTabMaxWidth(); } + @UnsupportedAppUsage public void animateToVisibility(int visibility) { if (mVisibilityAnim != null) { mVisibilityAnim.cancel(); @@ -244,6 +249,7 @@ public class ScrollingTabContainerView extends HorizontalScrollView } } + @UnsupportedAppUsage public void animateToTab(final int position) { final View tabView = mTabLayout.getChildAt(position); if (mTabSelector != null) { @@ -293,6 +299,7 @@ public class ScrollingTabContainerView extends HorizontalScrollView return tabView; } + @UnsupportedAppUsage public void addTab(ActionBar.Tab tab, boolean setSelected) { TabView tabView = createTabView(mContext, tab, false); mTabLayout.addView(tabView, new LinearLayout.LayoutParams(0, @@ -308,6 +315,7 @@ public class ScrollingTabContainerView extends HorizontalScrollView } } + @UnsupportedAppUsage public void addTab(ActionBar.Tab tab, int position, boolean setSelected) { final TabView tabView = createTabView(mContext, tab, false); mTabLayout.addView(tabView, position, new LinearLayout.LayoutParams( @@ -323,6 +331,7 @@ public class ScrollingTabContainerView extends HorizontalScrollView } } + @UnsupportedAppUsage public void updateTab(int position) { ((TabView) mTabLayout.getChildAt(position)).update(); if (mTabSpinner != null) { @@ -333,6 +342,7 @@ public class ScrollingTabContainerView extends HorizontalScrollView } } + @UnsupportedAppUsage public void removeTabAt(int position) { mTabLayout.removeViewAt(position); if (mTabSpinner != null) { @@ -343,6 +353,7 @@ public class ScrollingTabContainerView extends HorizontalScrollView } } + @UnsupportedAppUsage public void removeAllTabs() { mTabLayout.removeAllViews(); if (mTabSpinner != null) { diff --git a/core/res/res/values-watch/config.xml b/core/res/res/values-watch/config.xml index 8e824791ef15..a96a96ddaf01 100644 --- a/core/res/res/values-watch/config.xml +++ b/core/res/res/values-watch/config.xml @@ -64,9 +64,8 @@ Set to true for watch devices. --> <bool name="config_focusScrollContainersInTouchMode">true</bool> - <!-- Enable generic multi-window in order to support Activity in virtual display. --> - <bool name="config_supportsMultiWindow">true</bool> - <bool name="config_supportsMultiDisplay">true</bool> + <bool name="config_supportsMultiWindow">false</bool> + <bool name="config_supportsMultiDisplay">false</bool> <bool name="config_supportsSplitScreenMultiWindow">false</bool> <!-- Default Gravity setting for the system Toast view. Equivalent to: Gravity.CENTER --> diff --git a/graphics/java/android/graphics/fonts/SystemFonts.java b/graphics/java/android/graphics/fonts/SystemFonts.java index dae48f8b528f..26b4ec530072 100644 --- a/graphics/java/android/graphics/fonts/SystemFonts.java +++ b/graphics/java/android/graphics/fonts/SystemFonts.java @@ -24,6 +24,7 @@ import android.util.ArrayMap; import android.util.Log; import com.android.internal.annotations.VisibleForTesting; +import com.android.internal.util.ArrayUtils; import org.xmlpull.v1.XmlPullParserException; @@ -251,7 +252,7 @@ public class SystemFonts { return fontConfig.getAliases(); } catch (IOException | XmlPullParserException e) { Log.e(TAG, "Failed initialize system fallbacks.", e); - return null; + return ArrayUtils.emptyArray(FontConfig.Alias.class); } } diff --git a/location/java/com/android/internal/location/ProviderRequest.java b/location/java/com/android/internal/location/ProviderRequest.java index 45fdb76f1e93..88919f628638 100644 --- a/location/java/com/android/internal/location/ProviderRequest.java +++ b/location/java/com/android/internal/location/ProviderRequest.java @@ -19,6 +19,7 @@ package com.android.internal.location; import java.util.ArrayList; import java.util.List; +import android.annotation.UnsupportedAppUsage; import android.location.LocationRequest; import android.os.Parcel; import android.os.Parcelable; @@ -27,9 +28,11 @@ import android.util.TimeUtils; /** @hide */ public final class ProviderRequest implements Parcelable { /** Location reporting is requested (true) */ + @UnsupportedAppUsage public boolean reportLocation = false; /** The smallest requested interval */ + @UnsupportedAppUsage public long interval = Long.MAX_VALUE; /** @@ -45,8 +48,10 @@ public final class ProviderRequest implements Parcelable { * is a high power slow interval request and a * low power fast interval request. */ + @UnsupportedAppUsage public List<LocationRequest> locationRequests = new ArrayList<LocationRequest>(); + @UnsupportedAppUsage public ProviderRequest() { } diff --git a/packages/ExtServices/src/android/ext/services/notification/AgingHelper.java b/packages/ExtServices/src/android/ext/services/notification/AgingHelper.java new file mode 100644 index 000000000000..5782ea100070 --- /dev/null +++ b/packages/ExtServices/src/android/ext/services/notification/AgingHelper.java @@ -0,0 +1,172 @@ +/** + * Copyright (C) 2018 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package android.ext.services.notification; + +import static android.app.NotificationManager.IMPORTANCE_MIN; + +import android.app.AlarmManager; +import android.app.PendingIntent; +import android.content.BroadcastReceiver; +import android.content.Context; +import android.content.Intent; +import android.content.IntentFilter; +import android.ext.services.notification.NotificationCategorizer.Category; +import android.net.Uri; +import android.util.ArraySet; +import android.util.Slog; + +import java.util.Set; + +public class AgingHelper { + private final static String TAG = "AgingHelper"; + private final boolean DEBUG = false; + + private static final String AGING_ACTION = AgingHelper.class.getSimpleName() + ".EVALUATE"; + private static final int REQUEST_CODE_AGING = 1; + private static final String AGING_SCHEME = "aging"; + private static final String EXTRA_KEY = "key"; + private static final String EXTRA_CATEGORY = "category"; + + private static final int HOUR_MS = 1000 * 60 * 60; + private static final int TWO_HOURS_MS = 2 * HOUR_MS; + + private Context mContext; + private NotificationCategorizer mNotificationCategorizer; + private AlarmManager mAm; + private Callback mCallback; + + // The set of keys we've scheduled alarms for + private Set<String> mAging = new ArraySet<>(); + + public AgingHelper(Context context, NotificationCategorizer categorizer, Callback callback) { + mNotificationCategorizer = categorizer; + mContext = context; + mAm = mContext.getSystemService(AlarmManager.class); + mCallback = callback; + + IntentFilter filter = new IntentFilter(AGING_ACTION); + filter.addDataScheme(AGING_SCHEME); + mContext.registerReceiver(mBroadcastReceiver, filter); + } + + // NAS lifecycle methods + + public void onNotificationSeen(NotificationEntry entry) { + // user has strong opinions about this notification. we can't down rank it, so don't bother. + if (entry.getChannel().isImportanceLocked()) { + return; + } + + @Category int category = mNotificationCategorizer.getCategory(entry); + + // already very low + if (category == NotificationCategorizer.CATEGORY_MIN) { + return; + } + + if (entry.hasSeen()) { + if (category == NotificationCategorizer.CATEGORY_ONGOING + || category > NotificationCategorizer.CATEGORY_REMINDER) { + scheduleAging(entry.getSbn().getKey(), category, TWO_HOURS_MS); + } else { + scheduleAging(entry.getSbn().getKey(), category, HOUR_MS); + } + + mAging.add(entry.getSbn().getKey()); + } + } + + public void onNotificationPosted(NotificationEntry entry) { + cancelAging(entry.getSbn().getKey()); + } + + public void onNotificationRemoved(String key) { + cancelAging(key); + } + + public void onDestroy() { + mContext.unregisterReceiver(mBroadcastReceiver); + } + + // Aging + + private void scheduleAging(String key, @Category int category, long duration) { + if (mAging.contains(key)) { + // already scheduled. Don't reset aging just because the user saw the noti again. + return; + } + final PendingIntent pi = createPendingIntent(key, category); + long time = System.currentTimeMillis() + duration; + if (DEBUG) Slog.d(TAG, "Scheduling evaluate for " + key + " in ms: " + duration); + mAm.setExactAndAllowWhileIdle(AlarmManager.RTC_WAKEUP, time, pi); + } + + private void cancelAging(String key) { + final PendingIntent pi = createPendingIntent(key); + mAm.cancel(pi); + mAging.remove(key); + } + + private Intent createBaseIntent(String key) { + return new Intent(AGING_ACTION) + .setData(new Uri.Builder().scheme(AGING_SCHEME).appendPath(key).build()); + } + + private Intent createAgingIntent(String key, @Category int category) { + Intent intent = createBaseIntent(key); + intent.addFlags(Intent.FLAG_RECEIVER_FOREGROUND) + .putExtra(EXTRA_CATEGORY, category) + .putExtra(EXTRA_KEY, key); + return intent; + } + + private PendingIntent createPendingIntent(String key, @Category int category) { + return PendingIntent.getBroadcast(mContext, + REQUEST_CODE_AGING, + createAgingIntent(key, category), + PendingIntent.FLAG_UPDATE_CURRENT); + } + + private PendingIntent createPendingIntent(String key) { + return PendingIntent.getBroadcast(mContext, + REQUEST_CODE_AGING, + createBaseIntent(key), + PendingIntent.FLAG_UPDATE_CURRENT); + } + + private void demote(String key, @Category int category) { + int newImportance = IMPORTANCE_MIN; + // TODO: Change "aged" importance based on category + mCallback.sendAdjustment(key, newImportance); + } + + protected interface Callback { + void sendAdjustment(String key, int newImportance); + } + + private final BroadcastReceiver mBroadcastReceiver = new BroadcastReceiver() { + @Override + public void onReceive(Context context, Intent intent) { + if (DEBUG) { + Slog.d(TAG, "Reposting notification"); + } + if (AGING_ACTION.equals(intent.getAction())) { + demote(intent.getStringExtra(EXTRA_KEY), intent.getIntExtra(EXTRA_CATEGORY, + NotificationCategorizer.CATEGORY_EVERYTHING_ELSE)); + } + } + }; +} diff --git a/packages/ExtServices/src/android/ext/services/notification/Assistant.java b/packages/ExtServices/src/android/ext/services/notification/Assistant.java index a8ecec3db213..f0f31fbded6f 100644 --- a/packages/ExtServices/src/android/ext/services/notification/Assistant.java +++ b/packages/ExtServices/src/android/ext/services/notification/Assistant.java @@ -18,23 +18,28 @@ package android.ext.services.notification; import static android.app.NotificationManager.IMPORTANCE_LOW; import static android.app.NotificationManager.IMPORTANCE_MIN; +import static android.service.notification.Adjustment.KEY_IMPORTANCE; import static android.service.notification.NotificationListenerService.Ranking .USER_SENTIMENT_NEGATIVE; import android.annotation.NonNull; import android.annotation.Nullable; import android.app.ActivityThread; +import android.app.AlarmManager; import android.app.INotificationManager; import android.app.Notification; import android.app.NotificationChannel; import android.content.ContentResolver; import android.content.Context; +import android.content.pm.IPackageManager; import android.database.ContentObserver; +import android.ext.services.notification.AgingHelper.Callback; import android.net.Uri; import android.os.AsyncTask; import android.os.Bundle; import android.os.Environment; import android.os.Handler; +import android.os.UserHandle; import android.os.storage.StorageManager; import android.provider.Settings; import android.service.notification.Adjustment; @@ -64,6 +69,7 @@ import java.io.IOException; import java.io.InputStream; import java.nio.charset.StandardCharsets; import java.util.ArrayList; +import java.util.List; import java.util.Map; /** @@ -89,15 +95,17 @@ public class Assistant extends NotificationAssistantService { private int mStreakLimit; private SmartActionsHelper mSmartActionsHelper; private NotificationCategorizer mNotificationCategorizer; + private AgingHelper mAgingHelper; // key : impressions tracker // TODO: prune deleted channels and apps - final ArrayMap<String, ChannelImpressions> mkeyToImpressions = new ArrayMap<>(); - // SBN key : channel id - ArrayMap<String, String> mLiveNotifications = new ArrayMap<>(); + private final ArrayMap<String, ChannelImpressions> mkeyToImpressions = new ArrayMap<>(); + // SBN key : entry + protected ArrayMap<String, NotificationEntry> mLiveNotifications = new ArrayMap<>(); private Ranking mFakeRanking = null; private AtomicFile mFile = null; + private IPackageManager mPackageManager; protected SettingsObserver mSettingsObserver; public Assistant() { @@ -108,9 +116,13 @@ public class Assistant extends NotificationAssistantService { super.onCreate(); // Contexts are correctly hooked up by the creation step, which is required for the observer // to be hooked up/initialized. + mPackageManager = ActivityThread.getPackageManager(); mSettingsObserver = new SettingsObserver(mHandler); mSmartActionsHelper = new SmartActionsHelper(); mNotificationCategorizer = new NotificationCategorizer(); + mAgingHelper = new AgingHelper(getContext(), + mNotificationCategorizer, + new AgingCallback()); } private void loadFile() { @@ -157,7 +169,7 @@ public class Assistant extends NotificationAssistantService { } } - private void saveFile() throws IOException { + private void saveFile() { AsyncTask.execute(() -> { final FileOutputStream stream; try { @@ -200,6 +212,9 @@ public class Assistant extends NotificationAssistantService { public Adjustment onNotificationEnqueued(StatusBarNotification sbn, NotificationChannel channel) { if (DEBUG) Log.i(TAG, "ENQUEUED " + sbn.getKey() + " on " + channel.getId()); + if (!isForCurrentUser(sbn)) { + return null; + } NotificationEntry entry = new NotificationEntry( ActivityThread.getPackageManager(), sbn, channel); ArrayList<Notification.Action> actions = @@ -222,7 +237,7 @@ public class Assistant extends NotificationAssistantService { signals.putCharSequenceArrayList(Adjustment.KEY_SMART_REPLIES, smartReplies); } if (mNotificationCategorizer.shouldSilence(entry)) { - signals.putInt(Adjustment.KEY_IMPORTANCE, IMPORTANCE_LOW); + signals.putInt(KEY_IMPORTANCE, IMPORTANCE_LOW); } return new Adjustment( @@ -237,8 +252,13 @@ public class Assistant extends NotificationAssistantService { public void onNotificationPosted(StatusBarNotification sbn, RankingMap rankingMap) { if (DEBUG) Log.i(TAG, "POSTED " + sbn.getKey()); try { + if (!isForCurrentUser(sbn)) { + return; + } Ranking ranking = getRanking(sbn.getKey(), rankingMap); if (ranking != null && ranking.getChannel() != null) { + NotificationEntry entry = new NotificationEntry(mPackageManager, + sbn, ranking.getChannel()); String key = getKey( sbn.getPackageName(), sbn.getUserId(), ranking.getChannel().getId()); ChannelImpressions ci = mkeyToImpressions.getOrDefault(key, @@ -248,7 +268,8 @@ public class Assistant extends NotificationAssistantService { sbn.getPackageName(), sbn.getKey(), sbn.getUserId())); } mkeyToImpressions.put(key, ci); - mLiveNotifications.put(sbn.getKey(), ranking.getChannel().getId()); + mLiveNotifications.put(sbn.getKey(), entry); + mAgingHelper.onNotificationPosted(entry); } } catch (Throwable e) { Log.e(TAG, "Error occurred processing post", e); @@ -259,8 +280,11 @@ public class Assistant extends NotificationAssistantService { public void onNotificationRemoved(StatusBarNotification sbn, RankingMap rankingMap, NotificationStats stats, int reason) { try { + if (!isForCurrentUser(sbn)) { + return; + } boolean updatedImpressions = false; - String channelId = mLiveNotifications.remove(sbn.getKey()); + String channelId = mLiveNotifications.remove(sbn.getKey()).getChannel().getId(); String key = getKey(sbn.getPackageName(), sbn.getUserId(), channelId); synchronized (mkeyToImpressions) { ChannelImpressions ci = mkeyToImpressions.getOrDefault(key, @@ -302,6 +326,22 @@ public class Assistant extends NotificationAssistantService { } @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); + } + } + } + + @Override public void onListenerConnected() { if (DEBUG) Log.i(TAG, "CONNECTED"); try { @@ -318,6 +358,17 @@ public class Assistant extends NotificationAssistantService { } } + @Override + public void onListenerDisconnected() { + if (mAgingHelper != null) { + mAgingHelper.onDestroy(); + } + } + + private boolean isForCurrentUser(StatusBarNotification sbn) { + return sbn != null && sbn.getUserId() == UserHandle.myUserId(); + } + protected String getKey(String pkg, int userId, String channelId) { return pkg + "|" + userId + "|" + channelId; } @@ -361,6 +412,11 @@ public class Assistant extends NotificationAssistantService { } @VisibleForTesting + public void setPackageManager(IPackageManager pm) { + mPackageManager = pm; + } + + @VisibleForTesting public ChannelImpressions getImpressions(String key) { synchronized (mkeyToImpressions) { return mkeyToImpressions.get(key); @@ -380,6 +436,20 @@ public class Assistant extends NotificationAssistantService { return impressions; } + protected final class AgingCallback implements Callback { + @Override + public void sendAdjustment(String key, int newImportance) { + NotificationEntry entry = mLiveNotifications.get(key); + if (entry != null) { + Bundle bundle = new Bundle(); + bundle.putInt(KEY_IMPORTANCE, newImportance); + Adjustment adjustment = new Adjustment(entry.getSbn().getPackageName(), key, bundle, + "aging", entry.getSbn().getUserId()); + adjustNotification(adjustment); + } + } + } + /** * Observer for updates on blocking helper threshold values. */ diff --git a/packages/ExtServices/src/android/ext/services/notification/NotificationEntry.java b/packages/ExtServices/src/android/ext/services/notification/NotificationEntry.java index cdc09906cb82..8fee822f11c0 100644 --- a/packages/ExtServices/src/android/ext/services/notification/NotificationEntry.java +++ b/packages/ExtServices/src/android/ext/services/notification/NotificationEntry.java @@ -50,6 +50,7 @@ public class NotificationEntry { private AudioAttributes mAttributes; private NotificationChannel mChannel; private int mImportance; + private boolean mSeen; public NotificationEntry(IPackageManager packageManager, StatusBarNotification sbn, NotificationChannel channel) { @@ -198,6 +199,14 @@ public class NotificationEntry { return false; } + public void setSeen() { + mSeen = true; + } + + public boolean hasSeen() { + return mSeen; + } + public StatusBarNotification getSbn() { return mSbn; } diff --git a/packages/ExtServices/tests/src/android/ext/services/notification/AgingHelperTest.java b/packages/ExtServices/tests/src/android/ext/services/notification/AgingHelperTest.java new file mode 100644 index 000000000000..b023b364a19b --- /dev/null +++ b/packages/ExtServices/tests/src/android/ext/services/notification/AgingHelperTest.java @@ -0,0 +1,153 @@ +/** + * Copyright (C) 2018 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.ext.services.notification; + +import static android.app.NotificationManager.IMPORTANCE_HIGH; +import static android.app.NotificationManager.IMPORTANCE_MIN; + +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyInt; +import static org.mockito.ArgumentMatchers.anyLong; +import static org.mockito.ArgumentMatchers.anyString; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.never; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +import android.app.AlarmManager; +import android.app.Notification; +import android.app.NotificationChannel; +import android.app.PendingIntent; +import android.content.pm.ApplicationInfo; +import android.content.pm.IPackageManager; +import android.os.Build; +import android.os.Process; +import android.os.UserHandle; +import android.service.notification.StatusBarNotification; +import android.support.test.InstrumentationRegistry; +import android.support.test.runner.AndroidJUnit4; +import android.testing.TestableContext; + +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.Mock; +import org.mockito.MockitoAnnotations; + +@RunWith(AndroidJUnit4.class) +public class AgingHelperTest { + private String mPkg = "pkg"; + private int mUid = 2018; + + @Rule + public final TestableContext mContext = + new TestableContext(InstrumentationRegistry.getTargetContext(), null); + + @Mock + private NotificationCategorizer mCategorizer; + @Mock + private AlarmManager mAlarmManager; + @Mock + private IPackageManager mPackageManager; + @Mock + private AgingHelper.Callback mCallback; + + private AgingHelper mAgingHelper; + + private StatusBarNotification generateSbn(String channelId) { + Notification n = new Notification.Builder(mContext, channelId) + .setContentTitle("foo") + .build(); + + return new StatusBarNotification(mPkg, mPkg, 0, "tag", mUid, mUid, n, + UserHandle.SYSTEM, null, 0); + } + + @Before + public void setUp() throws Exception { + MockitoAnnotations.initMocks(this); + mPkg = mContext.getPackageName(); + mUid = Process.myUid(); + + ApplicationInfo info = mock(ApplicationInfo.class); + when(mPackageManager.getApplicationInfo(anyString(), anyInt(), anyInt())) + .thenReturn(info); + info.targetSdkVersion = Build.VERSION_CODES.P; + + mContext.addMockSystemService(AlarmManager.class, mAlarmManager); + + mAgingHelper = new AgingHelper(mContext, mCategorizer, mCallback); + } + + @Test + public void testNoSnoozingOnPost() { + NotificationChannel channel = new NotificationChannel("", "", IMPORTANCE_HIGH); + StatusBarNotification sbn = generateSbn(channel.getId()); + NotificationEntry entry = new NotificationEntry(mPackageManager, sbn, channel); + + + mAgingHelper.onNotificationPosted(entry); + verify(mAlarmManager, never()).setExactAndAllowWhileIdle(anyInt(), anyLong(), any()); + } + + @Test + public void testPostResetsSnooze() { + NotificationChannel channel = new NotificationChannel("", "", IMPORTANCE_HIGH); + StatusBarNotification sbn = generateSbn(channel.getId()); + NotificationEntry entry = new NotificationEntry(mPackageManager, sbn, channel); + + + mAgingHelper.onNotificationPosted(entry); + verify(mAlarmManager, times(1)).cancel(any(PendingIntent.class)); + } + + @Test + public void testSnoozingOnSeen() { + NotificationChannel channel = new NotificationChannel("", "", IMPORTANCE_HIGH); + StatusBarNotification sbn = generateSbn(channel.getId()); + NotificationEntry entry = new NotificationEntry(mPackageManager, sbn, channel); + entry.setSeen(); + when(mCategorizer.getCategory(entry)).thenReturn(NotificationCategorizer.CATEGORY_PEOPLE); + + mAgingHelper.onNotificationSeen(entry); + verify(mAlarmManager, times(1)).setExactAndAllowWhileIdle(anyInt(), anyLong(), any()); + } + + @Test + public void testNoSnoozingOnSeenUserLocked() { + NotificationChannel channel = new NotificationChannel("", "", IMPORTANCE_HIGH); + channel.lockFields(NotificationChannel.USER_LOCKED_IMPORTANCE); + StatusBarNotification sbn = generateSbn(channel.getId()); + NotificationEntry entry = new NotificationEntry(mPackageManager, sbn, channel); + when(mCategorizer.getCategory(entry)).thenReturn(NotificationCategorizer.CATEGORY_PEOPLE); + + mAgingHelper.onNotificationSeen(entry); + verify(mAlarmManager, never()).setExactAndAllowWhileIdle(anyInt(), anyLong(), any()); + } + + @Test + public void testNoSnoozingOnSeenAlreadyLow() { + NotificationEntry entry = mock(NotificationEntry.class); + when(entry.getChannel()).thenReturn(new NotificationChannel("", "", IMPORTANCE_HIGH)); + when(entry.getImportance()).thenReturn(IMPORTANCE_MIN); + + mAgingHelper.onNotificationSeen(entry); + verify(mAlarmManager, never()).setExactAndAllowWhileIdle(anyInt(), anyLong(), any()); + } +} diff --git a/packages/ExtServices/tests/src/android/ext/services/notification/AssistantTest.java b/packages/ExtServices/tests/src/android/ext/services/notification/AssistantTest.java index bb68bc2b875e..2820232cdb38 100644 --- a/packages/ExtServices/tests/src/android/ext/services/notification/AssistantTest.java +++ b/packages/ExtServices/tests/src/android/ext/services/notification/AssistantTest.java @@ -21,6 +21,8 @@ import static android.app.NotificationManager.IMPORTANCE_LOW; import static android.app.NotificationManager.IMPORTANCE_MIN; import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyInt; +import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.never; import static org.mockito.Mockito.times; @@ -33,6 +35,9 @@ import android.app.Notification; import android.app.NotificationChannel; import android.content.ContentResolver; import android.content.Intent; +import android.content.pm.ApplicationInfo; +import android.content.pm.IPackageManager; +import android.os.Build; import android.os.UserHandle; import android.provider.Settings; import android.service.notification.Adjustment; @@ -80,6 +85,8 @@ public class AssistantTest extends ServiceTestCase<Assistant> { @Mock INotificationManager mNoMan; @Mock AtomicFile mFile; + @Mock + IPackageManager mPackageManager; Assistant mAssistant; Application mApplication; @@ -113,6 +120,11 @@ public class AssistantTest extends ServiceTestCase<Assistant> { mAssistant = getService(); mAssistant.setNoMan(mNoMan); mAssistant.setFile(mFile); + mAssistant.setPackageManager(mPackageManager); + ApplicationInfo info = mock(ApplicationInfo.class); + when(mPackageManager.getApplicationInfo(anyString(), anyInt(), anyInt())) + .thenReturn(info); + info.targetSdkVersion = Build.VERSION_CODES.P; when(mFile.startWrite()).thenReturn(mock(FileOutputStream.class)); } @@ -439,4 +451,19 @@ public class AssistantTest extends ServiceTestCase<Assistant> { // With the new threshold, the blocking helper should be triggered. assertEquals(true, ci.shouldTriggerBlock()); } + + @Test + public void testTrimLiveNotifications() { + StatusBarNotification sbn = generateSbn(PKG1, UID1, P1C1, "no", null); + mAssistant.setFakeRanking(generateRanking(sbn, P1C1)); + + mAssistant.onNotificationPosted(sbn, mock(RankingMap.class)); + + assertTrue(mAssistant.mLiveNotifications.containsKey(sbn.getKey())); + + mAssistant.onNotificationRemoved( + sbn, mock(RankingMap.class), new NotificationStats(), 0); + + assertFalse(mAssistant.mLiveNotifications.containsKey(sbn.getKey())); + } } diff --git a/packages/OsuLogin/Android.mk b/packages/OsuLogin/Android.mk new file mode 100644 index 000000000000..f04227bda263 --- /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 000000000000..f6cd79be6dd6 --- /dev/null +++ b/packages/OsuLogin/AndroidManifest.xml @@ -0,0 +1,37 @@ +<?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: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 000000000000..aa7c3e65d964 --- /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 000000000000..4eafb39d1713 --- /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 000000000000..47c82246738c --- /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 000000000000..9fafeeff4348 --- /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 000000000000..f6c233954b52 --- /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/src/com/android/hotspot2/osu/OsuLoginActivity.java b/packages/OsuLogin/src/com/android/hotspot2/osu/OsuLoginActivity.java new file mode 100644 index 000000000000..6a4890467686 --- /dev/null +++ b/packages/OsuLogin/src/com/android/hotspot2/osu/OsuLoginActivity.java @@ -0,0 +1,216 @@ +/* + * Copyright (C) 2018 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.hotspot2.osu; + +import android.annotation.Nullable; +import android.app.Activity; +import android.content.Context; +import android.net.ConnectivityManager; +import android.net.Network; +import android.net.NetworkCapabilities; +import android.net.NetworkRequest; +import android.net.wifi.WifiManager; +import android.os.Bundle; +import android.util.Log; +import android.view.KeyEvent; +import android.webkit.WebResourceError; +import android.webkit.WebResourceRequest; +import android.webkit.WebSettings; +import android.webkit.WebView; +import android.webkit.WebViewClient; + +import com.android.hotspot2.R; + +import java.net.MalformedURLException; +import java.net.URL; + +/** + * Online Sign Up Login Web View launched during Provision Process of Hotspot 2.0 rel2. + */ +public class OsuLoginActivity extends Activity { + private static final String TAG = "OsuLogin"; + private static final boolean DBG = true; + + private String mUrl; + private String mHostName; + private Network mNetwork; + private ConnectivityManager mCm; + private ConnectivityManager.NetworkCallback mNetworkCallback; + private WifiManager mWifiManager; + private WebView mWebView; + + @Override + protected void onCreate(@Nullable Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + if (DBG) { + Log.d(TAG, "onCreate: Opening OSU Web View"); + } + + mWifiManager = (WifiManager) getApplicationContext().getSystemService(Context.WIFI_SERVICE); + if (mWifiManager == null) { + Log.e(TAG, "Cannot get wifi service"); + finishAndRemoveTask(); + return; + } + + if (getIntent() == null) { + Log.e(TAG, "Intent is null"); + finishAndRemoveTask(); + return; + } + + mNetwork = getIntent().getParcelableExtra(WifiManager.EXTRA_OSU_NETWORK); + if (mNetwork == null) { + Log.e(TAG, "Cannot get the network instance for OSU from intent"); + finishAndRemoveTask(); + return; + } + + mUrl = getIntent().getStringExtra(WifiManager.EXTRA_URL); + if (mUrl == null) { + Log.e(TAG, "Cannot get OSU server url from intent"); + finishAndRemoveTask(); + return; + } + + mHostName = getHost(mUrl); + if (mHostName == null) { + Log.e(TAG, "Cannot get host from the url"); + finishAndRemoveTask(); + return; + } + + mCm = (ConnectivityManager) getApplicationContext().getSystemService( + Context.CONNECTIVITY_SERVICE); + if (mCm == null) { + Log.e(TAG, "Cannot get connectivity service"); + finishAndRemoveTask(); + return; + } + + if (!mCm.bindProcessToNetwork(mNetwork)) { + Log.e(TAG, "Network is no longer valid"); + finishAndRemoveTask(); + return; + } + + final NetworkCapabilities networkCapabilities = mCm.getNetworkCapabilities(mNetwork); + if (networkCapabilities == null || !networkCapabilities.hasTransport( + NetworkCapabilities.TRANSPORT_WIFI)) { + Log.e(TAG, "WiFi is not supported for the Network"); + finishAndRemoveTask(); + return; + } + + getActionBar().setDisplayShowHomeEnabled(false); + setContentView(R.layout.osu_web_view); + + // Exit this app if network disappeared. + mNetworkCallback = new ConnectivityManager.NetworkCallback() { + @Override + public void onLost(Network network) { + if (DBG) { + Log.d(TAG, "Lost for the current Network, close the browser"); + } + if (mNetwork.equals(network)) { + finishAndRemoveTask(); + } + } + }; + + mCm.registerNetworkCallback( + new NetworkRequest.Builder().addTransportType( + NetworkCapabilities.TRANSPORT_WIFI).build(), + mNetworkCallback); + + mWebView = findViewById(R.id.webview); + mWebView.clearCache(true); + WebSettings webSettings = mWebView.getSettings(); + webSettings.setJavaScriptEnabled(true); + webSettings.setMixedContentMode(WebSettings.MIXED_CONTENT_COMPATIBILITY_MODE); + webSettings.setUseWideViewPort(true); + webSettings.setLoadWithOverviewMode(true); + webSettings.setSupportZoom(true); + webSettings.setBuiltInZoomControls(true); + webSettings.setDisplayZoomControls(false); + + mWebView.setWebViewClient(new OsuWebViewClient()); + if (DBG) { + Log.d(TAG, "OSU Web View to " + mUrl); + } + mWebView.loadUrl(mUrl); + } + + @Override + public boolean onKeyDown(int keyCode, KeyEvent event) { + // Check if the key event was the Back button. + if ((keyCode == KeyEvent.KEYCODE_BACK)) { + // If there is a history to move back + if (mWebView.canGoBack()){ + mWebView.goBack(); + return true; + } + + // In case of back key, it needs to disconnect current connection with OSU AP to + // abort current Provisioning flow. + if (mWifiManager != null) { + mWifiManager.disconnect(); + } + } + return super.onKeyDown(keyCode, event); + } + + @Override + protected void onDestroy() { + if (mNetworkCallback != null) { + mCm.unregisterNetworkCallback(mNetworkCallback); + } + super.onDestroy(); + } + + private String getHost(String url) { + try { + return new URL(url).getHost(); + } catch (MalformedURLException e) { + Log.e(TAG, "Invalid URL " + url); + } + return null; + } + + private class OsuWebViewClient extends WebViewClient { + boolean mPageError = false; + + @Override + public void onPageFinished(WebView view, String url) { + // Do not show the page error on UI. + if (mPageError) { + finishAndRemoveTask(); + } + } + + @Override + public void onReceivedError(WebView view, WebResourceRequest request, + WebResourceError error) { + if (request.isForMainFrame()) { + // This happens right after getting HTTP redirect response from an OSU server + // since no more Http request is allowed to send to the OSU server. + mPageError = true; + Log.e(TAG, "onReceived Error for MainFrame: " + error.getErrorCode()); + } + } + } +} diff --git a/packages/PackageInstaller/AndroidManifest.xml b/packages/PackageInstaller/AndroidManifest.xml index 513c8624ca71..2be9311d91ea 100644 --- a/packages/PackageInstaller/AndroidManifest.xml +++ b/packages/PackageInstaller/AndroidManifest.xml @@ -19,7 +19,7 @@ android:label="@string/app_name" android:icon="@drawable/ic_app_icon" android:allowBackup="false" - android:theme="@style/DialogWhenLarge" + android:theme="@style/Theme.AlertDialogActivity" android:supportsRtl="true" android:defaultToDeviceProtectedStorage="true" android:directBootAware="true"> @@ -32,6 +32,7 @@ </receiver> <activity android:name=".InstallStart" + android:theme="@android:style/Theme.Translucent.NoTitleBar" android:exported="true" android:excludeFromRecents="true"> <intent-filter android:priority="1"> @@ -59,13 +60,14 @@ android:exported="false" /> <activity android:name=".DeleteStagedFileOnResult" + android:theme="@android:style/Theme.Translucent.NoTitleBar" android:exported="false" /> <activity android:name=".PackageInstallerActivity" android:exported="false" /> <activity android:name=".InstallInstalling" - android:theme="@style/DialogWhenLargeNoAnimation" + android:theme="@style/Theme.AlertDialogActivity.NoAnimation" android:exported="false" /> <receiver android:name=".InstallEventReceiver" @@ -77,18 +79,17 @@ </receiver> <activity android:name=".InstallSuccess" - android:theme="@style/DialogWhenLargeNoAnimation" + android:theme="@style/Theme.AlertDialogActivity.NoAnimation" android:exported="false" /> <activity android:name=".InstallFailed" - android:theme="@style/DialogWhenLargeNoAnimation" + android:theme="@style/Theme.AlertDialogActivity.NoAnimation" android:exported="false" /> <activity android:name=".UninstallerActivity" android:configChanges="orientation|keyboardHidden|screenSize" android:excludeFromRecents="true" - android:noHistory="true" - android:theme="@style/AlertDialogActivity"> + android:noHistory="true"> <intent-filter android:priority="1"> <action android:name="android.intent.action.DELETE" /> <action android:name="android.intent.action.UNINSTALL_PACKAGE" /> @@ -107,7 +108,6 @@ <activity android:name=".UninstallUninstalling" android:excludeFromRecents="true" - android:theme="@style/AlertDialogActivity" android:exported="false" /> <receiver android:name=".UninstallFinish" diff --git a/packages/PackageInstaller/res/layout/install_confirm.xml b/packages/PackageInstaller/res/layout/install_confirm.xml deleted file mode 100644 index 6be46fc88e9b..000000000000 --- a/packages/PackageInstaller/res/layout/install_confirm.xml +++ /dev/null @@ -1,91 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - Copyright (C) 2016 The Android Open Source Project - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - --> - -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:orientation="vertical"> - - <LinearLayout android:id="@+id/app_snippet" - android:background="?android:attr/colorPrimary" - android:layout_width="match_parent" - android:layout_height="?android:attr/actionBarSize" - android:orientation="horizontal" - android:elevation="@dimen/headerElevation" - android:gravity="center_vertical"> - - <ImageView android:id="@+id/app_icon" - android:layout_marginStart="16dp" - android:layout_width="24dp" - android:layout_height="24dp" - android:scaleType="fitCenter" - android:src="@drawable/ic_file_download" /> - - <TextView android:id="@+id/app_name" - android:layout_marginStart="32dp" - android:layout_marginEnd="16dp" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:textAppearance="?android:attr/titleTextStyle" - android:singleLine="true" - android:text="@string/app_name_unknown" - android:ellipsize="end" /> - - </LinearLayout> - - <ScrollView android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_weight="1" - android:padding="16dip"> - - <TextView android:id="@+id/install_confirm_question" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:textAppearance="?android:attr/textAppearanceMedium" /> - - </ScrollView> - - <LinearLayout style="?android:attr/buttonBarStyle" - android:background="?android:attr/colorBackground" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:orientation="horizontal" - android:padding="8dp" - android:measureWithLargestChild="true"> - - <!-- spacer to push buttons to the right --> - <View android:layout_width="0dp" - android:layout_height="0dp" - android:layout_weight="1" /> - - <Button android:id="@+id/cancel_button" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:text="@string/cancel" - android:maxLines="2" - style="?android:attr/buttonBarButtonStyle" /> - - <Button android:id="@+id/ok_button" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:text="@string/install" - android:maxLines="2" - style="?android:attr/buttonBarButtonStyle" /> - - </LinearLayout> - -</LinearLayout> diff --git a/packages/PackageInstaller/res/layout/install_content_view.xml b/packages/PackageInstaller/res/layout/install_content_view.xml new file mode 100644 index 000000000000..5e94a29a6399 --- /dev/null +++ b/packages/PackageInstaller/res/layout/install_content_view.xml @@ -0,0 +1,144 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + Copyright (C) 2018 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + --> + +<FrameLayout + xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:theme="?android:attr/alertDialogTheme" + android:paddingTop="8dp" + android:paddingLeft="?android:attr/dialogPreferredPadding" + android:paddingRight="?android:attr/dialogPreferredPadding"> + + <LinearLayout + android:id="@+id/staging" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="vertical" + android:visibility="invisible"> + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + style="@android:style/TextAppearance.Material.Subhead" + android:text="@string/message_staging" /> + + <ProgressBar + android:id="@+id/progress_indeterminate" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:paddingTop="8dp" + style="?android:attr/progressBarStyleHorizontal" + android:indeterminate="true" /> + + </LinearLayout> + + <LinearLayout + android:id="@+id/installing" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="vertical" + android:visibility="invisible"> + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + style="@android:style/TextAppearance.Material.Subhead" + android:text="@string/installing" /> + + <ProgressBar + android:id="@+id/progress" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:paddingTop="8dp" + style="?android:attr/progressBarStyleHorizontal" /> + + </LinearLayout> + + <TextView + android:id="@+id/install_confirm_question" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + style="@android:style/TextAppearance.Material.Subhead" + android:text="@string/install_confirm_question" + android:visibility="invisible" /> + + <TextView + android:id="@+id/install_confirm_question_update" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + style="@android:style/TextAppearance.Material.Subhead" + android:text="@string/install_confirm_question_update" + android:visibility="invisible" /> + + <TextView + android:id="@+id/install_confirm_question_update_system" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + style="@android:style/TextAppearance.Material.Subhead" + android:text="@string/install_confirm_question_update_system" + android:visibility="invisible" /> + + <TextView + android:id="@+id/install_success" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + style="@android:style/TextAppearance.Material.Subhead" + android:text="@string/install_done" + android:visibility="invisible" /> + + <TextView + android:id="@+id/install_failed" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + style="@android:style/TextAppearance.Material.Subhead" + android:text="@string/install_failed" + android:visibility="invisible" /> + + <TextView + android:id="@+id/install_failed_blocked" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + style="@android:style/TextAppearance.Material.Subhead" + android:text="@string/install_failed_blocked" + android:visibility="invisible" /> + + <TextView + android:id="@+id/install_failed_conflict" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + style="@android:style/TextAppearance.Material.Subhead" + android:text="@string/install_failed_conflict" + android:visibility="invisible" /> + + <TextView + android:id="@+id/install_failed_incompatible" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + style="@android:style/TextAppearance.Material.Subhead" + android:text="@string/install_failed_incompatible" + android:visibility="invisible" /> + + <TextView + android:id="@+id/install_failed_invalid_apk" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + style="@android:style/TextAppearance.Material.Subhead" + android:text="@string/install_failed_invalid_apk" + android:visibility="invisible" /> + +</FrameLayout> diff --git a/packages/PackageInstaller/res/layout/install_failed.xml b/packages/PackageInstaller/res/layout/install_failed.xml deleted file mode 100644 index d000ee9aa607..000000000000 --- a/packages/PackageInstaller/res/layout/install_failed.xml +++ /dev/null @@ -1,96 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - Copyright (C) 2016 The Android Open Source Project - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - --> - -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:orientation="vertical"> - - <LinearLayout android:id="@+id/app_snippet" - android:background="?android:attr/colorPrimary" - android:layout_width="match_parent" - android:layout_height="?android:attr/actionBarSize" - android:orientation="horizontal" - android:elevation="@dimen/headerElevation" - android:gravity="center_vertical"> - - <ImageView android:id="@+id/app_icon" - android:layout_marginStart="16dp" - android:layout_width="24dp" - android:layout_height="24dp" - android:scaleType="fitCenter" /> - - <TextView android:id="@+id/app_name" - android:layout_marginStart="32dp" - android:layout_marginEnd="16dp" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:textAppearance="?android:attr/titleTextStyle" - android:singleLine="true" - android:ellipsize="end" /> - - </LinearLayout> - - <LinearLayout android:id="@+id/simple_status_view" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_weight="1" - android:gravity="center" - android:orientation="vertical" - android:paddingLeft="16dip" - android:paddingRight="16dip"> - - <ImageView android:id="@+id/center_icon" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginBottom="12dp" - android:src="@drawable/ic_report_problem_92" - android:tint="@color/bigIconColor" - android:contentDescription="@null" /> - - <TextView android:id="@+id/simple_status" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:textAppearance="?android:attr/textAppearanceMedium" /> - - </LinearLayout> - - <LinearLayout android:id="@+id/buttons_panel" - style="?android:attr/buttonBarStyle" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:orientation="horizontal" - android:measureWithLargestChild="true" - android:padding="8dip"> - - <!-- spacer to push button to the right --> - <View android:layout_width="0dp" - android:layout_height="0dp" - android:layout_weight="1" /> - - <Button android:id="@+id/done_button" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:text="@string/done" - android:maxLines="2" - style="?android:attr/buttonBarButtonStyle" /> - - </LinearLayout> - -</LinearLayout> - - diff --git a/packages/PackageInstaller/res/layout/install_installing.xml b/packages/PackageInstaller/res/layout/install_installing.xml deleted file mode 100644 index a043a0146c80..000000000000 --- a/packages/PackageInstaller/res/layout/install_installing.xml +++ /dev/null @@ -1,108 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> - -<!-- Copyright (C) 2016 The Android Open Source Project - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. ---> - -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:orientation="vertical"> - - <LinearLayout android:id="@+id/app_snippet" - android:background="?android:attr/colorPrimary" - android:layout_width="match_parent" - android:layout_height="?android:attr/actionBarSize" - android:orientation="horizontal" - android:elevation="@dimen/headerElevation" - android:gravity="center_vertical"> - - <ImageView - android:id="@+id/app_icon" - android:layout_width="24dp" - android:layout_height="24dp" - android:layout_marginStart="16dp" - android:scaleType="fitCenter" /> - - <TextView - android:id="@+id/app_name" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginStart="32dp" - android:layout_marginEnd="16dp" - android:ellipsize="end" - android:singleLine="true" - android:textAppearance="?android:attr/titleTextStyle" /> - - </LinearLayout> - - <LinearLayout - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_weight="1" - android:gravity="center" - android:orientation="vertical" - android:paddingLeft="16dip" - android:paddingRight="16dip"> - - <ImageView - android:layout_width="92dp" - android:layout_height="92dp" - android:layout_marginBottom="12dp" - android:contentDescription="@null" - android:tint="@color/bigIconColor" - android:src="@drawable/ic_file_download" /> - - <ProgressBar - android:id="@+id/progress_bar" - style="?android:attr/progressBarStyleHorizontal" - android:layout_width="250dp" - android:layout_height="wrap_content" - android:indeterminate="false" /> - - <TextView - android:id="@+id/center_text" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:gravity="center_horizontal" - android:text="@string/installing" - android:textAppearance="?android:attr/textAppearanceMedium" /> - - </LinearLayout> - - <LinearLayout - android:id="@+id/buttons_panel" - style="?android:attr/buttonBarStyle" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:measureWithLargestChild="true" - android:orientation="horizontal" - android:padding="8dip"> - - <View - android:layout_width="0dp" - android:layout_height="0dp" - android:layout_weight="1" /> - - <Button - android:id="@+id/cancel_button" - style="?android:attr/buttonBarButtonStyle" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:maxLines="2" - android:text="@string/cancel" /> - - </LinearLayout> - -</LinearLayout> diff --git a/packages/PackageInstaller/res/layout/install_staging.xml b/packages/PackageInstaller/res/layout/install_staging.xml deleted file mode 100644 index e3022e7afb20..000000000000 --- a/packages/PackageInstaller/res/layout/install_staging.xml +++ /dev/null @@ -1,113 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - Copyright (C) 2016 The Android Open Source Project - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - --> - -<!-- - Defines the layout of the splash screen that displays the security - settings required for an application and requests the confirmation of the - user before it is installed. ---> - -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:orientation="vertical"> - - <!-- title bar --> - <LinearLayout android:id="@+id/app_snippet" - android:layout_width="match_parent" - android:layout_height="?android:attr/actionBarSize" - android:background="?android:attr/colorPrimary" - android:elevation="@dimen/headerElevation" - android:gravity="center_vertical" - android:orientation="horizontal"> - - <ImageView android:layout_width="24dp" - android:layout_height="24dp" - android:layout_marginLeft="16dp" - android:scaleType="fitCenter" - android:src="@drawable/ic_file_download" - android:tint="?android:attr/colorAccent" /> - - <TextView android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginLeft="32dp" - android:layout_marginRight="16dp" - android:ellipsize="end" - android:singleLine="true" - android:text="@string/app_name_unknown" - android:textAppearance="?android:attr/titleTextStyle" /> - - </LinearLayout> - - <!-- content --> - <LinearLayout - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_weight="1" - android:gravity="center" - android:orientation="vertical" - android:paddingLeft="16dip" - android:paddingRight="16dip"> - - <ImageView - android:layout_width="92dp" - android:layout_height="92dp" - android:scaleType="fitCenter" - android:layout_marginBottom="12dp" - android:contentDescription="@null" - android:tint="@color/bigIconColor" - android:src="@drawable/ic_file_download" /> - - <ProgressBar - style="?android:attr/progressBarStyleHorizontal" - android:layout_width="250dp" - android:layout_height="wrap_content" - android:indeterminate="true" /> - - <TextView - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:gravity="center_horizontal" - android:text="@string/message_staging" - android:textAppearance="?android:attr/textAppearanceMedium" /> - - </LinearLayout> - - <!-- Bottom buttons --> - <LinearLayout style="?android:attr/buttonBarStyle" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:orientation="horizontal" - android:padding="8dp"> - - <!-- spacer to push button to the right --> - <View android:layout_width="0dp" - android:layout_height="0dp" - android:layout_weight="1" /> - - <Button android:id="@+id/cancel_button" - style="?android:attr/buttonBarButtonStyle" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:maxLines="2" - android:text="@string/cancel" /> - - </LinearLayout> - -</LinearLayout> - - diff --git a/packages/PackageInstaller/res/layout/install_success.xml b/packages/PackageInstaller/res/layout/install_success.xml deleted file mode 100644 index fee6bede578a..000000000000 --- a/packages/PackageInstaller/res/layout/install_success.xml +++ /dev/null @@ -1,101 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - Copyright (C) 2016 The Android Open Source Project - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - --> - -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:orientation="vertical"> - - <LinearLayout android:id="@+id/app_snippet" - android:background="?android:attr/colorPrimary" - android:layout_width="match_parent" - android:layout_height="?android:attr/actionBarSize" - android:orientation="horizontal" - android:elevation="@dimen/headerElevation" - android:gravity="center_vertical"> - - <ImageView android:id="@+id/app_icon" - android:layout_marginStart="16dp" - android:layout_width="24dp" - android:layout_height="24dp" - android:scaleType="fitCenter" /> - - <TextView android:id="@+id/app_name" - android:layout_marginStart="32dp" - android:layout_marginEnd="16dp" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:textAppearance="?android:attr/titleTextStyle" - android:singleLine="true" - android:ellipsize="end" /> - - </LinearLayout> - - <LinearLayout android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_weight="1" - android:gravity="center" - android:orientation="vertical" - android:paddingLeft="16dip" - android:paddingRight="16dip"> - - <ImageView android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginBottom="12dp" - android:src="@drawable/ic_done_92" - android:tint="@color/bigIconColor" - android:contentDescription="@null" /> - - <TextView android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:gravity="center_horizontal" - android:text="@string/install_done" - android:textAppearance="?android:attr/textAppearanceMedium" /> - - </LinearLayout> - - <LinearLayout style="?android:attr/buttonBarStyle" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:orientation="horizontal" - android:measureWithLargestChild="true" - android:padding="8dip"> - - <!-- spacer to push buttons to the right --> - <View android:layout_width="0dp" - android:layout_height="0dp" - android:layout_weight="1" /> - - <Button android:id="@+id/done_button" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:text="@string/done" - android:maxLines="2" - style="?android:attr/buttonBarButtonStyle" /> - - <Button android:id="@+id/launch_button" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:text="@string/launch" - android:maxLines="2" - style="?android:attr/buttonBarButtonStyle" /> - - </LinearLayout> - -</LinearLayout> - - diff --git a/packages/PackageInstaller/res/values-night/themes.xml b/packages/PackageInstaller/res/values-night/themes.xml new file mode 100644 index 000000000000..483b0cf18c56 --- /dev/null +++ b/packages/PackageInstaller/res/values-night/themes.xml @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + Copyright (C) 2018 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + --> + +<resources> + + <style name="Theme.AlertDialogActivity" + parent="@android:style/Theme.DeviceDefault.Dialog.Alert" /> + +</resources> diff --git a/packages/PackageInstaller/res/values/strings.xml b/packages/PackageInstaller/res/values/strings.xml index 6c7160fc2935..ba81278fd7da 100644 --- a/packages/PackageInstaller/res/values/strings.xml +++ b/packages/PackageInstaller/res/values/strings.xml @@ -36,11 +36,11 @@ <!-- Message for updating an existing app [CHAR LIMIT=NONE] --> <string name="install_confirm_question_update">Do you want to install an update to this existing application? Your existing data will not - be lost. The updated application will get access to:</string> + be lost.</string> <!-- Message for updating an existing system app [CHAR LIMIT=NONE] --> <string name="install_confirm_question_update_system">Do you want to install an update to this built-in application? Your existing data will not - be lost. The updated application will get access to:</string> + be lost.</string> <!-- [CHAR LIMIT=100] --> <string name="install_failed">App not installed.</string> <!-- Reason displayed when installation fails because the package was blocked diff --git a/packages/PackageInstaller/res/values/styles.xml b/packages/PackageInstaller/res/values/styles.xml deleted file mode 100755 index f79f98feafdc..000000000000 --- a/packages/PackageInstaller/res/values/styles.xml +++ /dev/null @@ -1,39 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright (C) 2010 The Android Open Source Project - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. ---> - -<resources> - - <style name="MediumText" - parent="@android:style/TextAppearance.Medium"> - <item name="android:textColor">?android:attr/textColorPrimary</item> - </style> - - <style name="SmallText" - parent="@android:style/TextAppearance.Small"> - <item name="android:textColor">?android:attr/textColorPrimary</item> - </style> - - <style name="TitleText"> - <item name="android:fontFamily">sans-serif-medium</item> - <item name="android:textSize">20dp</item> - <item name="android:textColor">?android:attr/textColorPrimary</item> - </style> - - <style name="ActionBar" parent="@android:style/Widget.Material.ActionBar.Solid"> - <item name="android:contentInsetStart">72dp</item> - </style> - -</resources> diff --git a/packages/PackageInstaller/res/values/themes.xml b/packages/PackageInstaller/res/values/themes.xml index 6df6246ff560..6c8e4c551476 100644 --- a/packages/PackageInstaller/res/values/themes.xml +++ b/packages/PackageInstaller/res/values/themes.xml @@ -17,25 +17,11 @@ <resources> - <style name="DialogWhenLarge" - parent="@android:style/Theme.DeviceDefault.Light.NoActionBar"> - <item name="android:textAppearanceMedium">@style/MediumText</item> - <item name="android:textAppearanceSmall">@style/SmallText</item> - <item name="android:titleTextStyle">@style/TitleText</item> - </style> - - <style name="DialogWhenLargeNoAnimation" parent="DialogWhenLarge"> + <style name="Theme.AlertDialogActivity.NoAnimation"> <item name="android:windowAnimationStyle">@null</item> </style> - <style name="AlertDialogActivity" - parent="@android:style/Theme.DeviceDefault.Light.Panel"> - <item name="android:backgroundDimEnabled">true</item> - </style> - - <style name="Header.Settings" - parent="@android:style/Theme.DeviceDefault.Settings"> - </style> - + <style name="Theme.AlertDialogActivity" + parent="@android:style/Theme.DeviceDefault.Light.Dialog.Alert" /> </resources> diff --git a/packages/PackageInstaller/src/com/android/packageinstaller/InstallFailed.java b/packages/PackageInstaller/src/com/android/packageinstaller/InstallFailed.java index 5ba2d327d7d6..54105bb8432d 100644 --- a/packages/PackageInstaller/src/com/android/packageinstaller/InstallFailed.java +++ b/packages/PackageInstaller/src/com/android/packageinstaller/InstallFailed.java @@ -30,41 +30,49 @@ import android.content.pm.PackageManager; import android.net.Uri; import android.os.Bundle; import android.util.Log; -import android.widget.TextView; +import android.view.View; + +import com.android.internal.app.AlertActivity; import java.io.File; /** * Installation failed: Return status code to the caller or display failure UI to user */ -public class InstallFailed extends Activity { +public class InstallFailed extends AlertActivity { private static final String LOG_TAG = InstallFailed.class.getSimpleName(); /** Label of the app that failed to install */ private CharSequence mLabel; /** - * Convert an package installer status code into the user friendly label. + * Unhide the appropriate label for the statusCode. * * @param statusCode The status code from the package installer. - * - * @return The user friendly label for the status code */ - private int getExplanationFromErrorCode(int statusCode) { + private void setExplanationFromErrorCode(int statusCode) { Log.d(LOG_TAG, "Installation status code: " + statusCode); + View viewToEnable; switch (statusCode) { case PackageInstaller.STATUS_FAILURE_BLOCKED: - return R.string.install_failed_blocked; + viewToEnable = requireViewById(R.id.install_failed_blocked); + break; case PackageInstaller.STATUS_FAILURE_CONFLICT: - return R.string.install_failed_conflict; + viewToEnable = requireViewById(R.id.install_failed_conflict); + break; case PackageInstaller.STATUS_FAILURE_INCOMPATIBLE: - return R.string.install_failed_incompatible; + viewToEnable = requireViewById(R.id.install_failed_incompatible); + break; case PackageInstaller.STATUS_FAILURE_INVALID: - return R.string.install_failed_invalid_apk; + viewToEnable = requireViewById(R.id.install_failed_invalid_apk); + break; default: - return R.string.install_failed; + viewToEnable = requireViewById(R.id.install_failed); + break; } + + viewToEnable.setVisibility(View.VISIBLE); } @Override @@ -89,8 +97,6 @@ public class InstallFailed extends Activity { .getParcelableExtra(PackageUtil.INTENT_ATTR_APPLICATION_INFO); Uri packageURI = intent.getData(); - setContentView(R.layout.install_failed); - // Set header icon and title PackageUtil.AppSnippet as; PackageManager pm = getPackageManager(); @@ -106,7 +112,12 @@ public class InstallFailed extends Activity { // Store label for dialog mLabel = as.label; - PackageUtil.initSnippetForNewApp(this, as, R.id.app_snippet); + mAlert.setIcon(as.icon); + mAlert.setTitle(as.label); + mAlert.setView(R.layout.install_content_view); + mAlert.setButton(DialogInterface.BUTTON_POSITIVE, getString(R.string.done), + (ignored, ignored2) -> finish(), null); + setupAlert(); // Show out of space dialog if needed if (statusCode == PackageInstaller.STATUS_FAILURE_STORAGE) { @@ -114,11 +125,7 @@ public class InstallFailed extends Activity { } // Get status messages - ((TextView) findViewById(R.id.simple_status)).setText( - getExplanationFromErrorCode(statusCode)); - - // Set up "done" button - findViewById(R.id.done_button).setOnClickListener(view -> finish()); + setExplanationFromErrorCode(statusCode); } } diff --git a/packages/PackageInstaller/src/com/android/packageinstaller/InstallInstalling.java b/packages/PackageInstaller/src/com/android/packageinstaller/InstallInstalling.java index c2dd740f91e5..deb6163cbf9d 100755 --- a/packages/PackageInstaller/src/com/android/packageinstaller/InstallInstalling.java +++ b/packages/PackageInstaller/src/com/android/packageinstaller/InstallInstalling.java @@ -19,8 +19,8 @@ package com.android.packageinstaller; import static android.content.pm.PackageInstaller.SessionParams.UID_UNKNOWN; import android.annotation.Nullable; -import android.app.Activity; import android.app.PendingIntent; +import android.content.DialogInterface; import android.content.Intent; import android.content.pm.ApplicationInfo; import android.content.pm.PackageInstaller; @@ -30,9 +30,11 @@ import android.net.Uri; import android.os.AsyncTask; import android.os.Bundle; import android.util.Log; +import android.view.View; import android.widget.Button; import android.widget.ProgressBar; +import com.android.internal.app.AlertActivity; import com.android.internal.content.PackageHelper; import java.io.File; @@ -47,7 +49,7 @@ import java.io.OutputStream; * <p>This has two phases: First send the data to the package manager, then wait until the package * manager processed the result.</p> */ -public class InstallInstalling extends Activity { +public class InstallInstalling extends AlertActivity { private static final String LOG_TAG = InstallInstalling.class.getSimpleName(); private static final String SESSION_ID = "com.android.packageinstaller.SESSION_ID"; @@ -78,11 +80,31 @@ public class InstallInstalling extends Activity { protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); - setContentView(R.layout.install_installing); - ApplicationInfo appInfo = getIntent() .getParcelableExtra(PackageUtil.INTENT_ATTR_APPLICATION_INFO); mPackageURI = getIntent().getData(); + final File sourceFile = new File(mPackageURI.getPath()); + PackageUtil.AppSnippet as = PackageUtil.getAppSnippet(this, appInfo, sourceFile); + + mAlert.setIcon(as.icon); + mAlert.setTitle(as.label); + mAlert.setView(R.layout.install_content_view); + mAlert.setButton(DialogInterface.BUTTON_NEGATIVE, getString(R.string.cancel), + (ignored, ignored2) -> { + if (mInstallingTask != null) { + mInstallingTask.cancel(true); + } + + if (mSessionId > 0) { + getPackageManager().getPackageInstaller().abandonSession(mSessionId); + mSessionId = 0; + } + + setResult(RESULT_CANCELED); + finish(); + }, null); + setupAlert(); + requireViewById(R.id.installing).setVisibility(View.VISIBLE); if ("package".equals(mPackageURI.getScheme())) { try { @@ -92,10 +114,6 @@ public class InstallInstalling extends Activity { launchFailure(PackageManager.INSTALL_FAILED_INTERNAL_ERROR, null); } } else { - final File sourceFile = new File(mPackageURI.getPath()); - PackageUtil.initSnippetForNewApp(this, PackageUtil.getAppSnippet(this, appInfo, - sourceFile), R.id.app_snippet); - if (savedInstanceState != null) { mSessionId = savedInstanceState.getInt(SESSION_ID); mInstallId = savedInstanceState.getInt(INSTALL_ID); @@ -153,21 +171,7 @@ public class InstallInstalling extends Activity { } } - mCancelButton = (Button) findViewById(R.id.cancel_button); - - mCancelButton.setOnClickListener(view -> { - if (mInstallingTask != null) { - mInstallingTask.cancel(true); - } - - if (mSessionId > 0) { - getPackageManager().getPackageInstaller().abandonSession(mSessionId); - mSessionId = 0; - } - - setResult(RESULT_CANCELED); - finish(); - }); + mCancelButton = mAlert.getButton(DialogInterface.BUTTON_NEGATIVE); mSessionCallback = new InstallSessionCallback(); } @@ -307,7 +311,7 @@ public class InstallInstalling extends Activity { @Override public void onProgressChanged(int sessionId, float progress) { if (sessionId == mSessionId) { - ProgressBar progressBar = (ProgressBar)findViewById(R.id.progress_bar); + ProgressBar progressBar = requireViewById(R.id.progress); progressBar.setMax(Integer.MAX_VALUE); progressBar.setProgress((int) (Integer.MAX_VALUE * progress)); } diff --git a/packages/PackageInstaller/src/com/android/packageinstaller/InstallStaging.java b/packages/PackageInstaller/src/com/android/packageinstaller/InstallStaging.java index 1bc9dbd39b0a..98438cde7c68 100644 --- a/packages/PackageInstaller/src/com/android/packageinstaller/InstallStaging.java +++ b/packages/PackageInstaller/src/com/android/packageinstaller/InstallStaging.java @@ -29,6 +29,9 @@ import android.net.Uri; import android.os.AsyncTask; import android.os.Bundle; import android.util.Log; +import android.view.View; + +import com.android.internal.app.AlertActivity; import java.io.File; import java.io.FileOutputStream; @@ -40,7 +43,7 @@ import java.io.OutputStream; * If a package gets installed from an content URI this step loads the package and turns it into * and installation from a file. Then it re-starts the installation as usual. */ -public class InstallStaging extends Activity { +public class InstallStaging extends AlertActivity { private static final String LOG_TAG = InstallStaging.class.getSimpleName(); private static final String STAGED_FILE = "STAGED_FILE"; @@ -55,7 +58,19 @@ public class InstallStaging extends Activity { protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); - setContentView(R.layout.install_staging); + mAlert.setIcon(R.drawable.ic_file_download); + mAlert.setTitle(getString(R.string.app_name_unknown)); + mAlert.setView(R.layout.install_content_view); + mAlert.setButton(DialogInterface.BUTTON_NEGATIVE, getString(R.string.cancel), + (ignored, ignored2) -> { + if (mStagingTask != null) { + mStagingTask.cancel(true); + } + setResult(RESULT_CANCELED); + finish(); + }, null); + setupAlert(); + requireViewById(R.id.staging).setVisibility(View.VISIBLE); if (savedInstanceState != null) { mStagedFile = new File(savedInstanceState.getString(STAGED_FILE)); @@ -64,14 +79,6 @@ public class InstallStaging extends Activity { mStagedFile = null; } } - - findViewById(R.id.cancel_button).setOnClickListener(view -> { - if (mStagingTask != null) { - mStagingTask.cancel(true); - } - setResult(RESULT_CANCELED); - finish(); - }); } @Override diff --git a/packages/PackageInstaller/src/com/android/packageinstaller/InstallSuccess.java b/packages/PackageInstaller/src/com/android/packageinstaller/InstallSuccess.java index 94f6b31383bd..705d3f4bdf87 100644 --- a/packages/PackageInstaller/src/com/android/packageinstaller/InstallSuccess.java +++ b/packages/PackageInstaller/src/com/android/packageinstaller/InstallSuccess.java @@ -19,6 +19,7 @@ package com.android.packageinstaller; import android.annotation.Nullable; import android.app.Activity; import android.content.ActivityNotFoundException; +import android.content.DialogInterface; import android.content.Intent; import android.content.pm.ApplicationInfo; import android.content.pm.PackageManager; @@ -26,15 +27,18 @@ import android.content.pm.ResolveInfo; import android.net.Uri; import android.os.Bundle; import android.util.Log; +import android.view.View; import android.widget.Button; +import com.android.internal.app.AlertActivity; + import java.io.File; import java.util.List; /** * Finish installation: Return status code to the caller or display "success" UI to user */ -public class InstallSuccess extends Activity { +public class InstallSuccess extends AlertActivity { private static final String LOG_TAG = InstallSuccess.class.getSimpleName(); @Override @@ -53,8 +57,6 @@ public class InstallSuccess extends Activity { intent.getParcelableExtra(PackageUtil.INTENT_ATTR_APPLICATION_INFO); Uri packageURI = intent.getData(); - setContentView(R.layout.install_success); - // Set header icon and title PackageUtil.AppSnippet as; PackageManager pm = getPackageManager(); @@ -67,16 +69,20 @@ public class InstallSuccess extends Activity { as = PackageUtil.getAppSnippet(this, appInfo, sourceFile); } - PackageUtil.initSnippetForNewApp(this, as, R.id.app_snippet); - - // Set up "done" button - findViewById(R.id.done_button).setOnClickListener(view -> { - if (appInfo.packageName != null) { - Log.i(LOG_TAG, "Finished installing " + appInfo.packageName); - } - finish(); - }); - + mAlert.setIcon(as.icon); + mAlert.setTitle(as.label); + mAlert.setView(R.layout.install_content_view); + mAlert.setButton(DialogInterface.BUTTON_POSITIVE, getString(R.string.launch), null, + null); + mAlert.setButton(DialogInterface.BUTTON_NEGATIVE, getString(R.string.done), + (ignored, ignored2) -> { + if (appInfo.packageName != null) { + Log.i(LOG_TAG, "Finished installing " + appInfo.packageName); + } + finish(); + }, null); + setupAlert(); + requireViewById(R.id.install_success).setVisibility(View.VISIBLE); // Enable or disable "launch" button Intent launchIntent = getPackageManager().getLaunchIntentForPackage( appInfo.packageName); @@ -89,7 +95,7 @@ public class InstallSuccess extends Activity { } } - Button launchButton = (Button)findViewById(R.id.launch_button); + Button launchButton = mAlert.getButton(DialogInterface.BUTTON_POSITIVE); if (enabled) { launchButton.setOnClickListener(view -> { try { diff --git a/packages/PackageInstaller/src/com/android/packageinstaller/PackageInstallerActivity.java b/packages/PackageInstaller/src/com/android/packageinstaller/PackageInstallerActivity.java index 97bafe75be90..580308a4cffd 100644 --- a/packages/PackageInstaller/src/com/android/packageinstaller/PackageInstallerActivity.java +++ b/packages/PackageInstaller/src/com/android/packageinstaller/PackageInstallerActivity.java @@ -16,6 +16,8 @@ */ package com.android.packageinstaller; +import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS; + import android.Manifest; import android.annotation.NonNull; import android.annotation.StringRes; @@ -45,9 +47,9 @@ import android.os.UserManager; import android.provider.Settings; import android.util.Log; import android.view.View; -import android.view.View.OnClickListener; import android.widget.Button; -import android.widget.TextView; + +import com.android.internal.app.AlertActivity; import java.io.File; @@ -61,7 +63,7 @@ import java.io.File; * Based on the user response the package is then installed by launching InstallAppConfirm * sub activity. All state transitions are handled in this activity */ -public class PackageInstallerActivity extends OverlayTouchActivity implements OnClickListener { +public class PackageInstallerActivity extends AlertActivity { private static final String TAG = "PackageInstaller"; private static final int REQUEST_TRUST_EXTERNAL_SOURCE = 1; @@ -95,7 +97,6 @@ public class PackageInstallerActivity extends OverlayTouchActivity implements On // Buttons to indicate user acceptance private Button mOk; - private Button mCancel; private PackageUtil.AppSnippet mAppSnippet; @@ -119,18 +120,18 @@ public class PackageInstallerActivity extends OverlayTouchActivity implements On private boolean mEnableOk = false; private void startInstallConfirm() { - int msg; + View viewToEnable; if (mAppInfo != null) { - msg = (mAppInfo.flags & ApplicationInfo.FLAG_SYSTEM) != 0 - ? R.string.install_confirm_question_update_system - : R.string.install_confirm_question_update; + viewToEnable = (mAppInfo.flags & ApplicationInfo.FLAG_SYSTEM) != 0 + ? requireViewById(R.id.install_confirm_question_update_system) + : requireViewById(R.id.install_confirm_question_update); } else { // This is a new application with no permissions. - msg = R.string.install_confirm_question; + viewToEnable = requireViewById(R.id.install_confirm_question); } - ((TextView) findViewById(R.id.install_confirm_question)).setText(msg); + viewToEnable.setVisibility(View.VISIBLE); mEnableOk = true; mOk.setEnabled(true); @@ -280,6 +281,8 @@ public class PackageInstallerActivity extends OverlayTouchActivity implements On @Override protected void onCreate(Bundle icicle) { + getWindow().addPrivateFlags(PRIVATE_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS); + super.onCreate(null); if (icicle != null) { @@ -344,7 +347,7 @@ public class PackageInstallerActivity extends OverlayTouchActivity implements On // load dummy layout with OK button disabled until we override this layout in // startInstallConfirm - bindUi(R.layout.install_confirm); + bindUi(); checkIfAllowedAndInitiateInstall(); } @@ -374,17 +377,34 @@ public class PackageInstallerActivity extends OverlayTouchActivity implements On outState.putBoolean(ALLOW_UNKNOWN_SOURCES_KEY, mAllowUnknownSources); } - private void bindUi(int layout) { - setContentView(layout); - - mOk = (Button) findViewById(R.id.ok_button); - mCancel = (Button)findViewById(R.id.cancel_button); - mOk.setOnClickListener(this); - mCancel.setOnClickListener(this); + private void bindUi() { + mAlert.setIcon(mAppSnippet.icon); + mAlert.setTitle(mAppSnippet.label); + mAlert.setView(R.layout.install_content_view); + mAlert.setButton(DialogInterface.BUTTON_POSITIVE, getString(R.string.install), + (ignored, ignored2) -> { + if (mOk.isEnabled()) { + if (mSessionId != -1) { + mInstaller.setPermissionsResult(mSessionId, true); + finish(); + } else { + startInstall(); + } + } + }, null); + mAlert.setButton(DialogInterface.BUTTON_NEGATIVE, getString(R.string.cancel), + (ignored, ignored2) -> { + // Cancel and finish + setResult(RESULT_CANCELED); + if (mSessionId != -1) { + mInstaller.setPermissionsResult(mSessionId, false); + } + finish(); + }, null); + setupAlert(); + mOk = mAlert.getButton(DialogInterface.BUTTON_POSITIVE); mOk.setEnabled(false); - - PackageUtil.initSnippetForNewApp(this, mAppSnippet, R.id.app_snippet); } /** @@ -525,26 +545,6 @@ public class PackageInstallerActivity extends OverlayTouchActivity implements On super.onBackPressed(); } - public void onClick(View v) { - if (v == mOk) { - if (mOk.isEnabled()) { - if (mSessionId != -1) { - mInstaller.setPermissionsResult(mSessionId, true); - finish(); - } else { - startInstall(); - } - } - } else if (v == mCancel) { - // Cancel and finish - setResult(RESULT_CANCELED); - if (mSessionId != -1) { - mInstaller.setPermissionsResult(mSessionId, false); - } - finish(); - } - } - private void startInstall() { // Start subactivity to actually install the application Intent newIntent = new Intent(); diff --git a/packages/PackageInstaller/src/com/android/packageinstaller/PackageUtil.java b/packages/PackageInstaller/src/com/android/packageinstaller/PackageUtil.java index ba4bf8a6b838..0e89f56d2376 100644 --- a/packages/PackageInstaller/src/com/android/packageinstaller/PackageUtil.java +++ b/packages/PackageInstaller/src/com/android/packageinstaller/PackageUtil.java @@ -108,26 +108,6 @@ public class PackageUtil { icon); } - /** - * Utility method to display application snippet of a new package. - * The content view should have been set on context before invoking this method. - * appSnippet view should include R.id.app_icon and R.id.app_name - * defined on it. - * - * @param pContext context of package that can load the resources - * @param as The resources to be loaded - * @param snippetId view id of app snippet view - */ - @NonNull public static View initSnippetForNewApp(@NonNull Activity pContext, - @NonNull AppSnippet as, int snippetId) { - View appSnippet = pContext.findViewById(snippetId); - if (as.icon != null) { - ((ImageView) appSnippet.findViewById(R.id.app_icon)).setImageDrawable(as.icon); - } - ((TextView)appSnippet.findViewById(R.id.app_name)).setText(as.label); - return appSnippet; - } - static public class AppSnippet { @NonNull public CharSequence label; @Nullable public Drawable icon; diff --git a/packages/SettingsLib/OWNERS b/packages/SettingsLib/OWNERS index 4211c272b774..d188c65be883 100644 --- a/packages/SettingsLib/OWNERS +++ b/packages/SettingsLib/OWNERS @@ -8,8 +8,8 @@ dsandler@google.com evanlaird@google.com jackqdyulei@google.com jmonk@google.com +leifhendrik@google.com mfritze@google.com -nicoya@google.com rogerxue@google.com virgild@google.com zhfan@google.com @@ -18,4 +18,4 @@ zhfan@google.com miket@google.com # Exempt resource files (because they are in a flat directory and too hard to manage via OWNERS) -per-file *.xml=*
\ No newline at end of file +per-file *.xml=* diff --git a/packages/SettingsLib/tests/robotests/src/com/android/settingslib/bluetooth/CachedBluetoothDeviceManagerTest.java b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/bluetooth/CachedBluetoothDeviceManagerTest.java index 2d34f237a555..7baded8da1d4 100644 --- a/packages/SettingsLib/tests/robotests/src/com/android/settingslib/bluetooth/CachedBluetoothDeviceManagerTest.java +++ b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/bluetooth/CachedBluetoothDeviceManagerTest.java @@ -50,7 +50,6 @@ public class CachedBluetoothDeviceManagerTest { private final static String DEVICE_ADDRESS_3 = "AA:BB:CC:DD:EE:33"; private final static String DEVICE_SUMMARY_1 = "summary 1"; private final static String DEVICE_SUMMARY_2 = "summary 2"; - private final static String DEVICE_SUMMARY_3 = "summary 3"; private final static long HISYNCID1 = 10; private final static long HISYNCID2 = 11; private final BluetoothClass DEVICE_CLASS_1 = @@ -82,11 +81,6 @@ public class CachedBluetoothDeviceManagerTest { private CachedBluetoothDevice mCachedDevice3; private CachedBluetoothDeviceManager mCachedDeviceManager; private Context mContext; - private String[] mActiveDeviceStringsArray; - private String mActiveDeviceStringNone; - private String mActiveDeviceStringAll; - private String mActiveDeviceStringMedia; - private String mActiveDeviceStringPhone; @Before public void setUp() { diff --git a/packages/SystemUI/res/drawable-hdpi/ic_sysbar_back_carmode.png b/packages/SystemUI/res/drawable-hdpi/ic_sysbar_back_carmode.png Binary files differdeleted file mode 100644 index 95e5778448b2..000000000000 --- a/packages/SystemUI/res/drawable-hdpi/ic_sysbar_back_carmode.png +++ /dev/null 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 Binary files differdeleted file mode 100644 index 6421146caae3..000000000000 --- a/packages/SystemUI/res/drawable-hdpi/ic_sysbar_back_ime_carmode.png +++ /dev/null diff --git a/packages/SystemUI/res/drawable-hdpi/ic_sysbar_home_carmode.png b/packages/SystemUI/res/drawable-hdpi/ic_sysbar_home_carmode.png Binary files differdeleted file mode 100644 index 151d5feee7eb..000000000000 --- a/packages/SystemUI/res/drawable-hdpi/ic_sysbar_home_carmode.png +++ /dev/null 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 Binary files differdeleted file mode 100644 index b954aa7adc0c..000000000000 --- a/packages/SystemUI/res/drawable-ldrtl-hdpi/ic_sysbar_back_carmode.png +++ /dev/null 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 Binary files differdeleted file mode 100644 index 61d5db659850..000000000000 --- a/packages/SystemUI/res/drawable-ldrtl-mdpi/ic_sysbar_back_carmode.png +++ /dev/null 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 Binary files differdeleted file mode 100644 index 7b98c1fa7504..000000000000 --- a/packages/SystemUI/res/drawable-ldrtl-xhdpi/ic_sysbar_back_carmode.png +++ /dev/null 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 Binary files differdeleted file mode 100644 index aad13204b048..000000000000 --- a/packages/SystemUI/res/drawable-ldrtl-xxhdpi/ic_sysbar_back_carmode.png +++ /dev/null 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 000000000000..f91190b428d4 --- /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 Binary files differdeleted file mode 100644 index 754b2d99ec29..000000000000 --- a/packages/SystemUI/res/drawable-mdpi/ic_sysbar_back_carmode.png +++ /dev/null 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 Binary files differdeleted file mode 100644 index 873ed7f9e744..000000000000 --- a/packages/SystemUI/res/drawable-mdpi/ic_sysbar_back_ime_carmode.png +++ /dev/null diff --git a/packages/SystemUI/res/drawable-mdpi/ic_sysbar_home_carmode.png b/packages/SystemUI/res/drawable-mdpi/ic_sysbar_home_carmode.png Binary files differdeleted file mode 100644 index 7696d872fe21..000000000000 --- a/packages/SystemUI/res/drawable-mdpi/ic_sysbar_home_carmode.png +++ /dev/null diff --git a/packages/SystemUI/res/drawable-xhdpi/ic_sysbar_back_carmode.png b/packages/SystemUI/res/drawable-xhdpi/ic_sysbar_back_carmode.png Binary files differdeleted file mode 100644 index c98f55e071d8..000000000000 --- a/packages/SystemUI/res/drawable-xhdpi/ic_sysbar_back_carmode.png +++ /dev/null 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 Binary files differdeleted file mode 100644 index 187a5661a38b..000000000000 --- a/packages/SystemUI/res/drawable-xhdpi/ic_sysbar_back_ime_carmode.png +++ /dev/null diff --git a/packages/SystemUI/res/drawable-xhdpi/ic_sysbar_home_carmode.png b/packages/SystemUI/res/drawable-xhdpi/ic_sysbar_home_carmode.png Binary files differdeleted file mode 100644 index c66f8be323d6..000000000000 --- a/packages/SystemUI/res/drawable-xhdpi/ic_sysbar_home_carmode.png +++ /dev/null diff --git a/packages/SystemUI/res/drawable-xxhdpi/ic_sysbar_back_carmode.png b/packages/SystemUI/res/drawable-xxhdpi/ic_sysbar_back_carmode.png Binary files differdeleted file mode 100644 index 3a3a119041bd..000000000000 --- a/packages/SystemUI/res/drawable-xxhdpi/ic_sysbar_back_carmode.png +++ /dev/null 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 Binary files differdeleted file mode 100644 index 7198c825322f..000000000000 --- a/packages/SystemUI/res/drawable-xxhdpi/ic_sysbar_back_ime_carmode.png +++ /dev/null diff --git a/packages/SystemUI/res/drawable-xxhdpi/ic_sysbar_home_carmode.png b/packages/SystemUI/res/drawable-xxhdpi/ic_sysbar_home_carmode.png Binary files differdeleted file mode 100644 index b1fc02e51502..000000000000 --- a/packages/SystemUI/res/drawable-xxhdpi/ic_sysbar_home_carmode.png +++ /dev/null diff --git a/packages/SystemUI/res/drawable-xxxhdpi/ic_sysbar_back_carmode.png b/packages/SystemUI/res/drawable-xxxhdpi/ic_sysbar_back_carmode.png Binary files differdeleted file mode 100644 index c06bfdab0abd..000000000000 --- a/packages/SystemUI/res/drawable-xxxhdpi/ic_sysbar_back_carmode.png +++ /dev/null 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 Binary files differdeleted file mode 100644 index a8c76bfc664c..000000000000 --- a/packages/SystemUI/res/drawable-xxxhdpi/ic_sysbar_back_ime_carmode.png +++ /dev/null diff --git a/packages/SystemUI/res/drawable-xxxhdpi/ic_sysbar_home_carmode.png b/packages/SystemUI/res/drawable-xxxhdpi/ic_sysbar_home_carmode.png Binary files differdeleted file mode 100644 index b798e3d6ea06..000000000000 --- a/packages/SystemUI/res/drawable-xxxhdpi/ic_sysbar_home_carmode.png +++ /dev/null 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 000000000000..5844b2e0f2b6 --- /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 000000000000..542ba9b2a0d5 --- /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 000000000000..e07bf6f2290b --- /dev/null +++ b/packages/SystemUI/res/drawable/ic_sysbar_home_carmode.xml @@ -0,0 +1,12 @@ +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="44dp" + android:height="44dp" + android:viewportWidth="44.0" + android:viewportHeight="44.0"> + <path + android:pathData="M22.39,22.39m-14.54,0a14.54,14.54 0,1 1,29.07 0a14.54,14.54 0,1 1,-29.07 0" + android:fillType="evenOdd" + android:strokeColor="#F8F9FA" + android:fillColor="#00000000" + android:strokeWidth="4"/> +</vector> diff --git a/packages/SystemUI/res/layout/notification_snooze.xml b/packages/SystemUI/res/layout/notification_snooze.xml index fae759a7a49e..ffe2eee80447 100644 --- a/packages/SystemUI/res/layout/notification_snooze.xml +++ b/packages/SystemUI/res/layout/notification_snooze.xml @@ -22,7 +22,7 @@ android:orientation="vertical" android:clickable="true" android:background="@color/notification_guts_bg_color" - android:theme="@*android:style/Theme.DeviceDefault.Light"> + android:theme="@style/Theme.SystemUI"> <RelativeLayout android:id="@+id/notification_snooze" @@ -36,7 +36,7 @@ android:layout_alignParentStart="true" android:layout_centerVertical="true" android:paddingStart="@*android:dimen/notification_content_margin_start" - android:textColor="@color/notification_primary_text_color" + android:textColor="?android:attr/textColorPrimary" android:paddingEnd="4dp"/> <ImageView diff --git a/packages/SystemUI/res/layout/notification_snooze_option.xml b/packages/SystemUI/res/layout/notification_snooze_option.xml index aaf45f34585b..f2038397014f 100644 --- a/packages/SystemUI/res/layout/notification_snooze_option.xml +++ b/packages/SystemUI/res/layout/notification_snooze_option.xml @@ -22,4 +22,4 @@ android:layout_marginEnd="@*android:dimen/notification_content_margin_end" android:gravity="center_vertical" android:textSize="14sp" - android:textColor="#DD000000"/>
\ No newline at end of file + android:textColor="?android:attr/textColorSecondary"/>
\ No newline at end of file diff --git a/packages/SystemUI/res/values-television/styles.xml b/packages/SystemUI/res/values-television/styles.xml index 53dc4aa03a12..b59f0072b8c3 100644 --- a/packages/SystemUI/res/values-television/styles.xml +++ b/packages/SystemUI/res/values-television/styles.xml @@ -15,5 +15,6 @@ --> <resources xmlns:android="http://schemas.android.com/apk/res/android"> + <style name="Theme.SystemUI.Dialog" parent="@android:style/Theme.DeviceDefault.Dialog" /> <style name="Theme.SystemUI.Dialog.Alert" parent="@*android:style/Theme.DeviceDefault.Dialog.Alert" /> </resources> diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/car/CarStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/car/CarStatusBar.java index 6920d1063a91..6c9ca7037305 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 @@ package com.android.systemui.statusbar.car; 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.ViewGroup.LayoutParams; 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 @@ public class CarStatusBar extends StatusBar implements @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 506d69719e82..67a76fd86ba7 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 @@ package com.android.systemui.statusbar.car; 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 @@ public class FullscreenUserSwitcher { 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 @@ public class FullscreenUserSwitcher { 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 @@ public class FullscreenUserSwitcher { } 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 ee10d34b7d34..b376c007bbe4 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 static android.content.DialogInterface.BUTTON_POSITIVE; 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.core.graphics.drawable.RoundedBitmapDrawableFactory; 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 @@ import java.util.List; * 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 @@ public class UserGridRecyclerView extends PagedListView implements @Override public void onFinishInflate() { super.onFinishInflate(); - mUserManagerHelper.registerOnUsersUpdateListener(this); + mCarUserManagerHelper.registerOnUsersUpdateListener(this); } /** @@ -81,7 +81,7 @@ public class UserGridRecyclerView extends PagedListView implements @Override public void onDetachedFromWindow() { super.onDetachedFromWindow(); - mUserManagerHelper.unregisterOnUsersUpdateListener(); + mCarUserManagerHelper.unregisterOnUsersUpdateListener(this); } /** @@ -90,7 +90,7 @@ public class UserGridRecyclerView extends PagedListView implements * @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 @@ public class UserGridRecyclerView extends PagedListView implements // 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 @@ public class UserGridRecyclerView extends PagedListView implements 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 @@ public class UserGridRecyclerView extends PagedListView implements @Override public void onUsersUpdate() { mAdapter.clearUsers(); - mAdapter.updateUsers(createUserRecords(mUserManagerHelper.getAllUsers())); + mAdapter.updateUsers(createUserRecords(mCarUserManagerHelper.getAllUsers())); mAdapter.notifyDataSetChanged(); } @@ -210,7 +212,7 @@ public class UserGridRecyclerView extends PagedListView implements if (userRecord.mIsStartGuestSession) { notifyUserSelected(userRecord); - mUserManagerHelper.startNewGuestSession(mGuestName); + mCarUserManagerHelper.startNewGuestSession(mGuestName); return; } @@ -240,7 +242,7 @@ public class UserGridRecyclerView extends PagedListView implements } // 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 @@ public class UserGridRecyclerView extends PagedListView implements private Bitmap getUserRecordIcon(UserRecord userRecord) { if (userRecord.mIsStartGuestSession) { - return mUserManagerHelper.getGuestDefaultIcon(); + return mCarUserManagerHelper.getGuestDefaultIcon(); } if (userRecord.mIsAddUser) { @@ -262,7 +264,7 @@ public class UserGridRecyclerView extends PagedListView implements .getDrawable(R.drawable.car_add_circle_round)); } - return mUserManagerHelper.getUserIcon(userRecord.mInfo); + return mCarUserManagerHelper.getUserIcon(userRecord.mInfo); } @Override @@ -290,7 +292,7 @@ public class UserGridRecyclerView extends PagedListView implements @Override protected UserInfo doInBackground(String... userNames) { - return mUserManagerHelper.createNewUser(userNames[0]); + return mCarUserManagerHelper.createNewNonAdminUser(userNames[0]); } @Override @@ -300,7 +302,7 @@ public class UserGridRecyclerView extends PagedListView implements @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/logging/NotificationLogger.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/logging/NotificationLogger.java index 767b07f4e7f3..e96e176cc503 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/logging/NotificationLogger.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/logging/NotificationLogger.java @@ -62,6 +62,8 @@ public class NotificationLogger { protected IStatusBarService mBarService; private long mLastVisibilityReportUptimeMs; private NotificationListContainer mListContainer; + private Object mDozingLock = new Object(); + private boolean mDozing; protected final OnChildLocationsChangedListener mNotificationLocationsChangedListener = new OnChildLocationsChangedListener() { @@ -174,6 +176,12 @@ public class NotificationLogger { mNotificationLocationsChangedListener.onChildLocationsChanged(); } + public void setDozing(boolean dozing) { + synchronized (mDozingLock) { + mDozing = dozing; + } + } + private void logNotificationVisibilityChanges( Collection<NotificationVisibility> newlyVisible, Collection<NotificationVisibility> noLongerVisible) { @@ -190,19 +198,25 @@ public class NotificationLogger { // Ignore. } - final int N = newlyVisible.size(); + final int N = newlyVisibleAr.length; if (N > 0) { String[] newlyVisibleKeyAr = new String[N]; for (int i = 0; i < N; i++) { newlyVisibleKeyAr[i] = newlyVisibleAr[i].key; } - // TODO: Call NotificationEntryManager to do this, once it exists. - // TODO: Consider not catching all runtime exceptions here. - try { - mNotificationListener.setNotificationsShown(newlyVisibleKeyAr); - } catch (RuntimeException e) { - Log.d(TAG, "failed setNotificationsShown: ", e); + synchronized (mDozingLock) { + // setNotificationsShown should only be called if we are confident that + // the user has seen the notification, aka not when ambient display is on + if (!mDozing) { + // TODO: Call NotificationEntryManager to do this, once it exists. + // TODO: Consider not catching all runtime exceptions here. + try { + mNotificationListener.setNotificationsShown(newlyVisibleKeyAr); + } catch (RuntimeException e) { + Log.d(TAG, "failed setNotificationsShown: ", e); + } + } } } recycleAllVisibilityObjects(newlyVisibleAr); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarFragment.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarFragment.java index f3e100d18eba..40c8fde3f845 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarFragment.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarFragment.java @@ -181,6 +181,9 @@ public class NavigationBarFragment extends Fragment implements Callbacks { public void onQuickStepStarted() { // Use navbar dragging as a signal to hide the rotate button setRotateSuggestionButtonState(false); + + // Hide the notifications panel when quick step starts + mStatusBar.collapsePanel(true /* animate */); } @Override diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarGestureHelper.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarGestureHelper.java index ed1ae1097542..8c02e1f8220b 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarGestureHelper.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarGestureHelper.java @@ -75,7 +75,6 @@ public class NavigationBarGestureHelper implements TunerService.Tunable, Gesture private int mTouchDownY; private boolean mDownOnRecents; private VelocityTracker mVelocityTracker; - private boolean mNotificationsVisibleOnDown; private boolean mDockWindowEnabled; private boolean mDockWindowTouchSlopExceeded; @@ -108,9 +107,6 @@ public class NavigationBarGestureHelper implements TunerService.Tunable, Gesture } public boolean onInterceptTouchEvent(MotionEvent event) { - if (event.getActionMasked() == MotionEvent.ACTION_DOWN) { - mNotificationsVisibleOnDown = !mStatusBar.isPresenterFullyCollapsed(); - } if (!canHandleGestures()) { return false; } @@ -275,7 +271,7 @@ public class NavigationBarGestureHelper implements TunerService.Tunable, Gesture } private boolean canHandleGestures() { - return !mStatusBar.isKeyguardShowing() && !mNotificationsVisibleOnDown; + return !mStatusBar.isKeyguardShowing(); } private int calculateDragMode() { diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java index 3837fbcd547b..3e41cd2b39cc 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java @@ -791,8 +791,19 @@ public class NavigationBarView extends FrameLayout implements PluginListener<Nav showSwipeUpUI ? mQuickStepAccessibilityDelegate : null); } + public boolean isNotificationsFullyCollapsed() { + return mPanelView.isFullyCollapsed(); + } + + /** + * Updates the {@link WindowManager.LayoutParams.FLAG_SLIPPERY} state dependent on if swipe up + * is enabled, or the notifications is fully opened without being in an animated state. If + * slippery is enabled, touch events will leave the nav bar window and enter into the fullscreen + * app/home window, if not nav bar will receive a cancelled touch event once gesture leaves bar. + */ public void updateSlippery() { - setSlippery(!isQuickStepSwipeUpEnabled() || mPanelView.isFullyExpanded()); + setSlippery(!isQuickStepSwipeUpEnabled() || + (mPanelView.isFullyExpanded() && !mPanelView.isCollapsing())); } private void setSlippery(boolean slippery) { diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickStepController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickStepController.java index 6cc88bb4377c..a13bebdcdc0a 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickStepController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickStepController.java @@ -45,9 +45,6 @@ import android.util.Slog; import android.view.MotionEvent; import android.view.View; import android.view.WindowManagerGlobal; -import android.view.animation.DecelerateInterpolator; -import android.view.animation.Interpolator; -import androidx.annotation.DimenRes; import com.android.systemui.Dependency; import com.android.systemui.OverviewProxyService; import com.android.systemui.R; @@ -72,6 +69,7 @@ public class QuickStepController implements GestureHelper { private boolean mQuickScrubActive; private boolean mAllowGestureDetection; private boolean mQuickStepStarted; + private boolean mNotificationsVisibleOnDown; private int mTouchDownX; private int mTouchDownY; private boolean mDragPositive; @@ -190,7 +188,7 @@ public class QuickStepController implements GestureHelper { mNavigationBarView.getDownHitTarget() == HIT_TARGET_DEAD_ZONE; if (mOverviewEventSender.getProxy() == null || (!mNavigationBarView.isQuickScrubEnabled() && !mNavigationBarView.isQuickStepSwipeUpEnabled())) { - return false; + return deadZoneConsumed; } mNavigationBarView.requestUnbufferedDispatch(event); @@ -221,6 +219,7 @@ public class QuickStepController implements GestureHelper { mNavigationBarView.transformMatrixToLocal(mTransformLocalMatrix); mQuickStepStarted = false; mAllowGestureDetection = true; + mNotificationsVisibleOnDown = !mNavigationBarView.isNotificationsFullyCollapsed(); break; } case MotionEvent.ACTION_MOVE: { @@ -257,7 +256,8 @@ public class QuickStepController implements GestureHelper { // Decide to start quickstep if dragging away from the navigation bar, otherwise in // the parallel direction, decide to start quickscrub. Only one may run. if (!mQuickScrubActive && exceededSwipeUpTouchSlop) { - if (mNavigationBarView.isQuickStepSwipeUpEnabled()) { + if (mNavigationBarView.isQuickStepSwipeUpEnabled() + && !mNotificationsVisibleOnDown) { startQuickStep(event); } break; @@ -303,15 +303,28 @@ public class QuickStepController implements GestureHelper { break; } - // Proxy motion events to launcher if not handled by quick scrub - // Proxy motion events up/cancel that would be sent after long press on any nav button - if (!mQuickScrubActive && !mIsInScreenPinning && (mAllowGestureDetection - || action == MotionEvent.ACTION_CANCEL || action == MotionEvent.ACTION_UP)) { + if (shouldProxyEvents(action)) { proxyMotionEvents(event); } return mQuickScrubActive || mQuickStepStarted || deadZoneConsumed; } + private boolean shouldProxyEvents(int action) { + if (!mQuickScrubActive && !mIsInScreenPinning) { + // Allow down, cancel and up events, move and other events are passed if notifications + // are not showing and disabled gestures (such as long press) are not executed + switch (action) { + case MotionEvent.ACTION_DOWN: + case MotionEvent.ACTION_CANCEL: + case MotionEvent.ACTION_UP: + return true; + default: + return !mNotificationsVisibleOnDown && mAllowGestureDetection; + } + } + return false; + } + @Override public void onDraw(Canvas canvas) { if (!mNavigationBarView.isQuickScrubEnabled()) { diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java index cd0255b0edf4..3701eafeb5eb 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java @@ -3924,6 +3924,7 @@ public class StatusBar extends SystemUI implements DemoMode, mDozeScrimController.setDozing(mDozing); mKeyguardIndicationController.setDozing(mDozing); mNotificationPanel.setDozing(mDozing, animate); + mNotificationLogger.setDozing(mDozing); updateQsExpansionEnabled(); Trace.endSection(); } diff --git a/packages/SystemUI/tests/src/com/android/AAAPlusPlusVerifySysuiRequiredTestPropertiesTest.java b/packages/SystemUI/tests/src/com/android/AAAPlusPlusVerifySysuiRequiredTestPropertiesTest.java index 6792bc080066..7f83ed6164b9 100644 --- a/packages/SystemUI/tests/src/com/android/AAAPlusPlusVerifySysuiRequiredTestPropertiesTest.java +++ b/packages/SystemUI/tests/src/com/android/AAAPlusPlusVerifySysuiRequiredTestPropertiesTest.java @@ -19,6 +19,7 @@ import static org.hamcrest.Matchers.is; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertThat; +import android.content.pm.PackageManager; import android.support.test.filters.LargeTest; import android.support.test.filters.MediumTest; import android.support.test.filters.SmallTest; @@ -115,6 +116,13 @@ public class AAAPlusPlusVerifySysuiRequiredTestPropertiesTest extends SysuiTestC filter.add(new ExternalClassNameFilter()); filter.add(s -> s.startsWith("com.android.systemui") || s.startsWith("com.android.keyguard")); + + + if (!mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_AUTOMOTIVE)) { + // If it's not automotive target, exclude automotive classes from the test. + excludeAutomotiveClasses(filter); + } + try { return scanner.getClassPathEntries(filter); } catch (IOException e) { @@ -123,6 +131,13 @@ public class AAAPlusPlusVerifySysuiRequiredTestPropertiesTest extends SysuiTestC return Collections.emptyList(); } + private void excludeAutomotiveClasses(ChainedClassNameFilter filter) { + // Modifies the passed in filter. + filter.add(s -> !s.startsWith("com.android.systemui.statusbar.car.")); + filter.add(s -> !s.startsWith("com.android.systemui.qs.car.")); + filter.add(s -> !s.startsWith("com.android.systemui.car.")); + } + private String getClsStr() { return TextUtils.join(",", Arrays.asList(BASE_CLS_WHITELIST) .stream().map(cls -> cls.getSimpleName()).toArray()); diff --git a/services/autofill/java/com/android/server/autofill/ui/SaveUi.java b/services/autofill/java/com/android/server/autofill/ui/SaveUi.java index 0812cb992100..760e85e1e77b 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.IBinder; 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.text.Html; 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; @@ -337,7 +339,7 @@ final class SaveUi { 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 +378,35 @@ final class SaveUi { } } + // 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/TelephonyRegistry.java b/services/core/java/com/android/server/TelephonyRegistry.java index ad9fa40e0ab8..566ce4f48e25 100644 --- a/services/core/java/com/android/server/TelephonyRegistry.java +++ b/services/core/java/com/android/server/TelephonyRegistry.java @@ -36,6 +36,7 @@ import android.telephony.CellInfo; import android.telephony.CellLocation; import android.telephony.DisconnectCause; import android.telephony.LocationAccessPolicy; +import android.telephony.PhoneCapability; import android.telephony.PhoneStateListener; import android.telephony.PhysicalChannelConfig; import android.telephony.PreciseCallState; @@ -47,7 +48,6 @@ import android.telephony.SignalStrength; import android.telephony.SubscriptionManager; import android.telephony.TelephonyManager; import android.telephony.VoLteServiceState; -import android.text.TextUtils; import android.util.LocalLog; import com.android.internal.app.IBatteryStats; @@ -200,6 +200,8 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub { private boolean mCarrierNetworkChangeState = false; + private PhoneCapability mPhoneCapability = null; + private final LocalLog mLocalLog = new LocalLog(100); private PreciseDataConnectionState mPreciseDataConnectionState = @@ -658,6 +660,13 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub { remove(r.binder); } } + if ((events & PhoneStateListener.LISTEN_PHONE_CAPABILITY_CHANGE) != 0) { + try { + r.callback.onPhoneCapabilityChanged(mPhoneCapability); + } catch (RemoteException ex) { + remove(r.binder); + } + } } } } else { @@ -1453,6 +1462,33 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub { } } + public void notifyPhoneCapabilityChanged(PhoneCapability capability) { + if (!checkNotifyPermission("notifyPhoneCapabilityChanged()")) { + return; + } + + if (VDBG) { + log("notifyPhoneCapabilityChanged: capability=" + capability); + } + + synchronized (mRecords) { + mPhoneCapability = capability; + + for (Record r : mRecords) { + if (r.matchPhoneStateListenerEvent( + PhoneStateListener.LISTEN_PHONE_CAPABILITY_CHANGE)) { + try { + r.callback.onPhoneCapabilityChanged(capability); + } catch (RemoteException ex) { + mRemoveList.add(r.binder); + } + } + } + handleRemoveListLocked(); + } + } + + @Override public void dump(FileDescriptor fd, PrintWriter writer, String[] args) { final IndentingPrintWriter pw = new IndentingPrintWriter(writer, " "); @@ -1488,6 +1524,7 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub { pw.println("mForegroundCallState=" + mForegroundCallState); pw.println("mBackgroundCallState=" + mBackgroundCallState); pw.println("mVoLteServiceState=" + mVoLteServiceState); + pw.println("mPhoneCapability=" + mPhoneCapability); pw.decreaseIndent(); diff --git a/services/core/java/com/android/server/biometrics/common/AuthenticationClient.java b/services/core/java/com/android/server/biometrics/common/AuthenticationClient.java index 10a1b90b9135..a9cf96368a2b 100644 --- a/services/core/java/com/android/server/biometrics/common/AuthenticationClient.java +++ b/services/core/java/com/android/server/biometrics/common/AuthenticationClient.java @@ -21,10 +21,11 @@ import android.hardware.biometrics.BiometricAuthenticator; import android.hardware.biometrics.BiometricConstants; import android.hardware.biometrics.BiometricPrompt; import android.hardware.biometrics.IBiometricPromptReceiver; -import android.hardware.fingerprint.Fingerprint; import android.hardware.fingerprint.FingerprintManager; import android.os.Bundle; +import android.os.Handler; import android.os.IBinder; +import android.os.Looper; import android.os.RemoteException; import android.util.Slog; @@ -35,6 +36,7 @@ import com.android.internal.statusbar.IStatusBarService; */ public abstract class AuthenticationClient extends ClientMonitor { private long mOpId; + private Handler mHandler; public abstract int handleFailedAttempt(); public abstract void resetFailedAttempts(); @@ -97,6 +99,7 @@ public abstract class AuthenticationClient extends ClientMonitor { mStatusBarService = statusBarService; mFingerprintManager = (FingerprintManager) getContext() .getSystemService(Context.FINGERPRINT_SERVICE); + mHandler = new Handler(Looper.getMainLooper()); } @Override @@ -217,15 +220,19 @@ public abstract class AuthenticationClient extends ClientMonitor { BiometricConstants.BIOMETRIC_ERROR_LOCKOUT : BiometricConstants.BIOMETRIC_ERROR_LOCKOUT_PERMANENT; - // TODO: if the dialog is showing, this error should be delayed. On a similar - // note, AuthenticationClient should override onError and delay all other errors - // as well, if the dialog is showing - listener.onError(getHalDeviceId(), errorCode, 0 /* vendorCode */); - // Send the lockout message to the system dialog if (mBundle != null) { mStatusBarService.onBiometricError( mFingerprintManager.getErrorString(errorCode, 0 /* vendorCode */)); + mHandler.postDelayed(() -> { + try { + listener.onError(getHalDeviceId(), errorCode, 0 /* vendorCode */); + } catch (RemoteException e) { + Slog.w(getLogTag(), "RemoteException while sending error"); + } + }, BiometricPrompt.HIDE_DIALOG_DELAY); + } else { + listener.onError(getHalDeviceId(), errorCode, 0 /* vendorCode */); } } catch (RemoteException e) { Slog.w(getLogTag(), "Failed to notify lockout:", e); diff --git a/services/core/java/com/android/server/biometrics/common/BiometricService.java b/services/core/java/com/android/server/biometrics/common/BiometricService.java index f54baefa7161..5603f2f469b7 100644 --- a/services/core/java/com/android/server/biometrics/common/BiometricService.java +++ b/services/core/java/com/android/server/biometrics/common/BiometricService.java @@ -58,7 +58,6 @@ import android.util.SparseIntArray; import com.android.internal.logging.MetricsLogger; import com.android.internal.statusbar.IStatusBarService; import com.android.server.SystemService; -import com.android.server.biometrics.face.FaceService; import com.android.server.biometrics.fingerprint.FingerprintService; import java.util.ArrayList; diff --git a/services/core/java/com/android/server/notification/NotificationManagerService.java b/services/core/java/com/android/server/notification/NotificationManagerService.java index f0743192d65e..dd3e2d42ef88 100644 --- a/services/core/java/com/android/server/notification/NotificationManagerService.java +++ b/services/core/java/com/android/server/notification/NotificationManagerService.java @@ -72,7 +72,6 @@ import static android.service.notification.NotificationListenerService.REASON_UN import static android.service.notification.NotificationListenerService.REASON_USER_STOPPED; import static android.service.notification.NotificationListenerService.TRIM_FULL; import static android.service.notification.NotificationListenerService.TRIM_LIGHT; -import static android.view.Display.DEFAULT_DISPLAY; import static android.view.WindowManager.LayoutParams.TYPE_TOAST; import static com.android.server.utils.PriorityDump.PRIORITY_ARG; @@ -2694,24 +2693,30 @@ public class NotificationManagerService extends SystemService { try { synchronized (mNotificationLock) { final ManagedServiceInfo info = mListeners.checkServiceTokenLocked(token); - if (keys != null) { - final int N = keys.length; - for (int i = 0; i < N; i++) { - NotificationRecord r = mNotificationsByKey.get(keys[i]); - if (r == null) continue; - final int userId = r.sbn.getUserId(); - if (userId != info.userid && userId != UserHandle.USER_ALL && - !mUserProfiles.isCurrentProfile(userId)) { - throw new SecurityException("Disallowed call from listener: " - + info.service); - } - if (!r.isSeen()) { - if (DBG) Slog.d(TAG, "Marking notification as seen " + keys[i]); - reportSeen(r); - r.setSeen(); - maybeRecordInterruptionLocked(r); - } + if (keys == null) { + return; + } + ArrayList<NotificationRecord> seen = new ArrayList<>(); + final int n = keys.length; + for (int i = 0; i < n; i++) { + NotificationRecord r = mNotificationsByKey.get(keys[i]); + if (r == null) continue; + final int userId = r.sbn.getUserId(); + if (userId != info.userid && userId != UserHandle.USER_ALL + && !mUserProfiles.isCurrentProfile(userId)) { + throw new SecurityException("Disallowed call from listener: " + + info.service); } + seen.add(r); + if (!r.isSeen()) { + if (DBG) Slog.d(TAG, "Marking notification as seen " + keys[i]); + reportSeen(r); + r.setSeen(); + maybeRecordInterruptionLocked(r); + } + } + if (!seen.isEmpty()) { + mAssistants.onNotificationsSeenLocked(seen); } } } finally { @@ -6556,6 +6561,35 @@ public class NotificationManagerService extends SystemService { rebindServices(true); } + protected void onNotificationsSeenLocked(ArrayList<NotificationRecord> records) { + // There should be only one, but it's a list, so while we enforce + // singularity elsewhere, we keep it general here, to avoid surprises. + for (final ManagedServiceInfo info : NotificationAssistants.this.getServices()) { + ArrayList<String> keys = new ArrayList<>(records.size()); + for (NotificationRecord r : records) { + boolean sbnVisible = isVisibleToListener(r.sbn, info) + && info.isSameUser(r.getUserId()); + if (sbnVisible) { + keys.add(r.getKey()); + } + } + + if (!keys.isEmpty()) { + mHandler.post(() -> notifySeen(info, keys)); + } + } + } + + private void notifySeen(final ManagedServiceInfo info, + final ArrayList<String> keys) { + final INotificationListener assistant = (INotificationListener) info.service; + try { + assistant.onNotificationsSeen(keys); + } catch (RemoteException ex) { + Log.e(TAG, "unable to notify assistant (seen): " + assistant, ex); + } + } + public void onNotificationEnqueued(final NotificationRecord r) { final StatusBarNotification sbn = r.sbn; TrimCache trimCache = new TrimCache(sbn); diff --git a/services/core/java/com/android/server/pm/permission/BasePermission.java b/services/core/java/com/android/server/pm/permission/BasePermission.java index 1d002efc546f..820258022fd5 100644 --- a/services/core/java/com/android/server/pm/permission/BasePermission.java +++ b/services/core/java/com/android/server/pm/permission/BasePermission.java @@ -39,6 +39,7 @@ import android.util.Slog; import com.android.server.pm.DumpState; import com.android.server.pm.PackageManagerService; +import com.android.server.pm.PackageSetting; import com.android.server.pm.PackageSettingBase; import org.xmlpull.v1.XmlPullParser; @@ -374,8 +375,10 @@ public final class BasePermission { } public void enforceDeclaredUsedAndRuntimeOrDevelopment(PackageParser.Package pkg) { + final PackageSetting pkgSetting = (PackageSetting) pkg.mExtras; + final PermissionsState permsState = pkgSetting.getPermissionsState(); int index = pkg.requestedPermissions.indexOf(name); - if (index == -1) { + if (!permsState.hasRequestedPermission(name) && index == -1) { throw new SecurityException("Package " + pkg.packageName + " has not requested permission " + name); } diff --git a/services/core/java/com/android/server/pm/permission/PermissionsState.java b/services/core/java/com/android/server/pm/permission/PermissionsState.java index 11df380427eb..5e66bfc3cd3e 100644 --- a/services/core/java/com/android/server/pm/permission/PermissionsState.java +++ b/services/core/java/com/android/server/pm/permission/PermissionsState.java @@ -20,9 +20,9 @@ import android.content.pm.PackageManager; import android.os.UserHandle; import android.util.ArrayMap; import android.util.ArraySet; - import android.util.SparseArray; import android.util.SparseBooleanArray; + import com.android.internal.util.ArrayUtils; import java.util.ArrayList; @@ -291,6 +291,13 @@ public final class PermissionsState { } /** + * Returns whether the state has any known request for the given permission name, + * whether or not it has been granted. + */ + public boolean hasRequestedPermission(String name) { + return mPermissions != null && (mPermissions.get(name) != null); + } + /** * Gets all permissions for a given device user id regardless if they * are install time or runtime permissions. * diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java index c1bfbeacf52f..8a571432e735 100644 --- a/services/core/java/com/android/server/wm/WindowManagerService.java +++ b/services/core/java/com/android/server/wm/WindowManagerService.java @@ -2341,6 +2341,12 @@ public class WindowManagerService extends IWindowManager.Stub synchronized(mWindowMap) { final DisplayContent dc = mRoot.getDisplayContent(displayId); + if (dc == null) { + Slog.w(TAG_WM, "addWindowToken: Attempted to add token: " + binder + + " for non-exiting displayId=" + displayId); + return; + } + WindowToken token = dc.getWindowToken(binder); if (token != null) { Slog.w(TAG_WM, "addWindowToken: Attempted to add binder token: " + binder diff --git a/services/tests/servicestests/src/com/android/server/wm/DragDropControllerTests.java b/services/tests/servicestests/src/com/android/server/wm/DragDropControllerTests.java index f383fda0970f..7125246b6a29 100644 --- a/services/tests/servicestests/src/com/android/server/wm/DragDropControllerTests.java +++ b/services/tests/servicestests/src/com/android/server/wm/DragDropControllerTests.java @@ -23,6 +23,7 @@ import static android.view.WindowManager.LayoutParams.TYPE_BASE_APPLICATION; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import static org.mockito.Mockito.any; +import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.spy; import static org.mockito.Mockito.when; @@ -56,7 +57,7 @@ import java.util.concurrent.TimeUnit; /** * Tests for the {@link DragDropController} class. * - * atest com.android.server.wm.DragDropControllerTests + * atest FrameworksServicesTests:com.android.server.wm.DragDropControllerTests */ @SmallTest @RunWith(AndroidJUnit4.class) @@ -118,7 +119,7 @@ public class DragDropControllerTests extends WindowTestsBase { mTarget = new TestDragDropController(sWm, sWm.mH.getLooper()); mDisplayContent = spy(mDisplayContent); mWindow = createDropTargetWindow("Drag test window", 0); - when(mDisplayContent.getTouchableWinAtPointLocked(0, 0)).thenReturn(mWindow); + doReturn(mWindow).when(mDisplayContent).getTouchableWinAtPointLocked(0, 0); when(sWm.mInputManager.transferTouchFocus(any(), any())).thenReturn(true); synchronized (sWm.mWindowMap) { @@ -159,8 +160,7 @@ public class DragDropControllerTests extends WindowTestsBase { public void testPerformDrag_NullDataToOtherUser() throws Exception { final WindowState otherUsersWindow = createDropTargetWindow("Other user's window", 1 * UserHandle.PER_USER_RANGE); - when(mDisplayContent.getTouchableWinAtPointLocked(10, 10)) - .thenReturn(otherUsersWindow); + doReturn(otherUsersWindow).when(mDisplayContent).getTouchableWinAtPointLocked(10, 10); dragFlow(0, null, 10, 10); } diff --git a/telephony/java/android/telephony/ModemInfo.java b/telephony/java/android/telephony/ModemInfo.java new file mode 100644 index 000000000000..564effe05e38 --- /dev/null +++ b/telephony/java/android/telephony/ModemInfo.java @@ -0,0 +1,104 @@ +/* + * Copyright (C) 2018 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.telephony; + +import android.os.Parcel; +import android.os.Parcelable; + +import java.util.Objects; + +/** + * Information of a single logical modem indicating + * its id, supported rats and whether it supports voice or data, etc. + * @hide + */ +public class ModemInfo implements Parcelable { + public final int modemId; + public final int rat; /* bitset */ + public final boolean isVoiceSupported; + public final boolean isDataSupported; + + public ModemInfo(int modemId, int rat, boolean isVoiceSupported, boolean isDataSupported) { + this.modemId = modemId; + this.rat = rat; + this.isVoiceSupported = isVoiceSupported; + this.isDataSupported = isDataSupported; + } + + public ModemInfo(Parcel in) { + modemId = in.readInt(); + rat = in.readInt(); + isVoiceSupported = in.readBoolean(); + isDataSupported = in.readBoolean(); + } + + @Override + public String toString() { + return "modemId=" + modemId + " rat=" + rat + " isVoiceSupported:" + isVoiceSupported + + " isDataSupported:" + isDataSupported; + } + + @Override + public int hashCode() { + return Objects.hash(modemId, rat, isVoiceSupported, isDataSupported); + } + + @Override + public boolean equals(Object o) { + if (o == null || !(o instanceof ModemInfo) || hashCode() != o.hashCode()) { + return false; + } + + if (this == o) { + return true; + } + + ModemInfo s = (ModemInfo) o; + + return (modemId == s.modemId + && rat == s.rat + && isVoiceSupported == s.isVoiceSupported + && isDataSupported == s.isDataSupported); + } + + /** + * {@link Parcelable#describeContents} + */ + public @ContentsFlags int describeContents() { + return 0; + } + + /** + * {@link Parcelable#writeToParcel} + */ + public void writeToParcel(Parcel dest, @WriteFlags int flags) { + dest.writeInt(modemId); + dest.writeInt(rat); + dest.writeBoolean(isVoiceSupported); + dest.writeBoolean(isDataSupported); + } + + public static final Parcelable.Creator<ModemInfo> CREATOR = new Parcelable.Creator() { + public ModemInfo createFromParcel(Parcel in) { + return new ModemInfo(in); + } + + public ModemInfo[] newArray(int size) { + return new ModemInfo[size]; + } + }; +} diff --git a/telephony/java/android/telephony/PhoneCapability.aidl b/telephony/java/android/telephony/PhoneCapability.aidl new file mode 100644 index 000000000000..5de8d4a2c9e5 --- /dev/null +++ b/telephony/java/android/telephony/PhoneCapability.aidl @@ -0,0 +1,20 @@ +/* +** +** Copyright 2018, The Android Open Source Project +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ + +package android.telephony; + +parcelable PhoneCapability;
\ No newline at end of file diff --git a/telephony/java/android/telephony/PhoneCapability.java b/telephony/java/android/telephony/PhoneCapability.java new file mode 100644 index 000000000000..2ebfa53ead23 --- /dev/null +++ b/telephony/java/android/telephony/PhoneCapability.java @@ -0,0 +1,111 @@ +/* + * Copyright (C) 2018 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.telephony; + +import android.os.Parcel; +import android.os.Parcelable; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Objects; + +/** + * Define capability of a modem group. That is, the capabilities + * are shared between those modems defined by list of modem IDs. + * @hide + */ +public class PhoneCapability implements Parcelable { + public final int maxActiveVoiceCalls; + public final int maxActiveData; + public final int max5G; + public final List<ModemInfo> logicalModemList; + + public PhoneCapability(int maxActiveVoiceCalls, int maxActiveData, int max5G, + List<ModemInfo> logicalModemList) { + this.maxActiveVoiceCalls = maxActiveVoiceCalls; + this.maxActiveData = maxActiveData; + this.max5G = max5G; + // Make sure it's not null. + this.logicalModemList = logicalModemList == null ? new ArrayList<>() : logicalModemList; + } + + @Override + public String toString() { + return "maxActiveVoiceCalls=" + maxActiveVoiceCalls + " maxActiveData=" + maxActiveData + + " max5G=" + max5G + "logicalModemList:" + + Arrays.toString(logicalModemList.toArray()); + } + + private PhoneCapability(Parcel in) { + maxActiveVoiceCalls = in.readInt(); + maxActiveData = in.readInt(); + max5G = in.readInt(); + logicalModemList = new ArrayList<>(); + in.readList(logicalModemList, ModemInfo.class.getClassLoader()); + } + + @Override + public int hashCode() { + return Objects.hash(maxActiveVoiceCalls, maxActiveData, max5G, logicalModemList); + } + + @Override + public boolean equals(Object o) { + if (o == null || !(o instanceof PhoneCapability) || hashCode() != o.hashCode()) { + return false; + } + + if (this == o) { + return true; + } + + PhoneCapability s = (PhoneCapability) o; + + return (maxActiveVoiceCalls == s.maxActiveVoiceCalls + && maxActiveData == s.maxActiveData + && max5G == s.max5G + && logicalModemList.equals(s.logicalModemList)); + } + + /** + * {@link Parcelable#describeContents} + */ + public @Parcelable.ContentsFlags int describeContents() { + return 0; + } + + /** + * {@link Parcelable#writeToParcel} + */ + public void writeToParcel(Parcel dest, @Parcelable.WriteFlags int flags) { + dest.writeInt(maxActiveVoiceCalls); + dest.writeInt(maxActiveData); + dest.writeInt(max5G); + dest.writeList(logicalModemList); + } + + public static final Parcelable.Creator<PhoneCapability> CREATOR = new Parcelable.Creator() { + public PhoneCapability createFromParcel(Parcel in) { + return new PhoneCapability(in); + } + + public PhoneCapability[] newArray(int size) { + return new PhoneCapability[size]; + } + }; +} diff --git a/telephony/java/android/telephony/PhoneStateListener.java b/telephony/java/android/telephony/PhoneStateListener.java index 7f7ce8e50735..bd6a59d7492c 100644 --- a/telephony/java/android/telephony/PhoneStateListener.java +++ b/telephony/java/android/telephony/PhoneStateListener.java @@ -22,12 +22,11 @@ import android.os.Bundle; import android.os.Handler; import android.os.Looper; import android.os.Message; -import android.telecom.TelecomManager; import com.android.internal.telephony.IPhoneStateListener; -import java.util.List; import java.lang.ref.WeakReference; +import java.util.List; /** * A listener class for monitoring changes in specific telephony states @@ -273,6 +272,14 @@ public class PhoneStateListener { */ public static final int LISTEN_PHYSICAL_CHANNEL_CONFIGURATION = 0x00100000; + /** + * Listen for changes to the phone capability. + * + * @see #onPhoneCapabilityChanged + * @hide + */ + public static final int LISTEN_PHONE_CAPABILITY_CHANGE = 0x00200000; + /* * Subscription used to listen to the phone state changes * @hide @@ -395,6 +402,10 @@ public class PhoneStateListener { PhoneStateListener.this.onPhysicalChannelConfigurationChanged( (List<PhysicalChannelConfig>)msg.obj); break; + case LISTEN_PHONE_CAPABILITY_CHANGE: + PhoneStateListener.this.onPhoneCapabilityChanged( + (PhoneCapability) msg.obj); + break; } } }; @@ -625,6 +636,16 @@ public class PhoneStateListener { } /** + * Callback invoked when phone capability changes. Requires + * the READ_PRIVILEGED_PHONE_STATE permission. + * @param capability the new phone capability + * @hide + */ + public void onPhoneCapabilityChanged(PhoneCapability capability) { + // default implementation empty + } + + /** * Callback invoked when telephony has received notice from a carrier * app that a network action that could result in connectivity loss * has been requested by an app using @@ -751,6 +772,10 @@ public class PhoneStateListener { public void onPhysicalChannelConfigurationChanged(List<PhysicalChannelConfig> configs) { send(LISTEN_PHYSICAL_CHANNEL_CONFIGURATION, 0, 0, configs); } + + public void onPhoneCapabilityChanged(PhoneCapability capability) { + send(LISTEN_PHONE_CAPABILITY_CHANGE, 0, 0, capability); + } } @UnsupportedAppUsage diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index 3a8dba81c984..81d0d68fd92f 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -8075,4 +8075,23 @@ public class TelephonyManager { } return UNKNOWN_CARRIER_ID_LIST_VERSION; } + + + /** + * How many modems can have simultaneous data connections. + * @hide + */ + @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) + public int getNumberOfModemsWithSimultaneousDataConnections() { + try { + ITelephony telephony = getITelephony(); + if (telephony != null) { + return telephony.getNumberOfModemsWithSimultaneousDataConnections( + getSubId(), mContext.getOpPackageName()); + } + } catch (RemoteException ex) { + // This could happen if binder process crashes. + } + return 0; + } } diff --git a/telephony/java/com/android/internal/telephony/IPhoneStateListener.aidl b/telephony/java/com/android/internal/telephony/IPhoneStateListener.aidl index 0d315e5e563e..1ebb6976b45e 100644 --- a/telephony/java/com/android/internal/telephony/IPhoneStateListener.aidl +++ b/telephony/java/com/android/internal/telephony/IPhoneStateListener.aidl @@ -21,6 +21,7 @@ import android.telephony.ServiceState; import android.telephony.SignalStrength; import android.telephony.CellInfo; import android.telephony.DataConnectionRealTimeInfo; +import android.telephony.PhoneCapability; import android.telephony.PhysicalChannelConfig; import android.telephony.PreciseCallState; import android.telephony.PreciseDataConnectionState; @@ -50,5 +51,6 @@ oneway interface IPhoneStateListener { void onOemHookRawEvent(in byte[] rawData); void onCarrierNetworkChange(in boolean active); void onUserMobileDataStateChanged(in boolean enabled); + void onPhoneCapabilityChanged(in PhoneCapability capability); } diff --git a/telephony/java/com/android/internal/telephony/ITelephony.aidl b/telephony/java/com/android/internal/telephony/ITelephony.aidl index f9c394000c83..c59a7395ebac 100644 --- a/telephony/java/com/android/internal/telephony/ITelephony.aidl +++ b/telephony/java/com/android/internal/telephony/ITelephony.aidl @@ -1531,4 +1531,10 @@ interface ITelephony { * @hide */ void refreshUiccProfile(int subId); + + /** + * How many modems can have simultaneous data connections. + * @hide + */ + int getNumberOfModemsWithSimultaneousDataConnections(int subId, String callingPackage); } diff --git a/telephony/java/com/android/internal/telephony/ITelephonyRegistry.aidl b/telephony/java/com/android/internal/telephony/ITelephonyRegistry.aidl index 0127db97963e..e0e1a7b87916 100644 --- a/telephony/java/com/android/internal/telephony/ITelephonyRegistry.aidl +++ b/telephony/java/com/android/internal/telephony/ITelephonyRegistry.aidl @@ -21,6 +21,7 @@ import android.net.LinkProperties; import android.net.NetworkCapabilities; import android.os.Bundle; import android.telephony.CellInfo; +import android.telephony.PhoneCapability; import android.telephony.PhysicalChannelConfig; import android.telephony.ServiceState; import android.telephony.SignalStrength; @@ -74,4 +75,5 @@ interface ITelephonyRegistry { void notifySubscriptionInfoChanged(); void notifyCarrierNetworkChange(in boolean active); void notifyUserMobileDataStateChangedForPhoneId(in int phoneId, in int subId, in boolean state); + void notifyPhoneCapabilityChanged(in PhoneCapability capability); } diff --git a/telephony/java/com/android/internal/telephony/SmsConstants.java b/telephony/java/com/android/internal/telephony/SmsConstants.java index 2449108f22c4..0aba468b5e1f 100644 --- a/telephony/java/com/android/internal/telephony/SmsConstants.java +++ b/telephony/java/com/android/internal/telephony/SmsConstants.java @@ -58,7 +58,11 @@ public class SmsConstants { * See TS 23.038. */ public enum MessageClass{ - UNKNOWN, CLASS_0, CLASS_1, CLASS_2, CLASS_3; + UNKNOWN, + CLASS_0, + CLASS_1, + CLASS_2, + CLASS_3; } /** diff --git a/tools/aapt2/process/SymbolTable.cpp b/tools/aapt2/process/SymbolTable.cpp index fc4c9b537e73..70efbf5d17b2 100644 --- a/tools/aapt2/process/SymbolTable.cpp +++ b/tools/aapt2/process/SymbolTable.cpp @@ -194,6 +194,7 @@ std::unique_ptr<SymbolTable::Symbol> ResourceTableSymbolSource::FindByName( if (sr.package->id && sr.type->id && sr.entry->id) { symbol->id = ResourceId(sr.package->id.value(), sr.type->id.value(), sr.entry->id.value()); + symbol->is_dynamic = (sr.package->id.value() == 0); } if (name.type == ResourceType::kAttr || name.type == ResourceType::kAttrPrivate) { |