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

Commit d507e2f4 authored by Zoran Jovanovic's avatar Zoran Jovanovic Committed by Todd Kennedy
Browse files

OMS: expose getOverlayInfo API

Expose getOverlayInfo API on OMS in order to
implement additional AppInfo UI for resource
overlay in Settings app.

Bug: 124556507
Bug: 124540315
Test: make RunSettingsRoboTests ROBOTEST_FILTER=AppButtonsPreferenceControllerTest
Change-Id: Ib2cc257fe628e9cc855047cce7ed81a9786b2635
parent 09eb96c4
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1478,6 +1478,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