OSDN Git Service

Restrict reflection access to INotificationManager from Toast
authorAdam Powell <adamp@google.com>
Mon, 4 Feb 2019 21:29:11 +0000 (13:29 -0800)
committerAdam Powell <adamp@google.com>
Mon, 4 Feb 2019 21:33:23 +0000 (13:33 -0800)
Bug: 123768917
Change-Id: Ice757d9f10f08f6d50dc34ca5c459e44d1ade10d

core/java/android/widget/Toast.java

index c256d57..eef40e1 100644 (file)
@@ -341,10 +341,10 @@ public class Toast {
     // the proper ordering of these system-wide.
     // =======================================================================================
 
-    @UnsupportedAppUsage
+    @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
     private static INotificationManager sService;
 
-    @UnsupportedAppUsage
+    @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
     static private INotificationManager getService() {
         if (sService != null) {
             return sService;