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

Commit 643d8f51 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 6424828 from 30434079 to rvc-release

Change-Id: I072592f792b8fc5199ab5e8a2966b0ee2e67be16
parents 2b83115e 30434079
Loading
Loading
Loading
Loading
+32 −2
Original line number Diff line number Diff line
@@ -16,11 +16,14 @@

package com.android.internal.telephony;

import android.Manifest;
import android.annotation.NonNull;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.ServiceConnection;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.os.AsyncResult;
import android.os.Handler;
import android.os.IBinder;
@@ -29,6 +32,7 @@ import android.os.RemoteCallback;
import android.os.RemoteException;
import android.telephony.CellBroadcastService;
import android.telephony.ICellBroadcastService;
import android.text.TextUtils;
import android.util.LocalLog;
import android.util.Log;
import android.util.Pair;
@@ -37,6 +41,7 @@ import com.android.internal.telephony.cdma.SmsMessage;

import java.io.FileDescriptor;
import java.io.PrintWriter;
import java.util.List;

/**
 * Manages a single binding to the CellBroadcastService from the platform. In mSIM cases callers
@@ -203,8 +208,33 @@ public class CellBroadcastServiceManager {

    /** Returns the package name of the cell broadcast service, or null if there is none. */
    private String getCellBroadcastServicePackage() {
        return mContext.getResources().getString(
                com.android.internal.R.string.cellbroadcast_default_package);
        PackageManager packageManager = mContext.getPackageManager();
        List<ResolveInfo> cbsPackages = packageManager.queryIntentServices(
                new Intent(CellBroadcastService.CELL_BROADCAST_SERVICE_INTERFACE),
                PackageManager.MATCH_SYSTEM_ONLY);
        if (cbsPackages.size() != 1) {
            Log.e(TAG, "getCellBroadcastServicePackageName: found " + cbsPackages.size()
                    + " CBS packages");
        }
        for (ResolveInfo info : cbsPackages) {
            if (info.serviceInfo == null) continue;
            String packageName = info.serviceInfo.packageName;
            if (!TextUtils.isEmpty(packageName)) {
                if (packageManager.checkPermission(Manifest.permission.READ_PRIVILEGED_PHONE_STATE,
                        packageName) == PackageManager.PERMISSION_GRANTED) {
                    Log.d(TAG, "getCellBroadcastServicePackageName: " + packageName);
                    return packageName;
                } else {
                    Log.e(TAG, "getCellBroadcastServicePackageName: " + packageName
                            + " does not have READ_PRIVILEGED_PHONE_STATE permission");
                }
            } else {
                Log.e(TAG, "getCellBroadcastServicePackageName: found a CBS package but "
                        + "packageName is null/empty");
            }
        }
        Log.e(TAG, "getCellBroadcastServicePackageName: package name not found");
        return null;
    }

    private class CellBroadcastServiceConnection implements ServiceConnection {
+2 −2
Original line number Diff line number Diff line
@@ -423,9 +423,9 @@ public class CellularNetworkService extends NetworkService {
                            .AccessTechnologySpecificInfo.EutranRegistrationInfo eutranInfo =
                                    regResult.accessTechnologySpecificInfo.eutranInfo();

                    isEndcAvailable = eutranInfo.nrIndicators.isDcNrRestricted;
                    isDcNrRestricted = eutranInfo.nrIndicators.isDcNrRestricted;
                    isNrAvailable = eutranInfo.nrIndicators.isNrAvailable;
                    isDcNrRestricted = eutranInfo.nrIndicators.isEndcAvailable;
                    isEndcAvailable = eutranInfo.nrIndicators.isEndcAvailable;
                    vopsInfo = convertHalLteVopsSupportInfo(
                            eutranInfo.lteVopsInfo.isVopsSupported,
                            eutranInfo.lteVopsInfo.isEmcBearerSupported);
+9 −1
Original line number Diff line number Diff line
@@ -4849,11 +4849,20 @@ public class DcTracker extends Handler {
                return false;
            }

            // Skip recovery if it can cause a call to drop
            if (mInVoiceCall && getRecoveryAction() > RECOVERY_ACTION_CLEANUP) {
                if (VDBG_STALL) log("skip data stall recovery as there is an active call");
                return false;
            }

            // Allow recovery if data is expected to work
            return mAttached.get() && isDataAllowed(null);
        }

        private void triggerRecovery() {
            // Updating the recovery start time early to avoid race when
            // the message is being processed in the Queue
            mTimeLastRecoveryStartMs = SystemClock.elapsedRealtime();
            sendMessage(obtainMessage(DctConstants.EVENT_DO_RECOVERY));
        }

@@ -4903,7 +4912,6 @@ public class DcTracker extends Handler {
                            + recoveryAction);
                }
                mSentSinceLastRecv = 0;
                mTimeLastRecoveryStartMs = SystemClock.elapsedRealtime();
            }
        }

+4 −3
Original line number Diff line number Diff line
@@ -530,7 +530,9 @@ public class UiccController extends Handler {
                    break;
                case EVENT_MULTI_SIM_CONFIG_CHANGED:
                    if (DBG) log("Received EVENT_MULTI_SIM_CONFIG_CHANGED");
                    onMultiSimConfigChanged();
                    int activeModemCount = (int) ((AsyncResult) msg.obj).result;
                    onMultiSimConfigChanged(activeModemCount);
                    break;
                default:
                    Rlog.e(LOG_TAG, " Unknown Event " + msg.what);
                    break;
@@ -538,10 +540,9 @@ public class UiccController extends Handler {
        }
    }

    private void onMultiSimConfigChanged() {
    private void onMultiSimConfigChanged(int newActiveModemCount) {
        int prevActiveModemCount = mCis.length;
        mCis = PhoneFactory.getCommandsInterfaces();
        int newActiveModemCount = mCis.length;

        logWithLocalLog("onMultiSimConfigChanged: prevActiveModemCount " + prevActiveModemCount
                + ", newActiveModemCount " + newActiveModemCount);