diff options
| author | 2019-12-20 14:12:46 -0800 | |
|---|---|---|
| committer | 2019-12-20 14:12:46 -0800 | |
| commit | 682ba08d421fef1f13a7bab031b2452805838d07 (patch) | |
| tree | 1d9137039e874dbf9cc37b043410aa6b10a3586a | |
| parent | d24878927159f66e9409cfa6df6a6e82ab47a11b (diff) | |
| parent | c037935d74633912cf57738559e925484144d053 (diff) | |
Merge "Make PreciseCallState Constructor System API"
am: c037935d74
Change-Id: I8ec5d83ddcd2114e697e9ad322edb45e278ff1c1
| -rwxr-xr-x | api/system-current.txt | 1 | ||||
| -rw-r--r-- | services/core/java/com/android/server/TelephonyRegistry.java | 17 | ||||
| -rw-r--r-- | telephony/java/android/telephony/Annotation.java | 80 | ||||
| -rw-r--r-- | telephony/java/android/telephony/PreciseCallState.java | 24 |
4 files changed, 109 insertions, 13 deletions
diff --git a/api/system-current.txt b/api/system-current.txt index 001412d19082..25cbd4fdb8b2 100755 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -8589,6 +8589,7 @@ package android.telephony { } public final class PreciseCallState implements android.os.Parcelable { + ctor public PreciseCallState(int, int, int, int, int); method public int describeContents(); method public int getBackgroundCallState(); method public int getForegroundCallState(); diff --git a/services/core/java/com/android/server/TelephonyRegistry.java b/services/core/java/com/android/server/TelephonyRegistry.java index 08cec2e07753..4c6d6c5b8ae8 100644 --- a/services/core/java/com/android/server/TelephonyRegistry.java +++ b/services/core/java/com/android/server/TelephonyRegistry.java @@ -441,10 +441,10 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub { mCallDisconnectCause[i] = DisconnectCause.NOT_VALID; mCallPreciseDisconnectCause[i] = PreciseDisconnectCause.NOT_VALID; mCallQuality[i] = createCallQuality(); - mCallAttributes[i] = new CallAttributes(new PreciseCallState(), + mCallAttributes[i] = new CallAttributes(createPreciseCallState(), TelephonyManager.NETWORK_TYPE_UNKNOWN, createCallQuality()); mCallNetworkType[i] = TelephonyManager.NETWORK_TYPE_UNKNOWN; - mPreciseCallState[i] = new PreciseCallState(); + mPreciseCallState[i] = createPreciseCallState(); mRingingCallState[i] = PreciseCallState.PRECISE_CALL_STATE_IDLE; mForegroundCallState[i] = PreciseCallState.PRECISE_CALL_STATE_IDLE; mBackgroundCallState[i] = PreciseCallState.PRECISE_CALL_STATE_IDLE; @@ -534,10 +534,10 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub { mCallDisconnectCause[i] = DisconnectCause.NOT_VALID; mCallPreciseDisconnectCause[i] = PreciseDisconnectCause.NOT_VALID; mCallQuality[i] = createCallQuality(); - mCallAttributes[i] = new CallAttributes(new PreciseCallState(), + mCallAttributes[i] = new CallAttributes(createPreciseCallState(), TelephonyManager.NETWORK_TYPE_UNKNOWN, createCallQuality()); mCallNetworkType[i] = TelephonyManager.NETWORK_TYPE_UNKNOWN; - mPreciseCallState[i] = new PreciseCallState(); + mPreciseCallState[i] = createPreciseCallState(); mRingingCallState[i] = PreciseCallState.PRECISE_CALL_STATE_IDLE; mForegroundCallState[i] = PreciseCallState.PRECISE_CALL_STATE_IDLE; mBackgroundCallState[i] = PreciseCallState.PRECISE_CALL_STATE_IDLE; @@ -2645,6 +2645,15 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub { } } + /** Returns a new PreciseCallState object with default values. */ + private static PreciseCallState createPreciseCallState() { + return new PreciseCallState(PreciseCallState.PRECISE_CALL_STATE_NOT_VALID, + PreciseCallState.PRECISE_CALL_STATE_NOT_VALID, + PreciseCallState.PRECISE_CALL_STATE_NOT_VALID, + DisconnectCause.NOT_VALID, + PreciseDisconnectCause.NOT_VALID); + } + /** Returns a new CallQuality object with default values. */ private static CallQuality createCallQuality() { return new CallQuality(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); diff --git a/telephony/java/android/telephony/Annotation.java b/telephony/java/android/telephony/Annotation.java index 3940a3b0a1cf..9b9997f9b737 100644 --- a/telephony/java/android/telephony/Annotation.java +++ b/telephony/java/android/telephony/Annotation.java @@ -485,6 +485,86 @@ public class Annotation { PreciseCallState.PRECISE_CALL_STATE_DISCONNECTING}) public @interface PreciseCallStates {} + @IntDef(value = { + DisconnectCause.NOT_VALID, + DisconnectCause.NOT_DISCONNECTED, + DisconnectCause.INCOMING_MISSED, + DisconnectCause.NORMAL, + DisconnectCause.LOCAL, + DisconnectCause.BUSY, + DisconnectCause.CONGESTION, + DisconnectCause.MMI, + DisconnectCause.INVALID_NUMBER, + DisconnectCause.NUMBER_UNREACHABLE, + DisconnectCause.SERVER_UNREACHABLE, + DisconnectCause.INVALID_CREDENTIALS, + DisconnectCause.OUT_OF_NETWORK, + DisconnectCause.SERVER_ERROR, + DisconnectCause.TIMED_OUT, + DisconnectCause.LOST_SIGNAL, + DisconnectCause.LIMIT_EXCEEDED, + DisconnectCause.INCOMING_REJECTED, + DisconnectCause.POWER_OFF, + DisconnectCause.OUT_OF_SERVICE, + DisconnectCause.ICC_ERROR, + DisconnectCause.CALL_BARRED, + DisconnectCause.FDN_BLOCKED, + DisconnectCause.CS_RESTRICTED, + DisconnectCause.CS_RESTRICTED_NORMAL, + DisconnectCause.CS_RESTRICTED_EMERGENCY, + DisconnectCause.UNOBTAINABLE_NUMBER, + DisconnectCause.CDMA_LOCKED_UNTIL_POWER_CYCLE, + DisconnectCause.CDMA_DROP, + DisconnectCause.CDMA_INTERCEPT, + DisconnectCause.CDMA_REORDER, + DisconnectCause.CDMA_SO_REJECT, + DisconnectCause.CDMA_RETRY_ORDER, + DisconnectCause.CDMA_ACCESS_FAILURE, + DisconnectCause.CDMA_PREEMPTED, + DisconnectCause.CDMA_NOT_EMERGENCY, + DisconnectCause.CDMA_ACCESS_BLOCKED, + DisconnectCause.ERROR_UNSPECIFIED, + }) + @Retention(RetentionPolicy.SOURCE) + public @interface DisconnectCauses { + } + + @IntDef(value = { + PreciseDisconnectCause.NOT_VALID, + PreciseDisconnectCause.NO_DISCONNECT_CAUSE_AVAILABLE, + PreciseDisconnectCause.UNOBTAINABLE_NUMBER, + PreciseDisconnectCause.NORMAL, + PreciseDisconnectCause.BUSY, + PreciseDisconnectCause.NUMBER_CHANGED, + PreciseDisconnectCause.STATUS_ENQUIRY, + PreciseDisconnectCause.NORMAL_UNSPECIFIED, + PreciseDisconnectCause.NO_CIRCUIT_AVAIL, + PreciseDisconnectCause.TEMPORARY_FAILURE, + PreciseDisconnectCause.SWITCHING_CONGESTION, + PreciseDisconnectCause.CHANNEL_NOT_AVAIL, + PreciseDisconnectCause.QOS_NOT_AVAIL, + PreciseDisconnectCause.BEARER_NOT_AVAIL, + PreciseDisconnectCause.ACM_LIMIT_EXCEEDED, + PreciseDisconnectCause.CALL_BARRED, + PreciseDisconnectCause.FDN_BLOCKED, + PreciseDisconnectCause.IMSI_UNKNOWN_IN_VLR, + PreciseDisconnectCause.IMEI_NOT_ACCEPTED, + PreciseDisconnectCause.CDMA_LOCKED_UNTIL_POWER_CYCLE, + PreciseDisconnectCause.CDMA_DROP, + PreciseDisconnectCause.CDMA_INTERCEPT, + PreciseDisconnectCause.CDMA_REORDER, + PreciseDisconnectCause.CDMA_SO_REJECT, + PreciseDisconnectCause.CDMA_RETRY_ORDER, + PreciseDisconnectCause.CDMA_ACCESS_FAILURE, + PreciseDisconnectCause.CDMA_PREEMPTED, + PreciseDisconnectCause.CDMA_NOT_EMERGENCY, + PreciseDisconnectCause.CDMA_ACCESS_BLOCKED, + PreciseDisconnectCause.ERROR_UNSPECIFIED, + }) + @Retention(RetentionPolicy.SOURCE) + public @interface PreciseDisconnectCauses { + } + @Retention(RetentionPolicy.SOURCE) @IntDef(prefix = {"RIL_RADIO_TECHNOLOGY_" }, value = { ServiceState.RIL_RADIO_TECHNOLOGY_UNKNOWN, diff --git a/telephony/java/android/telephony/PreciseCallState.java b/telephony/java/android/telephony/PreciseCallState.java index 9f75332c4a03..bfa6326c3c18 100644 --- a/telephony/java/android/telephony/PreciseCallState.java +++ b/telephony/java/android/telephony/PreciseCallState.java @@ -16,19 +16,18 @@ package android.telephony; -import android.annotation.IntDef; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.SystemApi; import android.annotation.UnsupportedAppUsage; import android.os.Parcel; import android.os.Parcelable; +import android.telephony.Annotation.DisconnectCauses; import android.telephony.Annotation.PreciseCallStates; +import android.telephony.Annotation.PreciseDisconnectCauses; import android.telephony.DisconnectCause; import android.telephony.PreciseDisconnectCause; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; import java.util.Objects; /** @@ -73,19 +72,26 @@ public final class PreciseCallState implements Parcelable { private @PreciseCallStates int mRingingCallState = PRECISE_CALL_STATE_NOT_VALID; private @PreciseCallStates int mForegroundCallState = PRECISE_CALL_STATE_NOT_VALID; private @PreciseCallStates int mBackgroundCallState = PRECISE_CALL_STATE_NOT_VALID; - private int mDisconnectCause = DisconnectCause.NOT_VALID; - private int mPreciseDisconnectCause = PreciseDisconnectCause.NOT_VALID; + private @DisconnectCauses int mDisconnectCause = DisconnectCause.NOT_VALID; + private @PreciseDisconnectCauses int mPreciseDisconnectCause = PreciseDisconnectCause.NOT_VALID; /** - * Constructor + * Construct PreciseCallState with parameters + * + * @param ringingCall ring call state + * @param foregroundCall foreground call state + * @param backgroundCall background call state + * @param disconnectCause disconnect cause + * @param preciseDisconnectCause precise disconnect cause * * @hide */ - @UnsupportedAppUsage + @SystemApi public PreciseCallState(@PreciseCallStates int ringingCall, @PreciseCallStates int foregroundCall, - @PreciseCallStates int backgroundCall, int disconnectCause, - int preciseDisconnectCause) { + @PreciseCallStates int backgroundCall, + @DisconnectCauses int disconnectCause, + @PreciseDisconnectCauses int preciseDisconnectCause) { mRingingCallState = ringingCall; mForegroundCallState = foregroundCall; mBackgroundCallState = backgroundCall; |