Skip to content

Commit fad2681

Browse files
committed
i'm stupid. fix device name being null when not renamed
1 parent ed72692 commit fad2681

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

android/app/src/main/java/me/kavishdevar/aln/services/AirPodsService.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,10 +324,10 @@ class AirPodsService: Service() {
324324
connectionReceiver = object: BroadcastReceiver() {
325325
override fun onReceive(context: Context?, intent: Intent?) {
326326
if (intent?.action == AirPodsNotifications.Companion.AIRPODS_CONNECTION_DETECTED) {
327+
device = intent.getParcelableExtra("device", BluetoothDevice::class.java)!!
327328
val name = this@AirPodsService.getSharedPreferences("settings", MODE_PRIVATE)
328329
.getString("name", device?.name)
329330
Log.d("AirPodsService", "$name connected")
330-
device = intent.getParcelableExtra("device", BluetoothDevice::class.java)!!
331331
showPopup(this@AirPodsService, name.toString())
332332
connectToSocket(device!!)
333333
updateNotificationContent(true, name.toString(), batteryNotification.getBattery())

0 commit comments

Comments
 (0)