Merge "Change getEnabledComponentOverrides return type"
This commit is contained in:
@@ -297,6 +297,10 @@ package android.os {
|
||||
method @Nullable public android.os.IBinder getOrThrow() throws android.os.StatsServiceManager.ServiceNotFoundException;
|
||||
}
|
||||
|
||||
public class SystemConfigManager {
|
||||
method @NonNull public java.util.List<android.content.ComponentName> getEnabledComponentOverrides(@NonNull String);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
package android.os.storage {
|
||||
|
||||
@@ -8581,7 +8581,6 @@ package android.os {
|
||||
public class SystemConfigManager {
|
||||
method @NonNull @RequiresPermission(android.Manifest.permission.READ_CARRIER_APP_INFO) public java.util.Set<java.lang.String> getDisabledUntilUsedPreinstalledCarrierApps();
|
||||
method @NonNull @RequiresPermission(android.Manifest.permission.READ_CARRIER_APP_INFO) public java.util.Map<java.lang.String,java.util.List<java.lang.String>> getDisabledUntilUsedPreinstalledCarrierAssociatedApps();
|
||||
method @NonNull public java.util.List<java.lang.String> getEnabledComponentOverrides(@NonNull String);
|
||||
method @NonNull @RequiresPermission(android.Manifest.permission.GET_RUNTIME_PERMISSIONS) public int[] getSystemPermissionUids(@NonNull String);
|
||||
}
|
||||
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
|
||||
package android.os;
|
||||
|
||||
import android.content.ComponentName;
|
||||
|
||||
/**
|
||||
* Binder interface to query SystemConfig in the system server.
|
||||
* {@hide}
|
||||
@@ -44,5 +46,5 @@ interface ISystemConfig {
|
||||
/**
|
||||
* @see SystemConfigManager#getEnabledComponentOverrides
|
||||
*/
|
||||
List<String> getEnabledComponentOverrides(String packageName);
|
||||
List<ComponentName> getEnabledComponentOverrides(String packageName);
|
||||
}
|
||||
|
||||
@@ -17,10 +17,10 @@ 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;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.util.ArraySet;
|
||||
import android.util.Log;
|
||||
@@ -138,9 +138,9 @@ public class SystemConfigManager {
|
||||
* @return The enabled component
|
||||
* {@hide}
|
||||
*/
|
||||
@SystemApi
|
||||
@SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
|
||||
@NonNull
|
||||
public List<String> getEnabledComponentOverrides(@NonNull String packageName) {
|
||||
public List<ComponentName> getEnabledComponentOverrides(@NonNull String packageName) {
|
||||
try {
|
||||
return mInterface.getEnabledComponentOverrides(packageName);
|
||||
} catch (RemoteException e) {
|
||||
|
||||
@@ -19,6 +19,7 @@ import static java.util.stream.Collectors.toList;
|
||||
import static java.util.stream.Collectors.toMap;
|
||||
|
||||
import android.Manifest;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.os.ISystemConfig;
|
||||
import android.util.ArrayMap;
|
||||
@@ -87,14 +88,14 @@ public class SystemConfigService extends SystemService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getEnabledComponentOverrides(String packageName) {
|
||||
public List<ComponentName> getEnabledComponentOverrides(String packageName) {
|
||||
ArrayMap<String, Boolean> systemComponents = SystemConfig.getInstance()
|
||||
.getComponentsEnabledStates(packageName);
|
||||
List<String> enabledComponent = new ArrayList<>();
|
||||
List<ComponentName> enabledComponent = new ArrayList<>();
|
||||
if (systemComponents != null) {
|
||||
for (Map.Entry<String, Boolean> entry : systemComponents.entrySet()) {
|
||||
if (Boolean.TRUE.equals(entry.getValue())) {
|
||||
enabledComponent.add(entry.getKey());
|
||||
enabledComponent.add(new ComponentName(packageName, entry.getKey()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user