summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/java/android/app/StatusBarManager.java44
-rw-r--r--core/java/android/database/sqlite/package.html2
-rw-r--r--core/java/android/os/CountDownTimer.java2
-rw-r--r--core/java/android/provider/CalendarContract.java18
-rw-r--r--core/java/android/text/DynamicLayout.java6
-rw-r--r--core/java/android/text/StaticLayout.java144
-rw-r--r--core/java/android/view/View.java1
-rw-r--r--core/java/android/view/ViewRootImpl.java8
-rw-r--r--core/java/android/webkit/JniUtil.java8
-rw-r--r--core/java/android/webkit/WebSettings.java2
-rw-r--r--core/java/android/webkit/WebTextView.java53
-rw-r--r--core/java/android/webkit/WebView.java4
-rw-r--r--core/java/android/webkit/ZoomManager.java14
-rw-r--r--core/java/android/widget/RemoteViews.java10
-rw-r--r--core/java/android/widget/TextView.java20
-rw-r--r--core/java/com/android/internal/widget/ActionBarContextView.java9
-rw-r--r--core/java/com/android/internal/widget/ActionBarView.java4
-rw-r--r--core/jni/android/graphics/TextLayoutCache.cpp2
18 files changed, 206 insertions, 145 deletions
diff --git a/core/java/android/app/StatusBarManager.java b/core/java/android/app/StatusBarManager.java
index 7863102..5b8addf 100644
--- a/core/java/android/app/StatusBarManager.java
+++ b/core/java/android/app/StatusBarManager.java
@@ -22,6 +22,7 @@ import android.os.Binder;
import android.os.RemoteException;
import android.os.IBinder;
import android.os.ServiceManager;
+import android.util.Slog;
import android.view.View;
import com.android.internal.statusbar.IStatusBarService;
@@ -61,8 +62,17 @@ public class StatusBarManager {
StatusBarManager(Context context) {
mContext = context;
- mService = IStatusBarService.Stub.asInterface(
- ServiceManager.getService(Context.STATUS_BAR_SERVICE));
+ }
+
+ private synchronized IStatusBarService getService() {
+ if (mService == null) {
+ mService = IStatusBarService.Stub.asInterface(
+ ServiceManager.getService(Context.STATUS_BAR_SERVICE));
+ if (mService == null) {
+ Slog.w("StatusBarManager", "warning: no STATUS_BAR_SERVICE");
+ }
+ }
+ return mService;
}
/**
@@ -71,8 +81,9 @@ public class StatusBarManager {
*/
public void disable(int what) {
try {
- if (mService != null) {
- mService.disable(what, mToken, mContext.getPackageName());
+ final IStatusBarService svc = getService();
+ if (svc != null) {
+ svc.disable(what, mToken, mContext.getPackageName());
}
} catch (RemoteException ex) {
// system process is dead anyway.
@@ -85,7 +96,10 @@ public class StatusBarManager {
*/
public void expand() {
try {
- mService.expand();
+ final IStatusBarService svc = getService();
+ if (svc != null) {
+ svc.expand();
+ }
} catch (RemoteException ex) {
// system process is dead anyway.
throw new RuntimeException(ex);
@@ -97,7 +111,10 @@ public class StatusBarManager {
*/
public void collapse() {
try {
- mService.collapse();
+ final IStatusBarService svc = getService();
+ if (svc != null) {
+ svc.collapse();
+ }
} catch (RemoteException ex) {
// system process is dead anyway.
throw new RuntimeException(ex);
@@ -106,8 +123,11 @@ public class StatusBarManager {
public void setIcon(String slot, int iconId, int iconLevel, String contentDescription) {
try {
- mService.setIcon(slot, mContext.getPackageName(), iconId, iconLevel,
+ final IStatusBarService svc = getService();
+ if (svc != null) {
+ svc.setIcon(slot, mContext.getPackageName(), iconId, iconLevel,
contentDescription);
+ }
} catch (RemoteException ex) {
// system process is dead anyway.
throw new RuntimeException(ex);
@@ -116,7 +136,10 @@ public class StatusBarManager {
public void removeIcon(String slot) {
try {
- mService.removeIcon(slot);
+ final IStatusBarService svc = getService();
+ if (svc != null) {
+ svc.removeIcon(slot);
+ }
} catch (RemoteException ex) {
// system process is dead anyway.
throw new RuntimeException(ex);
@@ -125,7 +148,10 @@ public class StatusBarManager {
public void setIconVisibility(String slot, boolean visible) {
try {
- mService.setIconVisibility(slot, visible);
+ final IStatusBarService svc = getService();
+ if (svc != null) {
+ svc.setIconVisibility(slot, visible);
+ }
} catch (RemoteException ex) {
// system process is dead anyway.
throw new RuntimeException(ex);
diff --git a/core/java/android/database/sqlite/package.html b/core/java/android/database/sqlite/package.html
index ff0f9f5..ceed171 100644
--- a/core/java/android/database/sqlite/package.html
+++ b/core/java/android/database/sqlite/package.html
@@ -3,7 +3,7 @@
Contains the SQLite database management
classes that an application would use to manage its own private database.
<p>
-Applications use these classes to maange private databases. If creating a
+Applications use these classes to manage private databases. If creating a
content provider, you will probably have to use these classes to create and
manage your own database to store content. See <a
href="{@docRoot}guide/topics/providers/content-providers.html">Content Providers</a> to learn
diff --git a/core/java/android/os/CountDownTimer.java b/core/java/android/os/CountDownTimer.java
index 0c5c615..15e6405 100644
--- a/core/java/android/os/CountDownTimer.java
+++ b/core/java/android/os/CountDownTimer.java
@@ -25,7 +25,7 @@ import android.util.Log;
* Example of showing a 30 second countdown in a text field:
*
* <pre class="prettyprint">
- * new CountdownTimer(30000, 1000) {
+ * new CountDownTimer(30000, 1000) {
*
* public void onTick(long millisUntilFinished) {
* mTextField.setText("seconds remaining: " + millisUntilFinished / 1000);
diff --git a/core/java/android/provider/CalendarContract.java b/core/java/android/provider/CalendarContract.java
index ded496c..b14ca2b 100644
--- a/core/java/android/provider/CalendarContract.java
+++ b/core/java/android/provider/CalendarContract.java
@@ -304,7 +304,8 @@ public final class CalendarContract {
* or an empty string are reserved for indicating that the calendar does
* not use an index for looking up the color. The provider will update
* {@link #CALENDAR_COLOR} automatically when a valid index is written
- * to this column. @see Colors
+ * to this column. The index must reference an existing row of the
+ * {@link Colors} table. @see Colors
* <P>
* Type: TEXT
* </P>
@@ -852,8 +853,11 @@ public final class CalendarContract {
* string are reserved for indicating that the event does not use an
* index for looking up the color. The provider will update
* {@link #EVENT_COLOR} automatically when a valid index is written to
- * this column. @see Colors
- * <P>Type: TEXT</P>
+ * this column. The index must reference an existing row of the
+ * {@link Colors} table. @see Colors
+ * <P>
+ * Type: TEXT
+ * </P>
* TODO UNHIDE
*
* @hide
@@ -2329,7 +2333,7 @@ public final class CalendarContract {
/**
* The index used to reference this color. This can be any non-empty
* string, but must be unique for a given {@link #ACCOUNT_TYPE} and
- * {@link #ACCOUNT_NAME} . Column name.
+ * {@link #ACCOUNT_NAME}. Column name.
* <P>
* Type: TEXT
* </P>
@@ -2353,8 +2357,10 @@ public final class CalendarContract {
/**
* Fields for accessing colors available for a given account. Colors are
* referenced by {@link #COLOR_INDEX} which must be unique for a given
- * account name/type. These values should only be updated by the sync
- * adapter.
+ * account name/type. These values can only be updated by the sync
+ * adapter. Only {@link #COLOR} may be updated after the initial insert. In
+ * addition, a row can only be deleted once all references to that color
+ * have been removed from the {@link Calendars} or {@link Events} tables.
* TODO UNHIDE
*
* @hide
diff --git a/core/java/android/text/DynamicLayout.java b/core/java/android/text/DynamicLayout.java
index f82c9c4..026af34 100644
--- a/core/java/android/text/DynamicLayout.java
+++ b/core/java/android/text/DynamicLayout.java
@@ -281,9 +281,9 @@ extends Layout
}
reflowed.generate(text, where, where + after,
- getPaint(), getWidth(), getAlignment(), getTextDirectionHeuristic(),
- getSpacingMultiplier(), getSpacingAdd(),
- false, true, mEllipsizedWidth, mEllipsizeAt);
+ getPaint(), getWidth(), getTextDirectionHeuristic(), getSpacingMultiplier(),
+ getSpacingAdd(), false,
+ true, mEllipsizedWidth, mEllipsizeAt);
int n = reflowed.getLineCount();
// If the new layout has a blank line at the end, but it is not
diff --git a/core/java/android/text/StaticLayout.java b/core/java/android/text/StaticLayout.java
index 583cbe6..1dd4c8a 100644
--- a/core/java/android/text/StaticLayout.java
+++ b/core/java/android/text/StaticLayout.java
@@ -137,9 +137,9 @@ public class StaticLayout extends Layout {
mMeasured = MeasuredText.obtain();
- generate(source, bufstart, bufend, paint, outerwidth, align, textDir,
- spacingmult, spacingadd, includepad, includepad,
- ellipsizedWidth, ellipsize);
+ generate(source, bufstart, bufend, paint, outerwidth, textDir, spacingmult,
+ spacingadd, includepad, includepad, ellipsizedWidth,
+ ellipsize);
mMeasured = MeasuredText.recycle(mMeasured);
mFontMetricsInt = null;
@@ -157,10 +157,10 @@ public class StaticLayout extends Layout {
/* package */ void generate(CharSequence source, int bufStart, int bufEnd,
TextPaint paint, int outerWidth,
- Alignment align, TextDirectionHeuristic textDir,
- float spacingmult, float spacingadd,
- boolean includepad, boolean trackpad,
- float ellipsizedWidth, TextUtils.TruncateAt ellipsize) {
+ TextDirectionHeuristic textDir, float spacingmult,
+ float spacingadd, boolean includepad,
+ boolean trackpad, float ellipsizedWidth,
+ TextUtils.TruncateAt ellipsize) {
mLineCount = 0;
int v = 0;
@@ -328,9 +328,7 @@ public class StaticLayout extends Layout {
whichPaint = mWorkPaint;
}
- float wid = bm.getWidth() *
- -whichPaint.ascent() /
- bm.getHeight();
+ float wid = bm.getWidth() * -whichPaint.ascent() / bm.getHeight();
w += wid;
hasTabOrEmoji = true;
@@ -398,67 +396,49 @@ public class StaticLayout extends Layout {
okBottom = fitBottom;
}
} else {
- final boolean moreChars = (j + 1 < spanEnd);
- if (ok != here) {
- // Log.e("text", "output ok " + here + " to " +ok);
+ final boolean moreChars = (j + 1 < spanEnd);
+ int endPos;
+ int above, below, top, bottom;
+ float currentTextWidth;
- while (ok < spanEnd && chs[ok - paraStart] == CHAR_SPACE) {
- ok++;
- }
+ if (ok != here) {
+ // If it is a space that makes the length exceed width, cut here
+ if (c == CHAR_SPACE) ok = j + 1;
- v = out(source,
- here, ok,
- okAscent, okDescent, okTop, okBottom,
- v,
- spacingmult, spacingadd, chooseHt,
- chooseHtv, fm, hasTabOrEmoji,
- needMultiply, paraStart, chdirs, dir, easy,
- ok == bufEnd, includepad, trackpad,
- chs, widths, paraStart,
- ellipsize, ellipsizedWidth, okWidth,
- paint, moreChars);
-
- here = ok;
- } else if (fit != here) {
- // Log.e("text", "output fit " + here + " to " +fit);
- v = out(source,
- here, fit,
- fitAscent, fitDescent,
- fitTop, fitBottom,
- v,
- spacingmult, spacingadd, chooseHt,
- chooseHtv, fm, hasTabOrEmoji,
- needMultiply, paraStart, chdirs, dir, easy,
- fit == bufEnd, includepad, trackpad,
- chs, widths, paraStart,
- ellipsize, ellipsizedWidth, fitWidth,
- paint, moreChars);
-
- here = fit;
- } else {
- // Log.e("text", "output one " + here + " to " +(here + 1));
- // XXX not sure why the existing fm wasn't ok.
- // measureText(paint, mWorkPaint,
- // source, here, here + 1, fm, tab,
- // null);
-
- v = out(source,
- here, here+1,
- fm.ascent, fm.descent,
- fm.top, fm.bottom,
- v,
- spacingmult, spacingadd, chooseHt,
- chooseHtv, fm, hasTabOrEmoji,
- needMultiply, paraStart, chdirs, dir, easy,
- here + 1 == bufEnd, includepad,
- trackpad,
- chs, widths, paraStart,
- ellipsize, ellipsizedWidth,
- widths[here - paraStart], paint, moreChars);
-
- here = here + 1;
+ while (ok < spanEnd && chs[ok - paraStart] == CHAR_SPACE) {
+ ok++;
}
+ endPos = ok;
+ above = okAscent;
+ below = okDescent;
+ top = okTop;
+ bottom = okBottom;
+ currentTextWidth = okWidth;
+ } else if (fit != here) {
+ endPos = fit;
+ above = fitAscent;
+ below = fitDescent;
+ top = fitTop;
+ bottom = fitBottom;
+ currentTextWidth = fitWidth;
+ } else {
+ endPos = here + 1;
+ above = fm.ascent;
+ below = fm.descent;
+ top = fm.top;
+ bottom = fm.bottom;
+ currentTextWidth = widths[here - paraStart];
+ }
+
+ v = out(source, here, endPos,
+ above, below, top, bottom,
+ v, spacingmult, spacingadd, chooseHt,chooseHtv, fm, hasTabOrEmoji,
+ needMultiply, chdirs, dir, easy, bufEnd, includepad, trackpad,
+ chs, widths, paraStart, ellipsize, ellipsizedWidth,
+ currentTextWidth, paint, moreChars);
+ here = endPos;
+
if (here < spanStart) {
// didn't output all the text for this span
// we've measured the raw widths, though, so
@@ -501,10 +481,10 @@ public class StaticLayout extends Layout {
v,
spacingmult, spacingadd, chooseHt,
chooseHtv, fm, hasTabOrEmoji,
- needMultiply, paraStart, chdirs, dir, easy,
- paraEnd == bufEnd, includepad, trackpad,
- chs, widths, paraStart,
- ellipsize, ellipsizedWidth, w, paint, paraEnd != bufEnd);
+ needMultiply, chdirs, dir, easy, bufEnd,
+ includepad, trackpad, chs,
+ widths, paraStart, ellipsize,
+ ellipsizedWidth, w, paint, paraEnd != bufEnd);
}
paraStart = paraEnd;
@@ -525,10 +505,10 @@ public class StaticLayout extends Layout {
v,
spacingmult, spacingadd, null,
null, fm, false,
- needMultiply, bufEnd, null, DEFAULT_DIR, true,
- true, includepad, trackpad,
- null, null, bufStart,
- ellipsize, ellipsizedWidth, 0, paint, false);
+ needMultiply, null, DEFAULT_DIR, true, bufEnd,
+ includepad, trackpad, null,
+ null, bufStart, ellipsize,
+ ellipsizedWidth, 0, paint, false);
}
}
@@ -628,12 +608,12 @@ public class StaticLayout extends Layout {
float spacingmult, float spacingadd,
LineHeightSpan[] chooseHt, int[] chooseHtv,
Paint.FontMetricsInt fm, boolean hasTabOrEmoji,
- boolean needMultiply, int pstart, byte[] chdirs,
- int dir, boolean easy, boolean last,
- boolean includePad, boolean trackPad,
- char[] chs, float[] widths, int widthStart,
- TextUtils.TruncateAt ellipsize, float ellipsisWidth,
- float textWidth, TextPaint paint, boolean moreChars) {
+ boolean needMultiply, byte[] chdirs, int dir,
+ boolean easy, int bufEnd, boolean includePad,
+ boolean trackPad, char[] chs,
+ float[] widths, int widthStart, TextUtils.TruncateAt ellipsize,
+ float ellipsisWidth, float textWidth,
+ TextPaint paint, boolean moreChars) {
int j = mLineCount;
int off = j * mColumns;
int want = off + mColumns + TOP;
@@ -683,7 +663,7 @@ public class StaticLayout extends Layout {
above = top;
}
}
- if (last) {
+ if (end == bufEnd) {
if (trackPad) {
mBottomPadding = bottom - below;
}
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index a2f9b36..fea79d5 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -4219,6 +4219,7 @@ public class View implements Drawable.Callback, Drawable.Callback2, KeyEvent.Cal
*
* @attr ref android.R.styleable#View_contentDescription
*/
+ @RemotableViewMethod
public void setContentDescription(CharSequence contentDescription) {
mContentDescription = contentDescription;
}
diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java
index abb5bc8..a36aecb 100644
--- a/core/java/android/view/ViewRootImpl.java
+++ b/core/java/android/view/ViewRootImpl.java
@@ -287,7 +287,7 @@ public final class ViewRootImpl extends Handler implements ViewParent,
final AccessibilityManager mAccessibilityManager;
- AccessibilityInteractionController mAccessibilityInteractionContrtoller;
+ AccessibilityInteractionController mAccessibilityInteractionController;
AccessibilityInteractionConnectionManager mAccessibilityInteractionConnectionManager;
@@ -3526,10 +3526,10 @@ public final class ViewRootImpl extends Handler implements ViewParent,
throw new IllegalStateException("getAccessibilityInteractionController"
+ " called when there is no mView");
}
- if (mAccessibilityInteractionContrtoller == null) {
- mAccessibilityInteractionContrtoller = new AccessibilityInteractionController();
+ if (mAccessibilityInteractionController == null) {
+ mAccessibilityInteractionController = new AccessibilityInteractionController();
}
- return mAccessibilityInteractionContrtoller;
+ return mAccessibilityInteractionController;
}
private int relayoutWindow(WindowManager.LayoutParams params, int viewVisibility,
diff --git a/core/java/android/webkit/JniUtil.java b/core/java/android/webkit/JniUtil.java
index 7759ff3..4662040 100644
--- a/core/java/android/webkit/JniUtil.java
+++ b/core/java/android/webkit/JniUtil.java
@@ -22,6 +22,7 @@ import android.net.Uri;
import android.provider.Settings;
import android.util.Log;
+import java.io.File;
import java.io.InputStream;
class JniUtil {
@@ -79,7 +80,12 @@ class JniUtil {
checkInitialized();
if (sCacheDirectory == null) {
- sCacheDirectory = sContext.getCacheDir().getAbsolutePath();
+ File cacheDir = sContext.getCacheDir();
+ if (cacheDir == null) {
+ sCacheDirectory = "";
+ } else {
+ sCacheDirectory = cacheDir.getAbsolutePath();
+ }
}
return sCacheDirectory;
diff --git a/core/java/android/webkit/WebSettings.java b/core/java/android/webkit/WebSettings.java
index f1c2bde..f240a2e 100644
--- a/core/java/android/webkit/WebSettings.java
+++ b/core/java/android/webkit/WebSettings.java
@@ -777,7 +777,7 @@ public class WebSettings {
public void setDoubleTapZoom(int doubleTapZoom) {
if (mDoubleTapZoom != doubleTapZoom) {
mDoubleTapZoom = doubleTapZoom;
- mWebView.updateDoubleTapZoom();
+ mWebView.updateDoubleTapZoom(doubleTapZoom);
}
}
diff --git a/core/java/android/webkit/WebTextView.java b/core/java/android/webkit/WebTextView.java
index b0ecf09..ccacd09 100644
--- a/core/java/android/webkit/WebTextView.java
+++ b/core/java/android/webkit/WebTextView.java
@@ -607,23 +607,31 @@ import junit.framework.Assert;
// character or the existing selection, so it will not get cleared
// above.
mGotDelete = false;
+ // Prefer sending javascript events, so when adding one character,
+ // don't replace the unchanged text.
+ if (count > 1 && before == count - 1) {
+ String replaceButOne = s.subSequence(start,
+ start + before).toString();
+ String replacedString = getText().subSequence(start,
+ start + before).toString();
+ if (replaceButOne.equals(replacedString)) {
+ // we're just adding one character
+ start += before;
+ before = 0;
+ count = 1;
+ }
+ }
// Find the last character being replaced. If it can be represented by
- // events, we will pass them to native (after replacing the beginning
- // of the changed text), so we can see javascript events.
- // Otherwise, replace the text being changed (including the last
- // character) in the textfield.
- TextUtils.getChars(s, start + count - 1, start + count, mCharacter, 0);
- KeyCharacterMap kmap = KeyCharacterMap.load(KeyCharacterMap.VIRTUAL_KEYBOARD);
- KeyEvent[] events = kmap.getEvents(mCharacter);
- boolean cannotUseKeyEvents = null == events;
- int charactersFromKeyEvents = cannotUseKeyEvents ? 0 : 1;
- if (count > 1 || cannotUseKeyEvents) {
- String replace = s.subSequence(start,
- start + count - charactersFromKeyEvents).toString();
- mWebView.replaceTextfieldText(start, start + before, replace,
- start + count - charactersFromKeyEvents,
- start + count - charactersFromKeyEvents);
- } else {
+ // events, we will pass them to native so we can see javascript events.
+ // Otherwise, replace the text being changed in the textfield.
+ KeyEvent[] events = null;
+ if (count == 1) {
+ TextUtils.getChars(s, start + count - 1, start + count, mCharacter, 0);
+ KeyCharacterMap kmap = KeyCharacterMap.load(KeyCharacterMap.VIRTUAL_KEYBOARD);
+ events = kmap.getEvents(mCharacter);
+ }
+ boolean useKeyEvents = (events != null);
+ if (useKeyEvents) {
// This corrects the selection which may have been affected by the
// trackball or auto-correct.
if (DebugFlags.WEB_TEXT_VIEW) {
@@ -633,8 +641,6 @@ import junit.framework.Assert;
if (!mInSetTextAndKeepSelection) {
mWebView.setSelection(start, start + before);
}
- }
- if (!cannotUseKeyEvents) {
int length = events.length;
for (int i = 0; i < length; i++) {
// We never send modifier keys to native code so don't send them
@@ -643,6 +649,12 @@ import junit.framework.Assert;
sendDomEvent(events[i]);
}
}
+ } else {
+ String replace = s.subSequence(start,
+ start + count).toString();
+ mWebView.replaceTextfieldText(start, start + before, replace,
+ start + count,
+ start + count);
}
updateCachedTextfield();
}
@@ -966,8 +978,11 @@ import junit.framework.Assert;
* @param text The new text to place in the textfield.
*/
/* package */ void setTextAndKeepSelection(String text) {
- mPreChange = text.toString();
Editable edit = getText();
+ mPreChange = text;
+ if (edit.toString().equals(text)) {
+ return;
+ }
int selStart = Selection.getSelectionStart(edit);
int selEnd = Selection.getSelectionEnd(edit);
mInSetTextAndKeepSelection = true;
diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java
index 71ba7eb..a814b12 100644
--- a/core/java/android/webkit/WebView.java
+++ b/core/java/android/webkit/WebView.java
@@ -2995,8 +2995,8 @@ public class WebView extends AbsoluteLayout
/**
* Update the double-tap zoom.
*/
- /* package */ void updateDoubleTapZoom() {
- mZoomManager.updateDoubleTapZoom();
+ /* package */ void updateDoubleTapZoom(int doubleTapZoom) {
+ mZoomManager.updateDoubleTapZoom(doubleTapZoom);
}
private int computeRealHorizontalScrollRange() {
diff --git a/core/java/android/webkit/ZoomManager.java b/core/java/android/webkit/ZoomManager.java
index 9151fdd..7d3cf8e 100644
--- a/core/java/android/webkit/ZoomManager.java
+++ b/core/java/android/webkit/ZoomManager.java
@@ -152,6 +152,12 @@ class ZoomManager {
private float mDisplayDensity;
/*
+ * The factor that is used to tweak the zoom scale on a double-tap,
+ * and can be changed via WebSettings. Range is from 0.75f to 1.25f.
+ */
+ private float mDoubleTapZoomFactor = 1.0f;
+
+ /*
* The scale factor that is used as the minimum increment when going from
* overview to reading level on a double tap.
*/
@@ -314,10 +320,7 @@ class ZoomManager {
* Returns the zoom scale used for reading text on a double-tap.
*/
public final float getReadingLevelScale() {
- WebSettings settings = mWebView.getSettings();
- final float doubleTapZoomFactor = settings != null
- ? settings.getDoubleTapZoom() / 100.f : 1.0f;
- return mDisplayDensity * doubleTapZoomFactor;
+ return mDisplayDensity * mDoubleTapZoomFactor;
}
public final float getInvDefaultScale() {
@@ -516,8 +519,9 @@ class ZoomManager {
return mZoomScale != 0 || mInHWAcceleratedZoom;
}
- public void updateDoubleTapZoom() {
+ public void updateDoubleTapZoom(int doubleTapZoom) {
if (mInZoomOverview) {
+ mDoubleTapZoomFactor = doubleTapZoom / 100.0f;
mTextWrapScale = getReadingLevelScale();
refreshZoomScale(true);
}
diff --git a/core/java/android/widget/RemoteViews.java b/core/java/android/widget/RemoteViews.java
index 9cf2718..1592061 100644
--- a/core/java/android/widget/RemoteViews.java
+++ b/core/java/android/widget/RemoteViews.java
@@ -1546,6 +1546,16 @@ public class RemoteViews implements Parcelable, Filter {
}
/**
+ * Equivalent to calling View.setContentDescription
+ *
+ * @param viewId The id of the view whose content description should change
+ * @param contentDescription The new content description for the view
+ */
+ public void setContentDescription(int viewId, CharSequence contentDescription) {
+ setCharSequence(viewId, "setContentDescription", contentDescription);
+ }
+
+ /**
* Inflates the view hierarchy represented by this object and applies
* all of the actions.
*
diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java
index 55e49ea..5a300e8 100644
--- a/core/java/android/widget/TextView.java
+++ b/core/java/android/widget/TextView.java
@@ -359,7 +359,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
private SpellChecker mSpellChecker;
- private boolean mShowSoftInputOnFocus = true;
+ private boolean mSoftInputShownOnFocus = true;
// The alignment to pass to Layout, or null if not resolved.
private Layout.Alignment mLayoutAlignment;
@@ -2381,23 +2381,23 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
* Sets whether the soft input method will be made visible when this
* TextView gets focused. The default is true.
*
- * @attr ref android.R.styleable#TextView_showSoftInputOnFocus
+ * @attr ref android.R.styleable#TextView_softInputShownOnFocus
* @hide
*/
@android.view.RemotableViewMethod
- public final void setShowSoftInputOnFocus(boolean show) {
- mShowSoftInputOnFocus = show;
+ public final void setSoftInputShownOnFocus(boolean show) {
+ mSoftInputShownOnFocus = show;
}
/**
* Returns whether the soft input method will be made visible when this
* TextView gets focused. The default is true.
*
- * @attr ref android.R.styleable#TextView_showSoftInputOnFocus
+ * @attr ref android.R.styleable#TextView_softInputShownOnFocus
* @hide
*/
- public final boolean getShowSoftInputOnFocus() {
- return mShowSoftInputOnFocus;
+ public final boolean getSoftInputShownOnFocus() {
+ return mSoftInputShownOnFocus;
}
/**
@@ -5502,7 +5502,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
&& mLayout != null && onCheckIsTextEditor()) {
InputMethodManager imm = InputMethodManager.peekInstance();
viewClicked(imm);
- if (imm != null && mShowSoftInputOnFocus) {
+ if (imm != null && mSoftInputShownOnFocus) {
imm.showSoftInput(this, 0);
}
}
@@ -8344,7 +8344,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
// Show the IME, except when selecting in read-only text.
final InputMethodManager imm = InputMethodManager.peekInstance();
viewClicked(imm);
- if (!mTextIsSelectable && mShowSoftInputOnFocus) {
+ if (!mTextIsSelectable && mSoftInputShownOnFocus) {
handled |= imm != null && imm.showSoftInput(this, 0);
}
@@ -10202,7 +10202,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
final boolean selectionStarted = mSelectionActionMode != null ||
extractedTextModeWillBeStartedFullScreen;
- if (selectionStarted && !mTextIsSelectable && imm != null && mShowSoftInputOnFocus) {
+ if (selectionStarted && !mTextIsSelectable && imm != null && mSoftInputShownOnFocus) {
// Show the IME to be able to replace text, except when selecting non editable text.
imm.showSoftInput(this, 0, null);
}
diff --git a/core/java/com/android/internal/widget/ActionBarContextView.java b/core/java/com/android/internal/widget/ActionBarContextView.java
index 446dab1..18d45f7 100644
--- a/core/java/com/android/internal/widget/ActionBarContextView.java
+++ b/core/java/com/android/internal/widget/ActionBarContextView.java
@@ -94,6 +94,15 @@ public class ActionBarContextView extends AbsActionBarView implements AnimatorLi
}
@Override
+ public void onDetachedFromWindow() {
+ super.onDetachedFromWindow();
+ if (mActionMenuPresenter != null) {
+ mActionMenuPresenter.hideOverflowMenu();
+ mActionMenuPresenter.hideSubMenus();
+ }
+ }
+
+ @Override
public void setSplitActionBar(boolean split) {
if (mSplitActionBar != split) {
if (mActionMenuPresenter != null) {
diff --git a/core/java/com/android/internal/widget/ActionBarView.java b/core/java/com/android/internal/widget/ActionBarView.java
index 61bce60..e131242 100644
--- a/core/java/com/android/internal/widget/ActionBarView.java
+++ b/core/java/com/android/internal/widget/ActionBarView.java
@@ -285,6 +285,10 @@ public class ActionBarView extends AbsActionBarView {
public void onDetachedFromWindow() {
super.onDetachedFromWindow();
removeCallbacks(mTabSelector);
+ if (mActionMenuPresenter != null) {
+ mActionMenuPresenter.hideOverflowMenu();
+ mActionMenuPresenter.hideSubMenus();
+ }
}
@Override
diff --git a/core/jni/android/graphics/TextLayoutCache.cpp b/core/jni/android/graphics/TextLayoutCache.cpp
index 0b53850..c207150 100644
--- a/core/jni/android/graphics/TextLayoutCache.cpp
+++ b/core/jni/android/graphics/TextLayoutCache.cpp
@@ -534,7 +534,7 @@ void TextLayoutCacheValue::computeRunValuesWithHarfbuzz(HB_ShaperItem& shaperIte
#if DEBUG_GLYPHS
LOGD("HARFBUZZ -- num_glypth=%d - kerning_applied=%d", shaperItem.num_glyphs,
shaperItem.kerning_applied);
- LOGD(" -- string= '%s'", String8(chars + start, count).string());
+ LOGD(" -- string= '%s'", String8(shaperItem.string + start, count).string());
LOGD(" -- isDevKernText=%d", paint->isDevKernText());
logGlyphs(shaperItem);