am e42325c7: Merge "Fix incorrect VPN time" into klp-dev

* commit 'e42325c765fb4ec3a03d9de7eeaa0ed435a9f7b6':
  Fix incorrect VPN time
This commit is contained in:
Vinit Deshapnde
2013-10-02 12:26:30 -07:00
committed by Android Git Automerger
2 changed files with 4 additions and 1 deletions

View File

@@ -147,7 +147,7 @@ public class ManageDialog extends AlertActivity implements
mHandler.removeMessages(0);
if (!isFinishing()) {
if (mConfig.startTime != 0) {
if (mConfig.startTime != -1) {
long seconds = (SystemClock.elapsedRealtime() - mConfig.startTime) / 1000;
mDuration.setText(String.format("%02d:%02d:%02d",
seconds / 3600, seconds / 60 % 60, seconds % 60));

View File

@@ -1096,6 +1096,9 @@ public class Vpn extends BaseNetworkStateTracker {
// Here is the last step and it must be done synchronously.
synchronized (Vpn.this) {
// Set the start time
mConfig.startTime = SystemClock.elapsedRealtime();
// Check if the thread is interrupted while we are waiting.
checkpoint(false);