Improved debug message
Improved subscription info toString readability. Bug: 239607619 Test: Build Merged-In: I852e952a0ceeb4e16a1f63687935544a8d99e543 Change-Id: I852e952a0ceeb4e16a1f63687935544a8d99e543
This commit is contained in:
@@ -27,7 +27,6 @@ import android.os.Binder;
|
||||
import android.os.Bundle;
|
||||
import android.os.PersistableBundle;
|
||||
import android.os.SystemProperties;
|
||||
import android.telephony.SubscriptionManager;
|
||||
import android.telephony.TelephonyManager;
|
||||
|
||||
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.
|
||||
* @return The display name source in string format.
|
||||
* @param mobileDataPolicy The mobile data policy.
|
||||
* @return The mobile data policy in string format.
|
||||
*/
|
||||
@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";
|
||||
public static @NonNull String mobileDataPolicyToString(
|
||||
@TelephonyManager.MobileDataPolicy int mobileDataPolicy) {
|
||||
switch (mobileDataPolicy) {
|
||||
case TelephonyManager.MOBILE_DATA_POLICY_DATA_ON_NON_DEFAULT_DURING_VOICE_CALL:
|
||||
return "DATA_ON_NON_DEFAULT_DURING_VOICE_CALL";
|
||||
case TelephonyManager.MOBILE_DATA_POLICY_MMS_ALWAYS_ALLOWED:
|
||||
return "MMS_ALWAYS_ALLOWED";
|
||||
default:
|
||||
return "UNKNOWN(" + source + ")";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 + ")";
|
||||
return "UNKNOWN(" + mobileDataPolicy + ")";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -974,7 +974,7 @@ public class SubscriptionInfo implements Parcelable {
|
||||
+ " groupOwner=" + mGroupOwner
|
||||
+ " isGroupDisabled=" + mIsGroupDisabled
|
||||
+ " displayNameSource="
|
||||
+ TelephonyUtils.displayNameSourceToString(mDisplayNameSource)
|
||||
+ SubscriptionManager.displayNameSourceToString(mDisplayNameSource)
|
||||
+ " iconTint=" + mIconTint
|
||||
+ " number=" + Rlog.pii(TelephonyUtils.IS_DEBUGGABLE, mNumber)
|
||||
+ " dataRoaming=" + mDataRoaming
|
||||
@@ -988,9 +988,9 @@ public class SubscriptionInfo implements Parcelable {
|
||||
+ " carrierConfigAccessRules=" + Arrays.toString(mCarrierConfigAccessRules)
|
||||
+ " countryIso=" + mCountryIso
|
||||
+ " profileClass=" + mProfileClass
|
||||
+ " mType=" + TelephonyUtils.subscriptionTypeToString(mType)
|
||||
+ " mType=" + SubscriptionManager.subscriptionTypeToString(mType)
|
||||
+ " areUiccApplicationsEnabled=" + mAreUiccApplicationsEnabled
|
||||
+ " usageSetting=" + TelephonyUtils.usageSettingToString(mUsageSetting)
|
||||
+ " usageSetting=" + SubscriptionManager.usageSettingToString(mUsageSetting)
|
||||
+ "]";
|
||||
}
|
||||
|
||||
|
||||
@@ -4136,5 +4136,66 @@ public class SubscriptionManager {
|
||||
(iSub)-> iSub.setUsageSetting(
|
||||
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)
|
||||
@IntDef(prefix = "WIFI_MODE_", value = {
|
||||
WIFI_MODE_UNKNOWN,
|
||||
WIFI_MODE_WIFI_ONLY,
|
||||
WIFI_MODE_CELLULAR_PREFERRED,
|
||||
WIFI_MODE_WIFI_PREFERRED
|
||||
})
|
||||
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
|
||||
* registration if signal quality degrades.
|
||||
@@ -1581,4 +1588,24 @@ public class ImsMmTelManager implements RegistrationManager {
|
||||
.get());
|
||||
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