のねのBlog

パソコンやソフト開発で起きた問題など書きます。よろしくお願いします。

PROCSTATE CHANGED

Cross Reference: /frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java

   4090     private void dispatchProcessesChanged() {
   4091         int N;
   4092         synchronized (this) {
   4093             N = mPendingProcessChanges.size();
   4094             if (mActiveProcessChanges.length < N) {
   4095                 mActiveProcessChanges = new ProcessChangeItem[N];
   4096             }
   4097             mPendingProcessChanges.toArray(mActiveProcessChanges);
   4098             mPendingProcessChanges.clear();
   4099             if (DEBUG_PROCESS_OBSERVERS) Slog.i(TAG_PROCESS_OBSERVERS,
   4100                     "*** Delivering " + N + " process changes");

                             I/ActivityManager(717): *** Delivering 1 process changes

   4101         }
   4102 
   4103         int i = mProcessObservers.beginBroadcast();
   4104         while (i > 0) {
   4105             i--;
   4106             final IProcessObserver observer = mProcessObservers.getBroadcastItem(i);
   4107             if (observer != null) {
   4108                 try {
   4109                     for (int j=0; j<N; j++) {
   4110                         ProcessChangeItem item = mActiveProcessChanges[j];
   4111                         if ((item.changes&ProcessChangeItem.CHANGE_ACTIVITIES) != 0) {
   4112                             if (DEBUG_PROCESS_OBSERVERS) Slog.i(TAG_PROCESS_OBSERVERS,
   4113                                     "ACTIVITIES CHANGED pid=" + item.pid + " uid="
   4114                                     + item.uid + ": " + item.foregroundActivities);
                                            I//ActivityManager(717): ACTIVITIES CHANGED pid=25423 uid=1000: false
   4115                             observer.onForegroundActivitiesChanged(item.pid, item.uid,
   4116                                     item.foregroundActivities);
   4117                         }
   4118                         if ((item.changes&ProcessChangeItem.CHANGE_PROCESS_STATE) != 0) {
   4119                             if (DEBUG_PROCESS_OBSERVERS) Slog.i(TAG_PROCESS_OBSERVERS,
   4120                                     "PROCSTATE CHANGED pid=" + item.pid + " uid=" + item.uid
   4121                                     + ": " + item.processState);

                                             I/ActivityManager(717): PROCSTATE CHANGED pid=13412 uid=10063: 16

   4122                             observer.onProcessStateChanged(item.pid, item.uid, item.processState);
   4123                         }
   4124                     }
   4125                 } catch (RemoteException e) {
   4126                 }
   4127             }
   4128         }
   4129         mProcessObservers.finishBroadcast();
   4130 
   4131         synchronized (this) {
   4132             for (int j=0; j<N; j++) {
   4133                 mAvailProcessChanges.add(mActiveProcessChanges[j]);
   4134             }
   4135         }
   4136     }