public abstract class SignalController<T extends com.android.systemui.statusbar.policy.SignalController.State,I extends com.android.systemui.statusbar.policy.SignalController.IconGroup> extends Object
Modifier and Type | Field and Description |
---|---|
protected static boolean |
CHATTY |
protected static boolean |
DEBUG |
protected Context |
mContext |
protected T |
mCurrentState |
protected T |
mLastState |
protected NetworkControllerImpl |
mNetworkController |
protected String |
mTag |
protected int |
mTransportType |
Constructor and Description |
---|
SignalController(String tag,
Context context,
int type,
CallbackHandler callbackHandler,
NetworkControllerImpl networkController) |
Modifier and Type | Method and Description |
---|---|
protected abstract T |
cleanState()
Generate a blank T.
|
void |
dump(PrintWriter pw) |
int |
getContentDescription()
Gets the content description id for the signal based on current state of connected and
level.
|
int |
getCurrentIconId()
Gets the signal icon for SB based on current state of connected, enabled, and level.
|
protected I |
getIcons() |
int |
getQsCurrentIconId()
Gets the signal icon for QS based on current state of connected, enabled, and level.
|
T |
getState() |
protected String |
getStringIfExists(int resId)
Returns the resource if resId is not 0, and an empty string otherwise.
|
boolean |
isDirty()
Determines if the state of this signal controller has changed and
needs to trigger callbacks related to it.
|
void |
notifyListeners() |
abstract void |
notifyListeners(NetworkController.SignalCallback callback)
Trigger callbacks based on current state.
|
void |
notifyListenersIfNecessary() |
protected void |
recordLastState()
Saves the last state of any changes, so we can log the current
and last value of any state data.
|
void |
resetLastState()
Used at the end of demo mode to clear out any ugly state that it has created.
|
void |
saveLastState() |
void |
updateConnectivity(BitSet connectedTransports,
BitSet validatedTransports) |
protected static final boolean DEBUG
protected static final boolean CHATTY
protected final String mTag
protected final T extends com.android.systemui.statusbar.policy.SignalController.State mCurrentState
protected final T extends com.android.systemui.statusbar.policy.SignalController.State mLastState
protected final int mTransportType
protected final Context mContext
protected final NetworkControllerImpl mNetworkController
public SignalController(String tag, Context context, int type, CallbackHandler callbackHandler, NetworkControllerImpl networkController)
public T getState()
public void updateConnectivity(BitSet connectedTransports, BitSet validatedTransports)
public void resetLastState()
public boolean isDirty()
public void saveLastState()
public int getQsCurrentIconId()
public int getCurrentIconId()
public int getContentDescription()
public void notifyListenersIfNecessary()
protected String getStringIfExists(int resId)
protected I getIcons()
protected void recordLastState()
public void dump(PrintWriter pw)
public final void notifyListeners()
public abstract void notifyListeners(NetworkController.SignalCallback callback)
protected abstract T cleanState()