1 package com.android.phone.vvm.omtp.utils; 2 3 import android.content.Context; 4 import android.telecom.PhoneAccountHandle; 5 import android.telecom.TelecomManager; 6 7 import com.android.internal.util.IndentingPrintWriter; 8 import com.android.phone.vvm.omtp.OmtpVvmCarrierConfigHelper; 9 import com.android.phone.vvm.omtp.VvmLog; 10 11 import java.io.FileDescriptor; 12 import java.io.PrintWriter; 13 14 public class VvmDumpHandler { 15 16 public static void dump(Context context, FileDescriptor fd, PrintWriter writer, 17 String[] args) { 18 IndentingPrintWriter indentedWriter = new IndentingPrintWriter(writer, " "); 19 indentedWriter.println("******* OmtpVvm *******"); 20 indentedWriter.println("======= Configs ======="); 21 indentedWriter.increaseIndent(); 22 for (PhoneAccountHandle handle : TelecomManager.from(context) 23 .getCallCapablePhoneAccounts()) { 24 int subId = PhoneAccountHandleConverter.toSubId(handle); 25 OmtpVvmCarrierConfigHelper config = new OmtpVvmCarrierConfigHelper(context, subId); 26 indentedWriter.println(config.toString()); 27 } 28 indentedWriter.decreaseIndent(); 29 indentedWriter.println("======== Logs ========="); 30 VvmLog.dump(fd, indentedWriter, args); 31 } 32 } 33