QS: Don't set flashlight state when we don't have an id
am: ad32c550c0
Change-Id: I222d528ff37cc835bbcb66eb650954c49e5af935
This commit is contained in:
@@ -3405,6 +3405,9 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
|
|||||||
if (KeyguardUpdateMonitor.getInstance(mContext) != null) {
|
if (KeyguardUpdateMonitor.getInstance(mContext) != null) {
|
||||||
KeyguardUpdateMonitor.getInstance(mContext).dump(fd, pw, args);
|
KeyguardUpdateMonitor.getInstance(mContext).dump(fd, pw, args);
|
||||||
}
|
}
|
||||||
|
if (mFlashlightController != null) {
|
||||||
|
mFlashlightController.dump(fd, pw, args);
|
||||||
|
}
|
||||||
|
|
||||||
FalsingManager.getInstance(mContext).dump(pw);
|
FalsingManager.getInstance(mContext).dump(pw);
|
||||||
FalsingLog.dump(pw);
|
FalsingLog.dump(pw);
|
||||||
|
|||||||
@@ -27,6 +27,8 @@ import android.os.Process;
|
|||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
|
import java.io.FileDescriptor;
|
||||||
|
import java.io.PrintWriter;
|
||||||
import java.lang.ref.WeakReference;
|
import java.lang.ref.WeakReference;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
@@ -80,6 +82,7 @@ public class FlashlightController {
|
|||||||
public void setFlashlight(boolean enabled) {
|
public void setFlashlight(boolean enabled) {
|
||||||
boolean pendingError = false;
|
boolean pendingError = false;
|
||||||
synchronized (this) {
|
synchronized (this) {
|
||||||
|
if (mCameraId == null) return;
|
||||||
if (mFlashlightEnabled != enabled) {
|
if (mFlashlightEnabled != enabled) {
|
||||||
mFlashlightEnabled = enabled;
|
mFlashlightEnabled = enabled;
|
||||||
try {
|
try {
|
||||||
@@ -235,6 +238,17 @@ public class FlashlightController {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
public void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
|
||||||
|
pw.println("FlashlightController state:");
|
||||||
|
|
||||||
|
pw.print(" mCameraId=");
|
||||||
|
pw.println(mCameraId);
|
||||||
|
pw.print(" mFlashlightEnabled=");
|
||||||
|
pw.println(mFlashlightEnabled);
|
||||||
|
pw.print(" mTorchAvailable=");
|
||||||
|
pw.println(mTorchAvailable);
|
||||||
|
}
|
||||||
|
|
||||||
public interface FlashlightListener {
|
public interface FlashlightListener {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user