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

Commit 5c0bfaca authored by howardchung's avatar howardchung
Browse files

Floss: Adapter profile initialization should respect Admin

Upon adapter starts, it initializes all supported profiles, which could
overwrite the admin settings if BluetoothAdmin was created earlier.

This makes the profile initialization on adapter starts only initialize
allowed ones.

Bug: 259880968
Test: set allowlist to a random uuid and verify no bt device can be used
after reboot.

Change-Id: I2948055b92309ae18963165f308842b0afdd19df
parent 3e6a83ce
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -30,7 +30,7 @@ use tokio::task::JoinHandle;
use tokio::time;

use crate::battery_service::BatteryServiceActions;
use crate::bluetooth_admin::BluetoothAdmin;
use crate::bluetooth_admin::{BluetoothAdmin, IBluetoothAdmin};
use crate::bluetooth_media::{BluetoothMedia, IBluetoothMedia, MediaActions};
use crate::callbacks::Callbacks;
use crate::uuid::{Profile, UuidHelper, HOGP};
@@ -509,7 +509,8 @@ impl Bluetooth {
            }),
        });

        self.toggle_enabled_profiles(&vec![]);
        let allowed_profiles = self.bluetooth_admin.lock().unwrap().get_allowed_services();
        self.toggle_enabled_profiles(&allowed_profiles);
        // Mark profiles as ready
        self.profiles_ready = true;
    }