Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c37cc603 authored by Sudheer Shanka's avatar Sudheer Shanka Committed by Android (Google) Code Review
Browse files

Merge "Update IUidObserver.onUidStateChanged to include procStateSeq."

parents 61f31c7b 80255804
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -144,7 +144,7 @@ public class ActivityManager {
        }

        @Override
        public void onUidStateChanged(int uid, int procState) {
        public void onUidStateChanged(int uid, int procState, long procStateSeq) {
            mListener.onUidImportance(uid, RunningAppProcessInfo.procStateToImportance(procState));
        }

+6 −1
Original line number Diff line number Diff line
@@ -20,8 +20,13 @@ package android.app;
oneway interface IUidObserver {
    /**
     * General report of a state change of an uid.
     *
     * @param uid The uid for which the state change is being reported.
     * @param procState The updated process state for the uid.
     * @param procStateSeq The sequence no. associated with process state change of the uid,
     *                     see UidRecord.procStateSeq for details.
     */
    void onUidStateChanged(int uid, int procState);
    void onUidStateChanged(int uid, int procState, long procStateSeq);

    /**
     * Report that there are no longer any processes running for a uid.
+2 −1
Original line number Diff line number Diff line
@@ -2839,7 +2839,8 @@ class AlarmManagerService extends SystemService {
    }

    final class UidObserver extends IUidObserver.Stub {
        @Override public void onUidStateChanged(int uid, int procState) throws RemoteException {
        @Override public void onUidStateChanged(int uid, int procState,
                long procStateSeq) throws RemoteException {
        }

        @Override public void onUidGone(int uid, boolean disabled) throws RemoteException {
+3 −1
Original line number Diff line number Diff line
@@ -4370,7 +4370,8 @@ public class ActivityManagerService extends IActivityManager.Stub
                            if (reg.lastProcStates != null) {
                                reg.lastProcStates.put(item.uid, item.processState);
                            }
                            observer.onUidStateChanged(item.uid, item.processState);
                            observer.onUidStateChanged(item.uid, item.processState,
                                    item.procStateSeq);
                        }
                    }
                }
@@ -21486,6 +21487,7 @@ public class ActivityManagerService extends IActivityManager.Stub
        pendingChange.processState = uidRec != null
                ? uidRec.setProcState : ActivityManager.PROCESS_STATE_NONEXISTENT;
        pendingChange.ephemeral = uidRec.ephemeral;
        pendingChange.procStateSeq = uidRec != null ? uidRec.curProcStateSeq : 0;
        // Directly update the power manager, since we sit on top of it and it is critical
        // it be kept in sync (so wake locks will be held as soon as appropriate).
+1 −0
Original line number Diff line number Diff line
@@ -53,6 +53,7 @@ public final class UidRecord {
        int change;
        int processState;
        boolean ephemeral;
        long procStateSeq;
    }

    ChangeItem pendingChange;
Loading