Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 59585f80 authored by Andrew Lee's avatar Andrew Lee
Browse files

Use new Call.Details.PROPERTY_* values.

Bug: 20160395
Change-Id: Ibc877c3d6898770bce4bd96bdcbe673061141892
parent 7b10cf5e
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -25,7 +25,6 @@ import android.hardware.camera2.CameraCharacteristics;
import android.net.Uri;
import android.os.Bundle;
import android.os.Trace;
import android.telecom.CallProperties;
import android.telecom.DisconnectCause;
import android.telecom.GatewayInfo;
import android.telecom.InCallService.VideoCall;
@@ -425,8 +424,8 @@ public class Call {
        return (capabilities == (capabilities & mTelecommCall.getDetails().getCallCapabilities()));
    }

    private boolean hasProperty(int property) {
        return property == (property & mTelecommCall.getDetails().getCallProperties());
    public boolean hasProperty(int property) {
        return mTelecommCall.getDetails().hasProperty(property);
    }

    /** Gets the time when the call first became active. */
@@ -435,7 +434,8 @@ public class Call {
    }

    public boolean isConferenceCall() {
        return hasProperty(CallProperties.CONFERENCE);
        return mTelecommCall.getDetails().hasProperty(
                android.telecom.Call.Details.PROPERTY_CONFERENCE);
    }

    public GatewayInfo getGatewayInfo() {
+5 −9
Original line number Diff line number Diff line
@@ -304,11 +304,11 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi>
                    getConnectionLabel(),
                    getCallStateIcon(),
                    getGatewayNumber(),
                    primaryCallCan(Details.CAPABILITY_WIFI),
                    mPrimary.hasProperty(Details.PROPERTY_WIFI),
                    mPrimary.isConferenceCall());

            boolean showHdAudioIndicator =
                    isPrimaryCallActive() && primaryCallCan(Details.CAPABILITY_HIGH_DEF_AUDIO);
                    isPrimaryCallActive() && mPrimary.hasProperty(Details.PROPERTY_HIGH_DEF_AUDIO);
            getUi().showHdAudioIndicator(showHdAudioIndicator);

            setCallbackNumber();
@@ -353,7 +353,7 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi>
        //    number.
        boolean isEmergencyCall = PhoneNumberUtils.isEmergencyNumber(
                getNumberFromHandle(mPrimary.getHandle()));
        boolean showCallbackNumber = mPrimary.can(Details.CAPABILITY_SHOW_CALLBACK_NUMBER);
        boolean showCallbackNumber = mPrimary.hasProperty(Details.PROPERTY_EMERGENCY_CALLBACK_MODE);

        if (isEmergencyCall || showCallbackNumber) {
            callbackNumber = getSubscriptionNumber();
@@ -735,12 +735,8 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi>
        return mPrimary != null && mPrimary.getState() == Call.State.ACTIVE;
    }

    private boolean primaryCallCan(int capability) {
        return mPrimary.getTelecommCall().getDetails().can(capability);
    }

    private String getConferenceString(Call call) {
        boolean isGenericConference = call.can(Details.CAPABILITY_GENERIC_CONFERENCE);
        boolean isGenericConference = call.hasProperty(Details.PROPERTY_GENERIC_CONFERENCE);
        Log.v(this, "getConferenceString: " + isGenericConference);

        final int resId = isGenericConference
@@ -749,7 +745,7 @@ public class CallCardPresenter extends Presenter<CallCardPresenter.CallCardUi>
    }

    private Drawable getConferencePhoto(Call call) {
        boolean isGenericConference = call.can(Details.CAPABILITY_GENERIC_CONFERENCE);
        boolean isGenericConference = call.hasProperty(Details.PROPERTY_GENERIC_CONFERENCE);
        Log.v(this, "getConferencePhoto: " + isGenericConference);

        final int resId = isGenericConference
+4 −4
Original line number Diff line number Diff line
@@ -308,7 +308,7 @@ public class StatusBarNotifier implements InCallPresenter.InCallStateListener {
     * Returns the main string to use in the notification.
     */
    private String getContentTitle(ContactCacheEntry contactInfo, Call call) {
        if (call.isConferenceCall() && !call.can(Details.CAPABILITY_GENERIC_CONFERENCE)) {
        if (call.isConferenceCall() && !call.hasProperty(Details.PROPERTY_GENERIC_CONFERENCE)) {
            return mContext.getResources().getString(R.string.card_title_conf_call);
        }
        if (TextUtils.isEmpty(contactInfo.name)) {
@@ -335,7 +335,7 @@ public class StatusBarNotifier implements InCallPresenter.InCallStateListener {
     */
    private Bitmap getLargeIconToDisplay(ContactCacheEntry contactInfo, Call call) {
        Bitmap largeIcon = null;
        if (call.isConferenceCall() && !call.can(Details.CAPABILITY_GENERIC_CONFERENCE)) {
        if (call.isConferenceCall() && !call.hasProperty(Details.PROPERTY_GENERIC_CONFERENCE)) {
            largeIcon = BitmapFactory.decodeResource(mContext.getResources(),
                    R.drawable.img_conference);
        }
@@ -379,12 +379,12 @@ public class StatusBarNotifier implements InCallPresenter.InCallStateListener {
     */
    private int getContentString(Call call) {
        int resId = R.string.notification_ongoing_call;
        if (call.can(Details.CAPABILITY_WIFI)) {
        if (call.hasProperty(Details.PROPERTY_WIFI)) {
            resId = R.string.notification_ongoing_call_wifi;
        }

        if (call.getState() == Call.State.INCOMING || call.getState() == Call.State.CALL_WAITING) {
            if (call.can(Details.CAPABILITY_WIFI)) {
            if (call.hasProperty(Details.PROPERTY_WIFI)) {
                resId = R.string.notification_incoming_call_wifi;
            } else {
                resId = R.string.notification_incoming_call;