mirror of
https://github.com/kavishdevar/librepods.git
synced 2026-04-20 13:11:13 +00:00
save name name whn not renamed
This commit is contained in:
@@ -327,6 +327,10 @@ class AirPodsService: Service() {
|
|||||||
device = intent.getParcelableExtra("device", BluetoothDevice::class.java)!!
|
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)
|
||||||
|
if (this@AirPodsService.getSharedPreferences("settings", MODE_PRIVATE).getString("name", null) == null) {
|
||||||
|
this@AirPodsService.getSharedPreferences("settings", MODE_PRIVATE).edit()
|
||||||
|
.putString("name", name).apply()
|
||||||
|
}
|
||||||
Log.d("AirPodsService", "$name connected")
|
Log.d("AirPodsService", "$name connected")
|
||||||
showPopup(this@AirPodsService, name.toString())
|
showPopup(this@AirPodsService, name.toString())
|
||||||
connectToSocket(device!!)
|
connectToSocket(device!!)
|
||||||
|
|||||||
Reference in New Issue
Block a user