use of com.android.mms.service_alt.MmsConfig in project Signal-Android by WhisperSystems.
the class MmsConfigManager method loadMmsConfig.
@NonNull
private static MmsConfig loadMmsConfig(Context context, int subscriptionId) {
Optional<SubscriptionInfoCompat> subscriptionInfo = new SubscriptionManagerCompat(context).getActiveSubscriptionInfo(subscriptionId);
if (subscriptionInfo.isPresent()) {
SubscriptionInfoCompat subscriptionInfoCompat = subscriptionInfo.get();
Configuration configuration = context.getResources().getConfiguration();
configuration.mcc = subscriptionInfoCompat.getMcc();
configuration.mnc = subscriptionInfoCompat.getMnc();
Context subContext = context.createConfigurationContext(configuration);
return new MmsConfig(subContext, subscriptionId);
}
return new MmsConfig(context, subscriptionId);
}
use of com.android.mms.service_alt.MmsConfig in project Signal-Android by WhisperSystems.
the class MmsConfigManager method getMmsConfig.
@WorkerThread
@NonNull
static synchronized MmsConfig getMmsConfig(Context context, int subscriptionId) {
MmsConfig mmsConfig = mmsConfigMap.get(subscriptionId);
if (mmsConfig != null) {
return mmsConfig;
}
MmsConfig loadedConfig = loadMmsConfig(context, subscriptionId);
mmsConfigMap.put(subscriptionId, loadedConfig);
return loadedConfig;
}
use of com.android.mms.service_alt.MmsConfig in project Signal-Android by signalapp.
the class MmsConfigManager method getMmsConfig.
@WorkerThread
@NonNull
static synchronized MmsConfig getMmsConfig(Context context, int subscriptionId) {
MmsConfig mmsConfig = mmsConfigMap.get(subscriptionId);
if (mmsConfig != null) {
return mmsConfig;
}
MmsConfig loadedConfig = loadMmsConfig(context, subscriptionId);
mmsConfigMap.put(subscriptionId, loadedConfig);
return loadedConfig;
}
Aggregations