Snap for 12428696 from 4e05cd99a9 to 25Q1-release

Change-Id: Iabf4c6d23ea3c6e66459a91c2649951333c02d70
This commit is contained in:
Android Build Coastguard Worker
2024-09-28 21:22:12 +00:00
7 changed files with 64 additions and 16 deletions

View File

@@ -266,7 +266,7 @@
<string name="ethernet_tethering_subtext" product="default" msgid="8652438909365718644">"Partilhar a ligação à Internet do telemóvel através de Ethernet"</string> <string name="ethernet_tethering_subtext" product="default" msgid="8652438909365718644">"Partilhar a ligação à Internet do telemóvel através de Ethernet"</string>
<string name="ethernet_tethering_subtext" product="tablet" msgid="2227710549796706455">"Partilhar a ligação à Internet do tablet por Ethernet"</string> <string name="ethernet_tethering_subtext" product="tablet" msgid="2227710549796706455">"Partilhar a ligação à Internet do tablet por Ethernet"</string>
<string name="about_settings" product="tablet" msgid="1471390492111370330">"Acerca do tablet"</string> <string name="about_settings" product="tablet" msgid="1471390492111370330">"Acerca do tablet"</string>
<string name="about_settings" product="default" msgid="2621311564780208250">"Acerca do telefone"</string> <string name="about_settings" product="default" msgid="2621311564780208250">"Acerca do telemóvel"</string>
<string name="about_settings" product="device" msgid="7595574154492383452">"Acerca do dispositivo"</string> <string name="about_settings" product="device" msgid="7595574154492383452">"Acerca do dispositivo"</string>
<string name="about_settings" product="emulator" msgid="1099246296173401003">"Acerca do dispositivo emulado"</string> <string name="about_settings" product="emulator" msgid="1099246296173401003">"Acerca do dispositivo emulado"</string>
<string name="install_all_warning" product="tablet" msgid="1732116924846572063">"O seu tablet e os dados pessoais são mais vulneráveis a ataques de apps desconhecidas. Ao instalar apps desta fonte, aceita ser responsável por quaisquer danos no tablet ou perdas de dados que possam resultar da utilização do mesmo."</string> <string name="install_all_warning" product="tablet" msgid="1732116924846572063">"O seu tablet e os dados pessoais são mais vulneráveis a ataques de apps desconhecidas. Ao instalar apps desta fonte, aceita ser responsável por quaisquer danos no tablet ou perdas de dados que possam resultar da utilização do mesmo."</string>

View File

@@ -297,8 +297,8 @@
<string name="battery_tip_dialog_summary_message" product="device" msgid="7885502661524685786">"您的应用目前耗电量正常。如果应用耗电量过高,您的设备会为您提供操作建议。\n\n如果电池电量不足您可以随时开启省电模式。"</string> <string name="battery_tip_dialog_summary_message" product="device" msgid="7885502661524685786">"您的应用目前耗电量正常。如果应用耗电量过高,您的设备会为您提供操作建议。\n\n如果电池电量不足您可以随时开启省电模式。"</string>
<string name="smart_battery_summary" product="default" msgid="1210637215867635435">"限制不常用的应用的耗电量"</string> <string name="smart_battery_summary" product="default" msgid="1210637215867635435">"限制不常用的应用的耗电量"</string>
<string name="battery_usage_screen_footer" product="default" msgid="8872101342490341865">"手机充电时,系统不会衡量电池使用情况和屏幕使用时间"</string> <string name="battery_usage_screen_footer" product="default" msgid="8872101342490341865">"手机充电时,系统不会衡量电池使用情况和屏幕使用时间"</string>
<string name="battery_usage_screen_footer" product="tablet" msgid="1876984641036532124">"平板电脑充电时,系统不会衡量电池用量和设备使用时间"</string> <string name="battery_usage_screen_footer" product="tablet" msgid="1876984641036532124">"平板电脑充电时,系统不会衡量电池用量和屏幕使用时间"</string>
<string name="battery_usage_screen_footer" product="device" msgid="6488857833906266507">"设备充电时,系统不会衡量电池用量和设备使用时间"</string> <string name="battery_usage_screen_footer" product="device" msgid="6488857833906266507">"设备充电时,系统不会衡量电池用量和屏幕使用时间"</string>
<string name="credentials_install_summary" product="nosdcard" msgid="8585932964626513863">"从存储设备安装证书"</string> <string name="credentials_install_summary" product="nosdcard" msgid="8585932964626513863">"从存储设备安装证书"</string>
<string name="credentials_install_summary" product="default" msgid="879796378361350092">"从SD卡安装证书"</string> <string name="credentials_install_summary" product="default" msgid="879796378361350092">"从SD卡安装证书"</string>
<string name="really_remove_account_message" product="tablet" msgid="5134483498496943623">"移除该账号会从平板电脑中删除所有相关的邮件、联系人以及其他数据。"</string> <string name="really_remove_account_message" product="tablet" msgid="5134483498496943623">"移除该账号会从平板电脑中删除所有相关的邮件、联系人以及其他数据。"</string>

View File

@@ -198,6 +198,10 @@ public class ApnEditor extends SettingsPreferenceFragment
public static final String APN_TYPE_MCX = "mcx"; public static final String APN_TYPE_MCX = "mcx";
/** APN type for XCAP */ /** APN type for XCAP */
public static final String APN_TYPE_XCAP = "xcap"; public static final String APN_TYPE_XCAP = "xcap";
/** APN type for OEM_PAID networks (Automotive PANS) */
public static final String APN_TYPE_OEM_PAID = "oem_paid";
/** APN type for OEM_PRIVATE networks (Automotive PANS) */
public static final String APN_TYPE_OEM_PRIVATE = "oem_private";
/** Array of all APN types */ /** Array of all APN types */
public static final String[] APN_TYPES = {APN_TYPE_DEFAULT, public static final String[] APN_TYPES = {APN_TYPE_DEFAULT,
APN_TYPE_MMS, APN_TYPE_MMS,
@@ -211,6 +215,14 @@ public class ApnEditor extends SettingsPreferenceFragment
APN_TYPE_EMERGENCY, APN_TYPE_EMERGENCY,
APN_TYPE_MCX, APN_TYPE_MCX,
APN_TYPE_XCAP, APN_TYPE_XCAP,
APN_TYPE_OEM_PAID,
APN_TYPE_OEM_PRIVATE,
};
/** Array of APN types that are never user-editable */
private static final String[] ALWAYS_READ_ONLY_APN_TYPES = new String[] {
APN_TYPE_OEM_PAID,
APN_TYPE_OEM_PRIVATE,
}; };
/** /**
@@ -360,6 +372,18 @@ public class ApnEditor extends SettingsPreferenceFragment
} }
} }
/**
* Fetch complete list of read only APN types.
*
* The list primarily comes from carrier config, but is also supplied by APN types which are
* always read only.
*/
static String[] getReadOnlyApnTypes(PersistableBundle b) {
String[] carrierReadOnlyApnTypes = b.getStringArray(
CarrierConfigManager.KEY_READ_ONLY_APN_TYPES_STRING_ARRAY);
return ArrayUtils.concat(String.class, carrierReadOnlyApnTypes, ALWAYS_READ_ONLY_APN_TYPES);
}
/** /**
* Enable ProxySubscriptionMgr with Lifecycle support for all controllers * Enable ProxySubscriptionMgr with Lifecycle support for all controllers
* live within this fragment * live within this fragment
@@ -1355,8 +1379,7 @@ public class ApnEditor extends SettingsPreferenceFragment
if (configManager != null) { if (configManager != null) {
final PersistableBundle b = configManager.getConfigForSubId(mSubId); final PersistableBundle b = configManager.getConfigForSubId(mSubId);
if (b != null) { if (b != null) {
mReadOnlyApnTypes = b.getStringArray( mReadOnlyApnTypes = getReadOnlyApnTypes(b);
CarrierConfigManager.KEY_READ_ONLY_APN_TYPES_STRING_ARRAY);
if (!ArrayUtils.isEmpty(mReadOnlyApnTypes)) { if (!ArrayUtils.isEmpty(mReadOnlyApnTypes)) {
Log.d(TAG, Log.d(TAG,
"onCreate: read only APN type: " + Arrays.toString(mReadOnlyApnTypes)); "onCreate: read only APN type: " + Arrays.toString(mReadOnlyApnTypes));

View File

@@ -135,8 +135,7 @@ public class ApnSettings extends RestrictedSettingsFragment
mHideImsApn = b.getBoolean(CarrierConfigManager.KEY_HIDE_IMS_APN_BOOL); mHideImsApn = b.getBoolean(CarrierConfigManager.KEY_HIDE_IMS_APN_BOOL);
mAllowAddingApns = b.getBoolean(CarrierConfigManager.KEY_ALLOW_ADDING_APNS_BOOL); mAllowAddingApns = b.getBoolean(CarrierConfigManager.KEY_ALLOW_ADDING_APNS_BOOL);
if (mAllowAddingApns) { if (mAllowAddingApns) {
final String[] readOnlyApnTypes = b.getStringArray( final String[] readOnlyApnTypes = ApnEditor.getReadOnlyApnTypes(b);
CarrierConfigManager.KEY_READ_ONLY_APN_TYPES_STRING_ARRAY);
// if no apn type can be edited, do not allow adding APNs // if no apn type can be edited, do not allow adding APNs
if (ApnEditor.hasAllApns(readOnlyApnTypes)) { if (ApnEditor.hasAllApns(readOnlyApnTypes)) {
Log.d(TAG, "not allowing adding APN because all APN types are read only"); Log.d(TAG, "not allowing adding APN because all APN types are read only");

View File

@@ -204,9 +204,7 @@ fun getCarrierCustomizedConfig(
CarrierConfigManager.KEY_ALLOW_ADDING_APNS_BOOL CarrierConfigManager.KEY_ALLOW_ADDING_APNS_BOOL
) )
val customizedConfig = CustomizedConfig( val customizedConfig = CustomizedConfig(
readOnlyApnTypes = b.getStringArray( readOnlyApnTypes = ApnEditor.getReadOnlyApnTypes(b)?.toList() ?: emptyList(),
CarrierConfigManager.KEY_READ_ONLY_APN_TYPES_STRING_ARRAY
)?.toList() ?: emptyList(),
readOnlyApnFields = b.getStringArray( readOnlyApnFields = b.getStringArray(
CarrierConfigManager.KEY_READ_ONLY_APN_FIELDS_STRING_ARRAY CarrierConfigManager.KEY_READ_ONLY_APN_FIELDS_STRING_ARRAY
)?.toList() ?: emptyList(), )?.toList() ?: emptyList(),

View File

@@ -45,6 +45,8 @@ object ApnTypes {
ApnSetting.TYPE_VSIM_STRING, ApnSetting.TYPE_VSIM_STRING,
ApnSetting.TYPE_BIP_STRING, ApnSetting.TYPE_BIP_STRING,
ApnSetting.TYPE_ENTERPRISE_STRING, ApnSetting.TYPE_ENTERPRISE_STRING,
ApnSetting.TYPE_OEM_PAID_STRING,
ApnSetting.TYPE_OEM_PRIVATE_STRING,
) )
private fun splitToList(apnType: String): List<String> { private fun splitToList(apnType: String): List<String> {

View File

@@ -21,10 +21,12 @@ import static android.telephony.SubscriptionManager.PROFILE_CLASS_PROVISIONING;
import android.app.Activity; import android.app.Activity;
import android.app.Dialog; import android.app.Dialog;
import android.app.settings.SettingsEnums; import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.os.Bundle; import android.os.Bundle;
import android.telephony.SubscriptionInfo; import android.telephony.SubscriptionInfo;
import android.telephony.SubscriptionManager; import android.telephony.SubscriptionManager;
import android.telephony.TelephonyManager;
import android.util.Log; import android.util.Log;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
@@ -91,8 +93,12 @@ public class PreferredSimDialogFragment extends SimDialogFragment implements
} }
if (dialog == null) { if (dialog == null) {
Log.d(TAG, "Dialog is null."); dismiss("Dialog is null.");
dismiss(); return;
}
Context context = getContext();
if (context == null) {
dismiss("getContext is null.");
return; return;
} }
@@ -100,24 +106,44 @@ public class PreferredSimDialogFragment extends SimDialogFragment implements
if (info == null || (info.isEmbedded() if (info == null || (info.isEmbedded()
&& (info.getProfileClass() == PROFILE_CLASS_PROVISIONING && (info.getProfileClass() == PROFILE_CLASS_PROVISIONING
|| (Flags.oemEnabledSatelliteFlag() && info.isOnlyNonTerrestrialNetwork())))) { || (Flags.oemEnabledSatelliteFlag() && info.isOnlyNonTerrestrialNetwork())))) {
dismiss(); dismiss("SubscriptionInfo is null or other esim's cases.");
return; return;
} }
Log.d(TAG, "SubscriptionInfo: " + info); Log.d(TAG, "SubscriptionInfo: " + info);
TelephonyManager telephonyManager = context.getSystemService(TelephonyManager.class);
if (telephonyManager == null) {
dismiss("TelephonyManager is null.");
return;
}
telephonyManager = telephonyManager.createForSubscriptionId(info.getSubscriptionId());
if (telephonyManager.isDataEnabledForReason(TelephonyManager.DATA_ENABLED_REASON_USER)) {
dismiss("mobile data is on.");
final SimDialogActivity activity = (SimDialogActivity) getActivity();
if (activity != null) {
activity.finish();
}
return;
}
final CharSequence simName = final CharSequence simName =
SubscriptionUtil.getUniqueSubscriptionDisplayName(info, getContext()); SubscriptionUtil.getUniqueSubscriptionDisplayName(info, context);
final String title = final String title =
getContext().getString( context.getString(
getTitleResId(), getTitleResId(),
simName); simName);
final String message = final String message =
getContext().getString( context.getString(
R.string.sim_preferred_message, R.string.sim_preferred_message,
simName); simName);
dialog.setTitle(title); dialog.setTitle(title);
dialog.setMessage(message); dialog.setMessage(message);
} }
private void dismiss(String log) {
Log.d(TAG, log);
dismiss();
}
@Override @Override
public void updateDialog() { public void updateDialog() {
updateDialog((AlertDialog) getDialog()); updateDialog((AlertDialog) getDialog());