Merge changes from topics "rename_display_name_source", "sdbm" am: 6e20c774a2
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2458533 Change-Id: I49b7daf8b3f0fe0cdc7d908362d9cd0c2b33c99f Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -27,7 +27,6 @@ import android.os.Binder;
|
|||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.PersistableBundle;
|
import android.os.PersistableBundle;
|
||||||
import android.os.SystemProperties;
|
import android.os.SystemProperties;
|
||||||
import android.telephony.SubscriptionManager;
|
|
||||||
import android.telephony.TelephonyManager;
|
import android.telephony.TelephonyManager;
|
||||||
|
|
||||||
import java.io.PrintWriter;
|
import java.io.PrintWriter;
|
||||||
@@ -195,57 +194,20 @@ public final class TelephonyUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convert display name source to string.
|
* Convert mobile data policy to string.
|
||||||
*
|
*
|
||||||
* @param source The display name source.
|
* @param mobileDataPolicy The mobile data policy.
|
||||||
* @return The display name source in string format.
|
* @return The mobile data policy in string format.
|
||||||
*/
|
*/
|
||||||
@NonNull
|
public static @NonNull String mobileDataPolicyToString(
|
||||||
public static String displayNameSourceToString(
|
@TelephonyManager.MobileDataPolicy int mobileDataPolicy) {
|
||||||
@SubscriptionManager.SimDisplayNameSource int source) {
|
switch (mobileDataPolicy) {
|
||||||
switch (source) {
|
case TelephonyManager.MOBILE_DATA_POLICY_DATA_ON_NON_DEFAULT_DURING_VOICE_CALL:
|
||||||
case SubscriptionManager.NAME_SOURCE_UNKNOWN: return "UNKNOWN";
|
return "DATA_ON_NON_DEFAULT_DURING_VOICE_CALL";
|
||||||
case SubscriptionManager.NAME_SOURCE_CARRIER_ID: return "CARRIER_ID";
|
case TelephonyManager.MOBILE_DATA_POLICY_MMS_ALWAYS_ALLOWED:
|
||||||
case SubscriptionManager.NAME_SOURCE_SIM_SPN: return "SIM_SPN";
|
return "MMS_ALWAYS_ALLOWED";
|
||||||
case SubscriptionManager.NAME_SOURCE_USER_INPUT: return "USER_INPUT";
|
|
||||||
case SubscriptionManager.NAME_SOURCE_CARRIER: return "CARRIER";
|
|
||||||
case SubscriptionManager.NAME_SOURCE_SIM_PNN: return "SIM_PNN";
|
|
||||||
default:
|
default:
|
||||||
return "UNKNOWN(" + source + ")";
|
return "UNKNOWN(" + mobileDataPolicy + ")";
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Convert subscription type to string.
|
|
||||||
*
|
|
||||||
* @param type The subscription type.
|
|
||||||
* @return The subscription type in string format.
|
|
||||||
*/
|
|
||||||
@NonNull
|
|
||||||
public static String subscriptionTypeToString(@SubscriptionManager.SubscriptionType int type) {
|
|
||||||
switch (type) {
|
|
||||||
case SubscriptionManager.SUBSCRIPTION_TYPE_LOCAL_SIM: return "LOCAL_SIM";
|
|
||||||
case SubscriptionManager.SUBSCRIPTION_TYPE_REMOTE_SIM: return "REMOTE_SIM";
|
|
||||||
default:
|
|
||||||
return "UNKNOWN(" + type + ")";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Convert usage setting to string.
|
|
||||||
*
|
|
||||||
* @param usageSetting Usage setting.
|
|
||||||
* @return The usage setting in string format.
|
|
||||||
*/
|
|
||||||
@NonNull
|
|
||||||
public static String usageSettingToString(@SubscriptionManager.UsageSetting int usageSetting) {
|
|
||||||
switch (usageSetting) {
|
|
||||||
case SubscriptionManager.USAGE_SETTING_UNKNOWN: return "UNKNOWN";
|
|
||||||
case SubscriptionManager.USAGE_SETTING_DEFAULT: return "DEFAULT";
|
|
||||||
case SubscriptionManager.USAGE_SETTING_VOICE_CENTRIC: return "VOICE_CENTRIC";
|
|
||||||
case SubscriptionManager.USAGE_SETTING_DATA_CENTRIC: return "DATA_CENTRIC";
|
|
||||||
default:
|
|
||||||
return "UNKNOWN(" + usageSetting + ")";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -974,7 +974,7 @@ public class SubscriptionInfo implements Parcelable {
|
|||||||
+ " groupOwner=" + mGroupOwner
|
+ " groupOwner=" + mGroupOwner
|
||||||
+ " isGroupDisabled=" + mIsGroupDisabled
|
+ " isGroupDisabled=" + mIsGroupDisabled
|
||||||
+ " displayNameSource="
|
+ " displayNameSource="
|
||||||
+ TelephonyUtils.displayNameSourceToString(mDisplayNameSource)
|
+ SubscriptionManager.displayNameSourceToString(mDisplayNameSource)
|
||||||
+ " iconTint=" + mIconTint
|
+ " iconTint=" + mIconTint
|
||||||
+ " number=" + Rlog.pii(TelephonyUtils.IS_DEBUGGABLE, mNumber)
|
+ " number=" + Rlog.pii(TelephonyUtils.IS_DEBUGGABLE, mNumber)
|
||||||
+ " dataRoaming=" + mDataRoaming
|
+ " dataRoaming=" + mDataRoaming
|
||||||
@@ -988,9 +988,9 @@ public class SubscriptionInfo implements Parcelable {
|
|||||||
+ " carrierConfigAccessRules=" + Arrays.toString(mCarrierConfigAccessRules)
|
+ " carrierConfigAccessRules=" + Arrays.toString(mCarrierConfigAccessRules)
|
||||||
+ " countryIso=" + mCountryIso
|
+ " countryIso=" + mCountryIso
|
||||||
+ " profileClass=" + mProfileClass
|
+ " profileClass=" + mProfileClass
|
||||||
+ " mType=" + TelephonyUtils.subscriptionTypeToString(mType)
|
+ " mType=" + SubscriptionManager.subscriptionTypeToString(mType)
|
||||||
+ " areUiccApplicationsEnabled=" + mAreUiccApplicationsEnabled
|
+ " areUiccApplicationsEnabled=" + mAreUiccApplicationsEnabled
|
||||||
+ " usageSetting=" + TelephonyUtils.usageSettingToString(mUsageSetting)
|
+ " usageSetting=" + SubscriptionManager.usageSettingToString(mUsageSetting)
|
||||||
+ "]";
|
+ "]";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4140,5 +4140,66 @@ public class SubscriptionManager {
|
|||||||
(iSub)-> iSub.setUsageSetting(
|
(iSub)-> iSub.setUsageSetting(
|
||||||
usageSetting, subscriptionId, mContext.getOpPackageName()));
|
usageSetting, subscriptionId, mContext.getOpPackageName()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convert display name source to string.
|
||||||
|
*
|
||||||
|
* @param source The display name source.
|
||||||
|
* @return The display name source in string format.
|
||||||
|
*
|
||||||
|
* @hide
|
||||||
|
*/
|
||||||
|
@NonNull
|
||||||
|
public static String displayNameSourceToString(
|
||||||
|
@SubscriptionManager.SimDisplayNameSource int source) {
|
||||||
|
switch (source) {
|
||||||
|
case SubscriptionManager.NAME_SOURCE_UNKNOWN: return "UNKNOWN";
|
||||||
|
case SubscriptionManager.NAME_SOURCE_CARRIER_ID: return "CARRIER_ID";
|
||||||
|
case SubscriptionManager.NAME_SOURCE_SIM_SPN: return "SIM_SPN";
|
||||||
|
case SubscriptionManager.NAME_SOURCE_USER_INPUT: return "USER_INPUT";
|
||||||
|
case SubscriptionManager.NAME_SOURCE_CARRIER: return "CARRIER";
|
||||||
|
case SubscriptionManager.NAME_SOURCE_SIM_PNN: return "SIM_PNN";
|
||||||
|
default:
|
||||||
|
return "UNKNOWN(" + source + ")";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convert subscription type to string.
|
||||||
|
*
|
||||||
|
* @param type The subscription type.
|
||||||
|
* @return The subscription type in string format.
|
||||||
|
*
|
||||||
|
* @hide
|
||||||
|
*/
|
||||||
|
@NonNull
|
||||||
|
public static String subscriptionTypeToString(@SubscriptionManager.SubscriptionType int type) {
|
||||||
|
switch (type) {
|
||||||
|
case SubscriptionManager.SUBSCRIPTION_TYPE_LOCAL_SIM: return "LOCAL_SIM";
|
||||||
|
case SubscriptionManager.SUBSCRIPTION_TYPE_REMOTE_SIM: return "REMOTE_SIM";
|
||||||
|
default:
|
||||||
|
return "UNKNOWN(" + type + ")";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convert usage setting to string.
|
||||||
|
*
|
||||||
|
* @param usageSetting Usage setting.
|
||||||
|
* @return The usage setting in string format.
|
||||||
|
*
|
||||||
|
* @hide
|
||||||
|
*/
|
||||||
|
@NonNull
|
||||||
|
public static String usageSettingToString(@SubscriptionManager.UsageSetting int usageSetting) {
|
||||||
|
switch (usageSetting) {
|
||||||
|
case SubscriptionManager.USAGE_SETTING_UNKNOWN: return "UNKNOWN";
|
||||||
|
case SubscriptionManager.USAGE_SETTING_DEFAULT: return "DEFAULT";
|
||||||
|
case SubscriptionManager.USAGE_SETTING_VOICE_CENTRIC: return "VOICE_CENTRIC";
|
||||||
|
case SubscriptionManager.USAGE_SETTING_DATA_CENTRIC: return "DATA_CENTRIC";
|
||||||
|
default:
|
||||||
|
return "UNKNOWN(" + usageSetting + ")";
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -72,12 +72,19 @@ public class ImsMmTelManager implements RegistrationManager {
|
|||||||
*/
|
*/
|
||||||
@Retention(RetentionPolicy.SOURCE)
|
@Retention(RetentionPolicy.SOURCE)
|
||||||
@IntDef(prefix = "WIFI_MODE_", value = {
|
@IntDef(prefix = "WIFI_MODE_", value = {
|
||||||
|
WIFI_MODE_UNKNOWN,
|
||||||
WIFI_MODE_WIFI_ONLY,
|
WIFI_MODE_WIFI_ONLY,
|
||||||
WIFI_MODE_CELLULAR_PREFERRED,
|
WIFI_MODE_CELLULAR_PREFERRED,
|
||||||
WIFI_MODE_WIFI_PREFERRED
|
WIFI_MODE_WIFI_PREFERRED
|
||||||
})
|
})
|
||||||
public @interface WiFiCallingMode {}
|
public @interface WiFiCallingMode {}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Wifi calling mode is unknown. This is for initialization only.
|
||||||
|
* @hide
|
||||||
|
*/
|
||||||
|
public static final int WIFI_MODE_UNKNOWN = -1;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Register for IMS over IWLAN if WiFi signal quality is high enough. Do not hand over to LTE
|
* Register for IMS over IWLAN if WiFi signal quality is high enough. Do not hand over to LTE
|
||||||
* registration if signal quality degrades.
|
* registration if signal quality degrades.
|
||||||
@@ -1581,4 +1588,24 @@ public class ImsMmTelManager implements RegistrationManager {
|
|||||||
.get());
|
.get());
|
||||||
return binder;
|
return binder;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convert Wi-Fi calling mode to string.
|
||||||
|
*
|
||||||
|
* @param mode Wi-Fi calling mode.
|
||||||
|
* @return The Wi-Fi calling mode in string format.
|
||||||
|
*
|
||||||
|
* @hide
|
||||||
|
*/
|
||||||
|
@NonNull
|
||||||
|
public static String wifiCallingModeToString(@ImsMmTelManager.WiFiCallingMode int mode) {
|
||||||
|
switch (mode) {
|
||||||
|
case ImsMmTelManager.WIFI_MODE_UNKNOWN: return "UNKNOWN";
|
||||||
|
case ImsMmTelManager.WIFI_MODE_WIFI_ONLY: return "WIFI_ONLY";
|
||||||
|
case ImsMmTelManager.WIFI_MODE_CELLULAR_PREFERRED: return "CELLULAR_PREFERRED";
|
||||||
|
case ImsMmTelManager.WIFI_MODE_WIFI_PREFERRED: return "WIFI_PREFERRED";
|
||||||
|
default:
|
||||||
|
return "UNKNOWN(" + mode + ")";
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user