2011-06-29 9 views
66

में सक्रिय लंबित इंटेंटेंट की सूची प्राप्त करें I डिबग उद्देश्य के लिए डिवाइस में सक्रिय PendingIntent एस की एक सूची देखने का कोई तरीका है?AlarmManager

मैं AlarmManager के साथ काम करना शुरू कर रहा हूं और मुझे यह देखना अच्छा लगता है कि मेरे PendingIntent एस सही तरीके से बनाए गए हैं और हटा दिए गए हैं या नहीं।

यह देखना भी अच्छा होगा कि अन्य PendingIntent एस क्या हैं, यह देखने के लिए जिज्ञासा है कि कुछ ऐप कुछ "अतिरिक्त काम" कर रहा है या नहीं।

उत्तर

145
adb shell dumpsys alarm > dump.txt 

dump.txt:

Current Alarm Manager state: 

    Realtime wakeup (now=1309361618777): 
    RTC_WAKEUP #5: Alarm{4822f618 type 0 com.google.android.gsf} 
    type=0 when=1309882326582 repeatInterval=522747000 count=0 
    operation=PendingIntent{47dd3740: PendingIntentRecord{4822aeb8 com.google.android.gsf broadcastIntent}} 
    ... 
    RTC#5: Alarm{4810f9d8 type 1 com.tmobile.selfhelp} 
    type=1 when=1309445979715 repeatInterval=86400000 count=1 
    operation=PendingIntent{4815a5c8: PendingIntentRecord{4810f960 com.tmobile.selfhelp startService}} 
    RTC#4: Alarm{4810f668 type 1 com.tmobile.selfhelp} 
    type=1 when=1309445959620 repeatInterval=86400000 count=1 
    operation=PendingIntent{480996e8: PendingIntentRecord{480214a0 com.tmobile.selfhelp broadcastIntent}} 
    ... 

    Elapsed realtime wakeup (now=2110632): 
    ELAPSED_WAKEUP #5: Alarm{481c24e0 type 2 com.google.android.apps.maps} 
    type=2 when=2147485512925 repeatInterval=0 count=0 
    operation=PendingIntent{47d1d3a8: PendingIntentRecord{481a2600 com.google.android.apps.maps broadcastIntent}}  
    ... 
    ELAPSED #1: Alarm{4829ce98 type 3 android} 
    type=3 when=2512653 repeatInterval=0 count=0 
    operation=PendingIntent{47eabda8: PendingIntentRecord{47f20250 android broadcastIntent}} 
    ELAPSED #0: Alarm{480f0198 type 3 com.mixzing.basic} 
    type=3 when=2439998 repeatInterval=0 count=0 
    operation=PendingIntent{48100dd8: PendingIntentRecord{480ff5a0 com.mixzing.basic broadcastIntent}} 

    Broadcast ref count: 0 

    Alarm Stats: 
    com.google.android.location 
    3ms running, 1 wakeups 
    1 alarms: act=com.google.android.location.ALARM_WAKEUP flg=0x4 
    com.google.android.gsf 
    274ms running, 4 wakeups 
    1 alarms: flg=0x4 
    1 alarms: act=com.google.android.intent.action.GTALK_RECONNECT flg=0x4 
    2 alarms: act=com.google.android.intent.action.GTALK_HEARTBEAT flg=0x4 
... 
------------------------------------------------------------------------------- 
+1

ओह, यह पता चला है कि एक है। 'Dumpsys अलार्म 'का उपयोग करने का प्रयास करें। मैंने जवाब अपडेट कर लिया है। – inazaruk

+0

कूल धन्यवाद। – BrainCrash

+2

बस चेक किया गया है, और यह पुष्टि कर सकता है कि इस डिवाइस को तब तक करना संभव नहीं है जब तक कि आपके पास रूट नहीं है "अनुमति अस्वीकार: Parm = 16910, uid = 10120" –

2

adb shell dumpsys अलार्म> dump.txt जाने का रास्ता है और आप उस के लिए रूट अनुमति की जरूरत नहीं है। लेकिन आप ऊपर से क्या प्राप्त कर सकते हैं समझने के लिए बहुत भ्रमित हो सकता है। यह समझने के लिए कि पूरी तरह डंप पूरी तरह से आपको मॉर्फेटिक के उत्तर here की जांच करनी चाहिए।

संबंधित मुद्दे