REVERTME: ModemConfig: Use platform APIs for SystemProperties
Unfortunately sysprop - which is the SDK-compliant repacement for SystemProperties - does not work properly in Android Q. Specificially a java library is not generated and passed to the java compiler when building ModemConfig. This works flawlessly in Android R. Use SystemProperties from the private API as a stop-gap solution, until we either pick a build-system fix or move to R. Signed-off-by: Marijn Suijten <marijns95@gmail.com>
This commit is contained in:
parent
05d50c9738
commit
822920ff5b
2 changed files with 8 additions and 1 deletions
|
|
@ -7,5 +7,5 @@ android_app {
|
|||
|
||||
srcs: ["src/**/*.kt"],
|
||||
|
||||
sdk_version: "system_current",
|
||||
platform_apis: true,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ import android.app.Service
|
|||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.os.IBinder
|
||||
import android.os.SystemProperties
|
||||
import android.telephony.SubscriptionInfo
|
||||
import android.telephony.SubscriptionManager
|
||||
import android.telephony.TelephonyManager
|
||||
|
|
@ -161,6 +162,12 @@ context.resources.getXml(R.xml.service_provider_sim_configs).use {
|
|||
val globalTm = getSystemService(TelephonyManager::class.java)
|
||||
val tm = globalTm!!.createForSubscriptionId(sub.subscriptionId)
|
||||
val name = findConfigurationName(this, tm)
|
||||
|
||||
if (name != null) {
|
||||
val prop = "persist.vendor.somc.cust.modem${sub.simSlotIndex}"
|
||||
if (VERBOSE) Log.v(TAG, "Setting $prop to $name")
|
||||
SystemProperties.set(prop, name)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onCreate() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue