Skip to content

Commit 5995c17

Browse files
committed
save name name whn not renamed
1 parent fad2681 commit 5995c17

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,10 @@ class AirPodsService: Service() {
327327
device = intent.getParcelableExtra("device", BluetoothDevice::class.java)!!
328328
val name = this@AirPodsService.getSharedPreferences("settings", MODE_PRIVATE)
329329
.getString("name", device?.name)
330+
if (this@AirPodsService.getSharedPreferences("settings", MODE_PRIVATE).getString("name", null) == null) {
331+
this@AirPodsService.getSharedPreferences("settings", MODE_PRIVATE).edit()
332+
.putString("name", name).apply()
333+
}
330334
Log.d("AirPodsService", "$name connected")
331335
showPopup(this@AirPodsService, name.toString())
332336
connectToSocket(device!!)

0 commit comments

Comments
 (0)