Merge change I76127f6f into eclair

* changes:
  Add support for colored LED on jogball backlight.
This commit is contained in:
Android (Google) Code Review
2009-11-04 19:39:29 -05:00
2 changed files with 33 additions and 26 deletions

View File

@@ -30,6 +30,6 @@ interface IHardwareService
void enableCameraFlash(int milliseconds); void enableCameraFlash(int milliseconds);
// for the phone // for the phone
void setAttentionLight(boolean on); void setAttentionLight(boolean on, int color);
} }

View File

@@ -52,6 +52,7 @@ public class HardwareService extends IHardwareService.Stub {
static final int LIGHT_FLASH_NONE = 0; static final int LIGHT_FLASH_NONE = 0;
static final int LIGHT_FLASH_TIMED = 1; static final int LIGHT_FLASH_TIMED = 1;
static final int LIGHT_FLASH_HARDWARE = 2;
private final LinkedList<Vibration> mVibrations; private final LinkedList<Vibration> mVibrations;
private Vibration mCurrentVibration; private Vibration mCurrentVibration;
@@ -282,13 +283,19 @@ public class HardwareService extends IHardwareService.Stub {
setLight_native(mNativePointer, light, color, mode, onMS, offMS); setLight_native(mNativePointer, light, color, mode, onMS, offMS);
} }
public void setAttentionLight(boolean on) { void setAutoBrightness_UNCHECKED(boolean on) {
if (mAutoBrightnessAvailable) {
setAutoBrightness_native(mNativePointer, on);
}
}
public void setAttentionLight(boolean on, int color) {
// Not worthy of a permission. We shouldn't have a flashlight permission. // Not worthy of a permission. We shouldn't have a flashlight permission.
synchronized (this) { synchronized (this) {
mAttentionLightOn = on; mAttentionLightOn = on;
mPulsing = false; mPulsing = false;
setLight_native(mNativePointer, LIGHT_ID_ATTENTION, on ? 0xffffffff : 0, setLight_native(mNativePointer, LIGHT_ID_ATTENTION, color,
LIGHT_FLASH_NONE, 0, 0); LIGHT_FLASH_HARDWARE, on ? 3 : 0, 0);
} }
} }
@@ -302,8 +309,8 @@ public class HardwareService extends IHardwareService.Stub {
} }
if (!mAttentionLightOn && !mPulsing) { if (!mAttentionLightOn && !mPulsing) {
mPulsing = true; mPulsing = true;
setLight_native(mNativePointer, LIGHT_ID_ATTENTION, 0xff101010, setLight_native(mNativePointer, LIGHT_ID_ATTENTION, 0x00ffffff,
LIGHT_FLASH_NONE, 0, 0); LIGHT_FLASH_HARDWARE, 7, 0);
mH.sendMessageDelayed(Message.obtain(mH, 1), 3000); mH.sendMessageDelayed(Message.obtain(mH, 1), 3000);
} }
} }