mirror of
https://github.com/kavishdevar/librepods.git
synced 2026-04-21 21:52:33 +00:00
i'm stupid. fix device name being null when not renamed
This commit is contained in:
@@ -324,10 +324,10 @@ class AirPodsService: Service() {
|
|||||||
connectionReceiver = object: BroadcastReceiver() {
|
connectionReceiver = object: BroadcastReceiver() {
|
||||||
override fun onReceive(context: Context?, intent: Intent?) {
|
override fun onReceive(context: Context?, intent: Intent?) {
|
||||||
if (intent?.action == AirPodsNotifications.Companion.AIRPODS_CONNECTION_DETECTED) {
|
if (intent?.action == AirPodsNotifications.Companion.AIRPODS_CONNECTION_DETECTED) {
|
||||||
|
device = intent.getParcelableExtra("device", BluetoothDevice::class.java)!!
|
||||||
val name = this@AirPodsService.getSharedPreferences("settings", MODE_PRIVATE)
|
val name = this@AirPodsService.getSharedPreferences("settings", MODE_PRIVATE)
|
||||||
.getString("name", device?.name)
|
.getString("name", device?.name)
|
||||||
Log.d("AirPodsService", "$name connected")
|
Log.d("AirPodsService", "$name connected")
|
||||||
device = intent.getParcelableExtra("device", BluetoothDevice::class.java)!!
|
|
||||||
showPopup(this@AirPodsService, name.toString())
|
showPopup(this@AirPodsService, name.toString())
|
||||||
connectToSocket(device!!)
|
connectToSocket(device!!)
|
||||||
updateNotificationContent(true, name.toString(), batteryNotification.getBattery())
|
updateNotificationContent(true, name.toString(), batteryNotification.getBattery())
|
||||||
|
|||||||
Reference in New Issue
Block a user