use of android.app.IProcessObserver in project cornerstone by Onskreen.
the class ActivityManagerService method dispatchProcessesChanged.
private void dispatchProcessesChanged() {
int N;
synchronized (this) {
N = mPendingProcessChanges.size();
if (mActiveProcessChanges.length < N) {
mActiveProcessChanges = new ProcessChangeItem[N];
}
mPendingProcessChanges.toArray(mActiveProcessChanges);
mAvailProcessChanges.addAll(mPendingProcessChanges);
mPendingProcessChanges.clear();
if (DEBUG_PROCESS_OBSERVERS)
Slog.i(TAG, "*** Delivering " + N + " process changes");
}
int i = mProcessObservers.beginBroadcast();
while (i > 0) {
i--;
final IProcessObserver observer = mProcessObservers.getBroadcastItem(i);
if (observer != null) {
try {
for (int j = 0; j < N; j++) {
ProcessChangeItem item = mActiveProcessChanges[j];
if ((item.changes & ProcessChangeItem.CHANGE_ACTIVITIES) != 0) {
if (DEBUG_PROCESS_OBSERVERS)
Slog.i(TAG, "ACTIVITIES CHANGED pid=" + item.pid + " uid=" + item.uid + ": " + item.foregroundActivities);
observer.onForegroundActivitiesChanged(item.pid, item.uid, item.foregroundActivities);
}
if ((item.changes & ProcessChangeItem.CHANGE_IMPORTANCE) != 0) {
if (DEBUG_PROCESS_OBSERVERS)
Slog.i(TAG, "IMPORTANCE CHANGED pid=" + item.pid + " uid=" + item.uid + ": " + item.importance);
observer.onImportanceChanged(item.pid, item.uid, item.importance);
}
}
} catch (RemoteException e) {
}
}
}
mProcessObservers.finishBroadcast();
}
use of android.app.IProcessObserver in project android_frameworks_base by DirtyUnicorns.
the class ActivityManagerService method dispatchProcessesChanged.
private void dispatchProcessesChanged() {
int N;
synchronized (this) {
N = mPendingProcessChanges.size();
if (mActiveProcessChanges.length < N) {
mActiveProcessChanges = new ProcessChangeItem[N];
}
mPendingProcessChanges.toArray(mActiveProcessChanges);
mPendingProcessChanges.clear();
if (DEBUG_PROCESS_OBSERVERS)
Slog.i(TAG_PROCESS_OBSERVERS, "*** Delivering " + N + " process changes");
}
int i = mProcessObservers.beginBroadcast();
while (i > 0) {
i--;
final IProcessObserver observer = mProcessObservers.getBroadcastItem(i);
if (observer != null) {
try {
for (int j = 0; j < N; j++) {
ProcessChangeItem item = mActiveProcessChanges[j];
if ((item.changes & ProcessChangeItem.CHANGE_ACTIVITIES) != 0) {
if (DEBUG_PROCESS_OBSERVERS)
Slog.i(TAG_PROCESS_OBSERVERS, "ACTIVITIES CHANGED pid=" + item.pid + " uid=" + item.uid + ": " + item.foregroundActivities);
observer.onForegroundActivitiesChanged(item.pid, item.uid, item.foregroundActivities);
}
if ((item.changes & ProcessChangeItem.CHANGE_PROCESS_STATE) != 0) {
if (DEBUG_PROCESS_OBSERVERS)
Slog.i(TAG_PROCESS_OBSERVERS, "PROCSTATE CHANGED pid=" + item.pid + " uid=" + item.uid + ": " + item.processState);
observer.onProcessStateChanged(item.pid, item.uid, item.processState);
}
}
} catch (RemoteException e) {
}
}
}
mProcessObservers.finishBroadcast();
synchronized (this) {
for (int j = 0; j < N; j++) {
mAvailProcessChanges.add(mActiveProcessChanges[j]);
}
}
}
use of android.app.IProcessObserver in project android_frameworks_base by DirtyUnicorns.
the class ActivityManagerService method dispatchProcessDied.
private void dispatchProcessDied(int pid, int uid) {
int i = mProcessObservers.beginBroadcast();
while (i > 0) {
i--;
final IProcessObserver observer = mProcessObservers.getBroadcastItem(i);
if (observer != null) {
try {
observer.onProcessDied(pid, uid);
} catch (RemoteException e) {
}
}
}
mProcessObservers.finishBroadcast();
}
Aggregations