Merge "Adds better logging for ImsFeature features"

This commit is contained in:
Brad Ebinger
2019-08-06 00:27:04 +00:00
committed by Gerrit Code Review
2 changed files with 23 additions and 2 deletions

View File

@@ -34,7 +34,9 @@ import com.android.internal.annotations.VisibleForTesting;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import java.util.WeakHashMap;
@@ -105,6 +107,16 @@ public abstract class ImsFeature {
*/
public static final int FEATURE_MAX = 3;
/**
* Used for logging purposes.
* @hide
*/
public static final Map<Integer, String> FEATURE_LOG_MAP = new HashMap<Integer, String>() {{
put(FEATURE_EMERGENCY_MMTEL, "EMERGENCY_MMTEL");
put(FEATURE_MMTEL, "MMTEL");
put(FEATURE_RCS, "RCS");
}};
/**
* Integer values defining IMS features that are supported in ImsFeature.
* @hide
@@ -149,6 +161,16 @@ public abstract class ImsFeature {
*/
public static final int STATE_READY = 2;
/**
* Used for logging purposes.
* @hide
*/
public static final Map<Integer, String> STATE_LOG_MAP = new HashMap<Integer, String>() {{
put(STATE_UNAVAILABLE, "UNAVAILABLE");
put(STATE_INITIALIZING, "INITIALIZING");
put(STATE_READY, "READY");
}};
/**
* Integer values defining the result codes that should be returned from
* {@link #changeEnabledCapabilities} when the framework tries to set a feature's capability.

View File

@@ -21,7 +21,6 @@ import android.os.Parcel;
import android.os.Parcelable;
import android.telephony.ims.feature.ImsFeature;
import android.util.ArraySet;
import android.util.Pair;
import java.util.Set;
@@ -80,7 +79,7 @@ public final class ImsFeatureConfiguration implements Parcelable {
@Override
public String toString() {
return "{s=" + slotId + ", f=" + featureType + "}";
return "{s=" + slotId + ", f=" + ImsFeature.FEATURE_LOG_MAP.get(featureType) + "}";
}
}