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

Commit 0835bc38 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 6557338 from dd284ae8 to rvc-release

Change-Id: Ief8f73ec79e7950f6454860b5fe7e16e63d73191
parents 4385c16b dd284ae8
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -61,6 +61,7 @@ java_library {
        ":framework-telephony-common-shared-srcs",
        ":net-utils-telephony-common-srcs",
        ":statslog-telephony-java-gen",
        ":statslog-cellbroadcast-java-gen",
        "src/java/**/I*.aidl",
        "src/java/**/*.logtags",
    ],
+34 −9
Original line number Diff line number Diff line
@@ -37,6 +37,7 @@ import android.util.LocalLog;
import android.util.Log;
import android.util.Pair;

import com.android.cellbroadcastservice.CellBroadcastStatsLog;
import com.android.internal.telephony.cdma.SmsMessage;

import java.io.FileDescriptor;
@@ -146,7 +147,11 @@ public class CellBroadcastServiceManager {
                        return;
                    }
                    if (sServiceConnection.mService == null) {
                        Log.d(TAG, "No connection to CB module, ignoring message.");
                        final String errorMessage = "sServiceConnection.mService is null, ignoring message.";
                        Log.d(TAG, errorMessage);
                        CellBroadcastStatsLog.write(CellBroadcastStatsLog.CB_MESSAGE_ERROR,
                                CellBroadcastStatsLog.CELL_BROADCAST_MESSAGE_ERROR__TYPE__NO_CONNECTION_TO_CB_SERVICE,
                                errorMessage);
                        return;
                    }
                    try {
@@ -155,15 +160,24 @@ public class CellBroadcastServiceManager {
                                        sServiceConnection.mService);
                        if (msg.what == EVENT_NEW_GSM_SMS_CB) {
                            mLocalLog.log("GSM SMS CB for phone " + mPhone.getPhoneId());
                            CellBroadcastStatsLog.write(CellBroadcastStatsLog.CB_MESSAGE_REPORTED,
                                    CellBroadcastStatsLog.CELL_BROADCAST_MESSAGE_REPORTED__TYPE__GSM,
                                    CellBroadcastStatsLog.CELL_BROADCAST_MESSAGE_REPORTED__SOURCE__FRAMEWORK);
                            cellBroadcastService.handleGsmCellBroadcastSms(mPhone.getPhoneId(),
                                    (byte[]) ((AsyncResult) msg.obj).result);
                        } else if (msg.what == EVENT_NEW_CDMA_SMS_CB) {
                            mLocalLog.log("CDMA SMS CB for phone " + mPhone.getPhoneId());
                            SmsMessage sms = (SmsMessage) msg.obj;
                            CellBroadcastStatsLog.write(CellBroadcastStatsLog.CB_MESSAGE_REPORTED,
                                    CellBroadcastStatsLog.CELL_BROADCAST_MESSAGE_REPORTED__TYPE__CDMA,
                                    CellBroadcastStatsLog.CELL_BROADCAST_MESSAGE_REPORTED__SOURCE__FRAMEWORK);
                            cellBroadcastService.handleCdmaCellBroadcastSms(mPhone.getPhoneId(),
                                    sms.getEnvelopeBearerData(), sms.getEnvelopeServiceCategory());
                        } else if (msg.what == EVENT_NEW_CDMA_SCP_MESSAGE) {
                            mLocalLog.log("CDMA SCP message for phone " + mPhone.getPhoneId());
                            CellBroadcastStatsLog.write(CellBroadcastStatsLog.CB_MESSAGE_REPORTED,
                                    CellBroadcastStatsLog.CELL_BROADCAST_MESSAGE_REPORTED__TYPE__CDMA_SPC,
                                    CellBroadcastStatsLog.CELL_BROADCAST_MESSAGE_REPORTED__SOURCE__FRAMEWORK);
                            Pair<SmsMessage, RemoteCallback> smsAndCallback =
                                    (Pair<SmsMessage, RemoteCallback>) msg.obj;
                            SmsMessage sms = smsAndCallback.first;
@@ -174,10 +188,13 @@ public class CellBroadcastServiceManager {
                                    callback);
                        }
                    } catch (RemoteException e) {
                        Log.e(TAG, "Failed to connect to default app: "
                                + mCellBroadcastServicePackage + " err: " + e.toString());
                        mLocalLog.log("Failed to connect to default app: "
                                + mCellBroadcastServicePackage + " err: " + e.toString());
                        final String errorMessage = "Failed to connect to default app: "
                                + mCellBroadcastServicePackage + " err: " + e.toString();
                        Log.e(TAG, errorMessage);
                        mLocalLog.log(errorMessage);
                        CellBroadcastStatsLog.write(CellBroadcastStatsLog.CB_MESSAGE_ERROR,
                                CellBroadcastStatsLog.CELL_BROADCAST_MESSAGE_ERROR__TYPE__NO_CONNECTION_TO_CB_SERVICE,
                                errorMessage);
                        mContext.unbindService(sServiceConnection);
                        sServiceConnection = null;
                    }
@@ -191,8 +208,12 @@ public class CellBroadcastServiceManager {
                        Context.BIND_AUTO_CREATE);
                Log.d(TAG, "serviceWasBound=" + serviceWasBound);
                if (!serviceWasBound) {
                    Log.e(TAG, "Unable to bind to service");
                    mLocalLog.log("Unable to bind to service");
                    final String errorMessage = "Unable to bind to service";
                    Log.e(TAG, errorMessage);
                    mLocalLog.log(errorMessage);
                    CellBroadcastStatsLog.write(CellBroadcastStatsLog.CB_MESSAGE_ERROR,
                            CellBroadcastStatsLog.CELL_BROADCAST_MESSAGE_ERROR__TYPE__NO_CONNECTION_TO_CB_SERVICE,
                            errorMessage);
                    return;
                }
            } else {
@@ -201,8 +222,12 @@ public class CellBroadcastServiceManager {
            mPhone.mCi.setOnNewGsmBroadcastSms(mModuleCellBroadcastHandler, EVENT_NEW_GSM_SMS_CB,
                    null);
        } else {
            Log.e(TAG, "Unable to bind service; no cell broadcast service found");
            mLocalLog.log("Unable to bind service; no cell broadcast service found");
            final String errorMessage = "Unable to bind service; no cell broadcast service found";
            Log.e(TAG, errorMessage);
            mLocalLog.log(errorMessage);
            CellBroadcastStatsLog.write(CellBroadcastStatsLog.CB_MESSAGE_ERROR,
                    CellBroadcastStatsLog.CELL_BROADCAST_MESSAGE_ERROR__TYPE__NO_CONNECTION_TO_CB_SERVICE,
                    errorMessage);
        }
    }

+1 −1
Original line number Diff line number Diff line
@@ -1109,7 +1109,7 @@ public abstract class InboundSmsHandler extends StateMachine {
            mContext,
            0,
            new Intent(ACTION_OPEN_SMS_APP),
            PendingIntent.FLAG_ONE_SHOT);
                PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_IMMUTABLE);
        Notification.Builder mBuilder = new Notification.Builder(mContext)
                .setSmallIcon(com.android.internal.R.drawable.sym_action_chat)
                .setAutoCancel(true)
+3 −2
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@ import android.telephony.Annotation;
import android.telephony.CarrierConfigManager;
import android.telephony.NetworkRegistrationInfo;
import android.telephony.PhoneStateListener;
import android.telephony.RadioAccessFamily;
import android.telephony.ServiceState;
import android.telephony.SubscriptionManager;
import android.telephony.TelephonyDisplayInfo;
@@ -357,8 +358,8 @@ public class NetworkTypeController extends StateMachine {

    private @Annotation.OverrideNetworkType int getNrDisplayType() {
        // Don't show 5G icon if preferred network type does not include 5G
        if ((mPhone.getCachedPreferredNetworkType() & TelephonyManager.NETWORK_TYPE_BITMASK_NR)
                == 0) {
        if ((RadioAccessFamily.getRafFromNetworkType(mPhone.getCachedPreferredNetworkType())
                & TelephonyManager.NETWORK_TYPE_BITMASK_NR) == 0) {
            return TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NONE;
        }
        // Icon display keys in order of priority
+1 −1
Original line number Diff line number Diff line
@@ -88,7 +88,7 @@ public class NetworkTypeControllerTest extends TelephonyTest {
        broadcastCarrierConfigs();

        replaceInstance(Handler.class, "mLooper", mDisplayInfoController, Looper.myLooper());
        doReturn((int) TelephonyManager.NETWORK_TYPE_BITMASK_NR).when(mPhone)
        doReturn((int) TelephonyManager.NETWORK_MODE_NR_LTE_CDMA_EVDO_GSM_WCDMA).when(mPhone)
                .getCachedPreferredNetworkType();
        mNetworkTypeController = new NetworkTypeController(mPhone, mDisplayInfoController);
    }