remove getSystemConfigEnabledProfilesForPackage

Remove hidden api for mainline project.
This commit is only for
getSystemConfigEnabledProfilesForPackage
because this will trigger a SEDenial

Bug: 190440540
Test: Manual
Tag: #refactor
Change-Id: Icb822ab703e7617d2c96275d94f682d30171998f
This commit is contained in:
wescande
2021-06-18 10:51:19 +02:00
parent 56d72d1e0d
commit 0eef603309

View File

@@ -25,9 +25,9 @@ import static android.os.PowerExemptionManager.TEMPORARY_ALLOW_LIST_TYPE_FOREGRO
import static android.os.UserHandle.USER_SYSTEM; import static android.os.UserHandle.USER_SYSTEM;
import android.Manifest; import android.Manifest;
import android.annotation.NonNull;
import android.annotation.RequiresPermission; import android.annotation.RequiresPermission;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.annotation.NonNull;
import android.app.ActivityManager; import android.app.ActivityManager;
import android.app.AppGlobals; import android.app.AppGlobals;
import android.app.AppOpsManager; import android.app.AppOpsManager;
@@ -93,7 +93,6 @@ import com.android.server.pm.UserRestrictionsUtils;
import java.io.FileDescriptor; import java.io.FileDescriptor;
import java.io.PrintWriter; import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.Locale; import java.util.Locale;
@@ -804,35 +803,6 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
return mIsHearingAidProfileSupported; return mIsHearingAidProfileSupported;
} }
@Override
/** @hide */
public java.util.List<String> getSystemConfigEnabledProfilesForPackage(String packageName) {
if (Binder.getCallingUid() != Process.BLUETOOTH_UID) {
Slog.w(TAG, "getSystemConfigEnabledProfilesForPackage(): not allowed for non-bluetooth");
return null;
}
SystemConfig systemConfig = SystemConfig.getInstance();
if (systemConfig == null) {
return null;
}
android.util.ArrayMap<String, Boolean> componentEnabledStates =
systemConfig.getComponentsEnabledStates(packageName);
if (componentEnabledStates == null) {
return null;
}
ArrayList enabledProfiles = new ArrayList<String>();
for (Map.Entry<String, Boolean> entry : componentEnabledStates.entrySet()) {
if (entry.getValue()) {
enabledProfiles.add(entry.getKey());
}
}
return enabledProfiles;
}
private boolean isDeviceProvisioned() { private boolean isDeviceProvisioned() {
return Settings.Global.getInt(mContentResolver, Settings.Global.DEVICE_PROVISIONED, return Settings.Global.getInt(mContentResolver, Settings.Global.DEVICE_PROVISIONED,
0) != 0; 0) != 0;