Methods Summary |
---|
static void | clearLocked()Call this at any point to release any {@link WakeLock} and reset to
default state. Usually called before {@link Service#stopSelf()}.
Only call this while holding a {@link #sLock} lock.
if (sWakeLock != null && sWakeLock.isHeld()) {
if (LOGD) Log.d(TAG, "found held wakelock, so releasing");
sWakeLock.release();
}
sWakeLock = null;
sUpdateRequested = false;
sUpdateRunning = false;
sAppWidgetIds.clear();
sChangedEventIds.clear();
|
static int[] | collectAppWidgetIdsLocked()Collect all currently requested appWidgetId filters, returning as single
list. This call also clears the internal list.
Only call this while holding a {@link #sLock} lock.
final int size = sAppWidgetIds.size();
int[] array = new int[size];
Iterator<Integer> iterator = sAppWidgetIds.iterator();
for (int i = 0; i < size; i++) {
array[i] = iterator.next();
}
sAppWidgetIds.clear();
return array;
|
static java.util.Set | collectChangedEventIdsLocked()Collect all currently requested changedEventId filters, returning as
single list. This call also clears the internal list.
Only call this while holding a {@link #sLock} lock.
Set<Long> set = new HashSet<Long>();
for (Long value : sChangedEventIds) {
set.add(value);
}
sChangedEventIds.clear();
return set;
|
static void | mergeAppWidgetIdsLocked(int[] appWidgetIds)Merge a set of filtering appWidgetIds with those from other pending
requests. If null, then reset the filter to match all.
Only call this while holding a {@link #sLock} lock.
if (appWidgetIds != null) {
for (int appWidgetId : appWidgetIds) {
sAppWidgetIds.add(appWidgetId);
}
} else {
sAppWidgetIds.clear();
}
|
static void | mergeChangedEventIdsLocked(long[] changedEventIds)Merge a set of filtering changedEventIds with those from other pending
requests. If null, then reset the filter to match all.
Only call this while holding a {@link #sLock} lock.
if (changedEventIds != null) {
for (long changedEventId : changedEventIds) {
sChangedEventIds.add(changedEventId);
}
} else {
sChangedEventIds.clear();
}
|