Add @UnsupportedAppUsage annotations
For packages:
com.android.internal
com.android.internal.annotations
com.android.internal.app
com.android.internal.app.procstats
com.android.internal.appwidget
com.android.internal.backup
com.android.internal.car
com.android.internal.content
com.android.internal.inputmethod
com.android.internal.location
com.android.internal.logging
com.android.internal.midi
com.android.internal.net
com.android.internal.os
com.android.internal.policy
com.android.internal.statusbar
com.android.internal.telecom
com.android.internal.telephony.euicc
com.android.internal.textservice
com.android.internal.util
com.android.internal.view
com.android.internal.view.animation
com.android.internal.view.menu
com.android.internal.widget
This is an automatically generated CL. See go/UnsupportedAppUsage
for more details.
Exempted-From-Owner-Approval: Mechanical changes to the codebase
which have been approved by Android API council and announced on
android-eng@
Bug: 110868826
Test: m
Change-Id: Ib31b52e6957869e5744dadbb35cb4584ef17187f
diff --git a/core/java/com/android/internal/view/menu/MenuPopupHelper.java b/core/java/com/android/internal/view/menu/MenuPopupHelper.java
index 324f923..e6d3460 100644
--- a/core/java/com/android/internal/view/menu/MenuPopupHelper.java
+++ b/core/java/com/android/internal/view/menu/MenuPopupHelper.java
@@ -22,6 +22,7 @@
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.StyleRes;
+import android.annotation.UnsupportedAppUsage;
import android.content.Context;
import android.graphics.Point;
import android.graphics.Rect;
@@ -49,16 +50,19 @@
// Mutable cached popup menu properties.
private View mAnchorView;
private int mDropDownGravity = Gravity.START;
+ @UnsupportedAppUsage
private boolean mForceShowIcon;
private Callback mPresenterCallback;
private MenuPopup mPopup;
private OnDismissListener mOnDismissListener;
+ @UnsupportedAppUsage
public MenuPopupHelper(@NonNull Context context, @NonNull MenuBuilder menu) {
this(context, menu, null, false, com.android.internal.R.attr.popupMenuStyle, 0);
}
+ @UnsupportedAppUsage
public MenuPopupHelper(@NonNull Context context, @NonNull MenuBuilder menu,
@NonNull View anchorView) {
this(context, menu, anchorView, false, com.android.internal.R.attr.popupMenuStyle, 0);
@@ -92,6 +96,7 @@
*
* @param anchor the view to which the popup window should be anchored
*/
+ @UnsupportedAppUsage
public void setAnchorView(@NonNull View anchor) {
mAnchorView = anchor;
}
@@ -105,6 +110,7 @@
* @param forceShowIcon {@code true} to force icons to be shown, or
* {@code false} for icons to be optionally shown
*/
+ @UnsupportedAppUsage
public void setForceShowIcon(boolean forceShowIcon) {
mForceShowIcon = forceShowIcon;
if (mPopup != null) {
@@ -119,6 +125,7 @@
*
* @param gravity alignment of the popup relative to the anchor
*/
+ @UnsupportedAppUsage
public void setGravity(int gravity) {
mDropDownGravity = gravity;
}
@@ -130,6 +137,7 @@
return mDropDownGravity;
}
+ @UnsupportedAppUsage
public void show() {
if (!tryShow()) {
throw new IllegalStateException("MenuPopupHelper cannot be used without an anchor");
@@ -143,6 +151,7 @@
}
@NonNull
+ @UnsupportedAppUsage
public MenuPopup getPopup() {
if (mPopup == null) {
mPopup = createPopup();
@@ -156,6 +165,7 @@
* @return {@code true} if the popup was shown or was already showing prior to calling this
* method, {@code false} otherwise
*/
+ @UnsupportedAppUsage
public boolean tryShow() {
if (isShowing()) {
return true;
@@ -280,6 +290,7 @@
* Dismisses the popup, if showing.
*/
@Override
+ @UnsupportedAppUsage
public void dismiss() {
if (isShowing()) {
mPopup.dismiss();