1. Download our Official Android App: Forums for Android!

Apps How to dump log to file from GsmServiceStateTracker.java

Discussion in 'Android Development' started by AllanChao, May 6, 2016.

  1. AllanChao

    AllanChao Lurker
    Thread Starter
    Rank:
    None
    Points:
    15
    Posts:
    3
    Joined:
    May 6, 2016

    May 6, 2016
    3
    0
    15
    Male
    中和市
    Hi All,
    in the GsmServiceStateTracker.java, there is a dump function like following

    public void dump(FileDescriptor fd,PrintWriter pw,String[] args){
    pw.println("ServiceStateTracker:");
    pw.println(" mSS="+ mSS);
    pw.println(" mNewSS="+ mNewSS);
    pw.println(" mCellInfo="+ mCellInfo);
    pw.println(" mRestrictedState="+ mRestrictedState);
    pw.println(" mPollingContext="+ mPollingContext);
    pw.println(" mDesiredPowerState="+ mDesiredPowerState);
    pw.println(" mDontPollSignalStrength="+ mDontPollSignalStrength);
    pw.println(" mPendingRadioPowerOffAfterDataOff="+ mPendingRadioPowerOffAfterDataOff);
    pw.println(" mPendingRadioPowerOffAfterDataOffTag="+ mPendingRadioPowerOffAfterDataOffTag);
    }

    and i want to see these value when radio switch on
    so, does anyone know how to execute the dump function? thanks.
     

    Advertisement

  2. LV426

    LV426 I say we take off and nuke this place from orbit
    Moderator
    Rank:
     #11
    Points:
    1,988
    Posts:
    7,327
    Joined:
    Oct 16, 2015

    Oct 16, 2015
    7,327
    10,464
    1,988
    Male
    Software developer
    South West of England
    Are there any API javadocs for this class?

    The second parameter is the file you want to write to, which can be created like this

    Code (Text):
    1.  
    2.     File file =new File(your file name);
    3.     PrintWriter printWriter =newPrintWriter(file);
    4.  
    It's unclear what the other two parameters are for, but you could dig into the code a bit, and look at the super class of GsmServiceStateTracker, to see what the code is doing with these parameters.
     
  3. AllanChao

    AllanChao Lurker
    Thread Starter
    Rank:
    None
    Points:
    15
    Posts:
    3
    Joined:
    May 6, 2016

    May 6, 2016
    3
    0
    15
    Male
    中和市
    Thanks for your response,

    Does adb can dump these parameter?
     

Share This Page

Loading...