diff options
author | Dianne Hackborn <hackbod@google.com> | 2010-10-07 07:15:57 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2010-10-07 07:15:57 -0700 |
commit | e89bf50261902bf263887923bf95595ec8eae069 (patch) | |
tree | e96e6b5c332f8831f4e7b6586f918b39b8377730 /services | |
parent | f960718c1c02186746873ec4a669028bb8ea9d94 (diff) | |
parent | ef083ec008a3ec69180340912e7f0137472c97d9 (diff) | |
download | frameworks_base-e89bf50261902bf263887923bf95595ec8eae069.zip frameworks_base-e89bf50261902bf263887923bf95595ec8eae069.tar.gz frameworks_base-e89bf50261902bf263887923bf95595ec8eae069.tar.bz2 |
am ef083ec0: Merge "Work on issue #3062691: GPS enable bypass via com.android.settings.widget.SettingsAppWidgetProvider" into gingerbread
Merge commit 'ef083ec008a3ec69180340912e7f0137472c97d9' into gingerbread-plus-aosp
* commit 'ef083ec008a3ec69180340912e7f0137472c97d9':
Work on issue #3062691: GPS enable bypass via com.android.settings.widget.SettingsAppWidgetProvider
Diffstat (limited to 'services')
-rw-r--r-- | services/java/com/android/server/AlarmManagerService.java | 27 | ||||
-rw-r--r-- | services/java/com/android/server/am/BroadcastRecord.java | 4 |
2 files changed, 18 insertions, 13 deletions
diff --git a/services/java/com/android/server/AlarmManagerService.java b/services/java/com/android/server/AlarmManagerService.java index e088417..4e2f1e3 100644 --- a/services/java/com/android/server/AlarmManagerService.java +++ b/services/java/com/android/server/AlarmManagerService.java @@ -38,9 +38,11 @@ import android.text.TextUtils; import android.text.format.Time; import android.util.EventLog; import android.util.Slog; +import android.util.TimeUtils; import java.io.FileDescriptor; import java.io.PrintWriter; +import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Calendar; import java.util.Collections; @@ -456,25 +458,28 @@ class AlarmManagerService extends IAlarmManager.Stub { synchronized (mLock) { pw.println("Current Alarm Manager state:"); if (mRtcWakeupAlarms.size() > 0 || mRtcAlarms.size() > 0) { + final long now = System.currentTimeMillis(); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); pw.println(" "); pw.print(" Realtime wakeup (now="); - pw.print(System.currentTimeMillis()); pw.println("):"); + pw.print(sdf.format(new Date(now))); pw.println("):"); if (mRtcWakeupAlarms.size() > 0) { - dumpAlarmList(pw, mRtcWakeupAlarms, " ", "RTC_WAKEUP"); + dumpAlarmList(pw, mRtcWakeupAlarms, " ", "RTC_WAKEUP", now); } if (mRtcAlarms.size() > 0) { - dumpAlarmList(pw, mRtcAlarms, " ", "RTC"); + dumpAlarmList(pw, mRtcAlarms, " ", "RTC", now); } } if (mElapsedRealtimeWakeupAlarms.size() > 0 || mElapsedRealtimeAlarms.size() > 0) { + final long now = SystemClock.elapsedRealtime(); pw.println(" "); pw.print(" Elapsed realtime wakeup (now="); - pw.print(SystemClock.elapsedRealtime()); pw.println("):"); + TimeUtils.formatDuration(now, pw); pw.println("):"); if (mElapsedRealtimeWakeupAlarms.size() > 0) { - dumpAlarmList(pw, mElapsedRealtimeWakeupAlarms, " ", "ELAPSED_WAKEUP"); + dumpAlarmList(pw, mElapsedRealtimeWakeupAlarms, " ", "ELAPSED_WAKEUP", now); } if (mElapsedRealtimeAlarms.size() > 0) { - dumpAlarmList(pw, mElapsedRealtimeAlarms, " ", "ELAPSED"); + dumpAlarmList(pw, mElapsedRealtimeAlarms, " ", "ELAPSED", now); } } @@ -499,12 +504,13 @@ class AlarmManagerService extends IAlarmManager.Stub { } } - private static final void dumpAlarmList(PrintWriter pw, ArrayList<Alarm> list, String prefix, String label) { + private static final void dumpAlarmList(PrintWriter pw, ArrayList<Alarm> list, + String prefix, String label, long now) { for (int i=list.size()-1; i>=0; i--) { Alarm a = list.get(i); pw.print(prefix); pw.print(label); pw.print(" #"); pw.print(i); pw.print(": "); pw.println(a); - a.dump(pw, prefix + " "); + a.dump(pw, prefix + " ", now); } } @@ -619,10 +625,9 @@ class AlarmManagerService extends IAlarmManager.Stub { return sb.toString(); } - public void dump(PrintWriter pw, String prefix) - { + public void dump(PrintWriter pw, String prefix, long now) { pw.print(prefix); pw.print("type="); pw.print(type); - pw.print(" when="); pw.print(when); + pw.print(" when="); TimeUtils.formatDuration(when, now, pw); pw.print(" repeatInterval="); pw.print(repeatInterval); pw.print(" count="); pw.println(count); pw.print(prefix); pw.print("operation="); pw.println(operation); diff --git a/services/java/com/android/server/am/BroadcastRecord.java b/services/java/com/android/server/am/BroadcastRecord.java index bac21b1..b268efa 100644 --- a/services/java/com/android/server/am/BroadcastRecord.java +++ b/services/java/com/android/server/am/BroadcastRecord.java @@ -84,8 +84,8 @@ class BroadcastRecord extends Binder { pw.print(prefix); pw.print("extras: "); pw.println(bundle.toString()); } } - pw.print(prefix); pw.print("caller="); pw.print(callerPackage); pw.println(" "); - pw.println(callerApp != null ? callerApp.toShortString() : "null"); + pw.print(prefix); pw.print("caller="); pw.print(callerPackage); pw.print(" "); + pw.print(callerApp != null ? callerApp.toShortString() : "null"); pw.print(" pid="); pw.print(callingPid); pw.print(" uid="); pw.println(callingUid); if (requiredPermission != null) { |