コード例 #1
0
 public void onPause() {
   synchronized (mPauseLock) {
     mPaused = true;
     // record screen off
     Map<String, String> currentTime = currentTime();
     logPhoneUsage(currentTime, ENDFLAG);
   }
 }
コード例 #2
0
 public void onResume() {
   synchronized (mPauseLock) {
     mPaused = false;
     mPauseLock.notifyAll();
     // record screen start
     Map<String, String> currentTime = currentTime();
     logPhoneUsage(currentTime, STARTFLAG);
   }
 }