public void run() { while (!mFinished) { synchronized (mLock) { if (!mStopped) { ImpsAddress[] pollingAddress = mPollingAddress; if (pollingAddress == null) { // Didn't specify of which contacts the presence will // poll. Fetch the presence of all contacts in list. pollingAddress = getContactLists(); } mManager.fetchPresence(pollingAddress); } try { mLock.wait(mPollingInterval); } catch (InterruptedException e) { // ignore } } } }
private ImpsAddress[] getContactLists() { if (mContactLists == null) { mContactLists = mManager.getAllListAddress(); } return mContactLists; }