Loading core/java/android/app/ActivityThread.java +14 −0 Original line number Diff line number Diff line Loading @@ -1781,6 +1781,17 @@ public final class ActivityThread { performNewIntents(data.token, data.intents); } private static final ThreadLocal<Intent> sCurrentBroadcastIntent = new ThreadLocal<Intent>(); /** * Return the Intent that's currently being handled by a * BroadcastReceiver on this thread, or null if none. * @hide */ public static Intent getIntentBeingBroadcast() { return sCurrentBroadcastIntent.get(); } private final void handleReceiver(ReceiverData data) { // If we are getting ready to gc after going to the background, well // we are back active so skip it. Loading Loading @@ -1820,6 +1831,7 @@ public final class ActivityThread { + ", dir=" + packageInfo.getAppDir()); ContextImpl context = (ContextImpl)app.getBaseContext(); sCurrentBroadcastIntent.set(data.intent); receiver.setPendingResult(data); receiver.onReceive(context.getReceiverRestrictedContext(), data.intent); Loading @@ -1832,6 +1844,8 @@ public final class ActivityThread { "Unable to start receiver " + component + ": " + e.toString(), e); } } finally { sCurrentBroadcastIntent.set(null); } if (receiver.getPendingResult() != null) { Loading core/java/android/os/StrictMode.java +17 −0 Original line number Diff line number Diff line Loading @@ -17,7 +17,9 @@ package android.os; import android.animation.ValueAnimator; import android.app.ActivityManagerNative; import android.app.ActivityThread; import android.app.ApplicationErrorReport; import android.content.Intent; import android.util.Log; import android.util.Printer; Loading Loading @@ -1204,6 +1206,12 @@ public final class StrictMode { */ public long violationUptimeMillis; /** * The action of the Intent being broadcast to somebody's onReceive * on this thread right now, or null. */ public String broadcastIntentAction; /** * Create an uninitialized instance of ViolationInfo */ Loading @@ -1220,6 +1228,10 @@ public final class StrictMode { violationUptimeMillis = SystemClock.uptimeMillis(); this.policy = policy; this.numAnimationsRunning = ValueAnimator.getCurrentAnimationsCount(); Intent broadcastIntent = ActivityThread.getIntentBeingBroadcast(); if (broadcastIntent != null) { broadcastIntentAction = broadcastIntent.getAction(); } } /** Loading Loading @@ -1247,6 +1259,7 @@ public final class StrictMode { violationNumThisLoop = in.readInt(); numAnimationsRunning = in.readInt(); violationUptimeMillis = in.readLong(); broadcastIntentAction = in.readString(); } /** Loading @@ -1259,6 +1272,7 @@ public final class StrictMode { dest.writeInt(violationNumThisLoop); dest.writeInt(numAnimationsRunning); dest.writeLong(violationUptimeMillis); dest.writeString(broadcastIntentAction); } Loading @@ -1278,6 +1292,9 @@ public final class StrictMode { pw.println(prefix + "numAnimationsRunning: " + numAnimationsRunning); } pw.println(prefix + "violationUptimeMillis: " + violationUptimeMillis); if (broadcastIntentAction != null) { pw.println(prefix + "broadcastIntentAction: " + broadcastIntentAction); } } } Loading services/java/com/android/server/am/ActivityManagerService.java +3 −0 Original line number Diff line number Diff line Loading @@ -6679,6 +6679,9 @@ public final class ActivityManagerService extends ActivityManagerNative if (info.numAnimationsRunning != 0) { sb.append("Animations-Running: ").append(info.numAnimationsRunning).append("\n"); } if (info.broadcastIntentAction != null) { sb.append("Broadcast-Intent-Action: ").append(info.broadcastIntentAction).append("\n"); } if (info != null && info.durationMillis != -1) { sb.append("Duration-Millis: ").append(info.durationMillis).append("\n"); } Loading Loading
core/java/android/app/ActivityThread.java +14 −0 Original line number Diff line number Diff line Loading @@ -1781,6 +1781,17 @@ public final class ActivityThread { performNewIntents(data.token, data.intents); } private static final ThreadLocal<Intent> sCurrentBroadcastIntent = new ThreadLocal<Intent>(); /** * Return the Intent that's currently being handled by a * BroadcastReceiver on this thread, or null if none. * @hide */ public static Intent getIntentBeingBroadcast() { return sCurrentBroadcastIntent.get(); } private final void handleReceiver(ReceiverData data) { // If we are getting ready to gc after going to the background, well // we are back active so skip it. Loading Loading @@ -1820,6 +1831,7 @@ public final class ActivityThread { + ", dir=" + packageInfo.getAppDir()); ContextImpl context = (ContextImpl)app.getBaseContext(); sCurrentBroadcastIntent.set(data.intent); receiver.setPendingResult(data); receiver.onReceive(context.getReceiverRestrictedContext(), data.intent); Loading @@ -1832,6 +1844,8 @@ public final class ActivityThread { "Unable to start receiver " + component + ": " + e.toString(), e); } } finally { sCurrentBroadcastIntent.set(null); } if (receiver.getPendingResult() != null) { Loading
core/java/android/os/StrictMode.java +17 −0 Original line number Diff line number Diff line Loading @@ -17,7 +17,9 @@ package android.os; import android.animation.ValueAnimator; import android.app.ActivityManagerNative; import android.app.ActivityThread; import android.app.ApplicationErrorReport; import android.content.Intent; import android.util.Log; import android.util.Printer; Loading Loading @@ -1204,6 +1206,12 @@ public final class StrictMode { */ public long violationUptimeMillis; /** * The action of the Intent being broadcast to somebody's onReceive * on this thread right now, or null. */ public String broadcastIntentAction; /** * Create an uninitialized instance of ViolationInfo */ Loading @@ -1220,6 +1228,10 @@ public final class StrictMode { violationUptimeMillis = SystemClock.uptimeMillis(); this.policy = policy; this.numAnimationsRunning = ValueAnimator.getCurrentAnimationsCount(); Intent broadcastIntent = ActivityThread.getIntentBeingBroadcast(); if (broadcastIntent != null) { broadcastIntentAction = broadcastIntent.getAction(); } } /** Loading Loading @@ -1247,6 +1259,7 @@ public final class StrictMode { violationNumThisLoop = in.readInt(); numAnimationsRunning = in.readInt(); violationUptimeMillis = in.readLong(); broadcastIntentAction = in.readString(); } /** Loading @@ -1259,6 +1272,7 @@ public final class StrictMode { dest.writeInt(violationNumThisLoop); dest.writeInt(numAnimationsRunning); dest.writeLong(violationUptimeMillis); dest.writeString(broadcastIntentAction); } Loading @@ -1278,6 +1292,9 @@ public final class StrictMode { pw.println(prefix + "numAnimationsRunning: " + numAnimationsRunning); } pw.println(prefix + "violationUptimeMillis: " + violationUptimeMillis); if (broadcastIntentAction != null) { pw.println(prefix + "broadcastIntentAction: " + broadcastIntentAction); } } } Loading
services/java/com/android/server/am/ActivityManagerService.java +3 −0 Original line number Diff line number Diff line Loading @@ -6679,6 +6679,9 @@ public final class ActivityManagerService extends ActivityManagerNative if (info.numAnimationsRunning != 0) { sb.append("Animations-Running: ").append(info.numAnimationsRunning).append("\n"); } if (info.broadcastIntentAction != null) { sb.append("Broadcast-Intent-Action: ").append(info.broadcastIntentAction).append("\n"); } if (info != null && info.durationMillis != -1) { sb.append("Duration-Millis: ").append(info.durationMillis).append("\n"); } Loading