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

Commit 541f54df authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Replaced Telephony logs, getOperatorAlpha, compareLoosely" am: fba93131 am: 56d293e0

Original change: https://android-review.googlesource.com/c/platform/packages/apps/Bluetooth/+/1768406

Change-Id: I6374d02d322565c718a5d4326fcb824d92133f0c
parents acaf29f5 56d293e0
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -1752,9 +1752,12 @@ public class HeadsetStateMachine extends StateMachine {
        String operatorName = null;
        ServiceState serviceState = mSystemInterface.getHeadsetPhoneState().getServiceState();
        if (serviceState != null) {
            operatorName = serviceState.getOperatorAlpha();
            operatorName = serviceState.getOperatorAlphaLong();
            if (TextUtils.isEmpty(operatorName)) {
                operatorName = serviceState.getOperatorAlphaShort();
            }
        if (mSystemInterface.isInCall() || operatorName == null || operatorName.equals("")) {
        }
        if (mSystemInterface.isInCall() || TextUtils.isEmpty(operatorName)) {
            // Get operator name suggested by Telecom
            operatorName = mSystemInterface.getNetworkOperator();
        }
+5 −2
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@ import android.provider.Telephony.Threads;
import android.telephony.PhoneNumberUtils;
import android.telephony.SubscriptionInfo;
import android.telephony.SubscriptionManager;
import android.telephony.TelephonyManager;
import android.util.ArraySet;
import android.util.Log;

@@ -66,6 +67,7 @@ class MapClientContent {
    String mPhoneNumber = null;
    private int mSubscriptionId = SubscriptionManager.INVALID_SUBSCRIPTION_ID;
    private SubscriptionManager mSubscriptionManager;
    private TelephonyManager mTelephonyManager;
    private HashMap<String, Uri> mHandleToUriMap = new HashMap<>();
    private HashMap<Uri, MessageStatus> mUriToHandleMap = new HashMap<>();

@@ -96,6 +98,7 @@ class MapClientContent {
        mResolver = mContext.getContentResolver();

        mSubscriptionManager = mContext.getSystemService(SubscriptionManager.class);
        mTelephonyManager = mContext.getSystemService(TelephonyManager.class);
        mSubscriptionManager
                .addSubscriptionInfoRecord(mDevice.getAddress(), Utils.getName(mDevice), 0,
                        SubscriptionManager.SUBSCRIPTION_TYPE_REMOTE_SIM);
@@ -458,8 +461,8 @@ class MapClientContent {
        if (messageContacts.isEmpty()) {
            return Telephony.Threads.COMMON_THREAD;
        } else if (messageContacts.size() > 1) {
            messageContacts.removeIf(number -> (PhoneNumberUtils.compareLoosely(number,
                    mPhoneNumber)));
            messageContacts.removeIf(number -> (PhoneNumberUtils.areSamePhoneNumber(number,
                    mPhoneNumber, mTelephonyManager.getNetworkCountryIso())));
        }

        logV("Contacts = " + messageContacts.toString());
+10 −10
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@
package com.android.bluetooth.util;

import android.content.res.Resources;
import android.telephony.Rlog;
import android.util.Log;
import android.util.SparseIntArray;

import com.android.internal.R;
@@ -145,11 +145,11 @@ public class GsmAlphabet {
        StringBuilder ret = new StringBuilder(lengthSeptets);

        if (languageTable < 0 || languageTable > sLanguageTables.length) {
            Rlog.w(TAG, "unknown language table " + languageTable + ", using default");
            Log.w(TAG, "unknown language table " + languageTable + ", using default");
            languageTable = 0;
        }
        if (shiftTable < 0 || shiftTable > sLanguageShiftTables.length) {
            Rlog.w(TAG, "unknown single shift table " + shiftTable + ", using default");
            Log.w(TAG, "unknown single shift table " + shiftTable + ", using default");
            shiftTable = 0;
        }

@@ -159,11 +159,11 @@ public class GsmAlphabet {
            String shiftTableToChar = sLanguageShiftTables[shiftTable];

            if (languageTableToChar.isEmpty()) {
                Rlog.w(TAG, "no language table for code " + languageTable + ", using default");
                Log.w(TAG, "no language table for code " + languageTable + ", using default");
                languageTableToChar = sLanguageTables[0];
            }
            if (shiftTableToChar.isEmpty()) {
                Rlog.w(TAG, "no single shift table for code " + shiftTable + ", using default");
                Log.w(TAG, "no single shift table for code " + shiftTable + ", using default");
                shiftTableToChar = sLanguageShiftTables[0];
            }

@@ -203,7 +203,7 @@ public class GsmAlphabet {
                }
            }
        } catch (RuntimeException ex) {
            Rlog.e(TAG, "Error GSM 7 bit packed: ", ex);
            Log.e(TAG, "Error GSM 7 bit packed: " + '\n' + Log.getStackTraceString(ex));
            return null;
        }

@@ -293,7 +293,7 @@ public class GsmAlphabet {
        for (int i = 0; i < sz; i++) {
            char c = s.charAt(i);
            if (c == GSM_EXTENDED_ESCAPE) {
                Rlog.w(TAG, "countGsmSeptets() string contains Escape character, skipping.");
                Log.w(TAG, "countGsmSeptets() string contains Escape character, skipping.");
                continue;
            }
            if (charToLanguageTable.get(c, -1) != -1) {
@@ -676,7 +676,7 @@ public class GsmAlphabet {
        int numTables = sLanguageTables.length;
        int numShiftTables = sLanguageShiftTables.length;
        if (numTables != numShiftTables) {
            Rlog.e(TAG, "Error: language tables array length " + numTables
            Log.e(TAG, "Error: language tables array length " + numTables
                    + " != shift tables array length " + numShiftTables);
        }

@@ -686,7 +686,7 @@ public class GsmAlphabet {

            int tableLen = table.length();
            if (tableLen != 0 && tableLen != 128) {
                Rlog.e(TAG, "Error: language tables index " + i
                Log.e(TAG, "Error: language tables index " + i
                        + " length " + tableLen + " (expected 128 or 0)");
            }

@@ -704,7 +704,7 @@ public class GsmAlphabet {

            int shiftTableLen = shiftTable.length();
            if (shiftTableLen != 0 && shiftTableLen != 128) {
                Rlog.e(TAG, "Error: language shift tables index " + i
                Log.e(TAG, "Error: language shift tables index " + i
                        + " length " + shiftTableLen + " (expected 128 or 0)");
            }