|
|
@ -40,6 +40,7 @@ import org.mozilla.fenix.ext.components
|
|
|
|
import org.mozilla.fenix.ext.settings
|
|
|
|
import org.mozilla.fenix.ext.settings
|
|
|
|
import org.mozilla.fenix.isInExperiment
|
|
|
|
import org.mozilla.fenix.isInExperiment
|
|
|
|
import org.mozilla.fenix.test.Mockable
|
|
|
|
import org.mozilla.fenix.test.Mockable
|
|
|
|
|
|
|
|
import java.util.FormatFlagsConversionMismatchException
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Component group for background services. These are the components that need to be accessed from within a
|
|
|
|
* Component group for background services. These are the components that need to be accessed from within a
|
|
|
@ -61,12 +62,22 @@ class BackgroundServices(
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
fun defaultDeviceName(context: Context): String = context.getString(
|
|
|
|
// // A malformed string is causing crashes.
|
|
|
|
R.string.default_device_name,
|
|
|
|
// This will be removed when the string is fixed. See #5552
|
|
|
|
context.getString(R.string.app_name),
|
|
|
|
fun defaultDeviceName(context: Context): String = try {
|
|
|
|
Build.MANUFACTURER,
|
|
|
|
context.getString(
|
|
|
|
Build.MODEL
|
|
|
|
R.string.default_device_name,
|
|
|
|
)
|
|
|
|
context.getString(R.string.app_name),
|
|
|
|
|
|
|
|
Build.MANUFACTURER,
|
|
|
|
|
|
|
|
Build.MODEL
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
} catch (ex: FormatFlagsConversionMismatchException) {
|
|
|
|
|
|
|
|
"%s on %s %s".format(
|
|
|
|
|
|
|
|
context.getString(R.string.app_name),
|
|
|
|
|
|
|
|
Build.MANUFACTURER,
|
|
|
|
|
|
|
|
Build.MODEL
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private val serverConfig = ServerConfig.release(CLIENT_ID, redirectUrl(context))
|
|
|
|
private val serverConfig = ServerConfig.release(CLIENT_ID, redirectUrl(context))
|
|
|
|
private val deviceConfig = DeviceConfig(
|
|
|
|
private val deviceConfig = DeviceConfig(
|
|
|
|