Program: 926
Project: 926
Buggy source:
final void processNextBroadcast(boolean fromMsg){
synchronized (mService) {
    BroadcastRecord r;
    if (DEBUG_BROADCAST)     Slog.v(TAG,"String_Node_Str" + mQueueName + "String_Node_Str"+ mParallelBroadcasts.size()+ "String_Node_Str"+ mOrderedBroadcasts.size()+ "String_Node_Str");
    mService.updateCpuStats();
    if (fromMsg) {
      mBroadcastsScheduled=false;
    }
    while (mParallelBroadcasts.size() > 0) {
      r=mParallelBroadcasts.remove(0);
      r.dispatchTime=SystemClock.uptimeMillis();
      r.dispatchClockTime=System.currentTimeMillis();
      final int N=r.receivers.size();
      if (DEBUG_BROADCAST_LIGHT)       Slog.v(TAG,"String_Node_Str" + mQueueName + "String_Node_Str"+ r);
      for (int i=0; i < N; i++) {
        Object target=r.receivers.get(i);
        if (DEBUG_BROADCAST)         Slog.v(TAG,"String_Node_Str" + mQueueName + "String_Node_Str"+ target+ "String_Node_Str"+ r);
        deliverToRegisteredReceiverLocked(r,(BroadcastFilter)target,false);
      }
      addBroadcastToHistoryLocked(r);
      if (DEBUG_BROADCAST_LIGHT)       Slog.v(TAG,"String_Node_Str" + mQueueName + "String_Node_Str"+ r);
    }
    if (mPendingBroadcast != null) {
      if (DEBUG_BROADCAST_LIGHT) {
        Slog.v(TAG,"String_Node_Str" + mQueueName + "String_Node_Str"+ mPendingBroadcast.curApp);
      }
      boolean isDead;
synchronized (mService.mPidsSelfLocked) {
        isDead=(mService.mPidsSelfLocked.get(mPendingBroadcast.curApp.pid) == null);
      }
      if (!isDead) {
        return;
      }
 else {
        Slog.w(TAG,"String_Node_Str" + mQueueName + "String_Node_Str"+ mPendingBroadcast.curApp+ "String_Node_Str");
        mPendingBroadcast.state=BroadcastRecord.IDLE;
        mPendingBroadcast.nextReceiver=mPendingBroadcastRecvIndex;
        mPendingBroadcast=null;
      }
    }
    boolean looped=false;
    do {
      if (mOrderedBroadcasts.size() == 0) {
        mService.scheduleAppGcsLocked();
        if (looped) {
          mService.updateOomAdjLocked();
        }
        return;
      }
      r=mOrderedBroadcasts.get(0);
      boolean forceReceive=false;
      int numReceivers=(r.receivers != null) ? r.receivers.size() : 0;
      if (mService.mProcessesReady && r.dispatchTime > 0) {
        long now=SystemClock.uptimeMillis();
        if ((numReceivers > 0) && (now > r.dispatchTime + (2 * mTimeoutPeriod * numReceivers))) {
          Slog.w(TAG,"String_Node_Str" + mQueueName + "String_Node_Str"+ "String_Node_Str"+ now+ "String_Node_Str"+ r.dispatchTime+ "String_Node_Str"+ r.receiverTime+ "String_Node_Str"+ r.intent+ "String_Node_Str"+ numReceivers+ "String_Node_Str"+ r.nextReceiver+ "String_Node_Str"+ r.state);
          broadcastTimeoutLocked(false);
          forceReceive=true;
          r.state=BroadcastRecord.IDLE;
        }
      }
      if (r.state != BroadcastRecord.IDLE) {
        if (DEBUG_BROADCAST)         Slog.d(TAG,"String_Node_Str" + mQueueName + "String_Node_Str"+ r.state+ "String_Node_Str");
        return;
      }
      if (r.receivers == null || r.nextReceiver >= numReceivers || r.resultAbort || forceReceive) {
        if (r.resultTo != null) {
          try {
            if (DEBUG_BROADCAST) {
              int seq=r.intent.getIntExtra("String_Node_Str",-1);
              Slog.i(TAG,"String_Node_Str" + mQueueName + "String_Node_Str"+ r.intent.getAction()+ "String_Node_Str"+ seq+ "String_Node_Str"+ r.callerApp);
            }
            performReceiveLocked(r.callerApp,r.resultTo,new Intent(r.intent),r.resultCode,r.resultData,r.resultExtras,false,false,r.userId);
            r.resultTo=null;
          }
 catch (          RemoteException e) {
            Slog.w(TAG,"String_Node_Str" + mQueueName + "String_Node_Str"+ r.intent,e);
          }
        }
        if (DEBUG_BROADCAST)         Slog.v(TAG,"String_Node_Str");
        cancelBroadcastTimeoutLocked();
        if (DEBUG_BROADCAST_LIGHT)         Slog.v(TAG,"String_Node_Str" + r);
        addBroadcastToHistoryLocked(r);
        mOrderedBroadcasts.remove(0);
        r=null;
        looped=true;
        continue;
      }
    }
 while (r == null);
    int recIdx=r.nextReceiver++;
    r.receiverTime=SystemClock.uptimeMillis();
    if (recIdx == 0) {
      r.dispatchTime=r.receiverTime;
      r.dispatchClockTime=System.currentTimeMillis();
      if (DEBUG_BROADCAST_LIGHT)       Slog.v(TAG,"String_Node_Str" + mQueueName + "String_Node_Str"+ r);
    }
    if (!mPendingBroadcastTimeoutMessage) {
      long timeoutTime=r.receiverTime + mTimeoutPeriod;
      if (DEBUG_BROADCAST)       Slog.v(TAG,"String_Node_Str" + mQueueName + "String_Node_Str"+ r+ "String_Node_Str"+ timeoutTime);
      setBroadcastTimeoutLocked(timeoutTime);
    }
    Object nextReceiver=r.receivers.get(recIdx);
    if (nextReceiver instanceof BroadcastFilter) {
      BroadcastFilter filter=(BroadcastFilter)nextReceiver;
      if (DEBUG_BROADCAST)       Slog.v(TAG,"String_Node_Str" + mQueueName + "String_Node_Str"+ filter+ "String_Node_Str"+ r);
      deliverToRegisteredReceiverLocked(r,filter,r.ordered);
      if (r.receiver == null || !r.ordered) {
        if (DEBUG_BROADCAST)         Slog.v(TAG,"String_Node_Str" + mQueueName + "String_Node_Str"+ r.ordered+ "String_Node_Str"+ r.receiver);
        r.state=BroadcastRecord.IDLE;
        scheduleBroadcastsLocked();
      }
      return;
    }
    ResolveInfo info=(ResolveInfo)nextReceiver;
    ComponentName component=new ComponentName(info.activityInfo.applicationInfo.packageName,info.activityInfo.name);
    boolean skip=false;
    int perm=mService.checkComponentPermission(info.activityInfo.permission,r.callingPid,r.callingUid,info.activityInfo.applicationInfo.uid,info.activityInfo.exported);
    if (perm != PackageManager.PERMISSION_GRANTED) {
      if (!info.activityInfo.exported) {
        Slog.w(TAG,"String_Node_Str" + r.intent.toString() + "String_Node_Str"+ r.callerPackage+ "String_Node_Str"+ r.callingPid+ "String_Node_Str"+ r.callingUid+ "String_Node_Str"+ "String_Node_Str"+ info.activityInfo.applicationInfo.uid+ "String_Node_Str"+ component.flattenToShortString());
      }
 else {
        Slog.w(TAG,"String_Node_Str" + r.intent.toString() + "String_Node_Str"+ r.callerPackage+ "String_Node_Str"+ r.callingPid+ "String_Node_Str"+ r.callingUid+ "String_Node_Str"+ "String_Node_Str"+ info.activityInfo.permission+ "String_Node_Str"+ component.flattenToShortString());
      }
      skip=true;
    }
    if (info.activityInfo.applicationInfo.uid != Process.SYSTEM_UID && r.requiredPermission != null) {
      try {
        perm=AppGlobals.getPackageManager().checkPermission(r.requiredPermission,info.activityInfo.applicationInfo.packageName);
      }
 catch (      RemoteException e) {
        perm=PackageManager.PERMISSION_DENIED;
      }
      if (perm != PackageManager.PERMISSION_GRANTED) {
        Slog.w(TAG,"String_Node_Str" + r.intent + "String_Node_Str"+ component.flattenToShortString()+ "String_Node_Str"+ r.requiredPermission+ "String_Node_Str"+ r.callerPackage+ "String_Node_Str"+ r.callingUid+ "String_Node_Str");
        skip=true;
      }
    }
    if (r.appOp != AppOpsManager.OP_NONE) {
      int mode=mService.mAppOpsService.noteOperation(r.appOp,info.activityInfo.applicationInfo.uid,info.activityInfo.packageName);
      if (mode != AppOpsManager.MODE_ALLOWED) {
        if (DEBUG_BROADCAST)         Slog.v(TAG,"String_Node_Str" + r.appOp + "String_Node_Str"+ info.activityInfo.applicationInfo.uid+ "String_Node_Str"+ info.activityInfo.packageName);
        skip=true;
      }
    }
    if (!skip) {
      skip=!mService.mIntentFirewall.checkBroadcast(r.intent,r.callingUid,r.callingPid,r.resolvedType,info.activityInfo.applicationInfo.uid);
    }
    boolean isSingleton=false;
    try {
      isSingleton=mService.isSingleton(info.activityInfo.processName,info.activityInfo.applicationInfo,info.activityInfo.name,info.activityInfo.flags);
    }
 catch (    SecurityException e) {
      Slog.w(TAG,e.getMessage());
      skip=true;
    }
    if ((info.activityInfo.flags & ActivityInfo.FLAG_SINGLE_USER) != 0) {
      if (ActivityManager.checkUidPermission(android.Manifest.permission.INTERACT_ACROSS_USERS,info.activityInfo.applicationInfo.uid) != PackageManager.PERMISSION_GRANTED) {
        Slog.w(TAG,"String_Node_Str" + component.flattenToShortString() + "String_Node_Str"+ android.Manifest.permission.INTERACT_ACROSS_USERS);
        skip=true;
      }
    }
    if (r.curApp != null && r.curApp.crashing) {
      if (DEBUG_BROADCAST)       Slog.v(TAG,"String_Node_Str" + mQueueName + "String_Node_Str"+ r+ "String_Node_Str"+ r.curApp+ "String_Node_Str");
      skip=true;
    }
    if (skip) {
      if (DEBUG_BROADCAST)       Slog.v(TAG,"String_Node_Str" + mQueueName + "String_Node_Str"+ r+ "String_Node_Str");
      r.receiver=null;
      r.curFilter=null;
      r.state=BroadcastRecord.IDLE;
      scheduleBroadcastsLocked();
      return;
    }
    r.state=BroadcastRecord.APP_RECEIVE;
    String targetProcess=info.activityInfo.processName;
    r.curComponent=component;
    if (r.callingUid != Process.SYSTEM_UID && isSingleton) {
      info.activityInfo=mService.getActivityInfoForUser(info.activityInfo,0);
    }
    r.curReceiver=info.activityInfo;
    if (DEBUG_MU && r.callingUid > UserHandle.PER_USER_RANGE) {
      Slog.v(TAG_MU,"String_Node_Str" + info.activityInfo + "String_Node_Str"+ r.callingUid+ "String_Node_Str"+ info.activityInfo.applicationInfo.uid);
    }
    try {
      AppGlobals.getPackageManager().setPackageStoppedState(r.curComponent.getPackageName(),false,UserHandle.getUserId(r.callingUid));
    }
 catch (    RemoteException e) {
    }
catch (    IllegalArgumentException e) {
      Slog.w(TAG,"String_Node_Str" + r.curComponent.getPackageName() + "String_Node_Str"+ e);
    }
    ProcessRecord app=mService.getProcessRecordLocked(targetProcess,info.activityInfo.applicationInfo.uid,false);
    if (app != null && app.thread != null) {
      try {
        app.addPackage(info.activityInfo.packageName,mService.mProcessStats);
        processCurBroadcastLocked(r,app);
        return;
      }
 catch (      RemoteException e) {
        Slog.w(TAG,"String_Node_Str" + r.curComponent,e);
      }
catch (      RuntimeException e) {
        Log.wtf(TAG,"String_Node_Str" + r.curComponent + "String_Node_Str"+ r.intent,e);
        logBroadcastReceiverDiscardLocked(r);
        finishReceiverLocked(r,r.resultCode,r.resultData,r.resultExtras,r.resultAbort,false);
        scheduleBroadcastsLocked();
        r.state=BroadcastRecord.IDLE;
        return;
      }
    }
    if (DEBUG_BROADCAST)     Slog.v(TAG,"String_Node_Str" + mQueueName + "String_Node_Str"+ targetProcess+ "String_Node_Str"+ r);
    if ((r.curApp=mService.startProcessLocked(targetProcess,info.activityInfo.applicationInfo,true,r.intent.getFlags() | Intent.FLAG_FROM_BACKGROUND,"String_Node_Str",r.curComponent,(r.intent.getFlags() & Intent.FLAG_RECEIVER_BOOT_UPGRADE) != 0,false,false)) == null) {
      Slog.w(TAG,"String_Node_Str" + info.activityInfo.applicationInfo.packageName + "String_Node_Str"+ info.activityInfo.applicationInfo.uid+ "String_Node_Str"+ r.intent+ "String_Node_Str");
      logBroadcastReceiverDiscardLocked(r);
      finishReceiverLocked(r,r.resultCode,r.resultData,r.resultExtras,r.resultAbort,false);
      scheduleBroadcastsLocked();
      r.state=BroadcastRecord.IDLE;
      return;
    }
    mPendingBroadcast=r;
    mPendingBroadcastRecvIndex=recIdx;
  }
}

Fixed version (ground truth):
final void processNextBroadcast(boolean fromMsg){
synchronized (mService) {
    BroadcastRecord r;
    if (DEBUG_BROADCAST)     Slog.v(TAG,"String_Node_Str" + mQueueName + "String_Node_Str"+ mParallelBroadcasts.size()+ "String_Node_Str"+ mOrderedBroadcasts.size()+ "String_Node_Str");
    mService.updateCpuStats();
    if (fromMsg) {
      mBroadcastsScheduled=false;
    }
    while (mParallelBroadcasts.size() > 0) {
      r=mParallelBroadcasts.remove(0);
      r.dispatchTime=SystemClock.uptimeMillis();
      r.dispatchClockTime=System.currentTimeMillis();
      final int N=r.receivers.size();
      if (DEBUG_BROADCAST_LIGHT)       Slog.v(TAG,"String_Node_Str" + mQueueName + "String_Node_Str"+ r);
      for (int i=0; i < N; i++) {
        Object target=r.receivers.get(i);
        if (DEBUG_BROADCAST)         Slog.v(TAG,"String_Node_Str" + mQueueName + "String_Node_Str"+ target+ "String_Node_Str"+ r);
        deliverToRegisteredReceiverLocked(r,(BroadcastFilter)target,false);
      }
      addBroadcastToHistoryLocked(r);
      if (DEBUG_BROADCAST_LIGHT)       Slog.v(TAG,"String_Node_Str" + mQueueName + "String_Node_Str"+ r);
    }
    if (mPendingBroadcast != null) {
      if (DEBUG_BROADCAST_LIGHT) {
        Slog.v(TAG,"String_Node_Str" + mQueueName + "String_Node_Str"+ mPendingBroadcast.curApp);
      }
      boolean isDead;
synchronized (mService.mPidsSelfLocked) {
        ProcessRecord proc=mService.mPidsSelfLocked.get(mPendingBroadcast.curApp.pid);
        isDead=proc == null || proc.crashing;
      }
      if (!isDead) {
        return;
      }
 else {
        Slog.w(TAG,"String_Node_Str" + mQueueName + "String_Node_Str"+ mPendingBroadcast.curApp+ "String_Node_Str");
        mPendingBroadcast.state=BroadcastRecord.IDLE;
        mPendingBroadcast.nextReceiver=mPendingBroadcastRecvIndex;
        mPendingBroadcast=null;
      }
    }
    boolean looped=false;
    do {
      if (mOrderedBroadcasts.size() == 0) {
        mService.scheduleAppGcsLocked();
        if (looped) {
          mService.updateOomAdjLocked();
        }
        return;
      }
      r=mOrderedBroadcasts.get(0);
      boolean forceReceive=false;
      int numReceivers=(r.receivers != null) ? r.receivers.size() : 0;
      if (mService.mProcessesReady && r.dispatchTime > 0) {
        long now=SystemClock.uptimeMillis();
        if ((numReceivers > 0) && (now > r.dispatchTime + (2 * mTimeoutPeriod * numReceivers))) {
          Slog.w(TAG,"String_Node_Str" + mQueueName + "String_Node_Str"+ "String_Node_Str"+ now+ "String_Node_Str"+ r.dispatchTime+ "String_Node_Str"+ r.receiverTime+ "String_Node_Str"+ r.intent+ "String_Node_Str"+ numReceivers+ "String_Node_Str"+ r.nextReceiver+ "String_Node_Str"+ r.state);
          broadcastTimeoutLocked(false);
          forceReceive=true;
          r.state=BroadcastRecord.IDLE;
        }
      }
      if (r.state != BroadcastRecord.IDLE) {
        if (DEBUG_BROADCAST)         Slog.d(TAG,"String_Node_Str" + mQueueName + "String_Node_Str"+ r.state+ "String_Node_Str");
        return;
      }
      if (r.receivers == null || r.nextReceiver >= numReceivers || r.resultAbort || forceReceive) {
        if (r.resultTo != null) {
          try {
            if (DEBUG_BROADCAST) {
              int seq=r.intent.getIntExtra("String_Node_Str",-1);
              Slog.i(TAG,"String_Node_Str" + mQueueName + "String_Node_Str"+ r.intent.getAction()+ "String_Node_Str"+ seq+ "String_Node_Str"+ r.callerApp);
            }
            performReceiveLocked(r.callerApp,r.resultTo,new Intent(r.intent),r.resultCode,r.resultData,r.resultExtras,false,false,r.userId);
            r.resultTo=null;
          }
 catch (          RemoteException e) {
            Slog.w(TAG,"String_Node_Str" + mQueueName + "String_Node_Str"+ r.intent,e);
          }
        }
        if (DEBUG_BROADCAST)         Slog.v(TAG,"String_Node_Str");
        cancelBroadcastTimeoutLocked();
        if (DEBUG_BROADCAST_LIGHT)         Slog.v(TAG,"String_Node_Str" + r);
        addBroadcastToHistoryLocked(r);
        mOrderedBroadcasts.remove(0);
        r=null;
        looped=true;
        continue;
      }
    }
 while (r == null);
    int recIdx=r.nextReceiver++;
    r.receiverTime=SystemClock.uptimeMillis();
    if (recIdx == 0) {
      r.dispatchTime=r.receiverTime;
      r.dispatchClockTime=System.currentTimeMillis();
      if (DEBUG_BROADCAST_LIGHT)       Slog.v(TAG,"String_Node_Str" + mQueueName + "String_Node_Str"+ r);
    }
    if (!mPendingBroadcastTimeoutMessage) {
      long timeoutTime=r.receiverTime + mTimeoutPeriod;
      if (DEBUG_BROADCAST)       Slog.v(TAG,"String_Node_Str" + mQueueName + "String_Node_Str"+ r+ "String_Node_Str"+ timeoutTime);
      setBroadcastTimeoutLocked(timeoutTime);
    }
    Object nextReceiver=r.receivers.get(recIdx);
    if (nextReceiver instanceof BroadcastFilter) {
      BroadcastFilter filter=(BroadcastFilter)nextReceiver;
      if (DEBUG_BROADCAST)       Slog.v(TAG,"String_Node_Str" + mQueueName + "String_Node_Str"+ filter+ "String_Node_Str"+ r);
      deliverToRegisteredReceiverLocked(r,filter,r.ordered);
      if (r.receiver == null || !r.ordered) {
        if (DEBUG_BROADCAST)         Slog.v(TAG,"String_Node_Str" + mQueueName + "String_Node_Str"+ r.ordered+ "String_Node_Str"+ r.receiver);
        r.state=BroadcastRecord.IDLE;
        scheduleBroadcastsLocked();
      }
      return;
    }
    ResolveInfo info=(ResolveInfo)nextReceiver;
    ComponentName component=new ComponentName(info.activityInfo.applicationInfo.packageName,info.activityInfo.name);
    boolean skip=false;
    int perm=mService.checkComponentPermission(info.activityInfo.permission,r.callingPid,r.callingUid,info.activityInfo.applicationInfo.uid,info.activityInfo.exported);
    if (perm != PackageManager.PERMISSION_GRANTED) {
      if (!info.activityInfo.exported) {
        Slog.w(TAG,"String_Node_Str" + r.intent.toString() + "String_Node_Str"+ r.callerPackage+ "String_Node_Str"+ r.callingPid+ "String_Node_Str"+ r.callingUid+ "String_Node_Str"+ "String_Node_Str"+ info.activityInfo.applicationInfo.uid+ "String_Node_Str"+ component.flattenToShortString());
      }
 else {
        Slog.w(TAG,"String_Node_Str" + r.intent.toString() + "String_Node_Str"+ r.callerPackage+ "String_Node_Str"+ r.callingPid+ "String_Node_Str"+ r.callingUid+ "String_Node_Str"+ "String_Node_Str"+ info.activityInfo.permission+ "String_Node_Str"+ component.flattenToShortString());
      }
      skip=true;
    }
    if (info.activityInfo.applicationInfo.uid != Process.SYSTEM_UID && r.requiredPermission != null) {
      try {
        perm=AppGlobals.getPackageManager().checkPermission(r.requiredPermission,info.activityInfo.applicationInfo.packageName);
      }
 catch (      RemoteException e) {
        perm=PackageManager.PERMISSION_DENIED;
      }
      if (perm != PackageManager.PERMISSION_GRANTED) {
        Slog.w(TAG,"String_Node_Str" + r.intent + "String_Node_Str"+ component.flattenToShortString()+ "String_Node_Str"+ r.requiredPermission+ "String_Node_Str"+ r.callerPackage+ "String_Node_Str"+ r.callingUid+ "String_Node_Str");
        skip=true;
      }
    }
    if (r.appOp != AppOpsManager.OP_NONE) {
      int mode=mService.mAppOpsService.noteOperation(r.appOp,info.activityInfo.applicationInfo.uid,info.activityInfo.packageName);
      if (mode != AppOpsManager.MODE_ALLOWED) {
        if (DEBUG_BROADCAST)         Slog.v(TAG,"String_Node_Str" + r.appOp + "String_Node_Str"+ info.activityInfo.applicationInfo.uid+ "String_Node_Str"+ info.activityInfo.packageName);
        skip=true;
      }
    }
    if (!skip) {
      skip=!mService.mIntentFirewall.checkBroadcast(r.intent,r.callingUid,r.callingPid,r.resolvedType,info.activityInfo.applicationInfo.uid);
    }
    boolean isSingleton=false;
    try {
      isSingleton=mService.isSingleton(info.activityInfo.processName,info.activityInfo.applicationInfo,info.activityInfo.name,info.activityInfo.flags);
    }
 catch (    SecurityException e) {
      Slog.w(TAG,e.getMessage());
      skip=true;
    }
    if ((info.activityInfo.flags & ActivityInfo.FLAG_SINGLE_USER) != 0) {
      if (ActivityManager.checkUidPermission(android.Manifest.permission.INTERACT_ACROSS_USERS,info.activityInfo.applicationInfo.uid) != PackageManager.PERMISSION_GRANTED) {
        Slog.w(TAG,"String_Node_Str" + component.flattenToShortString() + "String_Node_Str"+ android.Manifest.permission.INTERACT_ACROSS_USERS);
        skip=true;
      }
    }
    if (r.curApp != null && r.curApp.crashing) {
      Slog.w(TAG,"String_Node_Str" + mQueueName + "String_Node_Str"+ r+ "String_Node_Str"+ r.curApp+ "String_Node_Str");
      skip=true;
    }
    if (skip) {
      if (DEBUG_BROADCAST)       Slog.v(TAG,"String_Node_Str" + mQueueName + "String_Node_Str"+ r+ "String_Node_Str");
      r.receiver=null;
      r.curFilter=null;
      r.state=BroadcastRecord.IDLE;
      scheduleBroadcastsLocked();
      return;
    }
    r.state=BroadcastRecord.APP_RECEIVE;
    String targetProcess=info.activityInfo.processName;
    r.curComponent=component;
    if (r.callingUid != Process.SYSTEM_UID && isSingleton) {
      info.activityInfo=mService.getActivityInfoForUser(info.activityInfo,0);
    }
    r.curReceiver=info.activityInfo;
    if (DEBUG_MU && r.callingUid > UserHandle.PER_USER_RANGE) {
      Slog.v(TAG_MU,"String_Node_Str" + info.activityInfo + "String_Node_Str"+ r.callingUid+ "String_Node_Str"+ info.activityInfo.applicationInfo.uid);
    }
    try {
      AppGlobals.getPackageManager().setPackageStoppedState(r.curComponent.getPackageName(),false,UserHandle.getUserId(r.callingUid));
    }
 catch (    RemoteException e) {
    }
catch (    IllegalArgumentException e) {
      Slog.w(TAG,"String_Node_Str" + r.curComponent.getPackageName() + "String_Node_Str"+ e);
    }
    ProcessRecord app=mService.getProcessRecordLocked(targetProcess,info.activityInfo.applicationInfo.uid,false);
    if (app != null && app.thread != null) {
      try {
        app.addPackage(info.activityInfo.packageName,mService.mProcessStats);
        processCurBroadcastLocked(r,app);
        return;
      }
 catch (      RemoteException e) {
        Slog.w(TAG,"String_Node_Str" + r.curComponent,e);
      }
catch (      RuntimeException e) {
        Log.wtf(TAG,"String_Node_Str" + r.curComponent + "String_Node_Str"+ r.intent,e);
        logBroadcastReceiverDiscardLocked(r);
        finishReceiverLocked(r,r.resultCode,r.resultData,r.resultExtras,r.resultAbort,false);
        scheduleBroadcastsLocked();
        r.state=BroadcastRecord.IDLE;
        return;
      }
    }
    if (DEBUG_BROADCAST)     Slog.v(TAG,"String_Node_Str" + mQueueName + "String_Node_Str"+ targetProcess+ "String_Node_Str"+ r);
    if ((r.curApp=mService.startProcessLocked(targetProcess,info.activityInfo.applicationInfo,true,r.intent.getFlags() | Intent.FLAG_FROM_BACKGROUND,"String_Node_Str",r.curComponent,(r.intent.getFlags() & Intent.FLAG_RECEIVER_BOOT_UPGRADE) != 0,false,false)) == null) {
      Slog.w(TAG,"String_Node_Str" + info.activityInfo.applicationInfo.packageName + "String_Node_Str"+ info.activityInfo.applicationInfo.uid+ "String_Node_Str"+ r.intent+ "String_Node_Str");
      logBroadcastReceiverDiscardLocked(r);
      finishReceiverLocked(r,r.resultCode,r.resultData,r.resultExtras,r.resultAbort,false);
      scheduleBroadcastsLocked();
      r.state=BroadcastRecord.IDLE;
      return;
    }
    mPendingBroadcast=r;
    mPendingBroadcastRecvIndex=recIdx;
  }
}