Merge "Import revised translations. DO NOT MERGE" into ics-mr1
diff --git a/core/java/android/hardware/Camera.java b/core/java/android/hardware/Camera.java
index c2a757f..4e38011 100644
--- a/core/java/android/hardware/Camera.java
+++ b/core/java/android/hardware/Camera.java
@@ -2512,13 +2512,16 @@
/**
* 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.
* @see #getWhiteBalance()
* @see #setAutoWhiteBalanceLock(boolean)
*/
public void setWhiteBalance(String value) {
+ String oldValue = get(KEY_WHITE_BALANCE);
+ if (same(value, oldValue)) return;
set(KEY_WHITE_BALANCE, value);
set(KEY_AUTO_WHITEBALANCE_LOCK, FALSE);
}
@@ -3493,6 +3496,12 @@
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;
+ }
};
/**
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
index b032169..ee3215c 100644
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -4020,21 +4020,26 @@
"setup_prepaid_detection_redir_host";
/**
- * The user's preferred "dream" (interactive screensaver) component.
- *
- * This component will be launched by the PhoneWindowManager after the user's chosen idle
- * timeout (specified by {@link #DREAM_TIMEOUT}).
+ * Whether the screensaver is enabled.
* @hide
*/
- public static final String DREAM_COMPONENT =
- "dream_component";
+ public static final String SCREENSAVER_ENABLED = "screensaver_enabled";
/**
- * The delay before a "dream" is started (set to 0 to disable).
+ * The user's chosen screensaver component.
+ *
+ * This component will be launched by the PhoneWindowManager after a timeout when not on
+ * battery, or upon dock insertion (if SCREENSAVER_ACTIVATE_ON_DOCK is set to 1).
* @hide
*/
- public static final String DREAM_TIMEOUT =
- "dream_timeout";
+ public static final String SCREENSAVER_COMPONENT = "screensaver_component";
+
+ /**
+ * Whether the screensaver should be automatically launched when the device is inserted
+ * into a (desk) dock.
+ * @hide
+ */
+ public static final String SCREENSAVER_ACTIVATE_ON_DOCK = "screensaver_activate_on_dock";
/** {@hide} */
public static final String NETSTATS_ENABLED = "netstats_enabled";
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index dc46d42..e2f3919 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -1487,7 +1487,8 @@
| AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED
| AccessibilityEvent.TYPE_VIEW_HOVER_ENTER
| AccessibilityEvent.TYPE_VIEW_HOVER_EXIT
- | AccessibilityEvent.TYPE_VIEW_TEXT_CHANGED;
+ | AccessibilityEvent.TYPE_VIEW_TEXT_CHANGED
+ | AccessibilityEvent.TYPE_VIEW_TEXT_SELECTION_CHANGED;
/**
* Temporary Rect currently for use in setBackground(). This will probably
diff --git a/core/java/android/view/accessibility/AccessibilityEvent.java b/core/java/android/view/accessibility/AccessibilityEvent.java
index 86dd9df..7bf0c83 100644
--- a/core/java/android/view/accessibility/AccessibilityEvent.java
+++ b/core/java/android/view/accessibility/AccessibilityEvent.java
@@ -220,15 +220,6 @@
* <li>{@link #isEnabled()} - Whether the source is enabled.</li>
* <li>{@link #getContentDescription()} - The content description of the source.</li>
* </ul>
- * <em>Note:</em> This event type is not dispatched to descendants though
- * {@link android.view.View#dispatchPopulateAccessibilityEvent(AccessibilityEvent)
- * View.dispatchPopulateAccessibilityEvent(AccessibilityEvent)}, hence the event
- * source {@link android.view.View} and the sub-tree rooted at it will not receive
- * calls to {@link android.view.View#onPopulateAccessibilityEvent(AccessibilityEvent)
- * View.onPopulateAccessibilityEvent(AccessibilityEvent)}. The preferred way to add
- * text content to such events is by setting the
- * {@link android.R.styleable#View_contentDescription contentDescription} of the source
- * view.</br>
* </p>
* <p>
* <b>View scrolled</b> - represents the event of scrolling a view. If
diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java
index 04f095f..7045f8c 100644
--- a/core/java/android/webkit/WebView.java
+++ b/core/java/android/webkit/WebView.java
@@ -17,6 +17,7 @@
package android.webkit;
import android.annotation.Widget;
+import android.app.ActivityManager;
import android.app.AlertDialog;
import android.content.BroadcastReceiver;
import android.content.ClipboardManager;
@@ -61,6 +62,7 @@
import android.util.AttributeSet;
import android.util.EventLog;
import android.util.Log;
+import android.view.Display;
import android.view.Gravity;
import android.view.HapticFeedbackConstants;
import android.view.HardwareCanvas;
@@ -77,6 +79,7 @@
import android.view.ViewGroup;
import android.view.ViewParent;
import android.view.ViewTreeObserver;
+import android.view.WindowManager;
import android.view.accessibility.AccessibilityEvent;
import android.view.accessibility.AccessibilityManager;
import android.view.accessibility.AccessibilityNodeInfo;
@@ -936,7 +939,11 @@
* Notify the listener that the picture has changed.
* @param view The WebView that owns the picture.
* @param picture The new picture.
- * @deprecated This method is now obsolete.
+ * @deprecated Due to internal changes, the picture does not include
+ * composited layers such as fixed position elements or scrollable divs.
+ * While the PictureListener API can still be used to detect changes in
+ * the WebView content, you are advised against its usage until a replacement
+ * is provided in a future Android release
*/
@Deprecated
public void onNewPicture(WebView view, Picture picture);
@@ -8451,7 +8458,11 @@
// nativeCreate sets mNativeClass to a non-zero value
String drawableDir = BrowserFrame.getRawResFilename(
BrowserFrame.DRAWABLEDIR, mContext);
- nativeCreate(msg.arg1, drawableDir);
+ WindowManager windowManager =
+ (WindowManager) mContext.getSystemService(Context.WINDOW_SERVICE);
+ Display display = windowManager.getDefaultDisplay();
+ nativeCreate(msg.arg1, drawableDir,
+ ActivityManager.isHighEndGfx(display));
if (mDelaySetPicture != null) {
setNewPicture(mDelaySetPicture, true);
mDelaySetPicture = null;
@@ -9480,7 +9491,7 @@
private native Rect nativeCacheHitNodeBounds();
private native int nativeCacheHitNodePointer();
/* package */ native void nativeClearCursor();
- private native void nativeCreate(int ptr, String drawableDir);
+ private native void nativeCreate(int ptr, String drawableDir, boolean isHighEndGfx);
private native int nativeCursorFramePointer();
private native Rect nativeCursorNodeBounds();
private native int nativeCursorNodePointer();
diff --git a/media/libmedia/MediaScannerClient.cpp b/media/libmedia/MediaScannerClient.cpp
index 7a7aeb6..629b165 100644
--- a/media/libmedia/MediaScannerClient.cpp
+++ b/media/libmedia/MediaScannerClient.cpp
@@ -82,7 +82,7 @@
// save the strings for later so they can be used for native encoding detection
mNames->push_back(name);
mValues->push_back(value);
- return true;
+ return OK;
}
// else fall through
}
diff --git a/media/libstagefright/StagefrightMediaScanner.cpp b/media/libstagefright/StagefrightMediaScanner.cpp
index bb6e4cd..2505096 100644
--- a/media/libstagefright/StagefrightMediaScanner.cpp
+++ b/media/libstagefright/StagefrightMediaScanner.cpp
@@ -94,7 +94,7 @@
char buffer[20];
sprintf(buffer, "%ld", temp);
status_t status = client->addStringTag("duration", buffer);
- if (status) {
+ if (status != OK) {
return MEDIA_SCAN_RESULT_ERROR;
}
return MEDIA_SCAN_RESULT_OK;
@@ -178,7 +178,7 @@
const char *value;
if ((value = mRetriever->extractMetadata(kKeyMap[i].key)) != NULL) {
status = client.addStringTag(kKeyMap[i].tag, value);
- if (status) {
+ if (status != OK) {
return MEDIA_SCAN_RESULT_ERROR;
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/DreamsDockLauncher.java b/packages/SystemUI/src/com/android/systemui/DreamsDockLauncher.java
index 0035296..20a1c50 100644
--- a/packages/SystemUI/src/com/android/systemui/DreamsDockLauncher.java
+++ b/packages/SystemUI/src/com/android/systemui/DreamsDockLauncher.java
@@ -24,7 +24,7 @@
private static void launchDream(Context context) {
try {
String component = Settings.Secure.getString(
- context.getContentResolver(), Settings.Secure.DREAM_COMPONENT);
+ context.getContentResolver(), Settings.Secure.SCREENSAVER_COMPONENT);
if (component == null) {
component = context.getResources().getString(
com.android.internal.R.string.config_defaultDreamComponent);
@@ -52,6 +52,12 @@
public static class DockEventReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
+ final boolean activateOnDock = 0 != Settings.Secure.getInt(
+ context.getContentResolver(),
+ Settings.Secure.SCREENSAVER_ACTIVATE_ON_DOCK, 1);
+
+ if (!activateOnDock) return;
+
if (Intent.ACTION_DOCK_EVENT.equals(intent.getAction())) {
Bundle extras = intent.getExtras();
int state = extras
diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
index 920aab8..e1676b8 100755
--- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
+++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
@@ -400,7 +400,8 @@
// visual screen saver support
int mScreenSaverTimeout = 0;
- boolean mScreenSaverEnabled = true;
+ boolean mScreenSaverEnabledByUser = false;
+ boolean mScreenSaverMayRun = true; // false if a wakelock is held
boolean mPluggedIn;
// Behavior of ENDCALL Button. (See Settings.System.END_BUTTON_BEHAVIOR.)
@@ -465,9 +466,11 @@
Settings.Secure.DEFAULT_INPUT_METHOD), false, this);
resolver.registerContentObserver(Settings.System.getUriFor(
"fancy_rotation_anim"), false, this);
+ resolver.registerContentObserver(Settings.Secure.getUriFor(
+ Settings.Secure.SCREENSAVER_ENABLED), false, this);
if (SEPARATE_TIMEOUT_FOR_SCREEN_SAVER) {
resolver.registerContentObserver(Settings.Secure.getUriFor(
- Settings.Secure.DREAM_TIMEOUT), false, this);
+ "screensaver_timeout"), false, this);
} // otherwise SCREEN_OFF_TIMEOUT will do nicely
updateSettings();
}
@@ -933,9 +936,12 @@
updateRotation = true;
}
+ mScreenSaverEnabledByUser = 0 != Settings.Secure.getInt(resolver,
+ Settings.Secure.SCREENSAVER_ENABLED, 1);
+
if (SEPARATE_TIMEOUT_FOR_SCREEN_SAVER) {
mScreenSaverTimeout = Settings.Secure.getInt(resolver,
- Settings.Secure.DREAM_TIMEOUT, 0);
+ "screensaver_timeout", 0);
} else {
mScreenSaverTimeout = Settings.System.getInt(resolver,
Settings.System.SCREEN_OFF_TIMEOUT, 0);
@@ -3451,7 +3457,7 @@
Runnable mScreenSaverActivator = new Runnable() {
public void run() {
- if (!(mScreenSaverEnabled && mScreenOnEarly)) {
+ if (!(mScreenSaverMayRun && mScreenOnEarly)) {
Log.w(TAG, "mScreenSaverActivator ran, but the screensaver should not be showing. Who's driving this thing?");
return;
}
@@ -3464,7 +3470,7 @@
try {
String component = Settings.Secure.getString(
- mContext.getContentResolver(), Settings.Secure.DREAM_COMPONENT);
+ mContext.getContentResolver(), Settings.Secure.SCREENSAVER_COMPONENT);
if (component == null) {
component = mContext.getResources().getString(R.string.config_defaultDreamComponent);
}
@@ -3492,13 +3498,13 @@
if (mScreenSaverActivator == null) return;
mHandler.removeCallbacks(mScreenSaverActivator);
- if (mScreenSaverEnabled && mScreenOnEarly && mScreenSaverTimeout > 0) {
+ if (mScreenSaverEnabledByUser && mScreenSaverMayRun && mScreenOnEarly && mScreenSaverTimeout > 0) {
if (localLOGV)
Log.v(TAG, "scheduling screensaver for " + mScreenSaverTimeout + "ms from now");
mHandler.postDelayed(mScreenSaverActivator, mScreenSaverTimeout);
} else {
if (localLOGV) {
- if (mScreenSaverTimeout == 0)
+ if (!mScreenSaverEnabledByUser || mScreenSaverTimeout == 0)
Log.v(TAG, "screen saver disabled by user");
else if (!mScreenOnEarly)
Log.v(TAG, "screen saver disabled while screen off");
@@ -3714,7 +3720,7 @@
// The window manager has just grabbed a wake lock. This is our cue to disable the screen
// saver.
synchronized (mLock) {
- mScreenSaverEnabled = false;
+ mScreenSaverMayRun = false;
}
}
@@ -3728,7 +3734,7 @@
synchronized (mLock) {
// even if the keyguard is up, now that all the wakelocks have been released, we
// should re-enable the screen saver
- mScreenSaverEnabled = true;
+ mScreenSaverMayRun = true;
updateScreenSaverTimeoutLocked();
}
}
diff --git a/voip/java/com/android/server/sip/SipHelper.java b/voip/java/com/android/server/sip/SipHelper.java
index dc628e0..113f007 100644
--- a/voip/java/com/android/server/sip/SipHelper.java
+++ b/voip/java/com/android/server/sip/SipHelper.java
@@ -73,7 +73,7 @@
*/
class SipHelper {
private static final String TAG = SipHelper.class.getSimpleName();
- private static final boolean DEBUG = true;
+ private static final boolean DEBUG = false;
private static final boolean DEBUG_PING = false;
private SipStack mSipStack;
diff --git a/voip/java/com/android/server/sip/SipService.java b/voip/java/com/android/server/sip/SipService.java
index 119ed54..38a683e 100644
--- a/voip/java/com/android/server/sip/SipService.java
+++ b/voip/java/com/android/server/sip/SipService.java
@@ -68,8 +68,7 @@
*/
public final class SipService extends ISipService.Stub {
static final String TAG = "SipService";
- static final boolean DEBUGV = false;
- static final boolean DEBUG = true;
+ static final boolean DEBUG = false;
private static final int EXPIRY_TIME = 3600;
private static final int SHORT_EXPIRY_TIME = 10;
private static final int MIN_EXPIRY_TIME = 60;
@@ -581,7 +580,7 @@
@Override
public void onRinging(ISipSession s, SipProfile caller,
String sessionDescription) {
- if (DEBUGV) Log.d(TAG, "<<<<< onRinging()");
+ if (DEBUG) Log.d(TAG, "<<<<< onRinging()");
SipSessionGroup.SipSessionImpl session =
(SipSessionGroup.SipSessionImpl) s;
synchronized (SipService.this) {
@@ -778,7 +777,6 @@
private void restartLater() {
synchronized (SipService.this) {
int interval = NAT_MEASUREMENT_RETRY_INTERVAL;
- Log.d(TAG, "Retry measurement " + interval + "s later.");
mTimer.cancel(this);
mTimer.set(interval * 1000, this);
}
@@ -788,7 +786,7 @@
private class AutoRegistrationProcess extends SipSessionAdapter
implements Runnable, SipSessionGroup.KeepAliveProcessCallback {
private static final int MIN_KEEPALIVE_SUCCESS_COUNT = 10;
- private String TAG = "SipAudoReg";
+ private String TAG = "SipAutoReg";
private SipSessionGroup.SipSessionImpl mSession;
private SipSessionGroup.SipSessionImpl mKeepAliveSession;
@@ -820,13 +818,12 @@
// in registration to avoid adding duplicate entries to server
mMyWakeLock.acquire(mSession);
mSession.unregister();
- if (DEBUG) TAG = mSession.getLocalProfile().getUriString();
- if (DEBUG) Log.d(TAG, "start AutoRegistrationProcess");
+ TAG = "SipAutoReg:" + mSession.getLocalProfile().getUriString();
}
}
private void startKeepAliveProcess(int interval) {
- Log.d(TAG, "start keepalive w interval=" + interval);
+ if (DEBUG) Log.d(TAG, "start keepalive w interval=" + interval);
if (mKeepAliveSession == null) {
mKeepAliveSession = mSession.duplicate();
} else {
@@ -864,9 +861,11 @@
mKeepAliveSuccessCount = 0;
}
} else {
- Log.i(TAG, "keep keepalive going with interval "
- + interval + ", past success count="
- + mKeepAliveSuccessCount);
+ if (DEBUG) {
+ Log.i(TAG, "keep keepalive going with interval "
+ + interval + ", past success count="
+ + mKeepAliveSuccessCount);
+ }
mKeepAliveSuccessCount /= 2;
}
} else {
@@ -894,7 +893,9 @@
// SipSessionGroup.KeepAliveProcessCallback
@Override
public void onError(int errorCode, String description) {
- Log.e(TAG, "keepalive error: " + description);
+ if (DEBUG) {
+ Log.e(TAG, "keepalive error: " + description);
+ }
onResponse(true); // re-register immediately
}
@@ -917,7 +918,7 @@
public void onKeepAliveIntervalChanged() {
if (mKeepAliveSession != null) {
int newInterval = getKeepAliveInterval();
- if (DEBUGV) {
+ if (DEBUG) {
Log.v(TAG, "restart keepalive w interval=" + newInterval);
}
mKeepAliveSuccessCount = 0;
@@ -987,7 +988,7 @@
}
private void restart(int duration) {
- if (DEBUG) Log.d(TAG, "Refresh registration " + duration + "s later.");
+ Log.d(TAG, "Refresh registration " + duration + "s later.");
mTimer.cancel(this);
mTimer.set(duration * 1000, this);
}
diff --git a/voip/java/com/android/server/sip/SipSessionGroup.java b/voip/java/com/android/server/sip/SipSessionGroup.java
index 06cdaf2..877a0a4 100644
--- a/voip/java/com/android/server/sip/SipSessionGroup.java
+++ b/voip/java/com/android/server/sip/SipSessionGroup.java
@@ -89,8 +89,8 @@
*/
class SipSessionGroup implements SipListener {
private static final String TAG = "SipSession";
- private static final boolean DEBUG = true;
- private static final boolean DEBUG_PING = DEBUG && false;
+ private static final boolean DEBUG = false;
+ private static final boolean DEBUG_PING = false;
private static final String ANONYMOUS = "anonymous";
// Limit the size of thread pool to 1 for the order issue when the phone is
// waken up from sleep and there are many packets to be processed in the SIP
@@ -205,7 +205,9 @@
}
synchronized void resetExternalAddress() {
- Log.d(TAG, " reset external addr on " + mSipStack);
+ if (DEBUG) {
+ Log.d(TAG, " reset external addr on " + mSipStack);
+ }
mExternalIp = null;
mExternalPort = 0;
}
@@ -362,7 +364,7 @@
+ SipSession.State.toString(session.mState));
}
} catch (Throwable e) {
- Log.w(TAG, "event process error: " + event, e);
+ Log.w(TAG, "event process error: " + event, getRootCause(e));
session.onError(e);
}
}
@@ -393,11 +395,22 @@
if ((rport > 0) && (externalIp != null)) {
mExternalIp = externalIp;
mExternalPort = rport;
- Log.d(TAG, " got external addr " + externalIp + ":" + rport
- + " on " + mSipStack);
+ if (DEBUG) {
+ Log.d(TAG, " got external addr " + externalIp + ":" + rport
+ + " on " + mSipStack);
+ }
}
}
+ private Throwable getRootCause(Throwable exception) {
+ Throwable cause = exception.getCause();
+ while (cause != null) {
+ exception = cause;
+ cause = exception.getCause();
+ }
+ return exception;
+ }
+
private SipSessionImpl createNewSession(RequestEvent event,
ISipSessionListener listener, ServerTransaction transaction,
int newState) throws SipException {
@@ -890,7 +903,9 @@
if (expires != null && time < expires.getExpires()) {
time = expires.getExpires();
}
- Log.v(TAG, "Expiry time = " + time);
+ if (DEBUG) {
+ Log.v(TAG, "Expiry time = " + time);
+ }
return time;
}
@@ -1409,15 +1424,6 @@
}
}
- private Throwable getRootCause(Throwable exception) {
- Throwable cause = exception.getCause();
- while (cause != null) {
- exception = cause;
- cause = exception.getCause();
- }
- return exception;
- }
-
private int getErrorCode(Throwable exception) {
String message = exception.getMessage();
if (exception instanceof UnknownHostException) {
@@ -1555,8 +1561,10 @@
try {
sendKeepAlive();
} catch (Throwable t) {
- Log.w(TAG, "keepalive error: "
- + mLocalProfile.getUriString(), getRootCause(t));
+ if (DEBUG) {
+ Log.w(TAG, "keepalive error: "
+ + mLocalProfile.getUriString(), getRootCause(t));
+ }
// It's possible that the keepalive process is being stopped
// during session.sendKeepAlive() so need to check mRunning
// again here.
diff --git a/voip/java/com/android/server/sip/SipWakeLock.java b/voip/java/com/android/server/sip/SipWakeLock.java
index 52bc094..0c4d14c 100644
--- a/voip/java/com/android/server/sip/SipWakeLock.java
+++ b/voip/java/com/android/server/sip/SipWakeLock.java
@@ -22,8 +22,8 @@
import java.util.HashSet;
class SipWakeLock {
- private static final boolean DEBUGV = SipService.DEBUGV;
- private static final String TAG = SipService.TAG;
+ private static final boolean DEBUG = false;
+ private static final String TAG = "SipWakeLock";
private PowerManager mPowerManager;
private PowerManager.WakeLock mWakeLock;
private PowerManager.WakeLock mTimerWakeLock;
@@ -34,9 +34,9 @@
}
synchronized void reset() {
+ if (DEBUG) Log.v(TAG, "reset count=" + mHolders.size());
mHolders.clear();
release(null);
- if (DEBUGV) Log.v(TAG, "~~~ hard reset wakelock");
}
synchronized void acquire(long timeout) {
@@ -55,8 +55,7 @@
PowerManager.PARTIAL_WAKE_LOCK, "SipWakeLock");
}
if (!mWakeLock.isHeld()) mWakeLock.acquire();
- if (DEBUGV) Log.v(TAG, "acquire wakelock: holder count="
- + mHolders.size());
+ if (DEBUG) Log.v(TAG, "acquire count=" + mHolders.size());
}
synchronized void release(Object holder) {
@@ -65,7 +64,6 @@
&& mWakeLock.isHeld()) {
mWakeLock.release();
}
- if (DEBUGV) Log.v(TAG, "release wakelock: holder count="
- + mHolders.size());
+ if (DEBUG) Log.v(TAG, "release count=" + mHolders.size());
}
}