From b37dcbc2abf29a4f0e200c9ad41fe0e78e688604 Mon Sep 17 00:00:00 2001 From: Andrey Kulikov Date: Wed, 28 Nov 2018 14:28:31 +0000 Subject: Restrict unsupported API usage to Scene#mEnterAction/mExitAction/setCurrentScene They were used via reflection in older versions of support transitions. Starting from 26.0.0 it is not in use and there is no need to allow this usages. Developers should update to the newer version of support libraries/androidx Bug: 117521462 Bug: 117521646 Test: none Change-Id: Ia1d5516a58c0deec68091d719065621fc588591b --- core/java/android/transition/Scene.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/core/java/android/transition/Scene.java b/core/java/android/transition/Scene.java index 7e499f29122a..b1fc17a4ecd1 100644 --- a/core/java/android/transition/Scene.java +++ b/core/java/android/transition/Scene.java @@ -20,6 +20,7 @@ import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.UnsupportedAppUsage; import android.content.Context; +import android.os.Build; import android.util.SparseArray; import android.view.LayoutInflater; import android.view.View; @@ -38,9 +39,9 @@ public final class Scene { private int mLayoutId = -1; private ViewGroup mSceneRoot; private View mLayout; // alternative to layoutId - @UnsupportedAppUsage + @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P) Runnable mEnterAction; - @UnsupportedAppUsage + @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P) Runnable mExitAction; /** @@ -200,7 +201,7 @@ public final class Scene { * * @param sceneRoot The view on which the current scene is being set */ - @UnsupportedAppUsage + @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P) static void setCurrentScene(@NonNull View sceneRoot, @Nullable Scene scene) { sceneRoot.setTagInternal(com.android.internal.R.id.current_scene, scene); } -- cgit v1.2.3-59-g8ed1b