Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 29162935 authored by Todd Kennedy's avatar Todd Kennedy Committed by Android (Google) Code Review
Browse files

Merge "OMS: expose getOverlayInfo API"

parents 3451f448 d507e2f4
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1479,6 +1479,7 @@ package android.content.om {
  }
  public class OverlayManager {
    method @Nullable public android.content.om.OverlayInfo getOverlayInfo(@NonNull String, @NonNull android.os.UserHandle);
    method public java.util.List<android.content.om.OverlayInfo> getOverlayInfosForTarget(@Nullable String, int);
    method public boolean setEnabled(@Nullable String, boolean, int);
    method public boolean setEnabledExclusiveInCategory(@Nullable String, int);
+24 −0
Original line number Diff line number Diff line
@@ -16,12 +16,14 @@

package android.content.om;

import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.SystemApi;
import android.annotation.SystemService;
import android.content.Context;
import android.os.RemoteException;
import android.os.ServiceManager;
import android.os.UserHandle;

import java.util.List;

@@ -95,6 +97,28 @@ public class OverlayManager {
        }
    }

    /**
     * Returns information about the overlay with the given package name for
     * the specified user.
     *
     * @param packageName The name of the package.
     * @param userHandle The user to get the OverlayInfos for.
     * @return An OverlayInfo object; if no overlays exist with the
     *         requested package name, null is returned.
     *
     * @hide
     */
    @SystemApi
    @Nullable
    public OverlayInfo getOverlayInfo(@NonNull final String packageName,
            @NonNull final UserHandle userHandle) {
        try {
            return mService.getOverlayInfo(packageName, userHandle.myUserId());
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
    }

    /**
     * Returns information about all overlays for the given target package for
     * the specified user. The returned list is ordered according to the