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

Commit 2bbe4843 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 5582435 from 3e9e44e6 to qt-qpr1-release

Change-Id: I0422dd2817442d19dee61b1a7cb81a6e05502e17
parents 0995eb97 3e9e44e6
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -20,7 +20,7 @@
    <string name="userCallActivityLabel" product="default" msgid="5415173590855187131">"फ़ोन"</string>
    <string name="unknown" msgid="6878797917991465859">"अज्ञात"</string>
    <string name="notification_missedCallTitle" msgid="7554385905572364535">"छूटी कॉल"</string>
    <string name="notification_missedWorkCallTitle" msgid="6242489980390803090">"कार्यस्थल का छूटा हुआ कॉल"</string>
    <string name="notification_missedWorkCallTitle" msgid="6242489980390803090">"दफ़्तर का छूटा हुआ कॉल"</string>
    <string name="notification_missedCallsTitle" msgid="1361677948941502522">"छूटी कॉल"</string>
    <string name="notification_missedCallsMsg" msgid="4575787816055205600">"<xliff:g id="NUM_MISSED_CALLS">%s</xliff:g> छूटी कॉल"</string>
    <string name="notification_missedCallTicker" msgid="504686252427747209">"<xliff:g id="MISSED_CALL_FROM">%s</xliff:g> की कॉल छूटी"</string>
@@ -62,15 +62,15 @@
    <string name="unblock_button" msgid="3078048901972674170">"अनवरोधित करें"</string>
    <string name="add_blocked_dialog_body" msgid="9030243212265516828">"इसके कॉल और मैसेज रोकें"</string>
    <string name="add_blocked_number_hint" msgid="6847675097085433553">"फ़ोन नंबर"</string>
    <string name="block_button" msgid="8822290682524373357">"अवरुद्ध करें"</string>
    <string name="non_primary_user" msgid="5180129233352533459">"केवल डिवाइस स्वामी अवरुद्ध किए गए नंबर देख और प्रबंधित कर सकते हैं."</string>
    <string name="block_button" msgid="8822290682524373357">"ब्लॉक करें"</string>
    <string name="non_primary_user" msgid="5180129233352533459">"सिर्फ़ डिवाइस के मालिक रोके गए नंबर देख और प्रबंधित कर सकते हैं."</string>
    <string name="delete_icon_description" msgid="8903995728252556724">"अनवरोधित करें"</string>
    <string name="blocked_numbers_butter_bar_title" msgid="438170866438793182">"अवरोधन अस्थायी रूप से बंद है"</string>
    <string name="blocked_numbers_butter_bar_body" msgid="2223244484319442431">"आपातकालीन नंबर डायल करने या उस पर लेख संदेश भेजने के बाद, अवरोधन बंद हो जाता है ताकि आपातकालीन सेवाएं आपसे संपर्क कर सकें."</string>
    <string name="blocked_numbers_butter_bar_button" msgid="2197943354922010696">"अभी फिर से सक्षम करें"</string>
    <string name="blocked_numbers_number_blocked_message" msgid="7678509606805029540">"<xliff:g id="BLOCKED_NUMBER">%1$s</xliff:g> अवरोधित है"</string>
    <string name="blocked_numbers_number_unblocked_message" msgid="977894647366750418">"<xliff:g id="UNBLOCKED_NUMBER">%1$s</xliff:g> अनवरोधित है"</string>
    <string name="blocked_numbers_block_emergency_number_message" msgid="917851876780698387">"आपातकालीन नंबर अवरुद्ध करने में असमर्थ."</string>
    <string name="blocked_numbers_block_emergency_number_message" msgid="917851876780698387">"आपातकालीन नंबर ब्लॉक करने में असमर्थ."</string>
    <string name="blocked_numbers_number_already_blocked_message" msgid="4392247814500811798">"<xliff:g id="BLOCKED_NUMBER">%1$s</xliff:g> पहले से अवरोधित है."</string>
    <string name="toast_personal_call_msg" msgid="5115361633476779723">"कॉल करने के लिए व्यक्तिगत डायलर का उपयोग करना"</string>
    <string name="notification_incoming_call" msgid="7713197997773986670">"<xliff:g id="CALL_FROM">%2$s</xliff:g> की ओर से <xliff:g id="CALL_VIA">%1$s</xliff:g> कॉल"</string>
+19 −14
Original line number Diff line number Diff line
@@ -3275,25 +3275,30 @@ public class CallsManager extends Call.ListenerBase
    }

    /**
     * Given a {@link PhoneAccountHandle} determines if there are calls owned by any other
     * {@link PhoneAccountHandle}.
     * Given a {@link PhoneAccountHandle} determines if there are other unholdable calls owned by
     * another connection service.
     * @param phoneAccountHandle The {@link PhoneAccountHandle} to check.
     * @return {@code true} if there are other calls, {@code false} otherwise.
     * @return {@code true} if there are other unholdable calls, {@code false} otherwise.
     */
    public boolean hasCallsForOtherPhoneAccount(PhoneAccountHandle phoneAccountHandle) {
        return getNumCallsForOtherPhoneAccount(phoneAccountHandle) > 0;
    public boolean hasUnholdableCallsForOtherConnectionService(
            PhoneAccountHandle phoneAccountHandle) {
        return getNumUnholdableCallsForOtherConnectionService(phoneAccountHandle) > 0;
    }

    /**
     * Determines the number of calls present for PhoneAccounts other than the one specified.
     * Determines the number of unholdable calls present in a connection service other than the one
     * the passed phone account belonds to.
     * @param phoneAccountHandle The handle of the PhoneAccount.
     * @return Number of calls owned by other PhoneAccounts.
     * @return Number of unholdable calls owned by other connection service.
     */
    public int getNumCallsForOtherPhoneAccount(PhoneAccountHandle phoneAccountHandle) {
    public int getNumUnholdableCallsForOtherConnectionService(
            PhoneAccountHandle phoneAccountHandle) {
        return (int) mCalls.stream().filter(call ->
                !phoneAccountHandle.equals(call.getTargetPhoneAccount()) &&
                        call.getParentCall() == null &&
                        !call.isExternalCall()).count();
                !phoneAccountHandle.getComponentName().equals(
                        call.getTargetPhoneAccount().getComponentName())
                        && call.getParentCall() == null
                        && !call.isExternalCall()
                        && !canHold(call)).count();
    }

    /**
@@ -3345,9 +3350,9 @@ public class CallsManager extends Call.ListenerBase
     * @return {@code true} if the system incoming call UI should be shown, {@code false} otherwise.
     */
    public boolean shouldShowSystemIncomingCallUi(Call incomingCall) {
        return incomingCall.isIncoming() && incomingCall.isSelfManaged() &&
                hasCallsForOtherPhoneAccount(incomingCall.getTargetPhoneAccount()) &&
                incomingCall.getHandoverSourceCall() == null;
        return incomingCall.isIncoming() && incomingCall.isSelfManaged()
                && hasUnholdableCallsForOtherConnectionService(incomingCall.getTargetPhoneAccount())
                && incomingCall.getHandoverSourceCall() == null;
    }

    private boolean makeRoomForOutgoingCall(Call call, boolean isEmergency) {
+6 −1
Original line number Diff line number Diff line
@@ -396,8 +396,8 @@ public class TelecomServiceImpl {
            synchronized (mLock) {
                try {
                    Log.startSession("TSI.gSCM");
                    final int user = ActivityManager.getCurrentUser();
                    final int callingUid = Binder.getCallingUid();
                    final int user = UserHandle.getUserId(callingUid);
                    long token = Binder.clearCallingIdentity();
                    try {
                        if (user != ActivityManager.getCurrentUser()) {
@@ -1805,6 +1805,11 @@ public class TelecomServiceImpl {
        }

        if (call != null) {
            if (call.isEmergencyCall()) {
                android.util.EventLog.writeEvent(0x534e4554, "132438333", -1, "");
                return false;
            }

            if (call.getState() == CallState.RINGING) {
                call.reject(false /* rejectWithMessage */, null, callingPackage);
            } else {
+8 −8
Original line number Diff line number Diff line
@@ -35,15 +35,11 @@ import android.content.Intent;
import android.content.IntentFilter;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.location.Country;
import android.location.CountryDetector;
import android.net.Uri;
import android.os.Process;
import android.os.UserHandle;
import android.os.UserManager;
import android.telecom.Log;
import android.telecom.PhoneAccountHandle;
import android.telephony.PhoneNumberUtils;

import java.io.FileNotFoundException;
import java.io.InputStream;
@@ -297,13 +293,17 @@ public class TelecomSystem {
        mIncomingCallNotifier = incomingCallNotifier;
        incomingCallNotifier.setCallsManagerProxy(new IncomingCallNotifier.CallsManagerProxy() {
            @Override
            public boolean hasCallsForOtherPhoneAccount(PhoneAccountHandle phoneAccountHandle) {
                return mCallsManager.hasCallsForOtherPhoneAccount(phoneAccountHandle);
            public boolean hasUnholdableCallsForOtherConnectionService(
                    PhoneAccountHandle phoneAccountHandle) {
                return mCallsManager.hasUnholdableCallsForOtherConnectionService(
                        phoneAccountHandle);
            }

            @Override
            public int getNumCallsForOtherPhoneAccount(PhoneAccountHandle phoneAccountHandle) {
                return mCallsManager.getNumCallsForOtherPhoneAccount(phoneAccountHandle);
            public int getNumUnholdableCallsForOtherConnectionService(
                    PhoneAccountHandle phoneAccountHandle) {
                return mCallsManager.getNumUnholdableCallsForOtherConnectionService(
                        phoneAccountHandle);
            }

            @Override
+4 −4
Original line number Diff line number Diff line
@@ -58,8 +58,8 @@ public class IncomingCallNotifier extends CallsManagerListenerBase {
     * Eliminates strict dependency between this class and CallsManager.
     */
    public interface CallsManagerProxy {
        boolean hasCallsForOtherPhoneAccount(PhoneAccountHandle phoneAccountHandle);
        int getNumCallsForOtherPhoneAccount(PhoneAccountHandle phoneAccountHandle);
        boolean hasUnholdableCallsForOtherConnectionService(PhoneAccountHandle phoneAccountHandle);
        int getNumUnholdableCallsForOtherConnectionService(PhoneAccountHandle phoneAccountHandle);
        Call getActiveCall();
    }

@@ -137,7 +137,7 @@ public class IncomingCallNotifier extends CallsManagerListenerBase {
                .findFirst();
        Call incomingCall = incomingCallOp.orElse(null);
        if (incomingCall != null && mCallsManagerProxy != null &&
                !mCallsManagerProxy.hasCallsForOtherPhoneAccount(
                !mCallsManagerProxy.hasUnholdableCallsForOtherConnectionService(
                        incomingCallOp.get().getTargetPhoneAccount())) {
            // If there is no calls in any other ConnectionService, we can rely on the
            // third-party app to display its own incoming call UI.
@@ -210,7 +210,7 @@ public class IncomingCallNotifier extends CallsManagerListenerBase {
        boolean isOngoingVideo = ongoingCall != null ?
                VideoProfile.isVideo(ongoingCall.getVideoState()) : false;
        int numOtherCalls = ongoingCall != null ?
                mCallsManagerProxy.getNumCallsForOtherPhoneAccount(
                mCallsManagerProxy.getNumUnholdableCallsForOtherConnectionService(
                        incomingCall.getTargetPhoneAccount()) : 1;

        // Build the "IncomingApp call from John Smith" message.
Loading