Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b1421591 authored by William Escande's avatar William Escande
Browse files

Flag 24Q3: remove auto_on_feature

Bug: 323060869
Fix: 323060869
Test: atest ServiceBluetoothRoboTests
Flag: com.android.bluetooth.flags.auto_on_feature
Change-Id: I5b29593925bcf4c87f2c0e7c6c6a46e9737406b7
parent 0fd474c6
Loading
Loading
Loading
Loading
+0 −8
Original line number Diff line number Diff line
package: "com.android.bluetooth.flags"
container: "com.android.btservices"

flag {
    name: "auto_on_feature"
    is_exported: true
    namespace: "bluetooth"
    description: "Turn bluetooth on next morning at 5 am"
    bug: "323060869"
}

flag {
    name: "avoid_static_loading_of_native"
    namespace: "bluetooth"
+7 −7
Original line number Diff line number Diff line
@@ -75,8 +75,8 @@ package android.bluetooth {
    method @NonNull @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public android.os.Bundle getPreferredAudioProfiles(@NonNull android.bluetooth.BluetoothDevice);
    method @NonNull @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public java.util.List<java.lang.Integer> getSupportedProfiles();
    method @NonNull @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public java.util.List<android.os.ParcelUuid> getUuidsList();
    method @FlaggedApi("com.android.bluetooth.flags.auto_on_feature") @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public boolean isAutoOnEnabled();
    method @FlaggedApi("com.android.bluetooth.flags.auto_on_feature") @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public boolean isAutoOnSupported();
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public boolean isAutoOnEnabled();
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public boolean isAutoOnSupported();
    method public boolean isBleScanAlwaysAvailable();
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int isDistanceMeasurementSupported();
    method public boolean isLeEnabled();
@@ -90,7 +90,7 @@ package android.bluetooth {
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public void requestControllerActivityEnergyInfo(@NonNull java.util.concurrent.Executor, @NonNull android.bluetooth.BluetoothAdapter.OnBluetoothActivityEnergyInfoCallback);
    method @NonNull @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public android.bluetooth.BluetoothSocket retrieveConnectedRfcommSocket(@NonNull java.util.UUID);
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED, android.Manifest.permission.MODIFY_PHONE_STATE}) public boolean setActiveDevice(@NonNull android.bluetooth.BluetoothDevice, int);
    method @FlaggedApi("com.android.bluetooth.flags.auto_on_feature") @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public void setAutoOnEnabled(boolean);
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public void setAutoOnEnabled(boolean);
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public int setBluetoothHciSnoopLoggingMode(int);
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_SCAN, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int setDiscoverableTimeout(@NonNull java.time.Duration);
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int setPreferredAudioProfiles(@NonNull android.bluetooth.BluetoothDevice, @NonNull android.os.Bundle);
@@ -100,7 +100,7 @@ package android.bluetooth {
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public boolean unregisterBluetoothConnectionCallback(@NonNull android.bluetooth.BluetoothAdapter.BluetoothConnectionCallback);
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int unregisterBluetoothQualityReportReadyCallback(@NonNull android.bluetooth.BluetoothAdapter.BluetoothQualityReportReadyCallback);
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int unregisterPreferredAudioProfilesChangedCallback(@NonNull android.bluetooth.BluetoothAdapter.PreferredAudioProfilesChangedCallback);
    field @FlaggedApi("com.android.bluetooth.flags.auto_on_feature") @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public static final String ACTION_AUTO_ON_STATE_CHANGED = "android.bluetooth.action.AUTO_ON_STATE_CHANGED";
    field @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public static final String ACTION_AUTO_ON_STATE_CHANGED = "android.bluetooth.action.AUTO_ON_STATE_CHANGED";
    field public static final String ACTION_BLE_STATE_CHANGED = "android.bluetooth.adapter.action.BLE_STATE_CHANGED";
    field public static final String ACTION_REQUEST_BLE_SCAN_ALWAYS_AVAILABLE = "android.bluetooth.adapter.action.REQUEST_BLE_SCAN_ALWAYS_AVAILABLE";
    field @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public static final String ACTION_REQUEST_DISABLE = "android.bluetooth.adapter.action.REQUEST_DISABLE";
@@ -109,12 +109,12 @@ package android.bluetooth {
    field public static final int ACTIVE_DEVICE_PHONE_CALL = 1; // 0x1
    field public static final String AUDIO_MODE_DUPLEX = "audio_mode_duplex";
    field public static final String AUDIO_MODE_OUTPUT_ONLY = "audio_mode_output_only";
    field @FlaggedApi("com.android.bluetooth.flags.auto_on_feature") public static final int AUTO_ON_STATE_DISABLED = 1; // 0x1
    field @FlaggedApi("com.android.bluetooth.flags.auto_on_feature") public static final int AUTO_ON_STATE_ENABLED = 2; // 0x2
    field public static final int AUTO_ON_STATE_DISABLED = 1; // 0x1
    field public static final int AUTO_ON_STATE_ENABLED = 2; // 0x2
    field public static final int BT_SNOOP_LOG_MODE_DISABLED = 0; // 0x0
    field public static final int BT_SNOOP_LOG_MODE_FILTERED = 1; // 0x1
    field public static final int BT_SNOOP_LOG_MODE_FULL = 2; // 0x2
    field @FlaggedApi("com.android.bluetooth.flags.auto_on_feature") public static final String EXTRA_AUTO_ON_STATE = "android.bluetooth.extra.AUTO_ON_STATE";
    field public static final String EXTRA_AUTO_ON_STATE = "android.bluetooth.extra.AUTO_ON_STATE";
    field public static final String EXTRA_RFCOMM_LISTENER_ID = "android.bluetooth.adapter.extra.RFCOMM_LISTENER_ID";
    field public static final int STATE_BLE_ON = 15; // 0xf
  }
+0 −8
Original line number Diff line number Diff line
@@ -29,7 +29,6 @@ import static java.util.Objects.requireNonNull;

import android.annotation.BroadcastBehavior;
import android.annotation.CallbackExecutor;
import android.annotation.FlaggedApi;
import android.annotation.IntDef;
import android.annotation.NonNull;
import android.annotation.Nullable;
@@ -753,7 +752,6 @@ public final class BluetoothAdapter {
     * @hide
     */
    @SystemApi
    @FlaggedApi(Flags.FLAG_AUTO_ON_FEATURE)
    @RequiresPermission(BLUETOOTH_PRIVILEGED)
    @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
    @BroadcastBehavior(registeredOnly = true, protectedBroadcast = true)
@@ -768,7 +766,6 @@ public final class BluetoothAdapter {
     * @hide
     */
    @SystemApi
    @FlaggedApi(Flags.FLAG_AUTO_ON_FEATURE)
    public static final String EXTRA_AUTO_ON_STATE = "android.bluetooth.extra.AUTO_ON_STATE";

    /**
@@ -777,7 +774,6 @@ public final class BluetoothAdapter {
     * @hide
     */
    @SystemApi
    @FlaggedApi(Flags.FLAG_AUTO_ON_FEATURE)
    public static final int AUTO_ON_STATE_DISABLED = 1;

    /**
@@ -786,7 +782,6 @@ public final class BluetoothAdapter {
     * @hide
     */
    @SystemApi
    @FlaggedApi(Flags.FLAG_AUTO_ON_FEATURE)
    public static final int AUTO_ON_STATE_ENABLED = 2;

    /**
@@ -5436,7 +5431,6 @@ public final class BluetoothAdapter {
     * @hide
     */
    @SystemApi
    @FlaggedApi(Flags.FLAG_AUTO_ON_FEATURE)
    @RequiresPermission(BLUETOOTH_PRIVILEGED)
    public boolean isAutoOnSupported() {
        try {
@@ -5454,7 +5448,6 @@ public final class BluetoothAdapter {
     * @hide
     */
    @SystemApi
    @FlaggedApi(Flags.FLAG_AUTO_ON_FEATURE)
    @RequiresPermission(BLUETOOTH_PRIVILEGED)
    public boolean isAutoOnEnabled() {
        try {
@@ -5473,7 +5466,6 @@ public final class BluetoothAdapter {
     * @hide
     */
    @SystemApi
    @FlaggedApi(Flags.FLAG_AUTO_ON_FEATURE)
    @RequiresPermission(BLUETOOTH_PRIVILEGED)
    public void setAutoOnEnabled(boolean status) {
        try {
+5 −10
Original line number Diff line number Diff line
@@ -608,18 +608,13 @@ class BluetoothManagerService {
            mEnableExternal = true;
        }

        { // AutoOn feature initialization of flag guarding
            final boolean autoOnFlag = Flags.autoOnFeature();
            final boolean autoOnProperty =
        mDeviceConfigAllowAutoOn =
                SystemProperties.getBoolean("bluetooth.server.automatic_turn_on", false);
            Log.d(TAG, "AutoOnFeature status: flag=" + autoOnFlag + ", property=" + autoOnProperty);

            mDeviceConfigAllowAutoOn = autoOnFlag && autoOnProperty;
        Log.d(TAG, "AutoOnFeature property=" + mDeviceConfigAllowAutoOn);
        if (mDeviceConfigAllowAutoOn) {
            Counter.logIncrement("bluetooth.value_auto_on_supported");
        }
    }
    }

    private Unit onBleScanDisabled() {
        if (mState.oneOf(STATE_OFF, STATE_BLE_TURNING_OFF)) {