|
|
@ -31,8 +31,10 @@ class BleCompanionService : CompanionDeviceService() { |
|
|
val serviceIntent = Intent().apply { |
|
|
val serviceIntent = Intent().apply { |
|
|
// 尝试使用BleMediaService,如果不存在则回退到BleService |
|
|
// 尝试使用BleMediaService,如果不存在则回退到BleService |
|
|
val serviceClassName = try { |
|
|
val serviceClassName = try { |
|
|
|
|
|
Log.d(TAG, "BleMediaService存在") |
|
|
Class.forName("com.yunqiinnovation.agent_service.BleMediaService").name |
|
|
Class.forName("com.yunqiinnovation.agent_service.BleMediaService").name |
|
|
} catch (e: ClassNotFoundException) { |
|
|
} catch (e: ClassNotFoundException) { |
|
|
|
|
|
Log.d(TAG, "BleMediaService不存在,回退到BleService") |
|
|
BleService::class.java.name |
|
|
BleService::class.java.name |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|