diff options
Diffstat (limited to 'src/com/android/bluetooth/btservice/AdapterService.java')
-rw-r--r-- | src/com/android/bluetooth/btservice/AdapterService.java | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/com/android/bluetooth/btservice/AdapterService.java b/src/com/android/bluetooth/btservice/AdapterService.java index 8eb6d8e23..fba0c8933 100644 --- a/src/com/android/bluetooth/btservice/AdapterService.java +++ b/src/com/android/bluetooth/btservice/AdapterService.java @@ -208,6 +208,8 @@ public class AdapterService extends Service { private PowerManager.WakeLock mWakeLock; private String mWakeLockName; + private ProfileObserver mProfileObserver; + public AdapterService() { super(); if (TRACE_REF) { @@ -440,8 +442,8 @@ public class AdapterService extends Service { registerReceiver(mAlarmBroadcastReceiver, new IntentFilter(ACTION_ALARM_WAKEUP)); setAdapterService(this); - - + mProfileObserver = new ProfileObserver(getApplicationContext(), this, new Handler()); + mProfileObserver.start(); } @Override @@ -460,10 +462,17 @@ public class AdapterService extends Service { public void onDestroy() { debugLog("onDestroy()"); + mProfileObserver.stop(); } void BleOnProcessStart() { debugLog("BleOnProcessStart()"); + + if (getApplicationContext().getResources().getBoolean( + R.bool.config_bluetooth_reload_supported_profiles_when_enabled)) { + Config.init(getApplicationContext()); + } + Class[] supportedProfileServices = Config.getSupportedProfiles(); //Initialize data objects for (int i=0; i < supportedProfileServices.length;i++) { |