```bash
adb shell cmd device_config put privacy camera_mic_icons_enabled false default
```
```
Exception occurred while executing 'put':
java.lang.SecurityException: Permission denial for flag 'privacy/camera_mic_icons_enabled'; allowlist permission granted, but must add flag to the allowlist
at com.android.providers.settings.SettingsProvider.enforceDeviceConfigWritePermission(SettingsProvider.java:2617)
at com.android.providers.settings.SettingsProvider.mutateConfigSetting(SettingsProvider.java:1392)
at com.android.providers.settings.SettingsProvider.insertConfigSetting(SettingsProvider.java:1244)
at com.android.providers.settings.SettingsProvider.call(SettingsProvider.java:489)
at android.content.ContentProvider.call(ContentProvider.java:2746)
at android.content.ContentProvider$Transport.call(ContentProvider.java:640)
at android.provider.Settings$NameValueCache.putStringForUser(Settings.java:3660)
at android.provider.Settings$Config.putString(Settings.java:21721)
at android.provider.SettingsConfigDataStore.setProperty(SettingsConfigDataStore.java:61)
at android.provider.DeviceConfig.setProperty(DeviceConfig.java:1443)
at com.android.providers.settings.DeviceConfigService$MyShellCommand.onCommand(DeviceConfigService.java:511)
at com.android.modules.utils.BasicShellCommandHandler.exec(BasicShellCommandHandler.java:97)
at android.os.ShellCommand.exec(ShellCommand.java:38)
at com.android.providers.settings.DeviceConfigService.onShellCommand(DeviceConfigService.java:101)
at android.os.Binder.shellCommand(Binder.java:1183)
at android.os.Binder.onTransact(Binder.java:961)
at android.os.Binder.execTransactInternal(Binder.java:1478)
at android.os.Binder.execTransact(Binder.java:1418)
```

No matter if `shell` or `root` on LineageOS 23.2 how to solve this error?
Aug 7, 6:50pm

The error you're encountering:

text
java.lang.SecurityException: Permission denial for flag 'privacy/camera_mic_icons_enabled'; allowlist permission granted, but must add flag to the allowlist

means that the camera_mic_icons_enabled flag is protected by an allowlist mechanism in Android (specifically in LineageOS 23.2, which is based on Android 13+). Even with adb root, this flag cannot be modified unless it is explicitly added to the device config allowlist.


Why This Happens

In Android 13 and later, certain device configuration flags (especially those related to privacy and security) are restricted and require explicit allowlisting in the system's configuration. This is a security feature to prevent unauthorized modifications to sensitive settings.

The privacy/camera_mic_icons_enabled flag controls whether the camera/microphone usage indicators (the green/orange dots in the status bar) are shown. Disabling this is intentionally restricted to prevent apps or users from hiding privacy indicators.


Possible Solutions

1. Modify the Allowlist (Requires System Modification)

To allow modification of this flag, you need to add it to the allowlist in the system's configuration. This requires root access and modifying system files.

Steps:

  1. Locate the allowlist file: The allowlist is typically defined in a file like:

    text
    /vendor/etc/device_config_allowlist.xml

    or

    text
    /system/etc/device_config_allowlist.xml

    (Path may vary by device/ROM.)

  2. Edit the file: Add the following line inside the <allowlist> tag:

    xml
    <flag name="privacy/camera_mic_icons_enabled" />
  3. Reboot the device: After modifying the file, reboot for changes to take effect.

  4. Retry the command:

    bash
    adb shell cmd device_config put privacy camera_mic_icons_enabled false

2. Use a Custom ROM or Kernel with the Flag Already Allowed

Some custom ROMs (like LineageOS) may have pre-configured allowlists or allow users to modify them more easily. Check if your ROM has a built-in toggle for this feature in Developer Options or Settings.


3. Disable the Indicator via Overlay (Alternative Approach)

If modifying the allowlist is not feasible, you can hide the indicator visually using an overlay (e.g., via Substratum or LSPosed modules). This does not disable the underlying flag but hides the UI element.


4. Check for ROM-Specific Workarounds

Some LineageOS builds may have custom props or tweaks to disable this. Check your ROM's XDA thread or GitHub issues for device-specific solutions.


Important Notes

  • Security Risk: Disabling privacy indicators can compromise user privacy by hiding when the camera/microphone is in use.
  • System Stability: Modifying system files can break functionality or cause bootloops. Always back up your device.
  • LineageOS Policy: LineageOS may intentionally restrict such changes to maintain security standards.

Final Recommendation

If you must disable the indicator, modifying the allowlist is the most direct method, but it requires root and file system access. If you're not comfortable with this, consider using an overlay or a custom ROM that allows it by default.

Aug 7, 6:50pm

This is a shared conversation and may include unverified content that doesn't reflect Mistral AI's views. Login to resume chatting.

Vibe can make mistakes. Check answers. Learn more