From e5ad598d1143ecc86b4d66f70ca098df068031a9 Mon Sep 17 00:00:00 2001 From: Mathew Inwood Date: Fri, 17 Aug 2018 15:07:52 +0100 Subject: Add @UnsupportedAppUsage annotations For packages: android.view.textservice android.view.textclassifier.logging android.view.textclassifier android.view.inputmethod android.view.autofill android.view.accessibility android.view 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: Ie4663ebd4640b2893e575e599582d2c9530da313 Merged-In: I4147b038ed7adf0311ee9918b44766f82a057eaf --- core/java/android/view/ViewRootImpl.java | 36 ++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'core/java/android/view/ViewRootImpl.java') diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java index b2e53ed78e68..954be0b38abf 100644 --- a/core/java/android/view/ViewRootImpl.java +++ b/core/java/android/view/ViewRootImpl.java @@ -30,6 +30,7 @@ import android.Manifest; import android.animation.LayoutTransition; import android.annotation.NonNull; import android.annotation.Nullable; +import android.annotation.UnsupportedAppUsage; import android.app.ActivityManager; import android.app.ActivityThread; import android.app.ResourcesManager; @@ -170,6 +171,7 @@ public final class ViewRootImpl implements ViewParent, */ static final int MAX_TRACKBALL_DELAY = 250; + @UnsupportedAppUsage static final ThreadLocal sRunQueues = new ThreadLocal(); static final ArrayList sFirstDrawHandlers = new ArrayList(); @@ -233,7 +235,9 @@ public final class ViewRootImpl implements ViewParent, */ @GuardedBy("mWindowCallbacks") final ArrayList mWindowCallbacks = new ArrayList<>(); + @UnsupportedAppUsage final Context mContext; + @UnsupportedAppUsage final IWindowSession mWindowSession; @NonNull Display mDisplay; final DisplayManager mDisplayManager; @@ -255,6 +259,7 @@ public final class ViewRootImpl implements ViewParent, int mSeq; + @UnsupportedAppUsage View mView; View mAccessibilityFocusedHost; @@ -287,6 +292,7 @@ public final class ViewRootImpl implements ViewParent, // Set to true if the owner of this window is in the stopped state, // so the window should no longer be active. + @UnsupportedAppUsage boolean mStopped = false; // Set to true if the owner of this window is in ambient mode, @@ -306,8 +312,11 @@ public final class ViewRootImpl implements ViewParent, final Region mTransparentRegion; final Region mPreviousTransparentRegion; + @UnsupportedAppUsage int mWidth; + @UnsupportedAppUsage int mHeight; + @UnsupportedAppUsage Rect mDirty; public boolean mIsAnimating; @@ -321,10 +330,12 @@ public final class ViewRootImpl implements ViewParent, CompatibilityInfo.Translator mTranslator; + @UnsupportedAppUsage final View.AttachInfo mAttachInfo; InputChannel mInputChannel; InputQueue.Callback mInputQueueCallback; InputQueue mInputQueue; + @UnsupportedAppUsage FallbackEventHandler mFallbackEventHandler; Choreographer mChoreographer; @@ -389,8 +400,10 @@ public final class ViewRootImpl implements ViewParent, // These can be accessed by any thread, must be protected with a lock. // Surface can never be reassigned or cleared (use Surface.clear()). + @UnsupportedAppUsage public final Surface mSurface = new Surface(); + @UnsupportedAppUsage boolean mAdded; boolean mAddedTouchMode; @@ -425,6 +438,7 @@ public final class ViewRootImpl implements ViewParent, boolean mScrollMayChange; @SoftInputModeFlags int mSoftInputMode; + @UnsupportedAppUsage WeakReference mLastScrolledFocus; int mScrollY; int mCurScrollY; @@ -555,6 +569,7 @@ public final class ViewRootImpl implements ViewParent, } /** Add static config callback to be notified about global config changes. */ + @UnsupportedAppUsage public static void addConfigCallback(ConfigChangedCallback callback) { synchronized (sConfigCallbacks) { sConfigCallbacks.add(callback); @@ -891,6 +906,7 @@ public final class ViewRootImpl implements ViewParent, return (mWindowAttributes.flags & WindowManager.LayoutParams.FLAG_LOCAL_FOCUS_MODE) != 0; } + @UnsupportedAppUsage public int getWindowFlags() { return mWindowAttributes.flags; } @@ -930,6 +946,7 @@ public final class ViewRootImpl implements ViewParent, } } + @UnsupportedAppUsage public void detachFunctor(long functor) { if (mAttachInfo.mThreadedRenderer != null) { // Fence so that any pending invokeFunctor() messages will be processed @@ -947,6 +964,7 @@ public final class ViewRootImpl implements ViewParent, * has invoked. If false, the functor may be invoked * asynchronously. */ + @UnsupportedAppUsage public static void invokeFunctor(long functor, boolean waitForCompletion) { ThreadedRenderer.invokeFunctor(functor, waitForCompletion); } @@ -980,6 +998,7 @@ public final class ViewRootImpl implements ViewParent, mNextRtFrameCallback = callback; } + @UnsupportedAppUsage private void enableHardwareAcceleration(WindowManager.LayoutParams attrs) { mAttachInfo.mHardwareAccelerated = false; mAttachInfo.mHardwareAccelerationRequested = false; @@ -1040,6 +1059,7 @@ public final class ViewRootImpl implements ViewParent, } } + @UnsupportedAppUsage public View getView() { return mView; } @@ -1241,6 +1261,7 @@ public final class ViewRootImpl implements ViewParent, invalidate(); } + @UnsupportedAppUsage void invalidate() { mDirty.set(0, 0, mWidth, mHeight); if (!mWillDrawSoon) { @@ -1425,6 +1446,7 @@ public final class ViewRootImpl implements ViewParent, } } + @UnsupportedAppUsage void scheduleTraversals() { if (!mTraversalScheduled) { mTraversalScheduled = true; @@ -3665,6 +3687,7 @@ public final class ViewRootImpl implements ViewParent, /** * @hide */ + @UnsupportedAppUsage public View getAccessibilityFocusedHost() { return mAccessibilityFocusedHost; } @@ -3672,6 +3695,7 @@ public final class ViewRootImpl implements ViewParent, /** * @hide */ + @UnsupportedAppUsage public AccessibilityNodeInfo getAccessibilityFocusedVirtualView() { return mAccessibilityFocusedVirtualView; } @@ -4289,6 +4313,7 @@ public final class ViewRootImpl implements ViewParent, * @param inTouchMode Whether we want to be in touch mode. * @return True if the touch mode changed and focus changed was changed as a result */ + @UnsupportedAppUsage boolean ensureTouchMode(boolean inTouchMode) { if (DBG) Log.d("touchmode", "ensureTouchMode(" + inTouchMode + "), current " + "touch mode is " + mAttachInfo.mInTouchMode); @@ -6284,6 +6309,7 @@ public final class ViewRootImpl implements ViewParent, } /* drag/drop */ + @UnsupportedAppUsage void setLocalDragState(Object obj) { mLocalDragState = obj; } @@ -6431,6 +6457,7 @@ public final class ViewRootImpl implements ViewParent, } } + @UnsupportedAppUsage public void getLastTouchPoint(Point outLocation) { outLocation.x = (int) mLastTouchPoint.x; outLocation.y = (int) mLastTouchPoint.y; @@ -6829,6 +6856,7 @@ public final class ViewRootImpl implements ViewParent, } } + @UnsupportedAppUsage private void dispatchResized(Rect frame, Rect overscanInsets, Rect contentInsets, Rect visibleInsets, Rect stableInsets, Rect outsets, boolean reportDraw, MergedConfiguration mergedConfiguration, Rect backDropFrame, boolean forceLayout, @@ -6993,10 +7021,12 @@ public final class ViewRootImpl implements ViewParent, } } + @UnsupportedAppUsage void enqueueInputEvent(InputEvent event) { enqueueInputEvent(event, null, 0, false); } + @UnsupportedAppUsage void enqueueInputEvent(InputEvent event, InputEventReceiver receiver, int flags, boolean processImmediately) { adjustInputEventForCompatibility(event); @@ -7337,6 +7367,7 @@ public final class ViewRootImpl implements ViewParent, mInvalidateOnAnimationRunnable.addViewRect(info); } + @UnsupportedAppUsage public void cancelInvalidate(View view) { mHandler.removeMessages(MSG_INVALIDATE, view); // fixme: might leak the AttachInfo.InvalidateInfo objects instead of returning @@ -7345,10 +7376,12 @@ public final class ViewRootImpl implements ViewParent, mInvalidateOnAnimationRunnable.removeView(view); } + @UnsupportedAppUsage public void dispatchInputEvent(InputEvent event) { dispatchInputEvent(event, null); } + @UnsupportedAppUsage public void dispatchInputEvent(InputEvent event, InputEventReceiver receiver) { SomeArgs args = SomeArgs.obtain(); args.arg1 = event; @@ -7364,6 +7397,7 @@ public final class ViewRootImpl implements ViewParent, mHandler.sendMessage(msg); } + @UnsupportedAppUsage public void dispatchKeyFromIme(KeyEvent event) { Message msg = mHandler.obtainMessage(MSG_DISPATCH_KEY_FROM_IME, event); msg.setAsynchronous(true); @@ -7382,6 +7416,7 @@ public final class ViewRootImpl implements ViewParent, * Note that it is the responsibility of the caller of this API to recycle the InputEvent it * passes in. */ + @UnsupportedAppUsage public void dispatchUnhandledInputEvent(InputEvent event) { if (event instanceof MotionEvent) { event = MotionEvent.obtain((MotionEvent) event); @@ -8084,6 +8119,7 @@ public final class ViewRootImpl implements ViewParent, } public static final class CalledFromWrongThreadException extends AndroidRuntimeException { + @UnsupportedAppUsage public CalledFromWrongThreadException(String msg) { super(msg); } -- cgit v1.2.3