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

Commit a76a9d4c authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "resolve merge conflicts of f761f637 to master"

parents 98b6993a 54f44133
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -3252,4 +3252,6 @@

    <!-- Package name that should be granted Notification Assistant access -->
    <string name="config_defaultAssistantAccessPackage" translatable="false">android.ext.services</string>

    <bool name="config_supportBluetoothPersistedState">true</bool>
</resources>
+2 −0
Original line number Diff line number Diff line
@@ -3219,4 +3219,6 @@
  <java-symbol type="string" name="harmful_app_warning_title" />

  <java-symbol type="string" name="config_defaultAssistantAccessPackage" />

  <java-symbol type="bool" name="config_supportBluetoothPersistedState" />
</resources>
+10 −0
Original line number Diff line number Diff line
@@ -439,10 +439,17 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
                Settings.Global.AIRPLANE_MODE_ON, 0) == 1;
    }

    private boolean supportBluetoothPersistedState() {
        return mContext.getResources().getBoolean(R.bool.config_supportBluetoothPersistedState);
    }

    /**
     *  Returns true if the Bluetooth saved state is "on"
     */
    private boolean isBluetoothPersistedStateOn() {
        if (!supportBluetoothPersistedState()) {
            return false;
        }
        int state = Settings.Global.getInt(mContentResolver, Settings.Global.BLUETOOTH_ON, -1);
        if (DBG) {
            Slog.d(TAG, "Bluetooth persisted state: " + state);
@@ -454,6 +461,9 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
     *  Returns true if the Bluetooth saved state is BLUETOOTH_ON_BLUETOOTH
     */
    private boolean isBluetoothPersistedStateOnBluetooth() {
        if (!supportBluetoothPersistedState()) {
            return false;
        }
        return Settings.Global.getInt(mContentResolver, Settings.Global.BLUETOOTH_ON,
                BLUETOOTH_ON_BLUETOOTH) == BLUETOOTH_ON_BLUETOOTH;
    }