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

Commit 7a9b640e authored by shuoq's avatar shuoq
Browse files

Add SharedPreference information in TelephonyDebugService dumpsys

Test: Mannual
Bug: 32342371
Change-Id: Ic34812b8a562a8aa3d26ab19e97cd9e4b9364d6d
parent f5ff6bae
Loading
Loading
Loading
Loading
+20 −1
Original line number Original line Diff line number Diff line
@@ -19,10 +19,12 @@ package com.android.internal.telephony;
import android.annotation.Nullable;
import android.annotation.Nullable;
import android.content.ComponentName;
import android.content.ComponentName;
import android.content.Context;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager;
import android.net.LocalServerSocket;
import android.net.LocalServerSocket;
import android.os.Looper;
import android.os.Looper;
import android.os.ServiceManager;
import android.os.ServiceManager;
import android.preference.PreferenceManager;
import android.provider.Settings;
import android.provider.Settings;
import android.provider.Settings.SettingNotFoundException;
import android.provider.Settings.SettingNotFoundException;
import android.telephony.Rlog;
import android.telephony.Rlog;
@@ -45,6 +47,7 @@ import com.android.internal.util.IndentingPrintWriter;
import java.io.FileDescriptor;
import java.io.FileDescriptor;
import java.io.PrintWriter;
import java.io.PrintWriter;
import java.util.HashMap;
import java.util.HashMap;
import java.util.Map;


/**
/**
 * {@hide}
 * {@hide}
@@ -98,7 +101,6 @@ public class PhoneFactory {
        synchronized (sLockProxyPhones) {
        synchronized (sLockProxyPhones) {
            if (!sMadeDefaults) {
            if (!sMadeDefaults) {
                sContext = context;
                sContext = context;

                // create the telephony device controller.
                // create the telephony device controller.
                TelephonyDevController.create();
                TelephonyDevController.create();


@@ -489,5 +491,22 @@ public class PhoneFactory {
            pw.flush();
            pw.flush();
        }
        }
        pw.decreaseIndent();
        pw.decreaseIndent();
        pw.println("++++++++++++++++++++++++++++++++");

        pw.println("SharedPreferences:");
        pw.increaseIndent();
        try {
            if (sContext != null) {
                SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(sContext);
                Map spValues = sp.getAll();
                for (Object key : spValues.keySet()) {
                    pw.println(key + " : " + spValues.get(key));
                }
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        pw.flush();
        pw.decreaseIndent();
    }
    }
}
}