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

Commit d5be681c authored by Pengquan Meng's avatar Pengquan Meng
Browse files

Add dump permission check for UiccSmsController

Bug: 111855738
Test: atest CtsSecurityTestCases:ServicePermissionsTest
Change-Id: Id967ec56ebe3cdc5a671bcf985481f5d9565a3c5
parent 56de81a8
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -126,7 +126,7 @@ public class ProxyController {

        mUiccPhoneBookController = new UiccPhoneBookController(mPhones);
        mPhoneSubInfoController = new PhoneSubInfoController(mContext, mPhones);
        mUiccSmsController = new UiccSmsController();
        mUiccSmsController = new UiccSmsController(mContext);
        mSetRadioAccessFamilyStatus = new int[mPhones.length];
        mNewRadioAccessFamily = new int[mPhones.length];
        mOldRadioAccessFamily = new int[mPhones.length];
+11 −2
Original line number Diff line number Diff line
@@ -18,6 +18,8 @@

package com.android.internal.telephony;

import static com.android.internal.util.DumpUtils.checkDumpPermission;

import android.annotation.Nullable;
import android.app.ActivityThread;
import android.app.PendingIntent;
@@ -42,9 +44,12 @@ import java.util.List;
 * Implements the ISmsImplBase interface used in the SmsManager API.
 */
public class UiccSmsController extends ISmsImplBase {
    static final String LOG_TAG = "RIL_UiccSmsController";
    static final String LOG_TAG = "UiccSmsController";

    private final Context mContext;

    protected UiccSmsController() {
    protected UiccSmsController(Context context) {
        mContext = context;
        if (ServiceManager.getService("isms") == null) {
            ServiceManager.addService("isms", this);
        }
@@ -393,6 +398,10 @@ public class UiccSmsController extends ISmsImplBase {

    @Override
    protected void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
        if (!checkDumpPermission(mContext, LOG_TAG, pw)) {
            return;
        }

        IndentingPrintWriter indentingPW =
                new IndentingPrintWriter(pw, "    " /* singleIndent */);
        for (Phone phone : PhoneFactory.getPhones()) {