Loading core/java/android/app/SystemServiceRegistry.java +5 −1 Original line number Diff line number Diff line Loading @@ -58,6 +58,7 @@ import android.companion.CompanionDeviceManager; import android.companion.ICompanionDeviceManager; import android.companion.virtual.IVirtualDeviceManager; import android.companion.virtual.VirtualDeviceManager; import android.compat.Compatibility; import android.content.ClipboardManager; import android.content.ContentCaptureOptions; import android.content.Context; Loading Loading @@ -1092,7 +1093,10 @@ public final class SystemServiceRegistry { new CachedServiceFetcher<OverlayManager>() { @Override public OverlayManager createService(ContextImpl ctx) throws ServiceNotFoundException { IBinder b = ServiceManager.getServiceOrThrow(Context.OVERLAY_SERVICE); final IBinder b = (Compatibility.isChangeEnabled(OverlayManager.SELF_TARGETING_OVERLAY)) ? ServiceManager.getService(Context.OVERLAY_SERVICE) : ServiceManager.getServiceOrThrow(Context.OVERLAY_SERVICE); return new OverlayManager(ctx, IOverlayManager.Stub.asInterface(b)); }}); Loading core/java/android/content/om/OverlayManager.java +15 −0 Original line number Diff line number Diff line Loading @@ -91,6 +91,21 @@ public class OverlayManager { @EnabledSince(targetSdkVersion = Build.VERSION_CODES.R) private static final long THROW_SECURITY_EXCEPTIONS = 147340954; /** * Applications can use OverlayManager to create overlays to overlay on itself resources. The * overlay target is itself and the work range is only in caller application. * * <p>In {@link android.content.Context#getSystemService(String)}, it crashes because of {@link * java.lang.NullPointerException} if the parameter is OverlayManager. if the self-targeting is * enabled, the caller application can get the OverlayManager instance to use self-targeting * functionality. * * @hide */ @ChangeId @EnabledSince(targetSdkVersion = Build.VERSION_CODES.UPSIDE_DOWN_CAKE) public static final long SELF_TARGETING_OVERLAY = 205919743; /** * Creates a new instance. * Loading Loading
core/java/android/app/SystemServiceRegistry.java +5 −1 Original line number Diff line number Diff line Loading @@ -58,6 +58,7 @@ import android.companion.CompanionDeviceManager; import android.companion.ICompanionDeviceManager; import android.companion.virtual.IVirtualDeviceManager; import android.companion.virtual.VirtualDeviceManager; import android.compat.Compatibility; import android.content.ClipboardManager; import android.content.ContentCaptureOptions; import android.content.Context; Loading Loading @@ -1092,7 +1093,10 @@ public final class SystemServiceRegistry { new CachedServiceFetcher<OverlayManager>() { @Override public OverlayManager createService(ContextImpl ctx) throws ServiceNotFoundException { IBinder b = ServiceManager.getServiceOrThrow(Context.OVERLAY_SERVICE); final IBinder b = (Compatibility.isChangeEnabled(OverlayManager.SELF_TARGETING_OVERLAY)) ? ServiceManager.getService(Context.OVERLAY_SERVICE) : ServiceManager.getServiceOrThrow(Context.OVERLAY_SERVICE); return new OverlayManager(ctx, IOverlayManager.Stub.asInterface(b)); }}); Loading
core/java/android/content/om/OverlayManager.java +15 −0 Original line number Diff line number Diff line Loading @@ -91,6 +91,21 @@ public class OverlayManager { @EnabledSince(targetSdkVersion = Build.VERSION_CODES.R) private static final long THROW_SECURITY_EXCEPTIONS = 147340954; /** * Applications can use OverlayManager to create overlays to overlay on itself resources. The * overlay target is itself and the work range is only in caller application. * * <p>In {@link android.content.Context#getSystemService(String)}, it crashes because of {@link * java.lang.NullPointerException} if the parameter is OverlayManager. if the self-targeting is * enabled, the caller application can get the OverlayManager instance to use self-targeting * functionality. * * @hide */ @ChangeId @EnabledSince(targetSdkVersion = Build.VERSION_CODES.UPSIDE_DOWN_CAKE) public static final long SELF_TARGETING_OVERLAY = 205919743; /** * Creates a new instance. * Loading