New API for getting enabledcomponent
Bluetooth can no longer call SystemConfig and need to use the manager. Bug: 190440540 Bug: 199279027 Test: Manual Tag: #refactor Change-Id: I065ab407c83cd2edf2244e4170496b0979ac562c
This commit is contained in:
committed by
William Escande
parent
730b6cfbc1
commit
29dbede144
@@ -21,6 +21,7 @@ import static java.util.stream.Collectors.toMap;
|
||||
import android.Manifest;
|
||||
import android.content.Context;
|
||||
import android.os.ISystemConfig;
|
||||
import android.util.ArrayMap;
|
||||
import android.util.ArraySet;
|
||||
import android.util.SparseArray;
|
||||
|
||||
@@ -84,6 +85,21 @@ public class SystemConfigService extends SystemService {
|
||||
}
|
||||
return ArrayUtils.convertToIntArray(uids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getEnabledComponentOverrides(String packageName) {
|
||||
ArrayMap<String, Boolean> systemComponents = SystemConfig.getInstance()
|
||||
.getComponentsEnabledStates(packageName);
|
||||
List<String> enabledComponent = new ArrayList<>();
|
||||
if (systemComponents != null) {
|
||||
for (Map.Entry<String, Boolean> entry : systemComponents.entrySet()) {
|
||||
if (Boolean.TRUE.equals(entry.getValue())) {
|
||||
enabledComponent.add(entry.getKey());
|
||||
}
|
||||
}
|
||||
}
|
||||
return enabledComponent;
|
||||
}
|
||||
};
|
||||
|
||||
public SystemConfigService(Context context) {
|
||||
|
||||
Reference in New Issue
Block a user