Merge "Unlock camera AWB lock only when white-balance is changed." into ics-mr1
This commit is contained in:
@@ -2512,13 +2512,16 @@ public class Camera {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the white balance. Changing the setting will release the
|
* Sets the white balance. Changing the setting will release the
|
||||||
* auto-white balance lock.
|
* auto-white balance lock. It is recommended not to change white
|
||||||
|
* balance and AWB lock at the same time.
|
||||||
*
|
*
|
||||||
* @param value new white balance.
|
* @param value new white balance.
|
||||||
* @see #getWhiteBalance()
|
* @see #getWhiteBalance()
|
||||||
* @see #setAutoWhiteBalanceLock(boolean)
|
* @see #setAutoWhiteBalanceLock(boolean)
|
||||||
*/
|
*/
|
||||||
public void setWhiteBalance(String value) {
|
public void setWhiteBalance(String value) {
|
||||||
|
String oldValue = get(KEY_WHITE_BALANCE);
|
||||||
|
if (same(value, oldValue)) return;
|
||||||
set(KEY_WHITE_BALANCE, value);
|
set(KEY_WHITE_BALANCE, value);
|
||||||
set(KEY_AUTO_WHITEBALANCE_LOCK, FALSE);
|
set(KEY_AUTO_WHITEBALANCE_LOCK, FALSE);
|
||||||
}
|
}
|
||||||
@@ -3493,6 +3496,12 @@ public class Camera {
|
|||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean same(String s1, String s2) {
|
||||||
|
if (s1 == null && s2 == null) return true;
|
||||||
|
if (s1 != null && s1.equals(s2)) return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user