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

Commit ff708516 authored by Jack He's avatar Jack He Committed by android-build-merger
Browse files

Merge "[Script] Fixed assorted string usage issues" am: 5d8f7626

am: 84678552

Change-Id: Ia9df9165973e7ae5a6ffca6b7a499d083725758e
parents dc9e2340 84678552
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -571,7 +571,7 @@ public class AtPhonebook {

            // TODO(): Handle IRA commands. It's basically
            // a 7 bit ASCII character set.
            if (!name.equals("") && mCharacterSet.equals("GSM")) {
            if (!name.isEmpty() && mCharacterSet.equals("GSM")) {
                byte[] nameByte = GsmAlphabet.stringToGsm8BitPacked(name);
                if (nameByte == null) {
                    name = mContext.getString(R.string.unknownNumber);
+4 −3
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ package com.android.bluetooth.map;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Objects;

import android.content.ContentProviderClient;
import android.content.ContentResolver;
@@ -82,9 +83,9 @@ public class BluetoothMapAccountLoader {
                mPackageManager.queryIntentContentProviders(searchIntent, 0);
            if (resInfos != null ) {
                if(D) Log.d(TAG,"Found " + resInfos.size() + " application(s) with intent "
                        + searchIntent.getAction().toString());
                BluetoothMapUtils.TYPE msgType = (searchIntent.getAction().toString() ==
                        BluetoothMapContract.PROVIDER_INTERFACE_EMAIL) ?
                        + searchIntent.getAction());
                BluetoothMapUtils.TYPE msgType = (Objects.equals(searchIntent.getAction(),
                        BluetoothMapContract.PROVIDER_INTERFACE_EMAIL)) ?
                        BluetoothMapUtils.TYPE.EMAIL : BluetoothMapUtils.TYPE.IM;
                for (ResolveInfo rInfo : resInfos) {
                    if(D) Log.d(TAG,"ResolveInfo " + rInfo.toString());
+7 −6
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@ import android.net.Uri;
import android.util.Log;

import com.android.bluetooth.mapapi.BluetoothMapContract;
import java.util.Objects;

/**
 * Class to construct content observers for for email applications on the system.
@@ -100,7 +101,7 @@ public class BluetoothMapAppObserver{
            mFullList.put(app, newAccountList);
            for(BluetoothMapAccountItem newAcc: newAccountList){
                for(BluetoothMapAccountItem oldAcc: oldAccountList){
                    if(newAcc.getId() == oldAcc.getId()){
                    if(Objects.equals(newAcc.getId(), oldAcc.getId())){
                        // For each match remove from both removed and added lists
                        removedAccountList.remove(oldAcc);
                        addedAccountList.remove(newAcc);
@@ -235,17 +236,17 @@ public class BluetoothMapAppObserver{
                        if (resInfos != null ) {
                            if(D) Log.d(TAG,"Found " + resInfos.size()
                                    + " application(s) with intent "
                                    + searchIntent.getAction().toString());
                                    + searchIntent.getAction());
                            for (ResolveInfo rInfo : resInfos) {
                                if(rInfo != null) {
                                    // Find out if package contain Bluetooth MAP support
                                    if (packageName.equals(rInfo.providerInfo.packageName)) {
                                        resolveInfo = rInfo;
                                        if(searchIntent.getAction() ==
                                                BluetoothMapContract.PROVIDER_INTERFACE_EMAIL){
                                        if(Objects.equals(searchIntent.getAction(),
                                                BluetoothMapContract.PROVIDER_INTERFACE_EMAIL)){
                                            msgType = BluetoothMapUtils.TYPE.EMAIL;
                                        } else if (searchIntent.getAction() ==
                                                BluetoothMapContract.PROVIDER_INTERFACE_IM){
                                        } else if (Objects.equals(searchIntent.getAction(),
                                                BluetoothMapContract.PROVIDER_INTERFACE_IM)){
                                            msgType = BluetoothMapUtils.TYPE.IM;
                                        }
                                        break;
+15 −13
Original line number Diff line number Diff line
@@ -75,6 +75,7 @@ import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Objects;
import java.util.Set;

import javax.obex.ResponseCodes;
@@ -1117,62 +1118,62 @@ public class BluetoothMapContentObserver {
        /* This should have been a switch on the string, but it is not allowed in Java 1.6 */
        /* WARNING: Here we do pointer compare for the string to speed up things, that is.
         * HENCE: always use the EVENT_TYPE_"defines" */
        if(evt.eventType == EVENT_TYPE_NEW) {
        if(Objects.equals(evt.eventType, EVENT_TYPE_NEW)) {
            if(!sendEventNewMessage(eventFilter)) {
                if(D)Log.d(TAG, "Skip sending event of type: " + evt.eventType);
                return;
            }
        } else if(evt.eventType == EVENT_TYPE_DELETE) {
        } else if(Objects.equals(evt.eventType, EVENT_TYPE_DELETE)) {
            if(!sendEventMessageDeleted(eventFilter)) {
                if(D)Log.d(TAG, "Skip sending event of type: " + evt.eventType);
                return;
            }
        } else if(evt.eventType == EVENT_TYPE_REMOVED) {
        } else if(Objects.equals(evt.eventType, EVENT_TYPE_REMOVED)) {
            if(!sendEventMessageRemoved(eventFilter)) {
                if(D)Log.d(TAG, "Skip sending event of type: " + evt.eventType);
                return;
            }
        } else if(evt.eventType == EVENT_TYPE_SHIFT) {
        } else if(Objects.equals(evt.eventType, EVENT_TYPE_SHIFT)) {
            if(!sendEventMessageShift(eventFilter)) {
                if(D)Log.d(TAG, "Skip sending event of type: " + evt.eventType);
                return;
            }
        } else if(evt.eventType == EVENT_TYPE_DELEVERY_SUCCESS) {
        } else if(Objects.equals(evt.eventType, EVENT_TYPE_DELEVERY_SUCCESS)) {
            if(!sendEventDeliverySuccess(eventFilter)) {
                if(D)Log.d(TAG, "Skip sending event of type: " + evt.eventType);
                return;
            }
        } else if(evt.eventType == EVENT_TYPE_SENDING_SUCCESS) {
        } else if(Objects.equals(evt.eventType, EVENT_TYPE_SENDING_SUCCESS)) {
            if(!sendEventSendingSuccess(eventFilter)) {
                if(D)Log.d(TAG, "Skip sending event of type: " + evt.eventType);
                return;
            }
        } else if(evt.eventType == EVENT_TYPE_SENDING_FAILURE) {
        } else if(Objects.equals(evt.eventType, EVENT_TYPE_SENDING_FAILURE)) {
            if(!sendEventSendingFailed(eventFilter)) {
                if(D)Log.d(TAG, "Skip sending event of type: " + evt.eventType);
                return;
            }
        } else if(evt.eventType == EVENT_TYPE_DELIVERY_FAILURE) {
        } else if(Objects.equals(evt.eventType, EVENT_TYPE_DELIVERY_FAILURE)) {
            if(!sendEventDeliveryFailed(eventFilter)) {
                if(D)Log.d(TAG, "Skip sending event of type: " + evt.eventType);
                return;
            }
        } else if(evt.eventType == EVENT_TYPE_READ_STATUS) {
        } else if(Objects.equals(evt.eventType, EVENT_TYPE_READ_STATUS)) {
            if(!sendEventReadStatusChanged(eventFilter)) {
                if(D)Log.d(TAG, "Skip sending event of type: " + evt.eventType);
                return;
            }
        } else if(evt.eventType == EVENT_TYPE_CONVERSATION) {
        } else if(Objects.equals(evt.eventType, EVENT_TYPE_CONVERSATION)) {
            if(!sendEventConversationChanged(eventFilter)) {
                if(D)Log.d(TAG, "Skip sending event of type: " + evt.eventType);
                return;
            }
        } else if(evt.eventType == EVENT_TYPE_PRESENCE) {
        } else if(Objects.equals(evt.eventType, EVENT_TYPE_PRESENCE)) {
            if(!sendEventParticipantPresenceChanged(eventFilter)) {
                if(D)Log.d(TAG, "Skip sending event of type: " + evt.eventType);
                return;
            }
        } else if(evt.eventType == EVENT_TYPE_CHAT_STATE) {
        } else if(Objects.equals(evt.eventType, EVENT_TYPE_CHAT_STATE)) {
            if(!sendEventParticipantChatstateChanged(eventFilter)) {
                if(D)Log.d(TAG, "Skip sending event of type: " + evt.eventType);
                return;
@@ -1980,7 +1981,8 @@ public class BluetoothMapContentObserver {
                                    String currentPresenceStatus = contact
                                            .getPresenceStatus();
                                    if (contact.getPresenceAvailability() != presenceState
                                            || currentPresenceStatus != presenceStatus) {
                                            || !Objects.equals(currentPresenceStatus,
                                            presenceStatus)) {
                                        long lastOnline = c
                                                .getLong(cInfo.mContactColLastOnline);
                                        contact.setPresenceAvailability(presenceState);
+3 −4
Original line number Diff line number Diff line
@@ -446,10 +446,9 @@ public class BluetoothMapObexServer extends ServerRequestHandler {
                return ResponseCodes.OBEX_HTTP_OK;
            } else if (type.equals(TYPE_SET_MESSAGE_STATUS)) {
                if(V) {
                    Log.d(TAG,"TYPE_SET_MESSAGE_STATUS: " +
                              "StatusIndicator: " + appParams.getStatusIndicator()
                            + ", StatusValue: " + appParams.getStatusValue()
                            + ", ExtentedData: " + "" ); // TODO:   appParams.getExtendedImData());
                    Log.d(TAG, "TYPE_SET_MESSAGE_STATUS: " + "StatusIndicator: "
                            + appParams.getStatusIndicator() + ", StatusValue: "
                            + appParams.getStatusValue() + ", ExtentedData: "); // TODO:   appParams.getExtendedImData());
                }
                if (!isUserUnlocked()) {
                    Log.e(TAG, "Storage locked, " + type + " failed");
Loading