Add maxTargetSdk restriction to unused APIs.

These are APIs that have @UnsupportedAppUsage but for which we don't
have any evidence of them currently being used, so should be safe to
remove from the unsupported list.

Bug: 170729553
Test: Treehugger
Merged-In: I626caf7c1fe46c5ab1f39c2895b42a34319f771a
Change-Id: I54e5ecd11e76ca1de3c5893e3a98b0108e735413
This commit is contained in:
Mathew Inwood
2020-11-04 09:29:36 +00:00
parent 15075fcca0
commit 5d123b6775
638 changed files with 2392 additions and 2020 deletions

View File

@@ -18,6 +18,7 @@ package android.graphics;
import android.annotation.Nullable;
import android.compat.annotation.UnsupportedAppUsage;
import android.os.Build;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
@@ -69,17 +70,17 @@ import java.lang.ref.WeakReference;
*/
public class SurfaceTexture {
private final Looper mCreatorLooper;
@UnsupportedAppUsage
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
private Handler mOnFrameAvailableHandler;
/**
* These fields are used by native code, do not access or modify.
*/
@UnsupportedAppUsage
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
private long mSurfaceTexture;
@UnsupportedAppUsage
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
private long mProducer;
@UnsupportedAppUsage
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
private long mFrameAvailableListener;
private boolean mIsSingleBuffered;
@@ -390,7 +391,7 @@ public class SurfaceTexture {
* This method is invoked from native code only.
*/
@SuppressWarnings({"UnusedDeclaration"})
@UnsupportedAppUsage
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
private static void postEventFromNative(WeakReference<SurfaceTexture> weakSelf) {
SurfaceTexture st = weakSelf.get();
if (st != null) {