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

Commit 6d905015 authored by Pengquan Meng's avatar Pengquan Meng Committed by Gerrit Code Review
Browse files

Merge "Add dump permission check for UiccSmsController"

parents 4a56a5cb d5be681c
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -126,7 +126,7 @@ public class ProxyController {


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


package com.android.internal.telephony;
package com.android.internal.telephony;


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

import android.annotation.Nullable;
import android.annotation.Nullable;
import android.app.ActivityThread;
import android.app.ActivityThread;
import android.app.PendingIntent;
import android.app.PendingIntent;
@@ -42,9 +44,12 @@ import java.util.List;
 * Implements the ISmsImplBase interface used in the SmsManager API.
 * Implements the ISmsImplBase interface used in the SmsManager API.
 */
 */
public class UiccSmsController extends ISmsImplBase {
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) {
        if (ServiceManager.getService("isms") == null) {
            ServiceManager.addService("isms", this);
            ServiceManager.addService("isms", this);
        }
        }
@@ -393,6 +398,10 @@ public class UiccSmsController extends ISmsImplBase {


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

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