Merge "Fix flashlight availability." into nyc-dev
This commit is contained in:
@@ -68,6 +68,11 @@ public class FlashlightTile extends QSTile<QSTile.BooleanState> implements
|
|||||||
return new Intent(MediaStore.INTENT_ACTION_STILL_IMAGE_CAMERA);
|
return new Intent(MediaStore.INTENT_ACTION_STILL_IMAGE_CAMERA);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isAvailable() {
|
||||||
|
return mFlashlightController.hasFlashlight();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void handleClick() {
|
protected void handleClick() {
|
||||||
if (ActivityManager.isUserAMonkey()) {
|
if (ActivityManager.isUserAMonkey()) {
|
||||||
|
|||||||
@@ -93,6 +93,10 @@ public class FlashlightController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean hasFlashlight() {
|
||||||
|
return mCameraId != null;
|
||||||
|
}
|
||||||
|
|
||||||
public synchronized boolean isEnabled() {
|
public synchronized boolean isEnabled() {
|
||||||
return mFlashlightEnabled;
|
return mFlashlightEnabled;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user