Merge "Fix flashlight availability." into nyc-dev

This commit is contained in:
Jason Monk
2016-02-29 20:41:02 +00:00
committed by Android (Google) Code Review
2 changed files with 9 additions and 0 deletions

View File

@@ -68,6 +68,11 @@ public class FlashlightTile extends QSTile<QSTile.BooleanState> implements
return new Intent(MediaStore.INTENT_ACTION_STILL_IMAGE_CAMERA);
}
@Override
public boolean isAvailable() {
return mFlashlightController.hasFlashlight();
}
@Override
protected void handleClick() {
if (ActivityManager.isUserAMonkey()) {

View File

@@ -93,6 +93,10 @@ public class FlashlightController {
}
}
public boolean hasFlashlight() {
return mCameraId != null;
}
public synchronized boolean isEnabled() {
return mFlashlightEnabled;
}