Methods Summary |
---|
public void | dismissColorFade()Dismisses the electron beam surface.
mColorFade.dismiss();
mColorFadePrepared = false;
mColorFadeReady = true;
|
public void | dump(java.io.PrintWriter pw)
pw.println();
pw.println("Display Power State:");
pw.println(" mScreenState=" + Display.stateToString(mScreenState));
pw.println(" mScreenBrightness=" + mScreenBrightness);
pw.println(" mScreenReady=" + mScreenReady);
pw.println(" mScreenUpdatePending=" + mScreenUpdatePending);
pw.println(" mColorFadePrepared=" + mColorFadePrepared);
pw.println(" mColorFadeLevel=" + mColorFadeLevel);
pw.println(" mColorFadeReady=" + mColorFadeReady);
pw.println(" mColorFadeDrawPending=" + mColorFadeDrawPending);
mPhotonicModulator.dump(pw);
mColorFade.dump(pw);
|
public float | getColorFadeLevel()Gets the level of the electron beam steering current.
return mColorFadeLevel;
|
public int | getScreenBrightness()Gets the screen brightness.
return mScreenBrightness;
|
public int | getScreenState()Gets the desired screen state.
return mScreenState;
|
private void | invokeCleanListenerIfNeeded()
final Runnable listener = mCleanListener;
if (listener != null && mScreenReady && mColorFadeReady) {
mCleanListener = null;
listener.run();
}
|
private void | postScreenUpdateThreadSafe()
mHandler.removeCallbacks(mScreenUpdateRunnable);
mHandler.post(mScreenUpdateRunnable);
|
public boolean | prepareColorFade(android.content.Context context, int mode)Prepares the electron beam to turn on or off.
This method should be called before starting an animation because it
can take a fair amount of time to prepare the electron beam surface.
if (!mColorFade.prepare(context, mode)) {
mColorFadePrepared = false;
mColorFadeReady = true;
return false;
}
mColorFadePrepared = true;
mColorFadeReady = false;
scheduleColorFadeDraw();
return true;
|
private void | scheduleColorFadeDraw()
if (!mColorFadeDrawPending) {
mColorFadeDrawPending = true;
mChoreographer.postCallback(Choreographer.CALLBACK_TRAVERSAL,
mColorFadeDrawRunnable, null);
}
|
private void | scheduleScreenUpdate()
if (!mScreenUpdatePending) {
mScreenUpdatePending = true;
postScreenUpdateThreadSafe();
}
|
public void | setColorFadeLevel(float level)Sets the level of the electron beam steering current.
The display is blanked when the level is 0.0. In normal use, the electron
beam should have a value of 1.0. The electron beam is unstable in between
these states and the picture quality may be compromised. For best effect,
the electron beam should be warmed up or cooled off slowly.
Warning: Electron beam emits harmful radiation. Avoid direct exposure to
skin or eyes.
if (mColorFadeLevel != level) {
if (DEBUG) {
Slog.d(TAG, "setColorFadeLevel: level=" + level);
}
mColorFadeLevel = level;
if (mScreenState != Display.STATE_OFF) {
mScreenReady = false;
scheduleScreenUpdate(); // update backlight brightness
}
if (mColorFadePrepared) {
mColorFadeReady = false;
scheduleColorFadeDraw();
}
}
|
public void | setScreenBrightness(int brightness)Sets the display brightness.
if (mScreenBrightness != brightness) {
if (DEBUG) {
Slog.d(TAG, "setScreenBrightness: brightness=" + brightness);
}
mScreenBrightness = brightness;
if (mScreenState != Display.STATE_OFF) {
mScreenReady = false;
scheduleScreenUpdate();
}
}
|
public void | setScreenState(int state)Sets whether the screen is on, off, or dozing.
if (mScreenState != state) {
if (DEBUG) {
Slog.d(TAG, "setScreenState: state=" + state);
}
mScreenState = state;
mScreenReady = false;
scheduleScreenUpdate();
}
|
public boolean | waitUntilClean(java.lang.Runnable listener)Returns true if no properties have been invalidated.
Otherwise, returns false and promises to invoke the specified listener
when the properties have all been applied.
The listener always overrides any previously set listener.
if (!mScreenReady || !mColorFadeReady) {
mCleanListener = listener;
return false;
} else {
mCleanListener = null;
return true;
}
|