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

application which holds the global state More...

Inheritance diagram for de.yaacc.Yaacc:
Inheritance graph
Collaboration diagram for de.yaacc.Yaacc:
Collaboration graph

Public Member Functions

void onCreate ()
 
void userStarted ()
 The user starts the app (any screen created fresh, see UserStartCallbacks): whatever starts after this is a normal start, and what was held back after an exit is started now.
 
boolean dropRestoredScreen ()
 A browser activity that the system recreates from its saved state right after an explicit exit is left over from before the exit: it finishes instead of bringing the app back.
 
ShareRegistry getShareRegistry ()
 The shares the media proxy serves (links and held files), process wide.
 
UnclaimedShares getUnclaimedShares ()
 The shares that no player has claimed yet.
 
LaunchNonces getLaunchNonces ()
 The single-use tokens that the launcher puts into a forwarded file share.
 
PendingShare getPendingShare ()
 The one pending shared file (waiting for the receiver pick).
 
Executor getContentLoadExecutor ()
 
UpnpClient getUpnpClient ()
 
boolean isUnplugged ()
 
void exit ()
 Ends the app: the exit button and the notification action, the shutdown (sleep) timer and the idle timer.
 
void createNotificationChannel ()
 
void createYaaccGroupNotification ()
 
void cancelYaaccGroupNotification ()
 
void startShutdownTimer (long duration)
 Starts the shutdown timer.
 
void stopShutdownTimer ()
 
boolean isShutdownTimerRunning ()
 
long getShutdownTimerRemainingMillis ()
 
void addShutdownTimerListener (ShutdownTimerListener listener)
 Adds a listener that is called on the main thread on every tick.
 
void removeShutdownTimerListener (ShutdownTimerListener listener)
 

Static Public Member Functions

static long shareClockMillis ()
 The clock of the share registry (monotonic milliseconds), for the code that must agree with it; see ShareRegistry#createDefault().
 

Static Public Attributes

static final String NOTIFICATION_CHANNEL_ID = "YaaccNotifications"
 
static final String NOTIFICATION_GROUP_KEY = "Yaacc"
 

Detailed Description

application which holds the global state

Author
Tobias Schoene (tobexyz)

Member Function Documentation

◆ addShutdownTimerListener()

void de.yaacc.Yaacc.addShutdownTimerListener ( ShutdownTimerListener listener)

Adds a listener that is called on the main thread on every tick.

The application keeps it until removeShutdownTimerListener(ShutdownTimerListener), so remove it when the UI that owns it stops. Adding the same listener twice has no effect.

Referenced by de.yaacc.browser.ShutdownTimerController.attach().

Here is the caller graph for this function:

◆ exit()

void de.yaacc.Yaacc.exit ( )

Ends the app: the exit button and the notification action, the shutdown (sleep) timer and the idle timer.

The order is the point (tasks 12.2 and 12.9): mark the exit (persisted, so that a restart the system does afterwards is recognised), close the shares, end the players (media session, player notification, the Snapcast feed gives the group its stream back), stop the services and let go of the bindings, cancel the notifications, finish the tasks, then wait (bounded, without blocking the main thread, which the releases need) for the services and the feeds to end, cancel the notifications once more and end the process. A step that fails does not keep the others from running (ExitSequence).

The main thread never waits for a player (review W2 of Group 12A): ending a remote player sleeps and polls on the thread that does it, so every player is ended on a thread of its own (ExitHandoff) and the rest of the exit continues on the main thread when they ended or after EXIT_PLAYERS_MAX_WAIT_MILLIS.

Here is the call graph for this function:

◆ getLaunchNonces()

LaunchNonces de.yaacc.Yaacc.getLaunchNonces ( )

The single-use tokens that the launcher puts into a forwarded file share.

Never null.

◆ getPendingShare()

PendingShare de.yaacc.Yaacc.getPendingShare ( )

The one pending shared file (waiting for the receiver pick).

Never null.

◆ getShareRegistry()

ShareRegistry de.yaacc.Yaacc.getShareRegistry ( )

The shares the media proxy serves (links and held files), process wide.

Never null.

◆ getShutdownTimerRemainingMillis()

long de.yaacc.Yaacc.getShutdownTimerRemainingMillis ( )
Returns
the time left on the running shutdown timer as of the last tick, 0 if none runs

◆ getUnclaimedShares()

UnclaimedShares de.yaacc.Yaacc.getUnclaimedShares ( )

The shares that no player has claimed yet.

Never null.

◆ isShutdownTimerRunning()

boolean de.yaacc.Yaacc.isShutdownTimerRunning ( )
Returns
true while a shutdown timer is counting down

Referenced by de.yaacc.browser.ShutdownTimerController.setConfiguredMillis().

Here is the caller graph for this function:

◆ startShutdownTimer()

void de.yaacc.Yaacc.startShutdownTimer ( long duration)

Starts the shutdown timer.

The timer and its listener calls run on the main thread; a call from another thread is posted there.

Referenced by de.yaacc.browser.ShutdownTimerController.setConfiguredMillis(), and de.yaacc.browser.ShutdownTimerController.start().

Here is the caller graph for this function:

◆ userStarted()

void de.yaacc.Yaacc.userStarted ( )

The user starts the app (any screen created fresh, see UserStartCallbacks): whatever starts after this is a normal start, and what was held back after an exit is started now.

Main thread.

Here is the call graph for this function:

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