YAACC - UPNP Client and Server
Loading...
Searching...
No Matches
de.yaacc.util.SafBrowseGate Class Reference

Tells background work (the duration preload) that a Browse is being answered, so the background work gives way: a Browse of a big SAF folder needs the processor and the system's Binder threads for itself, and the preload asks the same document provider for every file. More...

Collaboration diagram for de.yaacc.util.SafBrowseGate:
Collaboration graph

Public Member Functions

void enter ()
 A Browse starts.
 
void exit ()
 A Browse ended (also when it failed).
 
boolean isBusy ()
 
long awaitIdle (long maxMillis)
 Returns at once when no Browse is active, else waits until the last one ended, at most maxMillis.
 

Detailed Description

Tells background work (the duration preload) that a Browse is being answered, so the background work gives way: a Browse of a big SAF folder needs the processor and the system's Binder threads for itself, and the preload asks the same document provider for every file.

Nothing is blocked for good: a waiter gives up after a limit, and a Browse never waits for the background work.

Usage: the Browse calls enter() and, in a finally block, exit(); the background work calls awaitIdle(long) between two files. No Android classes.

Member Function Documentation

◆ awaitIdle()

long de.yaacc.util.SafBrowseGate.awaitIdle ( long maxMillis)

Returns at once when no Browse is active, else waits until the last one ended, at most maxMillis.

Returns
the milliseconds that were waited (0 if nothing was active); an interrupt ends the wait and is kept

The documentation for this class was generated from the following file: