Loading core/java/android/app/ActivityThread.java +4 −0 Original line number Diff line number Diff line Loading @@ -1640,6 +1640,10 @@ public final class ActivityThread { return sCurrentActivityThread; } public static boolean isSystem() { return (sCurrentActivityThread != null) ? sCurrentActivityThread.mSystemThread : false; } public static String currentOpPackageName() { ActivityThread am = currentActivityThread(); return (am != null && am.getApplication() != null) Loading core/java/android/app/PendingIntent.java +13 −1 Original line number Diff line number Diff line Loading @@ -25,11 +25,13 @@ import android.content.IIntentReceiver; import android.content.IIntentSender; import android.content.IntentSender; import android.os.Bundle; import android.os.Looper; import android.os.RemoteException; import android.os.Handler; import android.os.IBinder; import android.os.Parcel; import android.os.Parcelable; import android.os.Process; import android.os.UserHandle; import android.util.AndroidException; Loading Loading @@ -206,11 +208,21 @@ public final class PendingIntent implements Parcelable { private int mResultCode; private String mResultData; private Bundle mResultExtras; private static Handler sDefaultSystemHandler; FinishedDispatcher(PendingIntent pi, OnFinished who, Handler handler) { mPendingIntent = pi; mWho = who; if (handler == null && ActivityThread.isSystem()) { // We assign a default handler for the system process to avoid deadlocks when // processing receivers in various components that hold global service locks. if (sDefaultSystemHandler == null) { sDefaultSystemHandler = new Handler(Looper.getMainLooper()); } mHandler = sDefaultSystemHandler; } else { mHandler = handler; } } public void performReceive(Intent intent, int resultCode, String data, Bundle extras, boolean serialized, boolean sticky, int sendingUser) { mIntent = intent; Loading Loading
core/java/android/app/ActivityThread.java +4 −0 Original line number Diff line number Diff line Loading @@ -1640,6 +1640,10 @@ public final class ActivityThread { return sCurrentActivityThread; } public static boolean isSystem() { return (sCurrentActivityThread != null) ? sCurrentActivityThread.mSystemThread : false; } public static String currentOpPackageName() { ActivityThread am = currentActivityThread(); return (am != null && am.getApplication() != null) Loading
core/java/android/app/PendingIntent.java +13 −1 Original line number Diff line number Diff line Loading @@ -25,11 +25,13 @@ import android.content.IIntentReceiver; import android.content.IIntentSender; import android.content.IntentSender; import android.os.Bundle; import android.os.Looper; import android.os.RemoteException; import android.os.Handler; import android.os.IBinder; import android.os.Parcel; import android.os.Parcelable; import android.os.Process; import android.os.UserHandle; import android.util.AndroidException; Loading Loading @@ -206,11 +208,21 @@ public final class PendingIntent implements Parcelable { private int mResultCode; private String mResultData; private Bundle mResultExtras; private static Handler sDefaultSystemHandler; FinishedDispatcher(PendingIntent pi, OnFinished who, Handler handler) { mPendingIntent = pi; mWho = who; if (handler == null && ActivityThread.isSystem()) { // We assign a default handler for the system process to avoid deadlocks when // processing receivers in various components that hold global service locks. if (sDefaultSystemHandler == null) { sDefaultSystemHandler = new Handler(Looper.getMainLooper()); } mHandler = sDefaultSystemHandler; } else { mHandler = handler; } } public void performReceive(Intent intent, int resultCode, String data, Bundle extras, boolean serialized, boolean sticky, int sendingUser) { mIntent = intent; Loading