public void onPause() { synchronized (mPauseLock) { mPaused = true; // record screen off Map<String, String> currentTime = currentTime(); logPhoneUsage(currentTime, ENDFLAG); } }
public void onResume() { synchronized (mPauseLock) { mPaused = false; mPauseLock.notifyAll(); // record screen start Map<String, String> currentTime = currentTime(); logPhoneUsage(currentTime, STARTFLAG); } }