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

Commit c9daa032 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Add new methods to activate/deactivate session" into tm-dev

parents 8b0ef791 2379385a
Loading
Loading
Loading
Loading
+24 −0
Original line number Diff line number Diff line
@@ -863,6 +863,30 @@ public class ApplicationsState {
            }
        }

        /**
         *  Activate session to enable a class that implements Callbacks to receive the callback.
         */
        public void activateSession() {
            synchronized (mEntriesMap) {
                if (!mResumed) {
                    mResumed = true;
                    mSessionsChanged = true;
                }
            }
        }

        /**
         *  Deactivate session to disable a class that implements Callbacks to get the callback.
         */
        public void deactivateSession() {
            synchronized (mEntriesMap) {
                if (mResumed) {
                    mResumed = false;
                    mSessionsChanged = true;
                }
            }
        }

        public ArrayList<AppEntry> getAllApps() {
            synchronized (mEntriesMap) {
                return new ArrayList<>(mAppEntries);