Search in sources :

Example 1 with LatchedHandler

use of com.android.server.net.NetworkStatsServiceTest.LatchedHandler in project android_frameworks_base by ResurrectionRemix.

the class NetworkStatsObserversTest method setUp.

@Override
public void setUp() throws Exception {
    super.setUp();
    MockitoAnnotations.initMocks(this);
    mObserverHandlerThread = new IdleableHandlerThread("HandlerThread");
    mObserverHandlerThread.start();
    final Looper observerLooper = mObserverHandlerThread.getLooper();
    mStatsObservers = new NetworkStatsObservers() {

        @Override
        protected Looper getHandlerLooperLocked() {
            return observerLooper;
        }
    };
    mCv = new ConditionVariable();
    mHandler = new LatchedHandler(Looper.getMainLooper(), mCv);
    mMessenger = new Messenger(mHandler);
    mActiveIfaces = new ArrayMap<>();
    mActiveUidIfaces = new ArrayMap<>();
}
Also used : ConditionVariable(android.os.ConditionVariable) Looper(android.os.Looper) LatchedHandler(com.android.server.net.NetworkStatsServiceTest.LatchedHandler) Messenger(android.os.Messenger) IdleableHandlerThread(com.android.server.net.NetworkStatsServiceTest.IdleableHandlerThread)

Example 2 with LatchedHandler

use of com.android.server.net.NetworkStatsServiceTest.LatchedHandler in project platform_frameworks_base by android.

the class NetworkStatsObserversTest method setUp.

@Override
public void setUp() throws Exception {
    super.setUp();
    MockitoAnnotations.initMocks(this);
    mObserverHandlerThread = new IdleableHandlerThread("HandlerThread");
    mObserverHandlerThread.start();
    final Looper observerLooper = mObserverHandlerThread.getLooper();
    mStatsObservers = new NetworkStatsObservers() {

        @Override
        protected Looper getHandlerLooperLocked() {
            return observerLooper;
        }
    };
    mCv = new ConditionVariable();
    mHandler = new LatchedHandler(Looper.getMainLooper(), mCv);
    mMessenger = new Messenger(mHandler);
    mActiveIfaces = new ArrayMap<>();
    mActiveUidIfaces = new ArrayMap<>();
}
Also used : ConditionVariable(android.os.ConditionVariable) Looper(android.os.Looper) LatchedHandler(com.android.server.net.NetworkStatsServiceTest.LatchedHandler) Messenger(android.os.Messenger) IdleableHandlerThread(com.android.server.net.NetworkStatsServiceTest.IdleableHandlerThread)

Example 3 with LatchedHandler

use of com.android.server.net.NetworkStatsServiceTest.LatchedHandler in project android_frameworks_base by DirtyUnicorns.

the class NetworkStatsObserversTest method setUp.

@Override
public void setUp() throws Exception {
    super.setUp();
    MockitoAnnotations.initMocks(this);
    mObserverHandlerThread = new IdleableHandlerThread("HandlerThread");
    mObserverHandlerThread.start();
    final Looper observerLooper = mObserverHandlerThread.getLooper();
    mStatsObservers = new NetworkStatsObservers() {

        @Override
        protected Looper getHandlerLooperLocked() {
            return observerLooper;
        }
    };
    mCv = new ConditionVariable();
    mHandler = new LatchedHandler(Looper.getMainLooper(), mCv);
    mMessenger = new Messenger(mHandler);
    mActiveIfaces = new ArrayMap<>();
    mActiveUidIfaces = new ArrayMap<>();
}
Also used : ConditionVariable(android.os.ConditionVariable) Looper(android.os.Looper) LatchedHandler(com.android.server.net.NetworkStatsServiceTest.LatchedHandler) Messenger(android.os.Messenger) IdleableHandlerThread(com.android.server.net.NetworkStatsServiceTest.IdleableHandlerThread)

Example 4 with LatchedHandler

use of com.android.server.net.NetworkStatsServiceTest.LatchedHandler in project android_frameworks_base by crdroidandroid.

the class NetworkStatsObserversTest method setUp.

@Override
public void setUp() throws Exception {
    super.setUp();
    MockitoAnnotations.initMocks(this);
    mObserverHandlerThread = new IdleableHandlerThread("HandlerThread");
    mObserverHandlerThread.start();
    final Looper observerLooper = mObserverHandlerThread.getLooper();
    mStatsObservers = new NetworkStatsObservers() {

        @Override
        protected Looper getHandlerLooperLocked() {
            return observerLooper;
        }
    };
    mCv = new ConditionVariable();
    mHandler = new LatchedHandler(Looper.getMainLooper(), mCv);
    mMessenger = new Messenger(mHandler);
    mActiveIfaces = new ArrayMap<>();
    mActiveUidIfaces = new ArrayMap<>();
}
Also used : ConditionVariable(android.os.ConditionVariable) Looper(android.os.Looper) LatchedHandler(com.android.server.net.NetworkStatsServiceTest.LatchedHandler) Messenger(android.os.Messenger) IdleableHandlerThread(com.android.server.net.NetworkStatsServiceTest.IdleableHandlerThread)

Aggregations

ConditionVariable (android.os.ConditionVariable)4 Looper (android.os.Looper)4 Messenger (android.os.Messenger)4 IdleableHandlerThread (com.android.server.net.NetworkStatsServiceTest.IdleableHandlerThread)4 LatchedHandler (com.android.server.net.NetworkStatsServiceTest.LatchedHandler)4