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

Commit 6ef60967 authored by Devci Telephony's avatar Devci Telephony Committed by Gerrit - the friendly Code Review server
Browse files

Merge "Dialer: add video call capability check based on PresenceService" into atel.lnx.2.0-dev

parents e1daacd0 8cb34a6a
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -30,6 +30,8 @@ src_dirs += \
    $(phone_common_dir)/src-N

LOCAL_SRC_FILES := $(call all-java-files-under, $(src_dirs))
LOCAL_SRC_FILES += src/org/codeaurora/presenceserv/IPresenceService.aidl \
                   src/org/codeaurora/presenceserv/IPresenceServiceCB.aidl
LOCAL_RESOURCE_DIR := $(addprefix $(LOCAL_PATH)/, $(res_dirs)) \
    $(support_library_root_dir)/v7/cardview/res \
    $(support_library_root_dir)/v7/recyclerview/res \
+1 −0
Original line number Diff line number Diff line
@@ -142,4 +142,5 @@
    <color name="searchview_edittext">#59ffffff</color>
    <color name="no_call_log">#42000000</color>
    <color name="list_all_call">#d3000000</color>
    <bool name="config_regional_presence_enable">false</bool>
</resources>
+39 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>

<!--
 * Copyright (c) 2015-2016, The Linux Foundation. All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are
 * met:
 * * Redistributions of source code must retain the above copyright
 * notice, this list of conditions and the following disclaimer.
 * * Redistributions in binary form must reproduce the above
 * copyright notice, this list of conditions and the following
 * disclaimer in the documentation and/or other materials provided
 * with the distribution.
 * * Neither the name of The Linux Foundation nor the names of its
 * contributors may be used to endorse or promote products derived
 * from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-->

<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">

    <SwitchPreference
        android:key="video_calling_preference"
        android:persistent="false"
        android:title="@string/video_call" />

</PreferenceScreen>
+15 −0
Original line number Diff line number Diff line
@@ -87,6 +87,7 @@ import com.android.dialer.util.Assert;
import com.android.dialer.util.DialerUtils;
import com.android.dialer.util.IntentUtil;
import com.android.dialer.util.IntentUtil.CallIntentBuilder;
import com.android.dialer.util.PresenceHelper;
import com.android.dialer.util.TelecomUtil;
import com.android.dialer.util.WifiCallUtils;
import com.android.dialer.voicemail.VoicemailArchiveActivity;
@@ -516,6 +517,12 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O
        mDialerDatabaseHelper = DatabaseHelperManager.getDatabaseHelper(this);
        SmartDialPrefix.initializeNanpSettings(this);

        boolean isPresenceEnabled = this.getResources().getBoolean(
                R.bool.config_regional_presence_enable);
        if (isPresenceEnabled && !PresenceHelper.isBound()) {
            PresenceHelper.bindService((Context) DialtactsActivity.this);
        }

        mWifiCallUtils = new WifiCallUtils();
        if (resources.getBoolean(R.bool.config_regional_pup_no_available_network)
                && mFirstLaunch) {
@@ -628,6 +635,14 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O
        super.onPause();
    }

    @Override
    protected void onStop() {
        if (PresenceHelper.isBound()) {
            PresenceHelper.unbindService((Context) DialtactsActivity.this);
        }
        super.onStop();
    }

    @Override
    protected void onSaveInstanceState(Bundle outState) {
        super.onSaveInstanceState(outState);
+8 −3
Original line number Diff line number Diff line
@@ -32,10 +32,10 @@ import com.android.dialer.PhoneCallDetails;
import com.android.dialer.R;
import com.android.dialer.util.DialerUtils;
import com.android.dialer.util.AppCompatConstants;
import com.android.dialer.util.PresenceHelper;
import com.google.common.collect.Lists;

import java.util.ArrayList;

/**
 * Adapter for a ListView containing history items from the details of a call.
 */
@@ -107,8 +107,13 @@ public class CallDetailHistoryAdapter extends BaseAdapter {
        TextView durationView = (TextView) result.findViewById(R.id.duration);

        int callType = details.callTypes[0];
        boolean isVideoCall = (details.features & Calls.FEATURES_VIDEO) == Calls.FEATURES_VIDEO
                && CallUtil.isVideoEnabled(mContext);
        boolean isPresenceEnabled = mContext.getResources().getBoolean(
                R.bool.config_regional_presence_enable);
        boolean isVideoCall = (details.features & Calls.FEATURES_VIDEO)
                == Calls.FEATURES_VIDEO && CallUtil.isVideoEnabled(mContext);
        if (isPresenceEnabled) {
            isVideoCall &= PresenceHelper.startAvailabilityFetch(details.number.toString());
        }
        boolean isVoLTE = (callType == AppCompatConstants.INCOMING_IMS_TYPE) ||
                          (callType == AppCompatConstants.OUTGOING_IMS_TYPE) ||
                          (callType == AppCompatConstants.MISSED_IMS_TYPE);
Loading