Merge "New API for getting enabledcomponent"

This commit is contained in:
Treehugger Robot
2021-09-14 18:18:30 +00:00
committed by Gerrit Code Review
4 changed files with 40 additions and 0 deletions

View File

@@ -40,4 +40,9 @@ interface ISystemConfig {
* @see SystemConfigManager#getSystemPermissionUids
*/
int[] getSystemPermissionUids(String permissionName);
/**
* @see SystemConfigManager#getEnabledComponentOverrides
*/
List<String> getEnabledComponentOverrides(String packageName);
}

View File

@@ -17,6 +17,7 @@ package android.os;
import android.Manifest;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.RequiresPermission;
import android.annotation.SystemApi;
import android.annotation.SystemService;
@@ -129,4 +130,21 @@ public class SystemConfigManager {
throw e.rethrowFromSystemServer();
}
}
/**
* Get enabled component for a specific package
*
* @param packageName The target package.
* @return The enabled component
* {@hide}
*/
@SystemApi
@NonNull
public List<String> getEnabledComponentOverrides(@NonNull String packageName) {
try {
return mInterface.getEnabledComponentOverrides(packageName);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
}
}