When new device connected, create shared_prefs per device.
From src/com/android/bluetooth/bthelper/slices/SliceBroadcastReceiver.java
mSharedPrefs = getSharedPreferences(Constants.PREFERENCES_BTHELPER, Context.MODE_PRIVATE);
SharedPreferences.Editor editor = getSharedPreferences(context).edit();
editor.putBoolean(key, enabled).apply();
So we might can be possible to create separate shared_prefs xml for per device,
load that xml only for that device.
And if device removed, setting xml also should be destroyed.
This gaves us some headaches.
Android only supports one instance per service.
If multiple onCreate called, it just overrides previous stuffs.
Might be possible to solve with shared_prefs?
Something like per device profiles.
- Written by: someone5678
- Date: 2023-07-04