diff options
author | Nancy Chen <nancychen@google.com> | 2014-09-08 14:31:23 -0700 |
---|---|---|
committer | Nancy Chen <nancychen@google.com> | 2014-09-09 11:58:31 -0700 |
commit | 07fd3fd3ac627faf1771ba4699fe53a0479f2293 (patch) | |
tree | 2d98880a08727e57ac4ea6976eb2856667bdd680 | |
parent | e7e294d880c8cdda8ddec98624f1a986af5d9ee0 (diff) |
API changes in GatewayInfo, Response, and PropertyPresentation (2/4)
* GatewayInfo: handle -> address, becomes SystemApi
* Response: hidden
* PropertyPresentation: class goes away, constants move to
TelecommManager
Bug: 17329632
Change-Id: I56180181a65e4b726e569aa4b8ac4cbb8dab00f9
4 files changed, 16 insertions, 16 deletions
diff --git a/InCallUI/src/com/android/incallui/Call.java b/InCallUI/src/com/android/incallui/Call.java index dd899b46d..36dd16291 100644 --- a/InCallUI/src/com/android/incallui/Call.java +++ b/InCallUI/src/com/android/incallui/Call.java @@ -248,7 +248,7 @@ public final class Call { public String getNumber() { if (mTelecommCall.getDetails().getGatewayInfo() != null) { return mTelecommCall.getDetails().getGatewayInfo() - .getOriginalHandle().getSchemeSpecificPart(); + .getOriginalAddress().getSchemeSpecificPart(); } return getHandle() == null ? null : getHandle().getSchemeSpecificPart(); } diff --git a/InCallUI/src/com/android/incallui/CallCardPresenter.java b/InCallUI/src/com/android/incallui/CallCardPresenter.java index ea324ba66..60a12730c 100644 --- a/InCallUI/src/com/android/incallui/CallCardPresenter.java +++ b/InCallUI/src/com/android/incallui/CallCardPresenter.java @@ -518,7 +518,7 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi> */ private String getGatewayNumber() { if (hasOutgoingGatewayCall()) { - return getNumberFromHandle(mPrimary.getGatewayInfo().getGatewayHandle()); + return getNumberFromHandle(mPrimary.getGatewayInfo().getGatewayAddress()); } return null; } diff --git a/InCallUI/src/com/android/incallui/CallerInfoUtils.java b/InCallUI/src/com/android/incallui/CallerInfoUtils.java index b060d6697..cc38a0e96 100644 --- a/InCallUI/src/com/android/incallui/CallerInfoUtils.java +++ b/InCallUI/src/com/android/incallui/CallerInfoUtils.java @@ -5,7 +5,7 @@ import android.content.Loader; import android.content.Loader.OnLoadCompleteListener; import android.net.Uri; import android.telecomm.PhoneAccount; -import android.telecomm.PropertyPresentation; +import android.telecomm.TelecommManager; import android.text.TextUtils; import android.util.Log; @@ -41,7 +41,7 @@ public class CallerInfoUtils { // TODO: Have phoneapp send a Uri when it knows the contact that triggered this call. - if (info.numberPresentation == PropertyPresentation.ALLOWED) { + if (info.numberPresentation == TelecommManager.PRESENTATION_ALLOWED) { // Start the query with the number provided from the call. Log.d(TAG, "==> Actually starting CallerInfoAsyncQuery.startQuery()..."); CallerInfoAsyncQuery.startQuery(QUERY_TOKEN, context, info, listener, call); @@ -107,9 +107,9 @@ public class CallerInfoUtils { final String[] absentNumberValues = context.getResources().getStringArray(R.array.absent_num); if (Arrays.asList(absentNumberValues).contains(number) - && presentation == PropertyPresentation.ALLOWED) { + && presentation == TelecommManager.PRESENTATION_ALLOWED) { number = context.getString(R.string.unknown); - ci.numberPresentation = PropertyPresentation.UNKNOWN; + ci.numberPresentation = TelecommManager.PRESENTATION_UNKNOWN; } // Check for other special "corner cases" for CNAP and fix them similarly. Corner @@ -117,16 +117,16 @@ public class CallerInfoUtils { // if we think we have an allowed presentation, or if the CallerInfo presentation doesn't // match the presentation passed in for verification (meaning we changed it previously // because it's a corner case and we're being called from a different entry point). - if (ci.numberPresentation == PropertyPresentation.ALLOWED + if (ci.numberPresentation == TelecommManager.PRESENTATION_ALLOWED || (ci.numberPresentation != presentation - && presentation == PropertyPresentation.ALLOWED)) { + && presentation == TelecommManager.PRESENTATION_ALLOWED)) { // For all special strings, change number & numberPrentation. if (isCnapSpecialCaseRestricted(number)) { number = context.getString(R.string.private_num); - ci.numberPresentation = PropertyPresentation.RESTRICTED; + ci.numberPresentation = TelecommManager.PRESENTATION_RESTRICTED; } else if (isCnapSpecialCaseUnknown(number)) { number = context.getString(R.string.unknown); - ci.numberPresentation = PropertyPresentation.UNKNOWN; + ci.numberPresentation = TelecommManager.PRESENTATION_UNKNOWN; } Log.d(TAG, "SpecialCnap: number=" + toLogSafePhoneNumber(number) + "; presentation now=" + ci.numberPresentation); diff --git a/InCallUI/src/com/android/incallui/ContactInfoCache.java b/InCallUI/src/com/android/incallui/ContactInfoCache.java index d0d093940..570b2de4f 100644 --- a/InCallUI/src/com/android/incallui/ContactInfoCache.java +++ b/InCallUI/src/com/android/incallui/ContactInfoCache.java @@ -24,7 +24,7 @@ import android.net.Uri; import android.os.Looper; import android.provider.ContactsContract.Contacts; import android.provider.ContactsContract.CommonDataKinds.Phone; -import android.telecomm.PropertyPresentation; +import android.telecomm.TelecommManager; import android.text.TextUtils; import com.android.contacts.common.util.PhoneNumberHelper; @@ -153,7 +153,7 @@ public class ContactInfoCache implements ContactsAsyncHelper.OnImageLoadComplete int presentationMode = call.getNumberPresentation(); if (callerInfo.contactExists || callerInfo.isEmergencyNumber() || callerInfo.isVoiceMailNumber()) { - presentationMode = PropertyPresentation.ALLOWED; + presentationMode = TelecommManager.PRESENTATION_ALLOWED; } final ContactCacheEntry cacheEntry = buildEntry(mContext, callId, @@ -389,7 +389,7 @@ public class ContactInfoCache implements ContactsAsyncHelper.OnImageLoadComplete // (or potentially some other default based on the presentation.) displayName = getPresentationString(context, presentation); Log.d(TAG, " ==> no name *or* number! displayName = " + displayName); - } else if (presentation != PropertyPresentation.ALLOWED) { + } else if (presentation != TelecommManager.PRESENTATION_ALLOWED) { // This case should never happen since the network should never send a phone # // AND a restricted presentation. However we leave it here in case of weird // network behavior @@ -426,7 +426,7 @@ public class ContactInfoCache implements ContactsAsyncHelper.OnImageLoadComplete } else { // We do have a valid "name" in the CallerInfo. Display that // in the "name" slot, and the phone number in the "number" slot. - if (presentation != PropertyPresentation.ALLOWED) { + if (presentation != TelecommManager.PRESENTATION_ALLOWED) { // This case should never happen since the network should never send a name // AND a restricted presentation. However we leave it here in case of weird // network behavior @@ -479,9 +479,9 @@ public class ContactInfoCache implements ContactsAsyncHelper.OnImageLoadComplete */ private static String getPresentationString(Context context, int presentation) { String name = context.getString(R.string.unknown); - if (presentation == PropertyPresentation.RESTRICTED) { + if (presentation == TelecommManager.PRESENTATION_RESTRICTED) { name = context.getString(R.string.private_num); - } else if (presentation == PropertyPresentation.PAYPHONE) { + } else if (presentation == TelecommManager.PRESENTATION_PAYPHONE) { name = context.getString(R.string.payphone); } return name; |