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

Commit 0a9ad5e0 authored by James.cf Lin's avatar James.cf Lin
Browse files

Add log to check whetner the IMPU is null or not

Bug: 188367356
Test: atest ImsServiceTest
Merged-In: I227a8c8c0986c422c7d99f6d472d1e1adf97eeaa
Change-Id: I2118c6d98d7b98e49ff06e19cbba7319e5ee27a1
parent 7df39d79
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -59,17 +59,23 @@ class PublishUtils {
        String[] impus = telephonyManager.getIsimImpu();

        if (TextUtils.isEmpty(domain) || impus == null) {
            Log.d(LOG_TAG, "getContactUriFromIsim: domain is null=" + TextUtils.isEmpty(domain));
            Log.d(LOG_TAG, "getContactUriFromIsim: impu is null=" +
                    ((impus == null || impus.length == 0) ? "true" : "false"));
            return null;
        }

        for (String impu : impus) {
            if (TextUtils.isEmpty(impu)) continue;
            Uri impuUri = Uri.parse(impu);
            if (SCHEME_SIP.equals(impuUri.getScheme()) &&
                    impuUri.getSchemeSpecificPart().endsWith(domain)) {
            String scheme = impuUri.getScheme();
            String schemeSpecificPart = impuUri.getSchemeSpecificPart();
            if (SCHEME_SIP.equals(scheme) && !TextUtils.isEmpty(schemeSpecificPart) &&
                    schemeSpecificPart.endsWith(domain)) {
                return impuUri;
            }
        }
        Log.d(LOG_TAG, "getContactUriFromIsim: there is no impu matching the domain");
        return null;
    }