Merge "Tweak key layouts."
diff --git a/api/current.xml b/api/current.xml
index 35d283e..b62c689 100644
--- a/api/current.xml
+++ b/api/current.xml
@@ -249201,7 +249201,7 @@
deprecated="not deprecated"
visibility="public"
>
-<parameter name="arg0" type="T">
+<parameter name="t" type="T">
</parameter>
</method>
</interface>
diff --git a/core/java/android/app/ActivityThread.java b/core/java/android/app/ActivityThread.java
index 5c4f57a..c0714e3 100644
--- a/core/java/android/app/ActivityThread.java
+++ b/core/java/android/app/ActivityThread.java
@@ -870,12 +870,6 @@
(dbStats.dbSize > 0) ? String.valueOf(dbStats.dbSize) : " ",
(dbStats.lookaside > 0) ? String.valueOf(dbStats.lookaside) : " ",
dbStats.cache, dbStats.dbName);
- if (dbStats.dataDump != null) {
- int size = dbStats.dataDump.size();
- for (int dumpIndex = 0; dumpIndex < size; dumpIndex++) {
- printRow(pw, "%s", dbStats.dataDump.get(dumpIndex));
- }
- }
}
}
diff --git a/core/java/android/database/sqlite/SQLiteDatabase.java b/core/java/android/database/sqlite/SQLiteDatabase.java
index 87f55d2..7efb7fd 100644
--- a/core/java/android/database/sqlite/SQLiteDatabase.java
+++ b/core/java/android/database/sqlite/SQLiteDatabase.java
@@ -2507,7 +2507,7 @@
if (pageCount > 0) {
dbStatsList.add(new DbStats(dbName, pageCount, db.getPageSize(),
lookasideUsed, db.getCacheHitNum(), db.getCacheMissNum(),
- db.getCachesize(), getDataDump(db)));
+ db.getCachesize()));
}
}
// if there are pooled connections, return the cache stats for them also.
@@ -2518,7 +2518,7 @@
for (SQLiteDatabase pDb : connPool.getConnectionList()) {
dbStatsList.add(new DbStats("(pooled # " + pDb.mConnectionNum + ") "
+ lastnode, 0, 0, 0, pDb.getCacheHitNum(),
- pDb.getCacheMissNum(), pDb.getCachesize(), null));
+ pDb.getCacheMissNum(), pDb.getCachesize()));
}
}
} catch (SQLiteException e) {
@@ -2529,44 +2529,6 @@
return dbStatsList;
}
- private static ArrayList<String> getDataDump(SQLiteDatabase db) {
- // create database dump of certain data from certain databases for debugging purposes
- if (db.getPath().equalsIgnoreCase(
- "/data/data/com.android.providers.downloads/databases/downloads.db")) {
- String sql =
- "select * from downloads " +
- " where notificationpackage = 'com.google.android.gsf'" +
- " or status >= 400";
- Cursor cursor = db.rawQuery(sql, null);
- try {
- int count = cursor.getCount();
- if (count == 0) {
- return null;
- }
- ArrayList<String> buff = new ArrayList<String>();
- buff.add(" Data from downloads.db");
- int columnCount = cursor.getColumnCount();
- for (int i =0; i < count && cursor.moveToNext(); i++) {
- buff.add(" Row#" + i + "");
- for (int j = 0; j < columnCount; j++) {
- String colName = cursor.getColumnName(j);
- String value = cursor.getString(j);
- buff.add(" " + colName + " = " + value);
- }
- }
- for (String s : buff) Log.i("vnoritag", s);
- return buff;
- } catch (SQLiteException e) {
- Log.w(TAG, "exception in executing the sql: " + sql, e);
- } finally {
- if (cursor != null) {
- cursor.close();
- }
- }
- }
- return null;
- }
-
/**
* Returns list of full pathnames of all attached databases including the main database
* by executing 'pragma database_list' on the database.
diff --git a/core/java/android/database/sqlite/SQLiteDebug.java b/core/java/android/database/sqlite/SQLiteDebug.java
index 72377f0..94960791 100644
--- a/core/java/android/database/sqlite/SQLiteDebug.java
+++ b/core/java/android/database/sqlite/SQLiteDebug.java
@@ -121,31 +121,27 @@
*/
public static class DbStats {
/** name of the database */
- public final String dbName;
+ public String dbName;
/** the page size for the database */
- public final long pageSize;
+ public long pageSize;
/** the database size */
- public final long dbSize;
+ public long dbSize;
/** documented here http://www.sqlite.org/c3ref/c_dbstatus_lookaside_used.html */
- public final int lookaside;
+ public int lookaside;
/** statement cache stats: hits/misses/cachesize */
- public final String cache;
-
- /** database dump of 'useful info for debugging only */
- public final ArrayList<String> dataDump;
+ public String cache;
public DbStats(String dbName, long pageCount, long pageSize, int lookaside,
- int hits, int misses, int cachesize, ArrayList<String> data) {
+ int hits, int misses, int cachesize) {
this.dbName = dbName;
this.pageSize = pageSize / 1024;
dbSize = (pageCount * pageSize) / 1024;
this.lookaside = lookaside;
this.cache = hits + "/" + misses + "/" + cachesize;
- this.dataDump = data;
}
}
diff --git a/core/java/android/view/animation/ScaleAnimation.java b/core/java/android/view/animation/ScaleAnimation.java
index 8537d42..1dd250f 100644
--- a/core/java/android/view/animation/ScaleAnimation.java
+++ b/core/java/android/view/animation/ScaleAnimation.java
@@ -17,8 +17,10 @@
package android.view.animation;
import android.content.Context;
+import android.content.res.Resources;
import android.content.res.TypedArray;
import android.util.AttributeSet;
+import android.util.TypedValue;
/**
* An animation that controls the scale of an object. You can specify the point
@@ -26,11 +28,23 @@
*
*/
public class ScaleAnimation extends Animation {
+ private final Resources mResources;
+
private float mFromX;
private float mToX;
private float mFromY;
private float mToY;
+ private int mFromXType = TypedValue.TYPE_NULL;
+ private int mToXType = TypedValue.TYPE_NULL;
+ private int mFromYType = TypedValue.TYPE_NULL;
+ private int mToYType = TypedValue.TYPE_NULL;
+
+ private int mFromXData = 0;
+ private int mToXData = 0;
+ private int mFromYData = 0;
+ private int mToYData = 0;
+
private int mPivotXType = ABSOLUTE;
private int mPivotYType = ABSOLUTE;
private float mPivotXValue = 0.0f;
@@ -48,14 +62,60 @@
public ScaleAnimation(Context context, AttributeSet attrs) {
super(context, attrs);
+ mResources = context.getResources();
+
TypedArray a = context.obtainStyledAttributes(attrs,
com.android.internal.R.styleable.ScaleAnimation);
- mFromX = a.getFloat(com.android.internal.R.styleable.ScaleAnimation_fromXScale, 0.0f);
- mToX = a.getFloat(com.android.internal.R.styleable.ScaleAnimation_toXScale, 0.0f);
+ TypedValue tv = a.peekValue(
+ com.android.internal.R.styleable.ScaleAnimation_fromXScale);
+ mFromX = 0.0f;
+ if (tv != null) {
+ if (tv.type == TypedValue.TYPE_FLOAT) {
+ // This is a scaling factor.
+ mFromX = tv.getFloat();
+ } else {
+ mFromXType = tv.type;
+ mFromXData = tv.data;
+ }
+ }
+ tv = a.peekValue(
+ com.android.internal.R.styleable.ScaleAnimation_toXScale);
+ mToX = 0.0f;
+ if (tv != null) {
+ if (tv.type == TypedValue.TYPE_FLOAT) {
+ // This is a scaling factor.
+ mToX = tv.getFloat();
+ } else {
+ mToXType = tv.type;
+ mToXData = tv.data;
+ }
+ }
- mFromY = a.getFloat(com.android.internal.R.styleable.ScaleAnimation_fromYScale, 0.0f);
- mToY = a.getFloat(com.android.internal.R.styleable.ScaleAnimation_toYScale, 0.0f);
+ tv = a.peekValue(
+ com.android.internal.R.styleable.ScaleAnimation_fromYScale);
+ mFromY = 0.0f;
+ if (tv != null) {
+ if (tv.type == TypedValue.TYPE_FLOAT) {
+ // This is a scaling factor.
+ mFromY = tv.getFloat();
+ } else {
+ mFromYType = tv.type;
+ mFromYData = tv.data;
+ }
+ }
+ tv = a.peekValue(
+ com.android.internal.R.styleable.ScaleAnimation_toYScale);
+ mToY = 0.0f;
+ if (tv != null) {
+ if (tv.type == TypedValue.TYPE_FLOAT) {
+ // This is a scaling factor.
+ mToY = tv.getFloat();
+ } else {
+ mToYType = tv.type;
+ mToYData = tv.data;
+ }
+ }
Description d = Description.parseValue(a.peekValue(
com.android.internal.R.styleable.ScaleAnimation_pivotX));
@@ -81,6 +141,7 @@
* @param toY Vertical scaling factor to apply at the end of the animation
*/
public ScaleAnimation(float fromX, float toX, float fromY, float toY) {
+ mResources = null;
mFromX = fromX;
mToX = toX;
mFromY = fromY;
@@ -107,6 +168,7 @@
*/
public ScaleAnimation(float fromX, float toX, float fromY, float toY,
float pivotX, float pivotY) {
+ mResources = null;
mFromX = fromX;
mToX = toX;
mFromY = fromY;
@@ -146,6 +208,7 @@
*/
public ScaleAnimation(float fromX, float toX, float fromY, float toY,
int pivotXType, float pivotXValue, int pivotYType, float pivotYValue) {
+ mResources = null;
mFromX = fromX;
mToX = toX;
mFromY = fromY;
@@ -177,10 +240,32 @@
}
}
+ float resolveScale(float scale, int type, int data, int size, int psize) {
+ float targetSize;
+ if (type == TypedValue.TYPE_FRACTION) {
+ targetSize = TypedValue.complexToFraction(data, size, psize);
+ } else if (type == TypedValue.TYPE_DIMENSION) {
+ targetSize = TypedValue.complexToDimension(data, mResources.getDisplayMetrics());
+ } else {
+ return scale;
+ }
+
+ if (size == 0) {
+ return 1;
+ }
+
+ return targetSize/(float)size;
+ }
+
@Override
public void initialize(int width, int height, int parentWidth, int parentHeight) {
super.initialize(width, height, parentWidth, parentHeight);
+ mFromX = resolveScale(mFromX, mFromXType, mFromXData, width, parentWidth);
+ mToX = resolveScale(mToX, mToXType, mToXData, width, parentWidth);
+ mFromY = resolveScale(mFromY, mFromYType, mFromYData, height, parentHeight);
+ mToY = resolveScale(mToY, mToYType, mToYData, height, parentHeight);
+
mPivotX = resolveSize(mPivotXType, mPivotXValue, width, parentWidth);
mPivotY = resolveSize(mPivotYType, mPivotYValue, height, parentHeight);
}
diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java
index 56325f6..33015ad 100644
--- a/core/java/android/webkit/WebView.java
+++ b/core/java/android/webkit/WebView.java
@@ -588,9 +588,11 @@
private static final int DRAG_HELD_MOTIONLESS = 8;
private static final int AWAKEN_SCROLL_BARS = 9;
private static final int PREVENT_DEFAULT_TIMEOUT = 10;
+ private static final int SCROLL_SELECT_TEXT = 11;
+
private static final int FIRST_PRIVATE_MSG_ID = REMEMBER_PASSWORD;
- private static final int LAST_PRIVATE_MSG_ID = PREVENT_DEFAULT_TIMEOUT;
+ private static final int LAST_PRIVATE_MSG_ID = SCROLL_SELECT_TEXT;
/*
* Package message ids
@@ -647,7 +649,8 @@
"RESUME_WEBCORE_PRIORITY", // = 7;
"DRAG_HELD_MOTIONLESS", // = 8;
"AWAKEN_SCROLL_BARS", // = 9;
- "PREVENT_DEFAULT_TIMEOUT" // = 10;
+ "PREVENT_DEFAULT_TIMEOUT", // = 10;
+ "SCROLL_SELECT_TEXT" // = 11;
};
static final String[] HandlerPackageDebugString = {
@@ -787,6 +790,11 @@
private int mBackgroundColor = Color.WHITE;
+ private static final long SELECT_SCROLL_INTERVAL = 1000 / 60; // 60 / second
+ private int mAutoScrollX = 0;
+ private int mAutoScrollY = 0;
+ private boolean mSentAutoScrollMessage = false;
+
// Used to notify listeners of a new picture.
private PictureListener mPictureListener;
/**
@@ -1923,25 +1931,15 @@
* browsing session and clears any internal state associated with that
* session. The consequences of calling this method while a private
* browsing session is active are unspecified.
- * @param context The same context which was used to create the private
- * browsing WebView.
* @return True if the private browsing files were successfully deleted,
* false otherwise.
* @hide pending API council approval.
*/
- public static boolean cleanupPrivateBrowsingFiles(Context context) {
- // It seems wrong that we have to pass the storage locations here, given
- // that the storage files are created native-side in WebRequestContext
- // (albeit using a dumb getter on BrowserFrame to get the paths from
- // Java). It looks like this is required because we may need to call
- // this method before the BrowserFrame has been set up.
- // TODO: Investigate whether this can be avoided.
- return nativeCleanupPrivateBrowsingFiles(context.getDatabasePath("dummy").getParent(),
- context.getCacheDir().getAbsolutePath());
+ public static boolean cleanupPrivateBrowsingFiles() {
+ return nativeCleanupPrivateBrowsingFiles();
}
- private static native boolean nativeCleanupPrivateBrowsingFiles(String databaseDirectory,
- String cacheDirectory);
+ private static native boolean nativeCleanupPrivateBrowsingFiles();
private boolean extendScroll(int y) {
int finalY = mScroller.getFinalY();
@@ -3883,13 +3881,6 @@
// decide which adornments to draw
int extras = DRAW_EXTRAS_NONE;
- if (DebugFlags.WEB_VIEW) {
- Log.v(LOGTAG, "mFindIsUp=" + mFindIsUp
- + " mSelectingText=" + mSelectingText
- + " nativePageShouldHandleShiftAndArrows()="
- + nativePageShouldHandleShiftAndArrows()
- + " animateZoom=" + animateZoom);
- }
if (mFindIsUp) {
extras = DRAW_EXTRAS_FIND;
} else if (mSelectingText) {
@@ -3900,6 +3891,14 @@
} else if (drawCursorRing) {
extras = DRAW_EXTRAS_CURSOR_RING;
}
+ if (DebugFlags.WEB_VIEW) {
+ Log.v(LOGTAG, "mFindIsUp=" + mFindIsUp
+ + " mSelectingText=" + mSelectingText
+ + " nativePageShouldHandleShiftAndArrows()="
+ + nativePageShouldHandleShiftAndArrows()
+ + " animateZoom=" + animateZoom
+ + " extras=" + extras);
+ }
if (canvas.isHardwareAccelerated()) {
try {
@@ -4654,6 +4653,9 @@
WebViewCore.resumePriority();
WebViewCore.resumeUpdatePicture(mWebViewCore);
invalidate(); // redraw without selection
+ mAutoScrollX = 0;
+ mAutoScrollY = 0;
+ mSentAutoScrollMessage = false;
}
}
@@ -5299,6 +5301,22 @@
if (parent != null) {
parent.requestDisallowInterceptTouchEvent(true);
}
+ int layer = nativeScrollableLayer(contentX, contentY);
+ if (layer == 0) {
+ mAutoScrollX = x <= SELECT_SCROLL ? -SELECT_SCROLL
+ : x >= getViewWidth() - SELECT_SCROLL
+ ? SELECT_SCROLL : 0;
+ mAutoScrollY = y <= SELECT_SCROLL ? -SELECT_SCROLL
+ : y >= getViewHeightWithTitle() - SELECT_SCROLL
+ ? SELECT_SCROLL : 0;
+ if (!mSentAutoScrollMessage) {
+ mSentAutoScrollMessage = true;
+ mPrivateHandler.sendEmptyMessageDelayed(
+ SCROLL_SELECT_TEXT, SELECT_SCROLL_INTERVAL);
+ }
+ } else {
+ // TODO: allow scrollable overflow div to autoscroll
+ }
nativeExtendSelection(contentX, contentY);
invalidate();
break;
@@ -5723,6 +5741,7 @@
private static final int TRACKBALL_MOVE_COUNT = 10;
private static final int TRACKBALL_MULTIPLIER = 3;
private static final int SELECT_CURSOR_OFFSET = 16;
+ private static final int SELECT_SCROLL = 5;
private int mSelectX = 0;
private int mSelectY = 0;
private boolean mFocusSizeChanged = false;
@@ -6627,6 +6646,16 @@
}
break;
}
+ case SCROLL_SELECT_TEXT: {
+ if (mAutoScrollX == 0 && mAutoScrollY == 0) {
+ mSentAutoScrollMessage = false;
+ break;
+ }
+ scrollBy(mAutoScrollX, mAutoScrollY);
+ sendEmptyMessageDelayed(
+ SCROLL_SELECT_TEXT, SELECT_SCROLL_INTERVAL);
+ break;
+ }
case SWITCH_TO_SHORTPRESS: {
if (mTouchMode == TOUCH_INIT_MODE) {
if (!getSettings().supportTouchOnly()
@@ -7739,6 +7768,7 @@
private native boolean nativeHitSelection(int x, int y);
private native String nativeImageURI(int x, int y);
private native void nativeInstrumentReport();
+ private native Rect nativeLayerBounds(int layer);
/* package */ native boolean nativeMoveCursorToNextTextInput();
// return true if the page has been scrolled
private native boolean nativeMotionUp(int x, int y, int slop);
diff --git a/core/java/android/webkit/WebViewCore.java b/core/java/android/webkit/WebViewCore.java
index 17f0a97..b7d20b4 100644
--- a/core/java/android/webkit/WebViewCore.java
+++ b/core/java/android/webkit/WebViewCore.java
@@ -1884,6 +1884,7 @@
int mScrollX;
int mScrollY;
boolean mMobileSite;
+ boolean mIsRestored;
}
static class DrawData {
@@ -2285,6 +2286,7 @@
mInitialViewState.mScrollY = mRestoredY;
mInitialViewState.mMobileSite = (0 == mViewportWidth);
if (mRestoredScale > 0) {
+ mInitialViewState.mIsRestored = true;
mInitialViewState.mViewScale = mRestoredScale / 100.0f;
if (mRestoredTextWrapScale > 0) {
mInitialViewState.mTextWrapScale = mRestoredTextWrapScale / 100.0f;
diff --git a/core/java/android/webkit/ZoomManager.java b/core/java/android/webkit/ZoomManager.java
index 69db6b2..b94dc3b 100644
--- a/core/java/android/webkit/ZoomManager.java
+++ b/core/java/android/webkit/ZoomManager.java
@@ -260,12 +260,7 @@
public final float getReadingLevelScale() {
// The reading scale is at least 0.5f apart from the overview scale.
final float MIN_SCALE_DIFF = 0.5f;
- final float zoomOverviewScale = getZoomOverviewScale();
- if (zoomOverviewScale > DEFAULT_READING_LEVEL_SCALE) {
- return Math.min(DEFAULT_READING_LEVEL_SCALE,
- zoomOverviewScale - MIN_SCALE_DIFF);
- }
- return Math.max(zoomOverviewScale + MIN_SCALE_DIFF,
+ return Math.max(getZoomOverviewScale() + MIN_SCALE_DIFF,
DEFAULT_READING_LEVEL_SCALE);
}
@@ -864,32 +859,33 @@
if (!mWebView.drawHistory()) {
float scale;
- final boolean reflowText;
- WebSettings settings = mWebView.getSettings();
+ final float overviewScale = getZoomOverviewScale();
if (mInitialScale > 0) {
scale = mInitialScale;
- reflowText = exceedsMinScaleIncrement(mTextWrapScale, scale);
} else if (viewState.mViewScale > 0) {
mTextWrapScale = viewState.mTextWrapScale;
scale = viewState.mViewScale;
- reflowText = false;
} else {
- scale = getZoomOverviewScale();
- if (settings.getUseWideViewPort()
- && settings.getLoadWithOverviewMode()) {
- mInitialZoomOverview = true;
- } else {
+ scale = overviewScale;
+ WebSettings settings = mWebView.getSettings();
+ if (!settings.getUseWideViewPort()
+ || !settings.getLoadWithOverviewMode()) {
scale = Math.max(viewState.mTextWrapScale, scale);
- mInitialZoomOverview = !exceedsMinScaleIncrement(scale, getZoomOverviewScale());
}
if (settings.isNarrowColumnLayout() && settings.getUseFixedViewport()) {
// When first layout, reflow using the reading level scale to avoid
// reflow when double tapped.
mTextWrapScale = getReadingLevelScale();
}
+ }
+ boolean reflowText = false;
+ if (!viewState.mIsRestored) {
+ scale = Math.max(scale, overviewScale);
+ mTextWrapScale = Math.max(mTextWrapScale, overviewScale);
reflowText = exceedsMinScaleIncrement(mTextWrapScale, scale);
}
+ mInitialZoomOverview = !exceedsMinScaleIncrement(scale, overviewScale);
setZoomScale(scale, reflowText);
// update the zoom buttons as the scale can be changed
diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java
index 88d3f7a..45c46db 100644
--- a/core/java/android/widget/TextView.java
+++ b/core/java/android/widget/TextView.java
@@ -7103,7 +7103,7 @@
handled |= mMovement.onTouchEvent(this, (Spannable) mText, event);
}
- if (isTextEditable()) {
+ if (isTextEditable() || mTextIsSelectable) {
if (mScrollX != oldScrollX || mScrollY != oldScrollY) {
// Hide insertion anchor while scrolling. Leave selection.
hideInsertionPointCursorController();
@@ -7153,7 +7153,7 @@
}
mInsertionControllerEnabled = windowSupportsHandles && isTextEditable() && mCursorVisible &&
- mLayout != null && !mTextIsSelectable;
+ mLayout != null;
mSelectionControllerEnabled = windowSupportsHandles && textCanBeSelected() &&
mLayout != null;
@@ -7172,8 +7172,7 @@
* a selectable TextView.
*/
private boolean isTextEditable() {
- return (mText instanceof Editable && onCheckIsTextEditor() && isEnabled())
- || mTextIsSelectable;
+ return mText instanceof Editable && onCheckIsTextEditor() && isEnabled();
}
/**
@@ -7748,7 +7747,7 @@
}
}
if (clip != null) {
- clipboard.setPrimaryClip(clip);
+ setPrimaryClip(clip);
}
}
return true;
@@ -7839,26 +7838,29 @@
return true;
}
- if (!isPositionOnText(mLastDownPositionX, mLastDownPositionY) && mInsertionControllerEnabled) {
+ if (!isPositionOnText(mLastDownPositionX, mLastDownPositionY) &&
+ mInsertionControllerEnabled) {
+ // Long press in empty space moves cursor and shows the Paste affordance if available.
final int offset = getOffset(mLastDownPositionX, mLastDownPositionY);
Selection.setSelection((Spannable)mText, offset);
- if (canPaste()) {
- getInsertionController().showWithPaste();
- performHapticFeedback(HapticFeedbackConstants.LONG_PRESS);
- } else {
- getInsertionController().show();
- }
+ getInsertionController().show(0);
mEatTouchRelease = true;
return true;
}
- if (mSelectionActionMode != null && touchPositionIsInSelection()) {
- final int start = getSelectionStart();
- final int end = getSelectionEnd();
- CharSequence selectedText = mTransformed.subSequence(start, end);
- ClipData data = ClipData.newPlainText(null, null, selectedText);
- startDrag(data, getTextThumbnailBuilder(selectedText), false);
- stopSelectionActionMode();
+ if (mSelectionActionMode != null) {
+ if (touchPositionIsInSelection()) {
+ // Start a drag
+ final int start = getSelectionStart();
+ final int end = getSelectionEnd();
+ CharSequence selectedText = mTransformed.subSequence(start, end);
+ ClipData data = ClipData.newPlainText(null, null, selectedText);
+ startDrag(data, getTextThumbnailBuilder(selectedText), false);
+ stopSelectionActionMode();
+ } else {
+ selectCurrentWord();
+ getSelectionController().show();
+ }
performHapticFeedback(HapticFeedbackConstants.LONG_PRESS);
mEatTouchRelease = true;
return true;
@@ -7950,10 +7952,10 @@
/**
* Paste clipboard content between min and max positions.
- *
- * @param clipboard getSystemService(Context.CLIPBOARD_SERVICE)
*/
- private void paste(ClipboardManager clipboard, int min, int max) {
+ private void paste(int min, int max) {
+ ClipboardManager clipboard =
+ (ClipboardManager) getContext().getSystemService(Context.CLIPBOARD_SERVICE);
ClipData clip = clipboard.getPrimaryClip();
if (clip != null) {
boolean didfirst = false;
@@ -7973,9 +7975,17 @@
}
}
stopSelectionActionMode();
+ sLastCutOrCopyTime = 0;
}
}
+ private void setPrimaryClip(ClipData clip) {
+ ClipboardManager clipboard = (ClipboardManager) getContext().
+ getSystemService(Context.CLIPBOARD_SERVICE);
+ clipboard.setPrimaryClip(clip);
+ sLastCutOrCopyTime = SystemClock.uptimeMillis();
+ }
+
private class SelectionActionModeCallback implements ActionMode.Callback {
@Override
@@ -8061,9 +8071,6 @@
return true;
}
- ClipboardManager clipboard = (ClipboardManager) getContext().
- getSystemService(Context.CLIPBOARD_SERVICE);
-
int min = 0;
int max = mText.length();
@@ -8077,18 +8084,18 @@
switch (item.getItemId()) {
case ID_PASTE:
- paste(clipboard, min, max);
+ paste(min, max);
return true;
case ID_CUT:
- clipboard.setPrimaryClip(ClipData.newPlainText(null, null,
+ setPrimaryClip(ClipData.newPlainText(null, null,
mTransformed.subSequence(min, max)));
((Editable) mText).delete(min, max);
stopSelectionActionMode();
return true;
case ID_COPY:
- clipboard.setPrimaryClip(ClipData.newPlainText(null, null,
+ setPrimaryClip(ClipData.newPlainText(null, null,
mTransformed.subSequence(min, max)));
stopSelectionActionMode();
return true;
@@ -8211,9 +8218,7 @@
@Override
public void onClick(View v) {
if (canPaste()) {
- ClipboardManager clipboard =
- (ClipboardManager) getContext().getSystemService(Context.CLIPBOARD_SERVICE);
- paste(clipboard, getSelectionStart(), getSelectionEnd());
+ paste(getSelectionStart(), getSelectionEnd());
}
hide();
}
@@ -8502,6 +8507,9 @@
}
case MotionEvent.ACTION_UP:
if (mPastePopupWindow != null) {
+ // Will show the paste popup after a delay.
+ mController.show();
+ /* TEMP USER TEST: Display Paste as soon as handle is draggged
long delay = SystemClock.uptimeMillis() - mTouchTimer;
if (delay < ViewConfiguration.getTapTimeout()) {
final float touchOffsetX = ev.getRawX() - mPositionX;
@@ -8515,7 +8523,7 @@
if (distanceSquared < slopSquared) {
showPastePopupWindow();
}
- }
+ }*/
}
mIsDragging = false;
break;
@@ -8561,6 +8569,8 @@
private class InsertionPointCursorController implements CursorController {
private static final int DELAY_BEFORE_FADE_OUT = 4100;
+ private static final int DELAY_BEFORE_PASTE = 2000;
+ private static final int RECENT_CUT_COPY_DURATION = 15 * 1000;
// The cursor controller image. Lazily created.
private HandleView mHandle;
@@ -8571,14 +8581,27 @@
}
};
+ private final Runnable mPastePopupShower = new Runnable() {
+ public void run() {
+ getHandle().showPastePopupWindow();
+ }
+ };
+
public void show() {
- updatePosition();
- getHandle().show();
+ show(DELAY_BEFORE_PASTE);
}
- void showWithPaste() {
- show();
- getHandle().showPastePopupWindow();
+ public void show(int delayBeforePaste) {
+ updatePosition();
+ hideDelayed();
+ getHandle().show();
+ removeCallbacks(mPastePopupShower);
+ if (canPaste()) {
+ final long durationSinceCutOrCopy = SystemClock.uptimeMillis() - sLastCutOrCopyTime;
+ if (durationSinceCutOrCopy < RECENT_CUT_COPY_DURATION)
+ delayBeforePaste = 0;
+ postDelayed(mPastePopupShower, delayBeforePaste);
+ }
}
public void hide() {
@@ -8586,6 +8609,7 @@
mHandle.hide();
}
removeCallbacks(mHider);
+ removeCallbacks(mPastePopupShower);
}
private void hideDelayed() {
@@ -8618,7 +8642,6 @@
return;
}
- // updatePosition is called only when isShowing. Handle has been created at this point.
getHandle().positionAtCursor(offset, true);
}
@@ -8681,6 +8704,7 @@
mEndHandle.show();
hideInsertionPointCursorController();
+ hideDelayed();
}
public void hide() {
@@ -8735,6 +8759,7 @@
Selection.setSelection((Spannable) mText, selectionStart, selectionEnd);
updatePosition();
+ hideDelayed();
}
public void updatePosition() {
@@ -8755,13 +8780,12 @@
// The handles have been created since the controller isShowing().
mStartHandle.positionAtCursor(selectionStart, true);
mEndHandle.positionAtCursor(selectionEnd, true);
- hideDelayed();
}
public boolean onTouchEvent(MotionEvent event) {
// This is done even when the View does not have focus, so that long presses can start
// selection and tap can move cursor from this tap position.
- if (isTextEditable()) {
+ if (isTextEditable() || mTextIsSelectable) {
switch (event.getActionMasked()) {
case MotionEvent.ACTION_DOWN:
final int x = (int) event.getX();
@@ -9143,4 +9167,6 @@
private InputFilter[] mFilters = NO_FILTERS;
private static final Spanned EMPTY_SPANNED = new SpannedString("");
private static int DRAG_THUMBNAIL_MAX_TEXT_LENGTH = 20;
+ // System wide time for last cut or copy action.
+ private static long sLastCutOrCopyTime;
}
diff --git a/core/jni/android_database_CursorWindow.cpp b/core/jni/android_database_CursorWindow.cpp
index 040dac3..fad9539 100644
--- a/core/jni/android_database_CursorWindow.cpp
+++ b/core/jni/android_database_CursorWindow.cpp
@@ -63,7 +63,8 @@
}
if (!window->initBuffer(localOnly)) {
- jniThrowException(env, "java/lang/IllegalStateException", "Couldn't init cursor window");
+ jniThrowException(env, "java/lang/RuntimeException",
+ "Memory couldn't be allocated for 1MB CursorWindow object.");
delete window;
return;
}
@@ -82,11 +83,13 @@
CursorWindow * window = new CursorWindow();
if (!window) {
- jniThrowException(env, "java/lang/RuntimeException", "No memory for native window object");
+ jniThrowException(env, "java/lang/RuntimeException",
+ "CursorWindow of size 1MB couldn't be created. No memory?");
return;
}
if (!window->setMemory(memory)) {
- jniThrowException(env, "java/lang/RuntimeException", "No memory in memObj");
+ jniThrowException(env, "java/lang/RuntimeException",
+ "Memory couldn't be initialized for 1MB CursorWindow object.");
delete window;
return;
}
@@ -131,8 +134,9 @@
static void throwExceptionWithRowCol(JNIEnv * env, jint row, jint column)
{
- char buf[100];
- snprintf(buf, sizeof(buf), "get field slot from row %d col %d failed", row, column);
+ char buf[200];
+ snprintf(buf, sizeof(buf), "Couldn't read row %d, col %d from CursorWindow. Make sure the Cursor is initialized correctly before accessing data from it",
+ row, column);
jniThrowException(env, "java/lang/IllegalStateException", buf);
}
diff --git a/core/res/res/anim/screen_rotate_0_enter.xml b/core/res/res/anim/screen_rotate_0_enter.xml
new file mode 100644
index 0000000..9e9a8ad
--- /dev/null
+++ b/core/res/res/anim/screen_rotate_0_enter.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright 2010, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+** http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<set xmlns:android="http://schemas.android.com/apk/res/android"
+ android:shareInterpolator="false">
+ <alpha android:fromAlpha="1.0" android:toAlpha="1.0"
+ android:interpolator="@anim/decelerate_quint_interpolator"
+ android:duration="@android:integer/config_shortAnimTime" />
+</set>
diff --git a/core/res/res/anim/screen_rotate_0_exit.xml b/core/res/res/anim/screen_rotate_0_exit.xml
new file mode 100644
index 0000000..09d0ac3
--- /dev/null
+++ b/core/res/res/anim/screen_rotate_0_exit.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright 2010, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+** http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<set xmlns:android="http://schemas.android.com/apk/res/android"
+ android:shareInterpolator="false">
+ <alpha android:fromAlpha="1.0" android:toAlpha="0"
+ android:interpolator="@anim/decelerate_quint_interpolator"
+ android:duration="@android:integer/config_shortAnimTime" />
+</set>
diff --git a/core/res/res/anim/screen_rotate_180_enter.xml b/core/res/res/anim/screen_rotate_180_enter.xml
new file mode 100644
index 0000000..bfc8c6d
--- /dev/null
+++ b/core/res/res/anim/screen_rotate_180_enter.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright 2010, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+** http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<set xmlns:android="http://schemas.android.com/apk/res/android"
+ android:shareInterpolator="false">
+ <scale android:fromXScale="1.0" android:toXScale="1.0"
+ android:fromYScale=".9" android:toYScale="1.0"
+ android:pivotX="50%" android:pivotY="50%"
+ android:interpolator="@anim/decelerate_quint_interpolator"
+ android:duration="@android:integer/config_mediumAnimTime" />
+</set>
diff --git a/core/res/res/anim/screen_rotate_180_exit.xml b/core/res/res/anim/screen_rotate_180_exit.xml
new file mode 100644
index 0000000..f1ce1cf
--- /dev/null
+++ b/core/res/res/anim/screen_rotate_180_exit.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright 2010, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+** http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<set xmlns:android="http://schemas.android.com/apk/res/android"
+ android:shareInterpolator="false">
+ <scale android:fromXScale="1.0" android:toXScale="1.0"
+ android:fromYScale="1.0" android:toYScale=".9"
+ android:pivotX="50%" android:pivotY="50%"
+ android:interpolator="@anim/decelerate_quint_interpolator"
+ android:duration="@android:integer/config_mediumAnimTime" />
+ <alpha android:fromAlpha="1.0" android:toAlpha="0"
+ android:interpolator="@anim/decelerate_quint_interpolator"
+ android:duration="@android:integer/config_mediumAnimTime" />
+</set>
diff --git a/core/res/res/anim/screen_rotate_minus_90_enter.xml b/core/res/res/anim/screen_rotate_minus_90_enter.xml
new file mode 100644
index 0000000..92a7779
--- /dev/null
+++ b/core/res/res/anim/screen_rotate_minus_90_enter.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright 2010, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+** http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<set xmlns:android="http://schemas.android.com/apk/res/android"
+ android:shareInterpolator="false">
+ <scale android:fromXScale="100%p" android:toXScale="100%"
+ android:fromYScale="100%p" android:toYScale="100%"
+ android:pivotX="50%" android:pivotY="50%"
+ android:interpolator="@anim/decelerate_quint_interpolator"
+ android:duration="@android:integer/config_mediumAnimTime" />
+ <rotate android:fromDegrees="-90" android:toDegrees="0"
+ android:pivotX="50%" android:pivotY="50%"
+ android:interpolator="@anim/decelerate_quint_interpolator"
+ android:duration="@android:integer/config_mediumAnimTime" />
+</set>
diff --git a/core/res/res/anim/screen_rotate_minus_90_exit.xml b/core/res/res/anim/screen_rotate_minus_90_exit.xml
new file mode 100644
index 0000000..c530759
--- /dev/null
+++ b/core/res/res/anim/screen_rotate_minus_90_exit.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright 2010, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+** http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<set xmlns:android="http://schemas.android.com/apk/res/android"
+ android:shareInterpolator="false">
+ <scale android:fromXScale="100%" android:toXScale="100%p"
+ android:fromYScale="100%" android:toYScale="100%p"
+ android:pivotX="50%" android:pivotY="50%"
+ android:interpolator="@anim/decelerate_quint_interpolator"
+ android:duration="@android:integer/config_mediumAnimTime" />
+ <rotate android:fromDegrees="0" android:toDegrees="90"
+ android:pivotX="50%" android:pivotY="50%"
+ android:interpolator="@anim/decelerate_quint_interpolator"
+ android:duration="@android:integer/config_mediumAnimTime" />
+ <alpha android:fromAlpha="1.0" android:toAlpha="0"
+ android:interpolator="@anim/decelerate_quint_interpolator"
+ android:duration="@android:integer/config_mediumAnimTime" />
+</set>
diff --git a/core/res/res/anim/screen_rotate_plus_90_enter.xml b/core/res/res/anim/screen_rotate_plus_90_enter.xml
new file mode 100644
index 0000000..f4ffaa8
--- /dev/null
+++ b/core/res/res/anim/screen_rotate_plus_90_enter.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright 2010, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+** http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<set xmlns:android="http://schemas.android.com/apk/res/android"
+ android:shareInterpolator="false">
+ <scale android:fromXScale="100%p" android:toXScale="100%"
+ android:fromYScale="100%p" android:toYScale="100%"
+ android:pivotX="50%" android:pivotY="50%"
+ android:interpolator="@anim/decelerate_quint_interpolator"
+ android:duration="@android:integer/config_mediumAnimTime" />
+ <rotate android:fromDegrees="90" android:toDegrees="0"
+ android:pivotX="50%" android:pivotY="50%"
+ android:interpolator="@anim/decelerate_quint_interpolator"
+ android:duration="@android:integer/config_mediumAnimTime" />
+</set>
diff --git a/core/res/res/anim/screen_rotate_plus_90_exit.xml b/core/res/res/anim/screen_rotate_plus_90_exit.xml
new file mode 100644
index 0000000..0728bfb
--- /dev/null
+++ b/core/res/res/anim/screen_rotate_plus_90_exit.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright 2010, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+** http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<set xmlns:android="http://schemas.android.com/apk/res/android"
+ android:shareInterpolator="false">
+ <scale android:fromXScale="100%" android:toXScale="100%p"
+ android:fromYScale="100%" android:toYScale="100%p"
+ android:pivotX="50%" android:pivotY="50%"
+ android:interpolator="@anim/decelerate_quint_interpolator"
+ android:duration="@android:integer/config_mediumAnimTime" />
+ <rotate android:fromDegrees="0" android:toDegrees="-90"
+ android:pivotX="50%" android:pivotY="50%"
+ android:interpolator="@anim/decelerate_quint_interpolator"
+ android:duration="@android:integer/config_mediumAnimTime" />
+ <alpha android:fromAlpha="1.0" android:toAlpha="0"
+ android:interpolator="@anim/decelerate_quint_interpolator"
+ android:duration="@android:integer/config_mediumAnimTime" />
+</set>
diff --git a/core/res/res/layout-xlarge/status_bar_latest_event_content.xml b/core/res/res/layout-xlarge/status_bar_latest_event_content.xml
index e4aa270..dca2c57 100644
--- a/core/res/res/layout-xlarge/status_bar_latest_event_content.xml
+++ b/core/res/res/layout-xlarge/status_bar_latest_event_content.xml
@@ -29,6 +29,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
+ android:layout_marginTop="-4dp"
android:singleLine="true"
android:ellipsize="marquee"
android:fadingEdge="horizontal"
diff --git a/core/res/res/layout-xlarge/status_bar_latest_event_content_large_icon.xml b/core/res/res/layout-xlarge/status_bar_latest_event_content_large_icon.xml
index 1e1f9de..144fa0d 100644
--- a/core/res/res/layout-xlarge/status_bar_latest_event_content_large_icon.xml
+++ b/core/res/res/layout-xlarge/status_bar_latest_event_content_large_icon.xml
@@ -22,6 +22,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
+ android:layout_marginTop="-4dp"
android:singleLine="true"
android:ellipsize="marquee"
android:fadingEdge="horizontal"
@@ -37,7 +38,9 @@
/>
<ImageView android:id="@+id/icon"
android:layout_width="48dp"
- android:layout_height="64dp"
+ android:layout_height="32dp"
+ android:layout_gravity="top"
+ android:layout_marginTop="8dp"
android:scaleType="center"
/>
</LinearLayout>
diff --git a/core/res/res/layout-xlarge/status_bar_latest_event_ticker.xml b/core/res/res/layout-xlarge/status_bar_latest_event_ticker.xml
index b09ed44..7631781 100644
--- a/core/res/res/layout-xlarge/status_bar_latest_event_ticker.xml
+++ b/core/res/res/layout-xlarge/status_bar_latest_event_ticker.xml
@@ -28,6 +28,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
+ android:layout_marginTop="-4dp"
android:singleLine="true"
android:ellipsize="marquee"
android:fadingEdge="horizontal"
@@ -37,8 +38,8 @@
android:textAppearance="@style/TextAppearance.StatusBar.EventContent.Info"
android:layout_width="wrap_content"
android:layout_height="match_parent"
+ android:layout_marginTop="-10dp"
android:singleLine="true"
- android:gravity="center_vertical"
/>
</LinearLayout>
diff --git a/core/res/res/layout-xlarge/status_bar_latest_event_ticker_large_icon.xml b/core/res/res/layout-xlarge/status_bar_latest_event_ticker_large_icon.xml
index 6c2e6f7..b382c55 100644
--- a/core/res/res/layout-xlarge/status_bar_latest_event_ticker_large_icon.xml
+++ b/core/res/res/layout-xlarge/status_bar_latest_event_ticker_large_icon.xml
@@ -23,6 +23,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
+ android:layout_marginTop="-4dp"
android:singleLine="true"
android:ellipsize="marquee"
android:fadingEdge="horizontal"
@@ -33,11 +34,13 @@
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:singleLine="true"
- android:gravity="center_vertical"
+ android:layout_marginTop="-10dp"
/>
<ImageView android:id="@+id/icon"
android:layout_width="48dp"
- android:layout_height="match_parent"
+ android:layout_height="32dp"
+ android:layout_gravity="top"
+ android:layout_marginTop="6dp"
android:scaleType="center"
/>
</LinearLayout>
diff --git a/core/res/res/values-xlarge/config.xml b/core/res/res/values-xlarge/config.xml
index 37f59c8..8ed1c3e 100644
--- a/core/res/res/values-xlarge/config.xml
+++ b/core/res/res/values-xlarge/config.xml
@@ -31,7 +31,7 @@
<bool name="config_enableLockScreenRotation">true</bool>
<!-- see comment in values/config.xml -->
- <integer name="config_longPressOnHomeBehavior">1</integer>
+ <integer name="config_longPressOnHomeBehavior">0</integer>
</resources>
diff --git a/core/res/res/values-xlarge/styles.xml b/core/res/res/values-xlarge/styles.xml
index 316861e..095a83d 100644
--- a/core/res/res/values-xlarge/styles.xml
+++ b/core/res/res/values-xlarge/styles.xml
@@ -29,10 +29,10 @@
<style name="TextAppearance.StatusBar.Icon">
</style>
<style name="TextAppearance.StatusBar.EventContent">
- <item name="android:textColor">?android:attr/textColorPrimary</item>
- <item name="android:textSize">16sp</item>
+ <item name="android:textColor">#ff999999</item>
</style>
<style name="TextAppearance.StatusBar.EventContent.Title">
- <item name="android:textStyle">bold</item>
+ <item name="android:textColor">?android:attr/textColorPrimary</item>
</style>
</resources>
+
diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml
index eacd14e..a8099e3 100755
--- a/core/res/res/values/attrs.xml
+++ b/core/res/res/values/attrs.xml
@@ -3233,10 +3233,10 @@
</declare-styleable>
<declare-styleable name="ScaleAnimation">
- <attr name="fromXScale" format="float" />
- <attr name="toXScale" format="float" />
- <attr name="fromYScale" format="float" />
- <attr name="toYScale" format="float" />
+ <attr name="fromXScale" format="float|fraction|dimension" />
+ <attr name="toXScale" format="float|fraction|dimension" />
+ <attr name="fromYScale" format="float|fraction|dimension" />
+ <attr name="toYScale" format="float|fraction|dimension" />
<attr name="pivotX" />
<attr name="pivotY" />
</declare-styleable>
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index 61223b3..03d581f 100644
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -355,7 +355,7 @@
1 - Recent apps dialog
2 - Recent apps activity in SystemUI
-->
- <integer name="config_longPressOnHomeBehavior">0</integer>
+ <integer name="config_longPressOnHomeBehavior">1</integer>
<!-- Array of light sensor LUX values to define our levels for auto backlight brightness support.
The N entries of this array define N + 1 zones as follows:
diff --git a/docs/html/guide/topics/ui/actionbar.jd b/docs/html/guide/topics/ui/actionbar.jd
index 2b942e7..c3d3482f 100644
--- a/docs/html/guide/topics/ui/actionbar.jd
+++ b/docs/html/guide/topics/ui/actionbar.jd
@@ -8,9 +8,10 @@
<h2>Quickview</h2>
<ul>
- <li>A replacement for the title bar for displaying global actions for the activity</li>
- <li>Provides toolbar actions and modes of navigating around the application</li>
- <li>Switches to contextual menu options when one or more items are selected</li>
+ <li>A replacement for the title bar that includes the application icon and activity title</li>
+ <li>Provides action items from the Options Menu and modes of navigating around the
+application</li>
+ <li>Supports custom views, including an embedded search box</li>
<li>Requires API Level HONEYCOMB</li>
</ul>
@@ -22,9 +23,9 @@
<li><a href="#Home">Using the application icon as an action item</a></li>
</ol>
</li>
+ <li><a href="#ActionView">Adding an Action View</a></li>
<li><a href="#Tabs">Adding Tabs</a></li>
<li><a href="#Dropdown">Adding Drop-down Navigation</a></li>
- <li><a href="#Search">Adding Search</a></li>
</ol>
<h2>Key classes</h2>
@@ -40,62 +41,88 @@
</div>
</div>
-<p>The action bar is a widget for activities that replaces the traditional title bar at
-the top of an activity. By default, the action bar includes the application logo on the left side,
-followed by the activity title. The action bar offers several useful features for
-applications—especially those targeted to tablet devices. The action bar features include
+<p>The Action Bar is a widget for activities that replaces the traditional title bar at
+the top of an activity. By default, the Action Bar includes the application logo on the left side,
+followed by the activity title. The Action Bar offers several useful features for
+applications—especially those targeted to tablet devices. The Action Bar features include
the ability to:</p>
<ul>
- <li>Display menu items from the <a
-href="{@docRoot}guide/topics/ui/menus.html#OptionsMenu">options menu</a> as "action
-items"—providing instant access to key user actions.</li>
+ <li>Display items from the <a
+href="{@docRoot}guide/topics/ui/menus.html#OptionsMenu">Options Menu</a> as "action
+items"—providing instant access to key user actions. (Menu items not appearing as action
+items are placed in the Overflow Menu, revealed by a drop-down in the Action Bar.)</li>
<li>Provide tabs for navigating between <a
href="{@docRoot}guide/topics/fragments/index.html">fragments</a>.</li>
<li>Provide drop-down navigation items.</li>
- <li>Embed a {@link android.widget.SearchView} for instant searching.</li>
+ <li>Provide interactive "action views" in place of action items.</li>
<li>Use the application logo as a "return home" or "up" navigation action.</li>
</ul>
<img src="{@docRoot}images/ui/actionbar.png" height="36" alt="" />
-<p class="img-caption"><strong>Figure 1.</strong> A screenshot of the action bar in the NotePad
+<p class="img-caption"><strong>Figure 1.</strong> A screenshot of the Action Bar in the NotePad
sample application, containing action items to save and delete the note.</p>
<h2 id="Adding">Adding the Action Bar</h2>
-<p>To add the Action Bar to your activity, apply the holographic theme—{@code
-Theme.Holo}—or the action bar theme—{@code Theme.WithActionBar}—in your manifest
-file. For example:</p>
+<p>To add the Action Bar to your activities, simply target your application for HONEYCOMB or later,
+using the <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html">{@code
+<uses-sdk>}</a> element. That is, by setting either the {@code android:minSdkVersion} or
+{@code android:targetSdkVersion} to HONEYCOMB or later, each activity in your application will
+include the Action Bar when running on devices with HONEYCOMB or later. For example:</p>
<pre>
-<activity android:theme="@android:style/Theme.Holo" >
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.example.helloworld"
+ android:versionCode="1"
+ android:versionName="1.0">
+ <b><uses-sdk android:minSdkVersion="Froyo" /></b>
+ <application ... >
+ ...
+ </application>
+</manifest>
</pre>
-<p>The activity now appears with the action bar in place of the traditional title bar.</p>
+<p>This also enables the "Holographic" theme for all your activities, which is the new default
+application theme for HONEYCOMB and later.</p>
+
+<p class="note"><strong>Note:</strong> In order for the Holographic theme to be applied based on
+the target platform version, the <a
+href="{@docRoot}guide/topics/manifest/uses-sdk-element.html">{@code <uses-sdk>}</a>
+element must appear <em>before</em> the <a
+href="{@docRoot}guide/topics/manifest/application-element.html">{@code <application>}</a>
+element.</p>
+
+<h3>Hide the Action Bar</h3>
+
+<p>If you want to hide the Action Bar for a particular activity, set the activity theme to
+{@code android:style/Theme.NoTitleBar}. For example:</p>
+
+<pre>
+<activity android:theme="@android:style/Theme.NoTitleBar">
+</pre>
<h2 id="ActionItems">Adding Action Items</h2>
-<p>For each action item you want to add to the action bar, you must add a menu item to the
-activity's <a href="{@docRoot}guide/topics/ui/menus.html#OptionsMenu">options menu</a> and declare
-that the item be shown as an action, using the {@code android:showAsAction} attribute in the menu
-XML or with {@link android.view.MenuItem#setShowAsAction setShowAsAction()} on the {@link
-android.view.MenuItem}.</p>
+<p>For each action item you want to add to the Action Bar, you must add a menu item to the
+activity's <a href="{@docRoot}guide/topics/ui/menus.html#OptionsMenu">Options Menu</a> and declare
+that the item be shown as an action.</p>
<div class="figure" style="width:359px">
<img src="{@docRoot}images/ui/actionbar-item-withtext.png" height="57" alt="" />
- <p class="img-caption"><strong>Figure 2.</strong> A screenshot from an action bar with two
+ <p class="img-caption"><strong>Figure 2.</strong> A screenshot from an Action Bar with two
action items.</p>
</div>
-<p>You can specify a menu item to appear as an action item in the action bar—if there is room
+<p>You can specify a menu item to appear as an action item—if there is room
for it—from the <a href="{@docRoot}guide/topics/resources/menu-resource.html">menu
resource</a> by declaring {@code
android:showAsAction="ifRoom"} for the {@code <item>} element. This way, the item will display
-in the action bar for quick access only if there is room available for it—if there's not
-enough room, the item is placed the options menu (revealed by the drop-down icon on the right side
-of the action bar). From your application code, you can specify the item to appear as an action item
+in the Action Bar for quick access only if there is room available for it—if there's not
+enough room, the item is placed the Overflow Menu (revealed by the menu icon on the right side
+of the Action Bar). From your application code, you can specify the item to appear as an action item
by calling {@link android.view.MenuItem#setShowAsAction setShowAsAction()} on the {@link
android.view.MenuItem} and passing {@link android.view.MenuItem#SHOW_AS_ACTION_IF_ROOM}.</p>
@@ -104,7 +131,7 @@
flag—in XML, add {@code withText} to the {@code android:showAsAction} attribute or, in
your application code, use the {@link android.view.MenuItem#SHOW_AS_ACTION_WITH_TEXT} flag when
calling {@link android.view.MenuItem#setShowAsAction setShowAsAction()}. Figure 2 shows a screenshot
-of an action bar with two action items that include text.</p>
+of an Action Bar with two action items that include text.</p>
<p>Here's an example of how you can declare a menu item as an action item in a <a
href="{@docRoot}guide/topics/resources/menu-resource.html">menu resource</a> file:</p>
@@ -121,22 +148,21 @@
<p>In this case, both the {@code ifRoom} and {@code withText} flags are set, so that when this
item appears as an action item, it includes the title text along with the icon.</p>
-<p>A menu item placed in the action bar triggers the same callback methods as other items in the
-options menu. When the user selects an item in the action bar, your activity receives a call to
+<p>A menu item placed in the Action Bar triggers the same callback methods as other items in the
+Options Menu. When the user selects an item in the Action Bar, your activity receives a call to
{@link android.app.Activity#onOptionsItemSelected(MenuItem) onOptionsItemSelected()}, passing the
item ID. (If you added the item from a fragment, then the respective {@link
android.app.Fragment#onOptionsItemSelected(MenuItem) onOptionsItemSelected()} method is called
for that fragment.)</p>
-<p class="note"><strong>Note:</strong> Even menu items that are contained in the options menu
-(and not shown as action items) will show an icon, so when using the action bar, you should
-provide an icon for every item in the options menu.</p>
+<p class="note"><strong>Note:</strong> Menu items that appear in the Overflow Menu (not as action
+items) also show an icon, so it's best if you provide an icon for every menu item.</p>
<p>You can also declare an item to <em>always</em> appear as an action item, but you should avoid
doing so. Most of the time, there will be enough room for several action items and they will appear
in the order you declare them. If you set items to always appear as action
items (instead of <em>if room</em>), then they are added without discrimination and there is a risk
-that they will collide with other elements in the action bar, such as tabs or custom views.</p>
+that they will collide with other elements in the Action Bar, such as tabs or custom views.</p>
<p>For more information about menus, see the <a
href="{@docRoot}guide/topics/ui/menus.html#options-menu">Creating Menus</a> developer guide.</p>
@@ -144,7 +170,7 @@
<h3 id="Home">Using the application icon as an action item</h3>
-<p>By default, the application icon appears in the action bar on the left side, but does nothing
+<p>By default, the application icon appears in the Action Bar on the left side, but does nothing
when tapped. To use the application icon as an action item when tapped, you simply need to add a
condition to your {@link android.app.Activity#onOptionsItemSelected onOptionsItemSelected()} method
that performs an action when the {@link android.view.MenuItem} ID is {@code android.R.id.home}.
@@ -158,7 +184,7 @@
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
- // app icon in action bar clicked; go home
+ // app icon in Action Bar clicked; go home
Intent intent = new Intent(this, HomeActivity.class);
startActivity(intent);
break;
@@ -176,7 +202,7 @@
<p>You can also use the application icon to provide "up" navigation. The way you handle the event
when a user taps the icon is the same, but if the user experience for the event is to <em>navigate
up to the parent activity</em>, then you should indicate this behavior by setting the
-action bar to "show home as up." You can do so by calling {@link
+Action Bar to "show home as up." You can do so by calling {@link
android.app.ActionBar#setDisplayOptions setDisplayOptions()} on your activity's {@link
android.app.ActionBar}, and passing the {@link
android.app.ActionBar#DISPLAY_HOME_AS_UP} display option.</p>
@@ -186,7 +212,7 @@
sure you do so <em>after</em> you've called {@link android.app.Activity#setContentView
setContentView()}).</p>
-<p>For example, here's how you can change the action bar display mode to show the application
+<p>For example, here's how you can change the Action Bar display mode to show the application
icon as an "up" action:</p>
<pre>
@@ -198,24 +224,103 @@
}
</pre>
-<p class="caution"><strong>Caution:</strong> If your activity does not have an action bar (if you
-did not set the theme of your activity or application to the holographic or action bar theme), then
+<p class="caution"><strong>Caution:</strong> If your activity does not have an Action Bar (if you
+did not set the theme of your activity or application to the holographic or Action Bar theme), then
{@link android.app.Activity#getActionBar} returns null.</p>
+
+<h2 id="ActionView">Adding an Action View</h2>
+
+<div class="figure" style="width:281px">
+ <img src="{@docRoot}images/ui/actionbar-actionview.png" alt="" />
+ <p class="img-caption"><strong>Figure 4.</strong> An action view with a search widget.</p>
+</div>
+
+<p>An action view is a customized view you can specify for an item in your Options Menu, to
+display in the Action Bar when the item is included as an action item. For example, you can
+include a menu item for "Search", which appears and behaves as a normal menu item in the Overflow
+Menu, but, when set as an action item, it provides an action view that is a {@link
+android.widget.SearchView}, so the user can initiate a search directly from the Action Bar.
+Figure 4 shows an example of this, in which a menu item for search provides an action view
+using the {@link android.widget.SearchView} widget.</p>
+
+<p>The best way to declare an action view for an item is in your <a
+href="{@docRoot}guide/topics/resources/menu-resource.html">menu resource</a>, using the {@code
+android:actionLayout} or {@code android:actionViewClass} attribute.</p>
+
+<ul>
+ <li>The value for {@code android:actionLayout} must be a resource pointer to a layout file.
+For example:
+<pre>
+<item android:id="@+id/menu_search"
+ android:title="Search"
+ android:icon="@drawable/ic_menu_search"
+ android:showAsAction="ifRoom"
+ <b>android:actionLayout="@layout/searchview"</b> />
+</pre></li>
+ <li>The value for {@code android:actionViewClass} must be a fully-qualified class name for
+the {@link android.view.View} you want to use. For example:
+<pre>
+<item android:id="@+id/menu_search"
+ android:title="Search"
+ android:icon="@drawable/ic_menu_search"
+ android:showAsAction="ifRoom"
+ <b>android:actionViewClass="android.widget.SearchView"</b> />
+</pre></li>
+</ul>
+
+<p>Now, when the menu item is displayed as an action item, it's action view appears instead of
+the item's traditional icon and/or text. Yet, if for some reason the item does not appear in the
+Action Bar, then it behaves like a normal menu item in the Overflow Menu and you must respond
+accordingly when the user taps it, from the {@link android.app.Activity#onOptionsItemSelected
+onOptionsItemSelected()} callback.</p>
+
+<p>When the activity first starts, the system populates the Action Bar and Overflow Menu by calling
+{@link android.app.Activity#onCreateOptionsMenu onCreateOptionsMenu()}.
+After you've inflated your menu in this method, you can acquire elements in an action view
+(perhaps in order to attach listeners) by calling {@link android.view.Menu#findItem
+findItem()} with the ID of the menu item, then {@link android.view.MenuItem#getActionView} on
+the returned {@link android.view.MenuItem}. For example, the search widget from the above samples is
+acquired like this:</p>
+
+<pre>
+@Override
+public boolean onCreateOptionsMenu(Menu menu) {
+ getMenuInflater().inflate(R.menu.options, menu);
+ SearchView searchView = (SearchView) menu.findItem(R.id.menu_search).getActionView();
+ // Set appropriate listeners for searchView
+ ...
+ return super.onCreateOptionsMenu(menu);
+}
+</pre>
+
+<p>For more information about enabling search in the Action Bar, see the <a
+href="{@docRoot}guide/topics/search/index.html">Search</a> developer guide.</p>
+
+
+
<h2 id="Tabs">Adding Tabs</h2>
-<p>The action bar can display tabs that allow the user navigate between different fragments in the
+<p>The Action Bar can display tabs that allow the user navigate between different fragments in the
activity. Each tab can include a title and/or an icon.</p>
+<!--
+<div class="figure" style="width:300px">
+ <img src="{@docRoot}images/ui/actionbar-tabs.png" alt="" />
+ <p class="img-caption"><strong>Figure 5.</strong> Screenshot of tabs in the
+Action Bar.</p>
+</div>
+-->
+
<p>To begin, your layout must include a {@link android.view.View} in which each {@link
android.app.Fragment} associated with a tab is displayed. Be sure the view has an ID that you
can use to reference it from your code.</p>
-<p>To add tabs to the action bar:</p>
+<p>To add tabs to the Action Bar:</p>
<ol>
<li>Create an implementation of {@link android.app.ActionBar.TabListener} to handle the
-interaction events on the action bar tabs. You must implement all methods: {@link
+interaction events on the Action Bar tabs. You must implement all methods: {@link
android.app.ActionBar.TabListener#onTabSelected onTabSelected()}, {@link
android.app.ActionBar.TabListener#onTabUnselected onTabUnselected()}, and {@link
android.app.ActionBar.TabListener#onTabReselected onTabReselected()}.
@@ -260,7 +365,7 @@
<li>Call {@link android.app.ActionBar#setNavigationMode(int)
setNavigationMode(NAVIGATION_MODE_TABS)} to enable tab mode for the {@link
android.app.ActionBar}.</li>
- <li>Create each tab for the action bar:
+ <li>Create each tab for the Action Bar:
<ol>
<li>Create a new {@link android.app.ActionBar.Tab} by calling {@link
android.app.ActionBar#newTab()} on the {@link android.app.ActionBar}.</li>
@@ -274,19 +379,19 @@
setTabListener()}.
</ol>
</li>
- <li>Add each {@link android.app.ActionBar.Tab} to the action bar by calling {@link
+ <li>Add each {@link android.app.ActionBar.Tab} to the Action Bar by calling {@link
android.app.ActionBar#addTab addTab()} on the {@link android.app.ActionBar} and passing the
-{@link android.app.ActionBar.Tab}.</li>
+{@link android.app.ActionBar.Tab}.<>
</ol>
<p>For example, the following code combines steps 2 - 5 to create two tabs and add them to
-the action bar:</p>
+the Action Bar:</p>
<pre>
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
- // setup action bar for tabs
+ // setup Action Bar for tabs
final ActionBar actionBar = getActionBar();
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
// remove the activity title to make space for tabs
@@ -295,11 +400,11 @@
// instantiate fragment for the tab
Fragment artistsFragment = new ArtistsFragment();
// add a new tab and set its title text and tab listener
- bar.addTab(bar.newTab().setText(R.string.tab_artists)
+ actionBar.addTab(actionBar.newTab().setText(R.string.tab_artists)
.setTabListener(new TabListener(artistsFragment)));
Fragment albumsFragment = new AlbumsFragment();
- bar.addTab(bar.newTab().setText(R.string.tab_albums)
+ actionBar.addTab(actionBar.newTab().setText(R.string.tab_albums)
.setTabListener(new TabListener(albumsFragment)));
}
</pre>
@@ -330,3 +435,159 @@
href="{@docRoot}guide/topics/fragments/index.html">Fragments</a> developer guide.</p>
+
+<h2 id="Dropdown">Adding Drop-down Navigation</h2>
+
+<p>As another mode of navigation within your activity, you can provide a drop-down list in the
+Action Bar. For example, the drop-down list can provide alternative modes for sorting the content in
+the activity or switching the user's account.</p>
+
+<!--
+<div class="figure" style="width:135px">
+ <img src="{@docRoot}images/ui/actionbar-dropdown.png" alt="" />
+ <p class="img-caption"><strong>Figure 5.</strong> Screenshot of a drop-down navigation list in the
+Action Bar.</p>
+</div>
+-->
+
+<p>Here's a quick list of what you must do to enable drop-down navigation:</p>
+
+<ol>
+ <li>Create a {@link android.widget.SpinnerAdapter} that provides the
+list of selectable items for the list and the layout to use when drawing each item in the list.</li>
+ <li>Implement {@link android.app.ActionBar.NavigationCallback} to define the behavior when the
+user selects an item from the list.</li>
+ <li>Turn on navigation mode for the Action Bar with {@link
+android.app.ActionBar#setNavigationMode setNavigationMode()}. For example:
+<pre>
+ActionBar actionBar = getActionBar();
+actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
+</pre>
+ <p>You should perform this during your activity's {@link android.app.Activity#onCreate
+onCreate()} method.</p>
+ </li>
+ <li>Following that, set the callback for your drop-down list with {@link
+android.app.ActionBar#setListNavigationCallbacks setListNavigationCallbacks()}. For example:
+<pre>
+actionBar.setListNavigationCallbacks(mSpinnerAdapter, mNavigationCallback);
+</pre>
+<p>This method takes your {@link android.widget.SpinnerAdapter} and {@link
+android.app.ActionBar.NavigationCallback}. More about these next.</p>
+</li>
+</ol>
+
+<p>That's the basic setup. The {@link android.widget.SpinnerAdapter} and {@link
+android.app.ActionBar.NavigationCallback} is where most of the work is done. There are many ways
+you can implement these to define the functionality for your drop-down navigation. Implementing
+various types of {@link android.widget.SpinnerAdapter} is beyond the scope of this
+document—you should refer to the class refrence for more information about implementing it or
+extending an existing implementation. However, below is a simple example for a {@link
+android.widget.SpinnerAdapter} and {@link android.app.ActionBar.NavigationCallback} to get you
+started.</p>
+
+
+<h3 id="Spinner">Example: simple SpinnerAdapter</h3>
+
+<p>{@link android.widget.SpinnerAdapter} is an interface that you can implement to provide
+content for the list and is where your implementation for the drop-down list can be heavily
+customized. Android includes some useful implementations that you can extend, such as {@link
+android.widget.ArrayAdapter} and {@link
+android.widget.SimpleCursorAdapter}. For example, here's an easy way to create a {@link
+android.widget.SpinnerAdapter} with {@link android.widget.ArrayAdapter}, using a string array
+from resources:</p>
+
+<pre>
+SpinnerAdapter mSpinnerAdapter = ArrayAdapter.createFromResource(this, R.array.action_list,
+ android.R.layout.simple_spinner_dropdown_item);
+</pre>
+
+<p>This is now ready to be given to {@link
+android.app.ActionBar#setListNavigationCallbacks setListNavigationCallbacks()}, in step 4 from
+above.</p>
+
+<p>A <a href="{@docRoot}guide/topics/resources/string-resource.html#StringArray">string array</a>
+defined as a resource looks like this:</p>
+
+<pre>
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <string-array name="action_list">
+ <item>Mercury</item>
+ <item>Venus</item>
+ <item>Earth</item>
+ </string-array>
+</pre>
+</pre>
+
+
+<h3 id="NavigationCallback">Example: simple NavigationCallback</h3>
+
+<p>Your implementation of {@link android.app.ActionBar.NavigationCallback} is where you handle
+fragment changes or other modifications to your activity when the user selects an item from the
+drop-down list. There's only one callback method to implement: {@link
+android.app.ActionBar.NavigationCallback#onNavigationItemSelected onNavigationItemSelected()}.</p>
+
+<p>The {@link
+android.app.ActionBar.NavigationCallback#onNavigationItemSelected onNavigationItemSelected()}
+method receives the position of the item in the list and an item ID provided by the {@link
+android.widget.SpinnerAdapter}.</p>
+
+<p>Here's an example that instantiates an anonymous implementation of {@link
+android.app.ActionBar.NavigationCallback}, which inserts a {@link android.app.Fragment} into the
+layout container identified by {@code R.id.fragment_container}:</p>
+
+<pre>
+mNavigationCallback = new NavigationCallback() {
+ // Get the same strings provided for the drop-down's ArrayAdapter
+ String[] strings = getResources().getStringArray(R.array.action_list);
+
+ @Override
+ public boolean onNavigationItemSelected(int position, long itemId) {
+ // Create new fragment from our own Fragment class
+ ListContentFragment newFragment = new ListContentFragment();
+ FragmentTransaction ft = openFragmentTransaction();
+ // Replace whatever is in the fragment container with this fragment
+ // and give the fragment a tag name equal to the string at the position selected
+ ft.replace(R.id.fragment_container, newFragment, strings[position]);
+ // Apply changes
+ ft.commit();
+ return true;
+ }
+};
+</pre>
+
+<p>This instance of {@link android.app.ActionBar.NavigationCallback} can be given to {@link
+android.app.ActionBar#setListNavigationCallbacks setListNavigationCallbacks()}, in step 4 from
+above.</p>
+
+<p>In this example, the fragment added is given a tag that can uniquely identify the fragment.
+For this example, the {@code ListContentFragment} class used uses this tag as
+the text for a {@link android.widget.TextView} in the fragment's layout. Here's how it's done:</p>
+
+<pre>
+public class ListContentFragment extends Fragment {
+ private String mText;
+
+ @Override
+ public void onAttach(Activity activity) {
+ // This is the first callback received; here we can set the text for
+ // the fragment as defined by the tag specified during the fragment transaction
+ super.onAttach(activity);
+ mText = getTag();
+ }
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container,
+ Bundle savedInstanceState) {
+ // This is called to define the layout for the fragment;
+ // we just create a TextView and set its text to be the fragment tag
+ TextView text = new TextView(getActivity());
+ text.setText(mText);
+ return text;
+ }
+}
+</pre>
+
+
+
+
diff --git a/docs/html/guide/topics/ui/declaring-layout.jd b/docs/html/guide/topics/ui/declaring-layout.jd
index 4d71d28..d561bdd 100644
--- a/docs/html/guide/topics/ui/declaring-layout.jd
+++ b/docs/html/guide/topics/ui/declaring-layout.jd
@@ -120,7 +120,7 @@
<pre>
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
- setContentView.(R.layout.main_layout);
+ setContentView(R.layout.main_layout);
}
</pre>
diff --git a/docs/html/images/ui/actionbar-actionview.png b/docs/html/images/ui/actionbar-actionview.png
new file mode 100644
index 0000000..30edca0
--- /dev/null
+++ b/docs/html/images/ui/actionbar-actionview.png
Binary files differ
diff --git a/libs/binder/CursorWindow.cpp b/libs/binder/CursorWindow.cpp
index fbba281..47bbd04 100644
--- a/libs/binder/CursorWindow.cpp
+++ b/libs/binder/CursorWindow.cpp
@@ -219,7 +219,8 @@
field_slot_t * CursorWindow::getFieldSlotWithCheck(int row, int column)
{
if (row < 0 || row >= mHeader->numRows || column < 0 || column >= mHeader->numColumns) {
- LOGE("Bad request for field slot %d,%d. numRows = %d, numColumns = %d", row, column, mHeader->numRows, mHeader->numColumns);
+ LOGE("Failed to read row# %d, column# from a CursorWindow which has %d rows, %d columns.",
+ row, column, mHeader->numRows, mHeader->numColumns);
return NULL;
}
row_slot_t * rowSlot = getRowSlot(row);
@@ -238,7 +239,8 @@
uint32_t CursorWindow::read_field_slot(int row, int column, field_slot_t * slotOut)
{
if (row < 0 || row >= mHeader->numRows || column < 0 || column >= mHeader->numColumns) {
- LOGE("Bad request for field slot %d,%d. numRows = %d, numColumns = %d", row, column, mHeader->numRows, mHeader->numColumns);
+ LOGE("Can't read row# %d, col# %d from CursorWindow. Make sure your Cursor is initialized correctly.",
+ row, column);
return -1;
}
row_slot_t * rowSlot = getRowSlot(row);
diff --git a/libs/rs/rsScriptC.h b/libs/rs/rsScriptC.h
index 4f0dff3..ab2db5c8 100644
--- a/libs/rs/rsScriptC.h
+++ b/libs/rs/rsScriptC.h
@@ -21,7 +21,9 @@
#include "RenderScriptEnv.h"
-struct BCCscript;
+namespace bcc {
+class BCCscript;
+}
// ---------------------------------------------------------------------------
namespace android {
@@ -46,7 +48,7 @@
Program_t mProgram;
- BCCscript* mBccScript;
+ bcc::BCCscript* mBccScript;
const Allocation *ptrToAllocation(const void *) const;
diff --git a/packages/SystemUI/res/drawable/ic_sysbar_back_ime.xml b/packages/SystemUI/res/drawable/ic_sysbar_back_ime.xml
new file mode 100644
index 0000000..248496d
--- /dev/null
+++ b/packages/SystemUI/res/drawable/ic_sysbar_back_ime.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2008 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:state_pressed="true" android:drawable="@drawable/ic_sysbar_back_ime_pressed" />
+ <item android:drawable="@drawable/ic_sysbar_back_ime_default" />
+</selector>
+
diff --git a/packages/SystemUI/res/layout-xlarge/sysbar_panel_notifications.xml b/packages/SystemUI/res/layout-xlarge/status_bar_notification_panel.xml
similarity index 94%
rename from packages/SystemUI/res/layout-xlarge/sysbar_panel_notifications.xml
rename to packages/SystemUI/res/layout-xlarge/status_bar_notification_panel.xml
index fb4cf3f..c0612c8 100644
--- a/packages/SystemUI/res/layout-xlarge/sysbar_panel_notifications.xml
+++ b/packages/SystemUI/res/layout-xlarge/status_bar_notification_panel.xml
@@ -62,6 +62,7 @@
<com.android.systemui.statusbar.policy.DateView
android:id="@+id/date"
+ style="@style/StatusBarNotificationText"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:layout_below="@id/clock"
@@ -84,12 +85,13 @@
<TextView
android:id="@+id/battery_text"
- android:layout_width="48dp"
+ style="@style/StatusBarNotificationText"
+ android:layout_width="56dp"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/battery"
android:layout_alignBaseline="@id/battery"
android:singleLine="true"
- android:text="@string/system_panel_settings_button"
+ android:text="@string/status_bar_settings_settings_button"
/>
<ImageView
@@ -104,12 +106,13 @@
<TextView
android:id="@+id/network_text"
+ style="@style/StatusBarNotificationText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/network"
android:layout_alignBaseline="@id/battery"
android:singleLine="true"
- android:text="@string/system_panel_settings_button"
+ android:text="@string/status_bar_settings_settings_button"
/>
<ImageView
diff --git a/packages/SystemUI/res/layout-xlarge/sysbar_panel_notification_peek.xml b/packages/SystemUI/res/layout-xlarge/status_bar_notification_peek.xml
similarity index 100%
rename from packages/SystemUI/res/layout-xlarge/sysbar_panel_notification_peek.xml
rename to packages/SystemUI/res/layout-xlarge/status_bar_notification_peek.xml
diff --git a/packages/SystemUI/res/layout-xlarge/status_bar_latest_event.xml b/packages/SystemUI/res/layout-xlarge/status_bar_notification_row.xml
similarity index 100%
rename from packages/SystemUI/res/layout-xlarge/status_bar_latest_event.xml
rename to packages/SystemUI/res/layout-xlarge/status_bar_notification_row.xml
diff --git a/packages/SystemUI/res/layout-xlarge/sysbar_panel_pocket.xml b/packages/SystemUI/res/layout-xlarge/status_bar_pocket_panel.xml
similarity index 100%
rename from packages/SystemUI/res/layout-xlarge/sysbar_panel_pocket.xml
rename to packages/SystemUI/res/layout-xlarge/status_bar_pocket_panel.xml
diff --git a/packages/SystemUI/res/layout-xlarge/sysbar_panel_recent_item.xml b/packages/SystemUI/res/layout-xlarge/status_bar_recent_item.xml
similarity index 99%
rename from packages/SystemUI/res/layout-xlarge/sysbar_panel_recent_item.xml
rename to packages/SystemUI/res/layout-xlarge/status_bar_recent_item.xml
index b1997b8..e7a3a61 100644
--- a/packages/SystemUI/res/layout-xlarge/sysbar_panel_recent_item.xml
+++ b/packages/SystemUI/res/layout-xlarge/status_bar_recent_item.xml
@@ -56,4 +56,4 @@
</LinearLayout>
-</LinearLayout>
\ No newline at end of file
+</LinearLayout>
diff --git a/packages/SystemUI/res/layout-xlarge/sysbar_panel_recent.xml b/packages/SystemUI/res/layout-xlarge/status_bar_recent_panel.xml
similarity index 100%
rename from packages/SystemUI/res/layout-xlarge/sysbar_panel_recent.xml
rename to packages/SystemUI/res/layout-xlarge/status_bar_recent_panel.xml
diff --git a/packages/SystemUI/res/layout-xlarge/status_bar_settings_view.xml b/packages/SystemUI/res/layout-xlarge/status_bar_settings_view.xml
new file mode 100644
index 0000000..6dd97c3
--- /dev/null
+++ b/packages/SystemUI/res/layout-xlarge/status_bar_settings_view.xml
@@ -0,0 +1,170 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+-->
+
+<com.android.systemui.statusbar.tablet.SettingsView
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical"
+ android:background="@drawable/status_bar_item_background"
+ android:paddingLeft="16dp"
+ >
+
+ <!-- Airplane mode -->
+ <LinearLayout
+ android:id="@+id/airplane"
+ style="@style/StatusBarPanelSettingsRow"
+ >
+ <ImageView
+ android:id="@+id/airplane_icon"
+ style="@style/StatusBarPanelSettingsIcon"
+ android:src="@drawable/ic_sysbar_airplane_on"
+ />
+ <TextView
+ android:id="@+id/airplane_label"
+ style="@style/StatusBarPanelSettingsContents"
+ android:text="@string/status_bar_settings_airplane"
+ />
+ <CheckBox
+ android:id="@+id/airplane_checkbox"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center_vertical"
+ />
+ </LinearLayout>
+ <View style="@style/StatusBarPanelSettingsPanelSeparator" />
+
+ <!-- Network -->
+ <LinearLayout
+ android:id="@+id/network"
+ style="@style/StatusBarPanelSettingsRow"
+ >
+ <ImageView
+ android:id="@+id/network_icon"
+ style="@style/StatusBarPanelSettingsIcon"
+ android:src="@drawable/ic_sysbar_wifi_on"
+ />
+ <TextView
+ android:id="@+id/network_label"
+ style="@style/StatusBarPanelSettingsContents"
+ />
+ <ImageView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="top"
+ android:layout_marginTop="16dp"
+ android:layout_marginRight="8dp"
+ android:src="@drawable/ic_notification_open"
+ />
+ </LinearLayout>
+ <View style="@style/StatusBarPanelSettingsPanelSeparator" />
+
+ <!-- Rotation lock -->
+ <LinearLayout
+ android:id="@+id/rotate"
+ style="@style/StatusBarPanelSettingsRow"
+ >
+ <ImageView
+ android:id="@+id/rotate_icon"
+ style="@style/StatusBarPanelSettingsIcon"
+ android:src="@drawable/ic_sysbar_rotate_on"
+ />
+ <TextView
+ android:id="@+id/rotate_label"
+ style="@style/StatusBarPanelSettingsContents"
+ android:text="@string/status_bar_settings_rotation_lock"
+ />
+ <CheckBox
+ android:id="@+id/rotate_checkbox"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center_vertical"
+ />
+ </LinearLayout>
+ <View style="@style/StatusBarPanelSettingsPanelSeparator" />
+
+ <!-- Brightness -->
+ <LinearLayout style="@style/StatusBarPanelSettingsRow" >
+ <ImageView
+ android:id="@+id/brightness_icon"
+ style="@style/StatusBarPanelSettingsIcon"
+ android:src="@drawable/ic_sysbar_brightness"
+ />
+ </LinearLayout>
+ <View style="@style/StatusBarPanelSettingsPanelSeparator" />
+
+ <!-- Volume -->
+ <LinearLayout style="@style/StatusBarPanelSettingsRow" >
+ <ImageView
+ android:id="@+id/volume_icon"
+ style="@style/StatusBarPanelSettingsIcon"
+ android:src="@drawable/ic_sysbar_sound_on"
+ />
+ </LinearLayout>
+ <View style="@style/StatusBarPanelSettingsPanelSeparator" />
+
+ <!-- Notifications / Do not disturb -->
+ <LinearLayout
+ android:id="@+id/do_not_disturb"
+ style="@style/StatusBarPanelSettingsRow"
+ >
+ <ImageView
+ android:id="@+id/do_not_disturb_icon"
+ style="@style/StatusBarPanelSettingsIcon"
+ android:src="@drawable/ic_sysbar_gps_on"
+ />
+ <TextView
+ style="@style/StatusBarPanelSettingsContents"
+ android:text="@string/status_bar_settings_notifications"
+ />
+ <CheckBox
+ android:id="@+id/do_not_disturb_checkbox"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center_vertical"
+ />
+ </LinearLayout>
+ <View style="@style/StatusBarPanelSettingsPanelSeparator" />
+
+ <!-- Link to settings -->
+ <LinearLayout
+ android:id="@+id/settings"
+ style="@style/StatusBarPanelSettingsRow"
+ >
+
+ <ImageView
+ android:id="@+id/settings"
+ style="@style/StatusBarPanelSettingsIcon"
+ android:src="@drawable/ic_sysbar_quicksettings"
+ />
+ <TextView
+ style="@style/StatusBarPanelSettingsContents"
+ android:text="@string/status_bar_settings_settings_button"
+ />
+ <ImageView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="top"
+ android:layout_marginTop="16dp"
+ android:layout_marginRight="8dp"
+ android:src="@drawable/ic_notification_open"
+ />
+ </LinearLayout>
+ <View style="@style/StatusBarPanelSettingsPanelSeparator" />
+
+</com.android.systemui.statusbar.tablet.SettingsView>
+
diff --git a/packages/SystemUI/res/layout-xlarge/ticker_compat.xml b/packages/SystemUI/res/layout-xlarge/status_bar_ticker_compat.xml
similarity index 100%
rename from packages/SystemUI/res/layout-xlarge/ticker_compat.xml
rename to packages/SystemUI/res/layout-xlarge/status_bar_ticker_compat.xml
diff --git a/packages/SystemUI/res/layout-xlarge/ticker.xml b/packages/SystemUI/res/layout-xlarge/status_bar_ticker_panel.xml
similarity index 100%
rename from packages/SystemUI/res/layout-xlarge/ticker.xml
rename to packages/SystemUI/res/layout-xlarge/status_bar_ticker_panel.xml
diff --git a/packages/SystemUI/res/layout-xlarge/sysbar_panel_settings.xml b/packages/SystemUI/res/layout-xlarge/sysbar_panel_settings.xml
deleted file mode 100644
index a800afb..0000000
--- a/packages/SystemUI/res/layout-xlarge/sysbar_panel_settings.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- * Copyright (C) 2010 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
--->
-
-<com.android.systemui.statusbar.tablet.SettingsPanel
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
- android:layout_height="200dip"
- android:background="#ff000000"
- >
-</com.android.systemui.statusbar.tablet.SettingsPanel>
-
diff --git a/packages/SystemUI/res/layout-xlarge/sysbar_panel_system.xml b/packages/SystemUI/res/layout-xlarge/sysbar_panel_system.xml
deleted file mode 100644
index a1792fd..0000000
--- a/packages/SystemUI/res/layout-xlarge/sysbar_panel_system.xml
+++ /dev/null
@@ -1,213 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/* apps/common/assets/default/default/skins/StatusBar.xml
-**
-** Copyright 2010, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-** http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
--->
-
-<com.android.systemui.statusbar.tablet.SystemPanel
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_height="wrap_content"
- android:layout_width="match_parent"
- android:background="@drawable/sysbar_panel_bg"
- android:orientation="vertical"
- android:paddingLeft="70dip"
- android:paddingRight="120dip"
- >
-
- <!-- top row: quick settings buttons -->
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="64dip"
- android:orientation="horizontal"
- android:gravity="center"
- >
- <ImageButton android:id="@+id/brightness"
- android:layout_width="90dip"
- android:layout_height="64dip"
- android:src="@drawable/ic_sysbar_brightness"
- android:background="@drawable/sysbar_toggle_bg_off"
- />
- <ImageButton android:id="@+id/sound"
- android:layout_width="90dip"
- android:layout_height="64dip"
- android:layout_marginLeft="8dip"
- android:src="@drawable/ic_sysbar_sound_on"
- android:background="@drawable/sysbar_toggle_bg_off"
- />
- <ImageButton android:id="@+id/orientation"
- android:layout_width="90dip"
- android:layout_height="64dip"
- android:layout_marginLeft="8dip"
- android:src="@drawable/ic_sysbar_rotate_on"
- android:background="@drawable/sysbar_toggle_bg_off"
- />
- <ImageButton android:id="@+id/airplane"
- android:layout_width="90dip"
- android:layout_height="64dip"
- android:layout_marginLeft="8dip"
- android:src="@drawable/ic_sysbar_airplane_on"
- android:background="@drawable/sysbar_toggle_bg_off"
- />
- <ImageButton android:id="@+id/gps"
- android:layout_width="90dip"
- android:layout_height="64dip"
- android:layout_marginLeft="8dip"
- android:src="@drawable/ic_sysbar_gps_on"
- android:background="@drawable/sysbar_toggle_bg_off"
- />
- <ImageButton android:id="@+id/bluetooth"
- android:layout_width="90dip"
- android:layout_height="64dip"
- android:layout_marginLeft="8dip"
- android:src="@drawable/ic_sysbar_bluetooth_on"
- android:background="@drawable/sysbar_toggle_bg_off"
- />
- </LinearLayout>
-
- <!-- main row: meters, clock -->
- <RelativeLayout
- android:padding="8dip"
- android:layout_width="match_parent"
- android:layout_height="192dip"
- >
- <RelativeLayout
- android:layout_width="256dip"
- android:layout_height="192dip"
- android:layout_alignParentLeft="true"
- android:layout_marginLeft="48dip"
- >
- <ImageView android:id="@+id/battery_meter"
- android:layout_width="256dip"
- android:layout_height="wrap_content"
- android:layout_alignParentBottom="true"
- android:scaleType="centerCrop"
- />
- <TextView android:id="@+id/battery_info"
- style="@style/TextAppearance.StatusBar.SystemPanel"
- android:layout_width="match_parent"
- android:layout_height="24dip"
- android:gravity="center"
- android:layout_above="@id/battery_meter"
- />
- </RelativeLayout>
-
- <com.android.systemui.statusbar.policy.Clock
- style="@style/TextAppearance.StatusBar.SystemPanel"
- android:id="@+id/clock"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:singleLine="true"
- android:textSize="50sp"
- android:textStyle="normal"
- android:textColor="#FFFFFFFF"
- android:layout_centerHorizontal="true"
- android:layout_alignParentBottom="true"
- />
-
- <RelativeLayout
- android:layout_width="256dip"
- android:layout_height="192dip"
- android:layout_alignParentRight="true"
- android:layout_marginRight="48dip"
- >
- <ImageView android:id="@+id/signal_meter"
- android:layout_width="256dip"
- android:layout_height="wrap_content"
- android:layout_alignParentBottom="true"
- android:scaleType="centerCrop"
- />
-
- <TextView android:id="@+id/signal_info"
- style="@style/TextAppearance.StatusBar.SystemPanel"
- android:layout_width="match_parent"
- android:layout_height="24dip"
- android:gravity="center"
- android:layout_above="@id/signal_meter"
- />
- </RelativeLayout>
-
- <ImageView
- android:layout_height="wrap_content"
- android:layout_width="wrap_content"
- android:layout_alignParentLeft="true"
- android:layout_alignParentBottom="true"
- android:layout_marginBottom="8dip"
- android:layout_marginLeft="8dip"
- android:src="@drawable/ic_sysbar_battery_on"
- />
- <ImageView
- android:layout_height="wrap_content"
- android:layout_width="wrap_content"
- android:layout_alignParentRight="true"
- android:layout_alignParentBottom="true"
- android:layout_marginBottom="8dip"
- android:layout_marginRight="8dip"
- android:src="@drawable/ic_sysbar_wifi_on"
- />
- </RelativeLayout>
-
- <!-- bottom row: transient indicators, settings button -->
- <View
- android:layout_width="match_parent"
- android:layout_height="1sp"
- android:background="@android:drawable/divider_horizontal_dark"
- />
- <RelativeLayout
- android:layout_width="match_parent"
- android:layout_height="48dip"
- >
- <TextView android:id="@+id/settings_button"
- style="@style/TextAppearance.StatusBar.TextButton"
- android:layout_width="wrap_content"
- android:layout_height="match_parent"
- android:layout_alignParentRight="true"
- android:paddingRight="32dip"
- android:paddingLeft="32dip"
- android:textSize="20sp"
- android:gravity="center"
- android:text="@string/system_panel_settings_button"
- />
- <View
- android:id="@+id/settings_left_divider"
- android:layout_height="match_parent"
- android:layout_width="1sp"
- android:layout_toLeftOf="@id/settings_button"
- android:background="@*android:drawable/divider_vertical_dark"
- />
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_alignParentLeft="true"
- android:layout_toLeftOf="@id/settings_left_divider"
- android:orientation="horizontal"
- android:gravity="left|center_vertical"
- >
- <!-- TODO: alarm -->
- <!-- TODO: sync -->
- <com.android.systemui.statusbar.policy.DateView
- android:id="@+id/date"
- style="@style/TextAppearance.StatusBar.SystemPanel"
- android:layout_width="wrap_content"
- android:layout_height="match_parent"
- android:singleLine="true"
- android:gravity="center"
- />
- </LinearLayout>
-
-
- </RelativeLayout>
-</com.android.systemui.statusbar.tablet.SystemPanel>
diff --git a/packages/SystemUI/res/layout-xlarge/ticker_icon.xml b/packages/SystemUI/res/layout-xlarge/ticker_icon.xml
deleted file mode 100644
index 9efa987..0000000
--- a/packages/SystemUI/res/layout-xlarge/ticker_icon.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- * Copyright (C) 2010 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
--->
-
-<ImageView
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="30dp"
- android:layout_height="30dp"
- android:layout_gravity="center"
- android:layout_marginLeft="6dp"
- />
-
diff --git a/packages/SystemUI/res/layout/status_bar_latest_event.xml b/packages/SystemUI/res/layout/status_bar_notification_row.xml
similarity index 100%
rename from packages/SystemUI/res/layout/status_bar_latest_event.xml
rename to packages/SystemUI/res/layout/status_bar_notification_row.xml
diff --git a/packages/SystemUI/res/values-ar/strings.xml b/packages/SystemUI/res/values-ar/strings.xml
index d94e58a..1a32aa7 100644
--- a/packages/SystemUI/res/values-ar/strings.xml
+++ b/packages/SystemUI/res/values-ar/strings.xml
@@ -35,7 +35,7 @@
<!-- no translation found for invalid_charger (4549105996740522523) -->
<skip />
<string name="battery_low_why" msgid="7279169609518386372">"استخدام البطارية"</string>
- <!-- no translation found for system_panel_settings_button (7832600575390861653) -->
+ <!-- no translation found for status_bar_settings_settings_button (7832600575390861653) -->
<skip />
<string name="recent_tasks_title" msgid="3691764623638127888">"حديثة"</string>
<!-- no translation found for recent_tasks_empty (1905484479067697884) -->
diff --git a/packages/SystemUI/res/values-bg/strings.xml b/packages/SystemUI/res/values-bg/strings.xml
index 975c207..a9c8ba0 100644
--- a/packages/SystemUI/res/values-bg/strings.xml
+++ b/packages/SystemUI/res/values-bg/strings.xml
@@ -35,7 +35,7 @@
<!-- no translation found for invalid_charger (4549105996740522523) -->
<skip />
<string name="battery_low_why" msgid="7279169609518386372">"Използване на батерията"</string>
- <!-- no translation found for system_panel_settings_button (7832600575390861653) -->
+ <!-- no translation found for status_bar_settings_settings_button (7832600575390861653) -->
<skip />
<string name="recent_tasks_title" msgid="3691764623638127888">"Скорошни"</string>
<!-- no translation found for recent_tasks_empty (1905484479067697884) -->
diff --git a/packages/SystemUI/res/values-ca/strings.xml b/packages/SystemUI/res/values-ca/strings.xml
index 611bec7..eea01e1 100644
--- a/packages/SystemUI/res/values-ca/strings.xml
+++ b/packages/SystemUI/res/values-ca/strings.xml
@@ -35,7 +35,7 @@
<!-- no translation found for invalid_charger (4549105996740522523) -->
<skip />
<string name="battery_low_why" msgid="7279169609518386372">"Ús de la bateria"</string>
- <!-- no translation found for system_panel_settings_button (7832600575390861653) -->
+ <!-- no translation found for status_bar_settings_settings_button (7832600575390861653) -->
<skip />
<string name="recent_tasks_title" msgid="3691764623638127888">"Recents"</string>
<!-- no translation found for recent_tasks_empty (1905484479067697884) -->
diff --git a/packages/SystemUI/res/values-cs-xlarge/strings.xml b/packages/SystemUI/res/values-cs-xlarge/strings.xml
index a0301bb..d432a8b 100644
--- a/packages/SystemUI/res/values-cs-xlarge/strings.xml
+++ b/packages/SystemUI/res/values-cs-xlarge/strings.xml
@@ -21,11 +21,11 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<!-- no translation found for status_bar_clear_all_button (4722520806446512408) -->
<skip />
- <string name="system_panel_signal_meter_disconnected" msgid="2123001074951934237">"žádné připojení k internetu"</string>
- <!-- no translation found for system_panel_signal_meter_wifi_ssid_format (6261810256542749384) -->
+ <string name="status_bar_settings_signal_meter_disconnected" msgid="2123001074951934237">"žádné připojení k internetu"</string>
+ <!-- no translation found for status_bar_settings_signal_meter_wifi_ssid_format (6261810256542749384) -->
<skip />
- <string name="system_panel_signal_meter_wifi_nossid" msgid="160846667119240422">"Wi-Fi: připojeno"</string>
- <string name="system_panel_signal_meter_wifi_connecting" msgid="4087640898624652649">"Wi-Fi: připojování"</string>
- <string name="system_panel_signal_meter_data_connected" msgid="2171100321540926054">"Mob. data: připojeno"</string>
- <string name="system_panel_signal_meter_data_connecting" msgid="7183001278053801143">"Mob. data: připojování"</string>
+ <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="160846667119240422">"Wi-Fi: připojeno"</string>
+ <string name="status_bar_settings_signal_meter_wifi_connecting" msgid="4087640898624652649">"Wi-Fi: připojování"</string>
+ <string name="status_bar_settings_signal_meter_data_connected" msgid="2171100321540926054">"Mob. data: připojeno"</string>
+ <string name="status_bar_settings_signal_meter_data_connecting" msgid="7183001278053801143">"Mob. data: připojování"</string>
</resources>
diff --git a/packages/SystemUI/res/values-cs/strings.xml b/packages/SystemUI/res/values-cs/strings.xml
index 4e7f5cf..5eac747 100644
--- a/packages/SystemUI/res/values-cs/strings.xml
+++ b/packages/SystemUI/res/values-cs/strings.xml
@@ -35,7 +35,7 @@
<!-- no translation found for invalid_charger (4549105996740522523) -->
<skip />
<string name="battery_low_why" msgid="7279169609518386372">"Využití baterie"</string>
- <!-- no translation found for system_panel_settings_button (7832600575390861653) -->
+ <!-- no translation found for status_bar_settings_settings_button (7832600575390861653) -->
<skip />
<string name="recent_tasks_title" msgid="3691764623638127888">"Nejnovější"</string>
<!-- no translation found for recent_tasks_empty (1905484479067697884) -->
diff --git a/packages/SystemUI/res/values-da-xlarge/strings.xml b/packages/SystemUI/res/values-da-xlarge/strings.xml
index d75b5a51..9d587a8 100644
--- a/packages/SystemUI/res/values-da-xlarge/strings.xml
+++ b/packages/SystemUI/res/values-da-xlarge/strings.xml
@@ -21,11 +21,11 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<!-- no translation found for status_bar_clear_all_button (4722520806446512408) -->
<skip />
- <string name="system_panel_signal_meter_disconnected" msgid="2123001074951934237">"ingen forbindelse"</string>
- <!-- no translation found for system_panel_signal_meter_wifi_ssid_format (6261810256542749384) -->
+ <string name="status_bar_settings_signal_meter_disconnected" msgid="2123001074951934237">"ingen forbindelse"</string>
+ <!-- no translation found for status_bar_settings_signal_meter_wifi_ssid_format (6261810256542749384) -->
<skip />
- <string name="system_panel_signal_meter_wifi_nossid" msgid="160846667119240422">"Wi-Fi forbundet"</string>
- <string name="system_panel_signal_meter_wifi_connecting" msgid="4087640898624652649">"Wi-Fi: forbinder..."</string>
- <string name="system_panel_signal_meter_data_connected" msgid="2171100321540926054">"Mobildata tilsluttet"</string>
- <string name="system_panel_signal_meter_data_connecting" msgid="7183001278053801143">"Mobildata tilsluttes"</string>
+ <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="160846667119240422">"Wi-Fi forbundet"</string>
+ <string name="status_bar_settings_signal_meter_wifi_connecting" msgid="4087640898624652649">"Wi-Fi: forbinder..."</string>
+ <string name="status_bar_settings_signal_meter_data_connected" msgid="2171100321540926054">"Mobildata tilsluttet"</string>
+ <string name="status_bar_settings_signal_meter_data_connecting" msgid="7183001278053801143">"Mobildata tilsluttes"</string>
</resources>
diff --git a/packages/SystemUI/res/values-da/strings.xml b/packages/SystemUI/res/values-da/strings.xml
index aad6d71..7b49070 100644
--- a/packages/SystemUI/res/values-da/strings.xml
+++ b/packages/SystemUI/res/values-da/strings.xml
@@ -35,7 +35,7 @@
<!-- no translation found for invalid_charger (4549105996740522523) -->
<skip />
<string name="battery_low_why" msgid="7279169609518386372">"Batteriforbrug"</string>
- <!-- no translation found for system_panel_settings_button (7832600575390861653) -->
+ <!-- no translation found for status_bar_settings_settings_button (7832600575390861653) -->
<skip />
<string name="recent_tasks_title" msgid="3691764623638127888">"Seneste"</string>
<!-- no translation found for recent_tasks_empty (1905484479067697884) -->
diff --git a/packages/SystemUI/res/values-de-xlarge/strings.xml b/packages/SystemUI/res/values-de-xlarge/strings.xml
index eb402da..fd1a976 100644
--- a/packages/SystemUI/res/values-de-xlarge/strings.xml
+++ b/packages/SystemUI/res/values-de-xlarge/strings.xml
@@ -21,11 +21,11 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<!-- no translation found for status_bar_clear_all_button (4722520806446512408) -->
<skip />
- <string name="system_panel_signal_meter_disconnected" msgid="2123001074951934237">"Keine Verbindung"</string>
- <!-- no translation found for system_panel_signal_meter_wifi_ssid_format (6261810256542749384) -->
+ <string name="status_bar_settings_signal_meter_disconnected" msgid="2123001074951934237">"Keine Verbindung"</string>
+ <!-- no translation found for status_bar_settings_signal_meter_wifi_ssid_format (6261810256542749384) -->
<skip />
- <string name="system_panel_signal_meter_wifi_nossid" msgid="160846667119240422">"WLAN: verbunden"</string>
- <string name="system_panel_signal_meter_wifi_connecting" msgid="4087640898624652649">"WLAN: verbindet..."</string>
- <string name="system_panel_signal_meter_data_connected" msgid="2171100321540926054">"Mobile Daten: aktiv"</string>
- <string name="system_panel_signal_meter_data_connecting" msgid="7183001278053801143">"Mobile Daten: verbindet"</string>
+ <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="160846667119240422">"WLAN: verbunden"</string>
+ <string name="status_bar_settings_signal_meter_wifi_connecting" msgid="4087640898624652649">"WLAN: verbindet..."</string>
+ <string name="status_bar_settings_signal_meter_data_connected" msgid="2171100321540926054">"Mobile Daten: aktiv"</string>
+ <string name="status_bar_settings_signal_meter_data_connecting" msgid="7183001278053801143">"Mobile Daten: verbindet"</string>
</resources>
diff --git a/packages/SystemUI/res/values-de/strings.xml b/packages/SystemUI/res/values-de/strings.xml
index 1674c22..1535e78 100644
--- a/packages/SystemUI/res/values-de/strings.xml
+++ b/packages/SystemUI/res/values-de/strings.xml
@@ -35,7 +35,7 @@
<!-- no translation found for invalid_charger (4549105996740522523) -->
<skip />
<string name="battery_low_why" msgid="7279169609518386372">"Akkuverbrauch"</string>
- <!-- no translation found for system_panel_settings_button (7832600575390861653) -->
+ <!-- no translation found for status_bar_settings_settings_button (7832600575390861653) -->
<skip />
<string name="recent_tasks_title" msgid="3691764623638127888">"Zuletzt verwendet"</string>
<!-- no translation found for recent_tasks_empty (1905484479067697884) -->
diff --git a/packages/SystemUI/res/values-el-xlarge/strings.xml b/packages/SystemUI/res/values-el-xlarge/strings.xml
index 63e59aa..c52d6daf 100644
--- a/packages/SystemUI/res/values-el-xlarge/strings.xml
+++ b/packages/SystemUI/res/values-el-xlarge/strings.xml
@@ -21,11 +21,11 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<!-- no translation found for status_bar_clear_all_button (4722520806446512408) -->
<skip />
- <string name="system_panel_signal_meter_disconnected" msgid="2123001074951934237">"χωρίς σύνδ. σε Διαδ."</string>
- <!-- no translation found for system_panel_signal_meter_wifi_ssid_format (6261810256542749384) -->
+ <string name="status_bar_settings_signal_meter_disconnected" msgid="2123001074951934237">"χωρίς σύνδ. σε Διαδ."</string>
+ <!-- no translation found for status_bar_settings_signal_meter_wifi_ssid_format (6261810256542749384) -->
<skip />
- <string name="system_panel_signal_meter_wifi_nossid" msgid="160846667119240422">"Wi-Fi: συνδέθηκε"</string>
- <string name="system_panel_signal_meter_wifi_connecting" msgid="4087640898624652649">"Wi-Fi: σύνδεση..."</string>
- <string name="system_panel_signal_meter_data_connected" msgid="2171100321540926054">"Δεδ. κιν.: συνδέθηκε"</string>
- <string name="system_panel_signal_meter_data_connecting" msgid="7183001278053801143">"Δεδ.κιν.: σύνδεση..."</string>
+ <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="160846667119240422">"Wi-Fi: συνδέθηκε"</string>
+ <string name="status_bar_settings_signal_meter_wifi_connecting" msgid="4087640898624652649">"Wi-Fi: σύνδεση..."</string>
+ <string name="status_bar_settings_signal_meter_data_connected" msgid="2171100321540926054">"Δεδ. κιν.: συνδέθηκε"</string>
+ <string name="status_bar_settings_signal_meter_data_connecting" msgid="7183001278053801143">"Δεδ.κιν.: σύνδεση..."</string>
</resources>
diff --git a/packages/SystemUI/res/values-el/strings.xml b/packages/SystemUI/res/values-el/strings.xml
index bb7fab1..369b16f 100644
--- a/packages/SystemUI/res/values-el/strings.xml
+++ b/packages/SystemUI/res/values-el/strings.xml
@@ -35,7 +35,7 @@
<!-- no translation found for invalid_charger (4549105996740522523) -->
<skip />
<string name="battery_low_why" msgid="7279169609518386372">"Χρήση μπαταρίας"</string>
- <!-- no translation found for system_panel_settings_button (7832600575390861653) -->
+ <!-- no translation found for status_bar_settings_settings_button (7832600575390861653) -->
<skip />
<string name="recent_tasks_title" msgid="3691764623638127888">"Πρόσφατα"</string>
<!-- no translation found for recent_tasks_empty (1905484479067697884) -->
diff --git a/packages/SystemUI/res/values-en-rGB/strings.xml b/packages/SystemUI/res/values-en-rGB/strings.xml
index 2939dba..db4f9ba 100644
--- a/packages/SystemUI/res/values-en-rGB/strings.xml
+++ b/packages/SystemUI/res/values-en-rGB/strings.xml
@@ -35,7 +35,7 @@
<!-- no translation found for invalid_charger (4549105996740522523) -->
<skip />
<string name="battery_low_why" msgid="7279169609518386372">"Battery use"</string>
- <!-- no translation found for system_panel_settings_button (7832600575390861653) -->
+ <!-- no translation found for status_bar_settings_settings_button (7832600575390861653) -->
<skip />
<string name="recent_tasks_title" msgid="3691764623638127888">"Recent"</string>
<!-- no translation found for recent_tasks_empty (1905484479067697884) -->
diff --git a/packages/SystemUI/res/values-es-rUS-xlarge/strings.xml b/packages/SystemUI/res/values-es-rUS-xlarge/strings.xml
index b4f8f27..6530edf 100644
--- a/packages/SystemUI/res/values-es-rUS-xlarge/strings.xml
+++ b/packages/SystemUI/res/values-es-rUS-xlarge/strings.xml
@@ -21,11 +21,11 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<!-- no translation found for status_bar_clear_all_button (4722520806446512408) -->
<skip />
- <string name="system_panel_signal_meter_disconnected" msgid="2123001074951934237">"no hay conexión a Internet"</string>
- <!-- no translation found for system_panel_signal_meter_wifi_ssid_format (6261810256542749384) -->
+ <string name="status_bar_settings_signal_meter_disconnected" msgid="2123001074951934237">"no hay conexión a Internet"</string>
+ <!-- no translation found for status_bar_settings_signal_meter_wifi_ssid_format (6261810256542749384) -->
<skip />
- <string name="system_panel_signal_meter_wifi_nossid" msgid="160846667119240422">"Wi-Fi: conectado"</string>
- <string name="system_panel_signal_meter_wifi_connecting" msgid="4087640898624652649">"Wi-Fi: conectando…"</string>
- <string name="system_panel_signal_meter_data_connected" msgid="2171100321540926054">"Datos para cel: conectado"</string>
- <string name="system_panel_signal_meter_data_connecting" msgid="7183001278053801143">"Datos para cel: conectando"</string>
+ <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="160846667119240422">"Wi-Fi: conectado"</string>
+ <string name="status_bar_settings_signal_meter_wifi_connecting" msgid="4087640898624652649">"Wi-Fi: conectando…"</string>
+ <string name="status_bar_settings_signal_meter_data_connected" msgid="2171100321540926054">"Datos para cel: conectado"</string>
+ <string name="status_bar_settings_signal_meter_data_connecting" msgid="7183001278053801143">"Datos para cel: conectando"</string>
</resources>
diff --git a/packages/SystemUI/res/values-es-rUS/strings.xml b/packages/SystemUI/res/values-es-rUS/strings.xml
index c18de7d..2312be7 100644
--- a/packages/SystemUI/res/values-es-rUS/strings.xml
+++ b/packages/SystemUI/res/values-es-rUS/strings.xml
@@ -35,7 +35,7 @@
<!-- no translation found for invalid_charger (4549105996740522523) -->
<skip />
<string name="battery_low_why" msgid="7279169609518386372">"Uso de la batería"</string>
- <string name="system_panel_settings_button" msgid="7832600575390861653">"Configuración"</string>
+ <string name="status_bar_settings_settings_button" msgid="7832600575390861653">"Configuración"</string>
<string name="recent_tasks_title" msgid="3691764623638127888">"Reciente"</string>
<!-- no translation found for recent_tasks_empty (1905484479067697884) -->
<skip />
diff --git a/packages/SystemUI/res/values-es-xlarge/strings.xml b/packages/SystemUI/res/values-es-xlarge/strings.xml
index 2045aa8..adcda91 100644
--- a/packages/SystemUI/res/values-es-xlarge/strings.xml
+++ b/packages/SystemUI/res/values-es-xlarge/strings.xml
@@ -21,11 +21,11 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<!-- no translation found for status_bar_clear_all_button (4722520806446512408) -->
<skip />
- <string name="system_panel_signal_meter_disconnected" msgid="2123001074951934237">"sin conexión"</string>
- <!-- no translation found for system_panel_signal_meter_wifi_ssid_format (6261810256542749384) -->
+ <string name="status_bar_settings_signal_meter_disconnected" msgid="2123001074951934237">"sin conexión"</string>
+ <!-- no translation found for status_bar_settings_signal_meter_wifi_ssid_format (6261810256542749384) -->
<skip />
- <string name="system_panel_signal_meter_wifi_nossid" msgid="160846667119240422">"WiFi: conectado"</string>
- <string name="system_panel_signal_meter_wifi_connecting" msgid="4087640898624652649">"WiFi: conectando..."</string>
- <string name="system_panel_signal_meter_data_connected" msgid="2171100321540926054">"Datos móviles: conectados"</string>
- <string name="system_panel_signal_meter_data_connecting" msgid="7183001278053801143">"Datos móviles: conectando..."</string>
+ <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="160846667119240422">"WiFi: conectado"</string>
+ <string name="status_bar_settings_signal_meter_wifi_connecting" msgid="4087640898624652649">"WiFi: conectando..."</string>
+ <string name="status_bar_settings_signal_meter_data_connected" msgid="2171100321540926054">"Datos móviles: conectados"</string>
+ <string name="status_bar_settings_signal_meter_data_connecting" msgid="7183001278053801143">"Datos móviles: conectando..."</string>
</resources>
diff --git a/packages/SystemUI/res/values-es/strings.xml b/packages/SystemUI/res/values-es/strings.xml
index 84b7e32..64b60b4 100644
--- a/packages/SystemUI/res/values-es/strings.xml
+++ b/packages/SystemUI/res/values-es/strings.xml
@@ -35,7 +35,7 @@
<!-- no translation found for invalid_charger (4549105996740522523) -->
<skip />
<string name="battery_low_why" msgid="7279169609518386372">"Uso de la batería"</string>
- <!-- no translation found for system_panel_settings_button (7832600575390861653) -->
+ <!-- no translation found for status_bar_settings_settings_button (7832600575390861653) -->
<skip />
<string name="recent_tasks_title" msgid="3691764623638127888">"Reciente"</string>
<!-- no translation found for recent_tasks_empty (1905484479067697884) -->
diff --git a/packages/SystemUI/res/values-fa/strings.xml b/packages/SystemUI/res/values-fa/strings.xml
index cc1f215..8e2b348 100644
--- a/packages/SystemUI/res/values-fa/strings.xml
+++ b/packages/SystemUI/res/values-fa/strings.xml
@@ -35,7 +35,7 @@
<!-- no translation found for invalid_charger (4549105996740522523) -->
<skip />
<string name="battery_low_why" msgid="7279169609518386372">"استفاده از باتری"</string>
- <!-- no translation found for system_panel_settings_button (7832600575390861653) -->
+ <!-- no translation found for status_bar_settings_settings_button (7832600575390861653) -->
<skip />
<string name="recent_tasks_title" msgid="3691764623638127888">"اخیر"</string>
<!-- no translation found for recent_tasks_empty (1905484479067697884) -->
diff --git a/packages/SystemUI/res/values-fi/strings.xml b/packages/SystemUI/res/values-fi/strings.xml
index 59e3af3..8fcc7d6 100644
--- a/packages/SystemUI/res/values-fi/strings.xml
+++ b/packages/SystemUI/res/values-fi/strings.xml
@@ -35,7 +35,7 @@
<!-- no translation found for invalid_charger (4549105996740522523) -->
<skip />
<string name="battery_low_why" msgid="7279169609518386372">"Akun käyttö"</string>
- <!-- no translation found for system_panel_settings_button (7832600575390861653) -->
+ <!-- no translation found for status_bar_settings_settings_button (7832600575390861653) -->
<skip />
<string name="recent_tasks_title" msgid="3691764623638127888">"Viimeisimmät"</string>
<!-- no translation found for recent_tasks_empty (1905484479067697884) -->
diff --git a/packages/SystemUI/res/values-fr-xlarge/strings.xml b/packages/SystemUI/res/values-fr-xlarge/strings.xml
index 36c6f77..f8036ad 100644
--- a/packages/SystemUI/res/values-fr-xlarge/strings.xml
+++ b/packages/SystemUI/res/values-fr-xlarge/strings.xml
@@ -21,11 +21,11 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<!-- no translation found for status_bar_clear_all_button (4722520806446512408) -->
<skip />
- <string name="system_panel_signal_meter_disconnected" msgid="2123001074951934237">"Internet indisponible"</string>
- <!-- no translation found for system_panel_signal_meter_wifi_ssid_format (6261810256542749384) -->
+ <string name="status_bar_settings_signal_meter_disconnected" msgid="2123001074951934237">"Internet indisponible"</string>
+ <!-- no translation found for status_bar_settings_signal_meter_wifi_ssid_format (6261810256542749384) -->
<skip />
- <string name="system_panel_signal_meter_wifi_nossid" msgid="160846667119240422">"Wi-Fi : connecté"</string>
- <string name="system_panel_signal_meter_wifi_connecting" msgid="4087640898624652649">"Wi-Fi : connexion..."</string>
- <string name="system_panel_signal_meter_data_connected" msgid="2171100321540926054">"Données mobiles connectées"</string>
- <string name="system_panel_signal_meter_data_connecting" msgid="7183001278053801143">"Connexion données mobiles..."</string>
+ <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="160846667119240422">"Wi-Fi : connecté"</string>
+ <string name="status_bar_settings_signal_meter_wifi_connecting" msgid="4087640898624652649">"Wi-Fi : connexion..."</string>
+ <string name="status_bar_settings_signal_meter_data_connected" msgid="2171100321540926054">"Données mobiles connectées"</string>
+ <string name="status_bar_settings_signal_meter_data_connecting" msgid="7183001278053801143">"Connexion données mobiles..."</string>
</resources>
diff --git a/packages/SystemUI/res/values-fr/strings.xml b/packages/SystemUI/res/values-fr/strings.xml
index 914e98e..7df4d74 100644
--- a/packages/SystemUI/res/values-fr/strings.xml
+++ b/packages/SystemUI/res/values-fr/strings.xml
@@ -35,7 +35,7 @@
<!-- no translation found for invalid_charger (4549105996740522523) -->
<skip />
<string name="battery_low_why" msgid="7279169609518386372">"Utilisation de la batterie"</string>
- <!-- no translation found for system_panel_settings_button (7832600575390861653) -->
+ <!-- no translation found for status_bar_settings_settings_button (7832600575390861653) -->
<skip />
<string name="recent_tasks_title" msgid="3691764623638127888">"Récentes"</string>
<!-- no translation found for recent_tasks_empty (1905484479067697884) -->
diff --git a/packages/SystemUI/res/values-he/strings.xml b/packages/SystemUI/res/values-he/strings.xml
index 67b2c5f..0e3479b 100644
--- a/packages/SystemUI/res/values-he/strings.xml
+++ b/packages/SystemUI/res/values-he/strings.xml
@@ -35,7 +35,7 @@
<!-- no translation found for invalid_charger (4549105996740522523) -->
<skip />
<string name="battery_low_why" msgid="7279169609518386372">"צריכת סוללה"</string>
- <!-- no translation found for system_panel_settings_button (7832600575390861653) -->
+ <!-- no translation found for status_bar_settings_settings_button (7832600575390861653) -->
<skip />
<string name="recent_tasks_title" msgid="3691764623638127888">"אחרונות"</string>
<!-- no translation found for recent_tasks_empty (1905484479067697884) -->
diff --git a/packages/SystemUI/res/values-hr/strings.xml b/packages/SystemUI/res/values-hr/strings.xml
index 149a356..0fea021 100644
--- a/packages/SystemUI/res/values-hr/strings.xml
+++ b/packages/SystemUI/res/values-hr/strings.xml
@@ -35,7 +35,7 @@
<!-- no translation found for invalid_charger (4549105996740522523) -->
<skip />
<string name="battery_low_why" msgid="7279169609518386372">"Iskorištenost baterije"</string>
- <!-- no translation found for system_panel_settings_button (7832600575390861653) -->
+ <!-- no translation found for status_bar_settings_settings_button (7832600575390861653) -->
<skip />
<string name="recent_tasks_title" msgid="3691764623638127888">"Nedavni"</string>
<!-- no translation found for recent_tasks_empty (1905484479067697884) -->
diff --git a/packages/SystemUI/res/values-hu/strings.xml b/packages/SystemUI/res/values-hu/strings.xml
index 9eb50fa..788e96f4 100644
--- a/packages/SystemUI/res/values-hu/strings.xml
+++ b/packages/SystemUI/res/values-hu/strings.xml
@@ -35,7 +35,7 @@
<!-- no translation found for invalid_charger (4549105996740522523) -->
<skip />
<string name="battery_low_why" msgid="7279169609518386372">"Akkumulátorhasználat"</string>
- <!-- no translation found for system_panel_settings_button (7832600575390861653) -->
+ <!-- no translation found for status_bar_settings_settings_button (7832600575390861653) -->
<skip />
<string name="recent_tasks_title" msgid="3691764623638127888">"Legutóbbiak"</string>
<!-- no translation found for recent_tasks_empty (1905484479067697884) -->
diff --git a/packages/SystemUI/res/values-id/strings.xml b/packages/SystemUI/res/values-id/strings.xml
index 3bf805c..cde575f 100644
--- a/packages/SystemUI/res/values-id/strings.xml
+++ b/packages/SystemUI/res/values-id/strings.xml
@@ -35,7 +35,7 @@
<!-- no translation found for invalid_charger (4549105996740522523) -->
<skip />
<string name="battery_low_why" msgid="7279169609518386372">"Penggunaan baterai"</string>
- <!-- no translation found for system_panel_settings_button (7832600575390861653) -->
+ <!-- no translation found for status_bar_settings_settings_button (7832600575390861653) -->
<skip />
<string name="recent_tasks_title" msgid="3691764623638127888">"Terbaru"</string>
<!-- no translation found for recent_tasks_empty (1905484479067697884) -->
diff --git a/packages/SystemUI/res/values-it-xlarge/strings.xml b/packages/SystemUI/res/values-it-xlarge/strings.xml
index 512dfa4..3909bd5 100644
--- a/packages/SystemUI/res/values-it-xlarge/strings.xml
+++ b/packages/SystemUI/res/values-it-xlarge/strings.xml
@@ -21,11 +21,11 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<!-- no translation found for status_bar_clear_all_button (4722520806446512408) -->
<skip />
- <string name="system_panel_signal_meter_disconnected" msgid="2123001074951934237">"no conness. Internet"</string>
- <!-- no translation found for system_panel_signal_meter_wifi_ssid_format (6261810256542749384) -->
+ <string name="status_bar_settings_signal_meter_disconnected" msgid="2123001074951934237">"no conness. Internet"</string>
+ <!-- no translation found for status_bar_settings_signal_meter_wifi_ssid_format (6261810256542749384) -->
<skip />
- <string name="system_panel_signal_meter_wifi_nossid" msgid="160846667119240422">"Wi-Fi: connesso"</string>
- <string name="system_panel_signal_meter_wifi_connecting" msgid="4087640898624652649">"Wi-Fi: connessione…"</string>
- <string name="system_panel_signal_meter_data_connected" msgid="2171100321540926054">"Dati cell.: connesso"</string>
- <string name="system_panel_signal_meter_data_connecting" msgid="7183001278053801143">"Dati cell.: connessione…"</string>
+ <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="160846667119240422">"Wi-Fi: connesso"</string>
+ <string name="status_bar_settings_signal_meter_wifi_connecting" msgid="4087640898624652649">"Wi-Fi: connessione…"</string>
+ <string name="status_bar_settings_signal_meter_data_connected" msgid="2171100321540926054">"Dati cell.: connesso"</string>
+ <string name="status_bar_settings_signal_meter_data_connecting" msgid="7183001278053801143">"Dati cell.: connessione…"</string>
</resources>
diff --git a/packages/SystemUI/res/values-it/strings.xml b/packages/SystemUI/res/values-it/strings.xml
index 849be2e..ee91a16 100644
--- a/packages/SystemUI/res/values-it/strings.xml
+++ b/packages/SystemUI/res/values-it/strings.xml
@@ -35,7 +35,7 @@
<!-- no translation found for invalid_charger (4549105996740522523) -->
<skip />
<string name="battery_low_why" msgid="7279169609518386372">"Utilizzo batteria"</string>
- <!-- no translation found for system_panel_settings_button (7832600575390861653) -->
+ <!-- no translation found for status_bar_settings_settings_button (7832600575390861653) -->
<skip />
<string name="recent_tasks_title" msgid="3691764623638127888">"Recenti"</string>
<!-- no translation found for recent_tasks_empty (1905484479067697884) -->
diff --git a/packages/SystemUI/res/values-ja-xlarge/strings.xml b/packages/SystemUI/res/values-ja-xlarge/strings.xml
index 01dacb3..df512b7 100644
--- a/packages/SystemUI/res/values-ja-xlarge/strings.xml
+++ b/packages/SystemUI/res/values-ja-xlarge/strings.xml
@@ -21,11 +21,11 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<!-- no translation found for status_bar_clear_all_button (4722520806446512408) -->
<skip />
- <string name="system_panel_signal_meter_disconnected" msgid="2123001074951934237">"インターネット接続なし"</string>
- <!-- no translation found for system_panel_signal_meter_wifi_ssid_format (6261810256542749384) -->
+ <string name="status_bar_settings_signal_meter_disconnected" msgid="2123001074951934237">"インターネット接続なし"</string>
+ <!-- no translation found for status_bar_settings_signal_meter_wifi_ssid_format (6261810256542749384) -->
<skip />
- <string name="system_panel_signal_meter_wifi_nossid" msgid="160846667119240422">"Wi-Fi: 接続されました"</string>
- <string name="system_panel_signal_meter_wifi_connecting" msgid="4087640898624652649">"Wi-Fi: 接続中..."</string>
- <string name="system_panel_signal_meter_data_connected" msgid="2171100321540926054">"データ通信: 接続されました"</string>
- <string name="system_panel_signal_meter_data_connecting" msgid="7183001278053801143">"データ通信: 接続中..."</string>
+ <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="160846667119240422">"Wi-Fi: 接続されました"</string>
+ <string name="status_bar_settings_signal_meter_wifi_connecting" msgid="4087640898624652649">"Wi-Fi: 接続中..."</string>
+ <string name="status_bar_settings_signal_meter_data_connected" msgid="2171100321540926054">"データ通信: 接続されました"</string>
+ <string name="status_bar_settings_signal_meter_data_connecting" msgid="7183001278053801143">"データ通信: 接続中..."</string>
</resources>
diff --git a/packages/SystemUI/res/values-ja/strings.xml b/packages/SystemUI/res/values-ja/strings.xml
index f787541..817f656 100644
--- a/packages/SystemUI/res/values-ja/strings.xml
+++ b/packages/SystemUI/res/values-ja/strings.xml
@@ -35,7 +35,7 @@
<!-- no translation found for invalid_charger (4549105996740522523) -->
<skip />
<string name="battery_low_why" msgid="7279169609518386372">"電池使用量"</string>
- <!-- no translation found for system_panel_settings_button (7832600575390861653) -->
+ <!-- no translation found for status_bar_settings_settings_button (7832600575390861653) -->
<skip />
<string name="recent_tasks_title" msgid="3691764623638127888">"新着"</string>
<!-- no translation found for recent_tasks_empty (1905484479067697884) -->
diff --git a/packages/SystemUI/res/values-ko-xlarge/strings.xml b/packages/SystemUI/res/values-ko-xlarge/strings.xml
index a26940a..42f798c 100644
--- a/packages/SystemUI/res/values-ko-xlarge/strings.xml
+++ b/packages/SystemUI/res/values-ko-xlarge/strings.xml
@@ -21,11 +21,11 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<!-- no translation found for status_bar_clear_all_button (4722520806446512408) -->
<skip />
- <string name="system_panel_signal_meter_disconnected" msgid="2123001074951934237">"인터넷에 연결되지 않음"</string>
- <!-- no translation found for system_panel_signal_meter_wifi_ssid_format (6261810256542749384) -->
+ <string name="status_bar_settings_signal_meter_disconnected" msgid="2123001074951934237">"인터넷에 연결되지 않음"</string>
+ <!-- no translation found for status_bar_settings_signal_meter_wifi_ssid_format (6261810256542749384) -->
<skip />
- <string name="system_panel_signal_meter_wifi_nossid" msgid="160846667119240422">"Wi-Fi: 연결됨"</string>
- <string name="system_panel_signal_meter_wifi_connecting" msgid="4087640898624652649">"Wi-Fi: 연결 중…"</string>
- <string name="system_panel_signal_meter_data_connected" msgid="2171100321540926054">"모바일 데이터: 연결됨"</string>
- <string name="system_panel_signal_meter_data_connecting" msgid="7183001278053801143">"모바일 데이터: 연결 중…"</string>
+ <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="160846667119240422">"Wi-Fi: 연결됨"</string>
+ <string name="status_bar_settings_signal_meter_wifi_connecting" msgid="4087640898624652649">"Wi-Fi: 연결 중…"</string>
+ <string name="status_bar_settings_signal_meter_data_connected" msgid="2171100321540926054">"모바일 데이터: 연결됨"</string>
+ <string name="status_bar_settings_signal_meter_data_connecting" msgid="7183001278053801143">"모바일 데이터: 연결 중…"</string>
</resources>
diff --git a/packages/SystemUI/res/values-ko/strings.xml b/packages/SystemUI/res/values-ko/strings.xml
index ff82d99..be94258 100644
--- a/packages/SystemUI/res/values-ko/strings.xml
+++ b/packages/SystemUI/res/values-ko/strings.xml
@@ -35,7 +35,7 @@
<!-- no translation found for invalid_charger (4549105996740522523) -->
<skip />
<string name="battery_low_why" msgid="7279169609518386372">"배터리 사용량"</string>
- <!-- no translation found for system_panel_settings_button (7832600575390861653) -->
+ <!-- no translation found for status_bar_settings_settings_button (7832600575390861653) -->
<skip />
<string name="recent_tasks_title" msgid="3691764623638127888">"최근 사용한 앱"</string>
<!-- no translation found for recent_tasks_empty (1905484479067697884) -->
diff --git a/packages/SystemUI/res/values-lt/strings.xml b/packages/SystemUI/res/values-lt/strings.xml
index c87f312..ccfc800 100644
--- a/packages/SystemUI/res/values-lt/strings.xml
+++ b/packages/SystemUI/res/values-lt/strings.xml
@@ -35,7 +35,7 @@
<!-- no translation found for invalid_charger (4549105996740522523) -->
<skip />
<string name="battery_low_why" msgid="7279169609518386372">"Akumuliatoriaus naudojimas"</string>
- <!-- no translation found for system_panel_settings_button (7832600575390861653) -->
+ <!-- no translation found for status_bar_settings_settings_button (7832600575390861653) -->
<skip />
<string name="recent_tasks_title" msgid="3691764623638127888">"Naujos"</string>
<!-- no translation found for recent_tasks_empty (1905484479067697884) -->
diff --git a/packages/SystemUI/res/values-lv/strings.xml b/packages/SystemUI/res/values-lv/strings.xml
index ac0715e..dd6cdcf 100644
--- a/packages/SystemUI/res/values-lv/strings.xml
+++ b/packages/SystemUI/res/values-lv/strings.xml
@@ -35,7 +35,7 @@
<!-- no translation found for invalid_charger (4549105996740522523) -->
<skip />
<string name="battery_low_why" msgid="7279169609518386372">"Akumulatora lietojums"</string>
- <!-- no translation found for system_panel_settings_button (7832600575390861653) -->
+ <!-- no translation found for status_bar_settings_settings_button (7832600575390861653) -->
<skip />
<string name="recent_tasks_title" msgid="3691764623638127888">"Nesens"</string>
<!-- no translation found for recent_tasks_empty (1905484479067697884) -->
diff --git a/packages/SystemUI/res/values-nb-xlarge/strings.xml b/packages/SystemUI/res/values-nb-xlarge/strings.xml
index 9a95faf..b07d70c 100644
--- a/packages/SystemUI/res/values-nb-xlarge/strings.xml
+++ b/packages/SystemUI/res/values-nb-xlarge/strings.xml
@@ -21,11 +21,11 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<!-- no translation found for status_bar_clear_all_button (4722520806446512408) -->
<skip />
- <string name="system_panel_signal_meter_disconnected" msgid="2123001074951934237">"ingen Int.-tilkobl."</string>
- <!-- no translation found for system_panel_signal_meter_wifi_ssid_format (6261810256542749384) -->
+ <string name="status_bar_settings_signal_meter_disconnected" msgid="2123001074951934237">"ingen Int.-tilkobl."</string>
+ <!-- no translation found for status_bar_settings_signal_meter_wifi_ssid_format (6261810256542749384) -->
<skip />
- <string name="system_panel_signal_meter_wifi_nossid" msgid="160846667119240422">"Wi-Fi: tilkoblet"</string>
- <string name="system_panel_signal_meter_wifi_connecting" msgid="4087640898624652649">"Wi-Fi: kobler til"</string>
- <string name="system_panel_signal_meter_data_connected" msgid="2171100321540926054">"Mob.data: tilkoblet"</string>
- <string name="system_panel_signal_meter_data_connecting" msgid="7183001278053801143">"Mob.data: kobler til"</string>
+ <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="160846667119240422">"Wi-Fi: tilkoblet"</string>
+ <string name="status_bar_settings_signal_meter_wifi_connecting" msgid="4087640898624652649">"Wi-Fi: kobler til"</string>
+ <string name="status_bar_settings_signal_meter_data_connected" msgid="2171100321540926054">"Mob.data: tilkoblet"</string>
+ <string name="status_bar_settings_signal_meter_data_connecting" msgid="7183001278053801143">"Mob.data: kobler til"</string>
</resources>
diff --git a/packages/SystemUI/res/values-nb/strings.xml b/packages/SystemUI/res/values-nb/strings.xml
index aefd2ec..5da4f01 100644
--- a/packages/SystemUI/res/values-nb/strings.xml
+++ b/packages/SystemUI/res/values-nb/strings.xml
@@ -35,7 +35,7 @@
<!-- no translation found for invalid_charger (4549105996740522523) -->
<skip />
<string name="battery_low_why" msgid="7279169609518386372">"Batteribruk"</string>
- <!-- no translation found for system_panel_settings_button (7832600575390861653) -->
+ <!-- no translation found for status_bar_settings_settings_button (7832600575390861653) -->
<skip />
<string name="recent_tasks_title" msgid="3691764623638127888">"Nylig"</string>
<!-- no translation found for recent_tasks_empty (1905484479067697884) -->
diff --git a/packages/SystemUI/res/values-nl-xlarge/strings.xml b/packages/SystemUI/res/values-nl-xlarge/strings.xml
index 8ab6234..6298908 100644
--- a/packages/SystemUI/res/values-nl-xlarge/strings.xml
+++ b/packages/SystemUI/res/values-nl-xlarge/strings.xml
@@ -21,11 +21,11 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<!-- no translation found for status_bar_clear_all_button (4722520806446512408) -->
<skip />
- <string name="system_panel_signal_meter_disconnected" msgid="2123001074951934237">"geen internet"</string>
- <!-- no translation found for system_panel_signal_meter_wifi_ssid_format (6261810256542749384) -->
+ <string name="status_bar_settings_signal_meter_disconnected" msgid="2123001074951934237">"geen internet"</string>
+ <!-- no translation found for status_bar_settings_signal_meter_wifi_ssid_format (6261810256542749384) -->
<skip />
- <string name="system_panel_signal_meter_wifi_nossid" msgid="160846667119240422">"Wi-Fi: verbonden"</string>
- <string name="system_panel_signal_meter_wifi_connecting" msgid="4087640898624652649">"Wi-Fi: verbinden…"</string>
- <string name="system_panel_signal_meter_data_connected" msgid="2171100321540926054">"Mobiel: verbonden"</string>
- <string name="system_panel_signal_meter_data_connecting" msgid="7183001278053801143">"Mobiel: verbinden..."</string>
+ <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="160846667119240422">"Wi-Fi: verbonden"</string>
+ <string name="status_bar_settings_signal_meter_wifi_connecting" msgid="4087640898624652649">"Wi-Fi: verbinden…"</string>
+ <string name="status_bar_settings_signal_meter_data_connected" msgid="2171100321540926054">"Mobiel: verbonden"</string>
+ <string name="status_bar_settings_signal_meter_data_connecting" msgid="7183001278053801143">"Mobiel: verbinden..."</string>
</resources>
diff --git a/packages/SystemUI/res/values-nl/strings.xml b/packages/SystemUI/res/values-nl/strings.xml
index e7fd55b..3492652 100644
--- a/packages/SystemUI/res/values-nl/strings.xml
+++ b/packages/SystemUI/res/values-nl/strings.xml
@@ -35,7 +35,7 @@
<!-- no translation found for invalid_charger (4549105996740522523) -->
<skip />
<string name="battery_low_why" msgid="7279169609518386372">"Accugebruik"</string>
- <!-- no translation found for system_panel_settings_button (7832600575390861653) -->
+ <!-- no translation found for status_bar_settings_settings_button (7832600575390861653) -->
<skip />
<string name="recent_tasks_title" msgid="3691764623638127888">"Recent"</string>
<!-- no translation found for recent_tasks_empty (1905484479067697884) -->
diff --git a/packages/SystemUI/res/values-pl-xlarge/strings.xml b/packages/SystemUI/res/values-pl-xlarge/strings.xml
index a11754b..e2cefc6 100644
--- a/packages/SystemUI/res/values-pl-xlarge/strings.xml
+++ b/packages/SystemUI/res/values-pl-xlarge/strings.xml
@@ -21,11 +21,11 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<!-- no translation found for status_bar_clear_all_button (4722520806446512408) -->
<skip />
- <string name="system_panel_signal_meter_disconnected" msgid="2123001074951934237">"brak połączenia internetowego"</string>
- <!-- no translation found for system_panel_signal_meter_wifi_ssid_format (6261810256542749384) -->
+ <string name="status_bar_settings_signal_meter_disconnected" msgid="2123001074951934237">"brak połączenia internetowego"</string>
+ <!-- no translation found for status_bar_settings_signal_meter_wifi_ssid_format (6261810256542749384) -->
<skip />
- <string name="system_panel_signal_meter_wifi_nossid" msgid="160846667119240422">"Wi-Fi: połączono"</string>
- <string name="system_panel_signal_meter_wifi_connecting" msgid="4087640898624652649">"Wi-Fi: łączenie…"</string>
- <string name="system_panel_signal_meter_data_connected" msgid="2171100321540926054">"Sieć komórkowa: połączono"</string>
- <string name="system_panel_signal_meter_data_connecting" msgid="7183001278053801143">"Sieć komórkowa: łączenie…"</string>
+ <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="160846667119240422">"Wi-Fi: połączono"</string>
+ <string name="status_bar_settings_signal_meter_wifi_connecting" msgid="4087640898624652649">"Wi-Fi: łączenie…"</string>
+ <string name="status_bar_settings_signal_meter_data_connected" msgid="2171100321540926054">"Sieć komórkowa: połączono"</string>
+ <string name="status_bar_settings_signal_meter_data_connecting" msgid="7183001278053801143">"Sieć komórkowa: łączenie…"</string>
</resources>
diff --git a/packages/SystemUI/res/values-pl/strings.xml b/packages/SystemUI/res/values-pl/strings.xml
index 108ef13..f6a6d79 100644
--- a/packages/SystemUI/res/values-pl/strings.xml
+++ b/packages/SystemUI/res/values-pl/strings.xml
@@ -35,7 +35,7 @@
<!-- no translation found for invalid_charger (4549105996740522523) -->
<skip />
<string name="battery_low_why" msgid="7279169609518386372">"Użycie baterii"</string>
- <!-- no translation found for system_panel_settings_button (7832600575390861653) -->
+ <!-- no translation found for status_bar_settings_settings_button (7832600575390861653) -->
<skip />
<string name="recent_tasks_title" msgid="3691764623638127888">"Najnowsze"</string>
<!-- no translation found for recent_tasks_empty (1905484479067697884) -->
diff --git a/packages/SystemUI/res/values-pt-rPT-xlarge/strings.xml b/packages/SystemUI/res/values-pt-rPT-xlarge/strings.xml
index 9f20932..550c11c 100644
--- a/packages/SystemUI/res/values-pt-rPT-xlarge/strings.xml
+++ b/packages/SystemUI/res/values-pt-rPT-xlarge/strings.xml
@@ -21,11 +21,11 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<!-- no translation found for status_bar_clear_all_button (4722520806446512408) -->
<skip />
- <string name="system_panel_signal_meter_disconnected" msgid="2123001074951934237">"Sem ligação à internet"</string>
- <!-- no translation found for system_panel_signal_meter_wifi_ssid_format (6261810256542749384) -->
+ <string name="status_bar_settings_signal_meter_disconnected" msgid="2123001074951934237">"Sem ligação à internet"</string>
+ <!-- no translation found for status_bar_settings_signal_meter_wifi_ssid_format (6261810256542749384) -->
<skip />
- <string name="system_panel_signal_meter_wifi_nossid" msgid="160846667119240422">"Wi-Fi: ligado"</string>
- <string name="system_panel_signal_meter_wifi_connecting" msgid="4087640898624652649">"Wi-Fi: a ligar…"</string>
- <string name="system_panel_signal_meter_data_connected" msgid="2171100321540926054">"Dados móveis: ligado"</string>
- <string name="system_panel_signal_meter_data_connecting" msgid="7183001278053801143">"Dados móveis: a ligar..."</string>
+ <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="160846667119240422">"Wi-Fi: ligado"</string>
+ <string name="status_bar_settings_signal_meter_wifi_connecting" msgid="4087640898624652649">"Wi-Fi: a ligar…"</string>
+ <string name="status_bar_settings_signal_meter_data_connected" msgid="2171100321540926054">"Dados móveis: ligado"</string>
+ <string name="status_bar_settings_signal_meter_data_connecting" msgid="7183001278053801143">"Dados móveis: a ligar..."</string>
</resources>
diff --git a/packages/SystemUI/res/values-pt-rPT/strings.xml b/packages/SystemUI/res/values-pt-rPT/strings.xml
index 1f38ed7..2c03a18 100644
--- a/packages/SystemUI/res/values-pt-rPT/strings.xml
+++ b/packages/SystemUI/res/values-pt-rPT/strings.xml
@@ -35,7 +35,7 @@
<!-- no translation found for invalid_charger (4549105996740522523) -->
<skip />
<string name="battery_low_why" msgid="7279169609518386372">"Utilização da bateria"</string>
- <!-- no translation found for system_panel_settings_button (7832600575390861653) -->
+ <!-- no translation found for status_bar_settings_settings_button (7832600575390861653) -->
<skip />
<string name="recent_tasks_title" msgid="3691764623638127888">"Recente"</string>
<!-- no translation found for recent_tasks_empty (1905484479067697884) -->
diff --git a/packages/SystemUI/res/values-pt-xlarge/strings.xml b/packages/SystemUI/res/values-pt-xlarge/strings.xml
index 481263f..9f2d033 100644
--- a/packages/SystemUI/res/values-pt-xlarge/strings.xml
+++ b/packages/SystemUI/res/values-pt-xlarge/strings.xml
@@ -21,11 +21,11 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<!-- no translation found for status_bar_clear_all_button (4722520806446512408) -->
<skip />
- <string name="system_panel_signal_meter_disconnected" msgid="2123001074951934237">"Sem conex. à intern."</string>
- <!-- no translation found for system_panel_signal_meter_wifi_ssid_format (6261810256542749384) -->
+ <string name="status_bar_settings_signal_meter_disconnected" msgid="2123001074951934237">"Sem conex. à intern."</string>
+ <!-- no translation found for status_bar_settings_signal_meter_wifi_ssid_format (6261810256542749384) -->
<skip />
- <string name="system_panel_signal_meter_wifi_nossid" msgid="160846667119240422">"Wi-Fi: conectado"</string>
- <string name="system_panel_signal_meter_wifi_connecting" msgid="4087640898624652649">"Wi-Fi: conectando…"</string>
- <string name="system_panel_signal_meter_data_connected" msgid="2171100321540926054">"Dados móv: conectado"</string>
- <string name="system_panel_signal_meter_data_connecting" msgid="7183001278053801143">"Dados: conectando..."</string>
+ <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="160846667119240422">"Wi-Fi: conectado"</string>
+ <string name="status_bar_settings_signal_meter_wifi_connecting" msgid="4087640898624652649">"Wi-Fi: conectando…"</string>
+ <string name="status_bar_settings_signal_meter_data_connected" msgid="2171100321540926054">"Dados móv: conectado"</string>
+ <string name="status_bar_settings_signal_meter_data_connecting" msgid="7183001278053801143">"Dados: conectando..."</string>
</resources>
diff --git a/packages/SystemUI/res/values-pt/strings.xml b/packages/SystemUI/res/values-pt/strings.xml
index 83bde68..a7a43a8 100644
--- a/packages/SystemUI/res/values-pt/strings.xml
+++ b/packages/SystemUI/res/values-pt/strings.xml
@@ -35,7 +35,7 @@
<!-- no translation found for invalid_charger (4549105996740522523) -->
<skip />
<string name="battery_low_why" msgid="7279169609518386372">"Uso da bateria"</string>
- <!-- no translation found for system_panel_settings_button (7832600575390861653) -->
+ <!-- no translation found for status_bar_settings_settings_button (7832600575390861653) -->
<skip />
<string name="recent_tasks_title" msgid="3691764623638127888">"Recente"</string>
<!-- no translation found for recent_tasks_empty (1905484479067697884) -->
diff --git a/packages/SystemUI/res/values-rm/strings.xml b/packages/SystemUI/res/values-rm/strings.xml
index 8a5014e..a8625a9 100644
--- a/packages/SystemUI/res/values-rm/strings.xml
+++ b/packages/SystemUI/res/values-rm/strings.xml
@@ -35,7 +35,7 @@
<!-- no translation found for invalid_charger (4549105996740522523) -->
<skip />
<string name="battery_low_why" msgid="7279169609518386372">"Consum dad accu"</string>
- <!-- no translation found for system_panel_settings_button (7832600575390861653) -->
+ <!-- no translation found for status_bar_settings_settings_button (7832600575390861653) -->
<skip />
<string name="recent_tasks_title" msgid="3691764623638127888">"Utilisà sco ultim"</string>
<!-- no translation found for recent_tasks_empty (1905484479067697884) -->
diff --git a/packages/SystemUI/res/values-ro/strings.xml b/packages/SystemUI/res/values-ro/strings.xml
index bdca5ea..7b4ad47 100644
--- a/packages/SystemUI/res/values-ro/strings.xml
+++ b/packages/SystemUI/res/values-ro/strings.xml
@@ -35,7 +35,7 @@
<!-- no translation found for invalid_charger (4549105996740522523) -->
<skip />
<string name="battery_low_why" msgid="7279169609518386372">"Utilizarea bateriei"</string>
- <!-- no translation found for system_panel_settings_button (7832600575390861653) -->
+ <!-- no translation found for status_bar_settings_settings_button (7832600575390861653) -->
<skip />
<string name="recent_tasks_title" msgid="3691764623638127888">"Recente"</string>
<!-- no translation found for recent_tasks_empty (1905484479067697884) -->
diff --git a/packages/SystemUI/res/values-ru-xlarge/strings.xml b/packages/SystemUI/res/values-ru-xlarge/strings.xml
index 7514d4b..68b2b9a 100644
--- a/packages/SystemUI/res/values-ru-xlarge/strings.xml
+++ b/packages/SystemUI/res/values-ru-xlarge/strings.xml
@@ -21,11 +21,11 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<!-- no translation found for status_bar_clear_all_button (4722520806446512408) -->
<skip />
- <string name="system_panel_signal_meter_disconnected" msgid="2123001074951934237">"связь отсутствует"</string>
- <!-- no translation found for system_panel_signal_meter_wifi_ssid_format (6261810256542749384) -->
+ <string name="status_bar_settings_signal_meter_disconnected" msgid="2123001074951934237">"связь отсутствует"</string>
+ <!-- no translation found for status_bar_settings_signal_meter_wifi_ssid_format (6261810256542749384) -->
<skip />
- <string name="system_panel_signal_meter_wifi_nossid" msgid="160846667119240422">"Wi-Fi: подключено"</string>
- <string name="system_panel_signal_meter_wifi_connecting" msgid="4087640898624652649">"Wi-Fi: подключение..."</string>
- <string name="system_panel_signal_meter_data_connected" msgid="2171100321540926054">"Моб. данные: подключено"</string>
- <string name="system_panel_signal_meter_data_connecting" msgid="7183001278053801143">"Моб. данные: подключение..."</string>
+ <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="160846667119240422">"Wi-Fi: подключено"</string>
+ <string name="status_bar_settings_signal_meter_wifi_connecting" msgid="4087640898624652649">"Wi-Fi: подключение..."</string>
+ <string name="status_bar_settings_signal_meter_data_connected" msgid="2171100321540926054">"Моб. данные: подключено"</string>
+ <string name="status_bar_settings_signal_meter_data_connecting" msgid="7183001278053801143">"Моб. данные: подключение..."</string>
</resources>
diff --git a/packages/SystemUI/res/values-ru/strings.xml b/packages/SystemUI/res/values-ru/strings.xml
index f701fe3..d597315 100644
--- a/packages/SystemUI/res/values-ru/strings.xml
+++ b/packages/SystemUI/res/values-ru/strings.xml
@@ -35,7 +35,7 @@
<!-- no translation found for invalid_charger (4549105996740522523) -->
<skip />
<string name="battery_low_why" msgid="7279169609518386372">"Расход заряда батареи"</string>
- <!-- no translation found for system_panel_settings_button (7832600575390861653) -->
+ <!-- no translation found for status_bar_settings_settings_button (7832600575390861653) -->
<skip />
<string name="recent_tasks_title" msgid="3691764623638127888">"Недавние"</string>
<!-- no translation found for recent_tasks_empty (1905484479067697884) -->
diff --git a/packages/SystemUI/res/values-sk/strings.xml b/packages/SystemUI/res/values-sk/strings.xml
index 95b4c30..b4a3221 100644
--- a/packages/SystemUI/res/values-sk/strings.xml
+++ b/packages/SystemUI/res/values-sk/strings.xml
@@ -35,7 +35,7 @@
<!-- no translation found for invalid_charger (4549105996740522523) -->
<skip />
<string name="battery_low_why" msgid="7279169609518386372">"Využitie batérie"</string>
- <!-- no translation found for system_panel_settings_button (7832600575390861653) -->
+ <!-- no translation found for status_bar_settings_settings_button (7832600575390861653) -->
<skip />
<string name="recent_tasks_title" msgid="3691764623638127888">"Najnovšie"</string>
<!-- no translation found for recent_tasks_empty (1905484479067697884) -->
diff --git a/packages/SystemUI/res/values-sl/strings.xml b/packages/SystemUI/res/values-sl/strings.xml
index 94b599d..8783529 100644
--- a/packages/SystemUI/res/values-sl/strings.xml
+++ b/packages/SystemUI/res/values-sl/strings.xml
@@ -35,7 +35,7 @@
<!-- no translation found for invalid_charger (4549105996740522523) -->
<skip />
<string name="battery_low_why" msgid="7279169609518386372">"Uporaba baterije"</string>
- <!-- no translation found for system_panel_settings_button (7832600575390861653) -->
+ <!-- no translation found for status_bar_settings_settings_button (7832600575390861653) -->
<skip />
<string name="recent_tasks_title" msgid="3691764623638127888">"Nedavno"</string>
<!-- no translation found for recent_tasks_empty (1905484479067697884) -->
diff --git a/packages/SystemUI/res/values-sr/strings.xml b/packages/SystemUI/res/values-sr/strings.xml
index e1f07b5..a4d2bf0 100644
--- a/packages/SystemUI/res/values-sr/strings.xml
+++ b/packages/SystemUI/res/values-sr/strings.xml
@@ -35,7 +35,7 @@
<!-- no translation found for invalid_charger (4549105996740522523) -->
<skip />
<string name="battery_low_why" msgid="7279169609518386372">"Коришћење батерије"</string>
- <!-- no translation found for system_panel_settings_button (7832600575390861653) -->
+ <!-- no translation found for status_bar_settings_settings_button (7832600575390861653) -->
<skip />
<string name="recent_tasks_title" msgid="3691764623638127888">"Недавно"</string>
<!-- no translation found for recent_tasks_empty (1905484479067697884) -->
diff --git a/packages/SystemUI/res/values-sv-xlarge/strings.xml b/packages/SystemUI/res/values-sv-xlarge/strings.xml
index ccc30ec..c1147c7 100644
--- a/packages/SystemUI/res/values-sv-xlarge/strings.xml
+++ b/packages/SystemUI/res/values-sv-xlarge/strings.xml
@@ -21,11 +21,11 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<!-- no translation found for status_bar_clear_all_button (4722520806446512408) -->
<skip />
- <string name="system_panel_signal_meter_disconnected" msgid="2123001074951934237">"ingen Internetanslutn."</string>
- <!-- no translation found for system_panel_signal_meter_wifi_ssid_format (6261810256542749384) -->
+ <string name="status_bar_settings_signal_meter_disconnected" msgid="2123001074951934237">"ingen Internetanslutn."</string>
+ <!-- no translation found for status_bar_settings_signal_meter_wifi_ssid_format (6261810256542749384) -->
<skip />
- <string name="system_panel_signal_meter_wifi_nossid" msgid="160846667119240422">"Wi-Fi: ansluten"</string>
- <string name="system_panel_signal_meter_wifi_connecting" msgid="4087640898624652649">"Wi-Fi: ansluter..."</string>
- <string name="system_panel_signal_meter_data_connected" msgid="2171100321540926054">"Mobildata: ansluten"</string>
- <string name="system_panel_signal_meter_data_connecting" msgid="7183001278053801143">"Mobildata: ansluter…"</string>
+ <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="160846667119240422">"Wi-Fi: ansluten"</string>
+ <string name="status_bar_settings_signal_meter_wifi_connecting" msgid="4087640898624652649">"Wi-Fi: ansluter..."</string>
+ <string name="status_bar_settings_signal_meter_data_connected" msgid="2171100321540926054">"Mobildata: ansluten"</string>
+ <string name="status_bar_settings_signal_meter_data_connecting" msgid="7183001278053801143">"Mobildata: ansluter…"</string>
</resources>
diff --git a/packages/SystemUI/res/values-sv/strings.xml b/packages/SystemUI/res/values-sv/strings.xml
index 4f9cfd0..f2dc7f1 100644
--- a/packages/SystemUI/res/values-sv/strings.xml
+++ b/packages/SystemUI/res/values-sv/strings.xml
@@ -35,7 +35,7 @@
<!-- no translation found for invalid_charger (4549105996740522523) -->
<skip />
<string name="battery_low_why" msgid="7279169609518386372">"Batteriförbrukning"</string>
- <!-- no translation found for system_panel_settings_button (7832600575390861653) -->
+ <!-- no translation found for status_bar_settings_settings_button (7832600575390861653) -->
<skip />
<string name="recent_tasks_title" msgid="3691764623638127888">"Senaste"</string>
<!-- no translation found for recent_tasks_empty (1905484479067697884) -->
diff --git a/packages/SystemUI/res/values-th/strings.xml b/packages/SystemUI/res/values-th/strings.xml
index 00be23d..fb25fdf 100644
--- a/packages/SystemUI/res/values-th/strings.xml
+++ b/packages/SystemUI/res/values-th/strings.xml
@@ -35,7 +35,7 @@
<!-- no translation found for invalid_charger (4549105996740522523) -->
<skip />
<string name="battery_low_why" msgid="7279169609518386372">"การใช้แบตเตอรี่"</string>
- <!-- no translation found for system_panel_settings_button (7832600575390861653) -->
+ <!-- no translation found for status_bar_settings_settings_button (7832600575390861653) -->
<skip />
<string name="recent_tasks_title" msgid="3691764623638127888">"เมื่อเร็วๆ นี้"</string>
<!-- no translation found for recent_tasks_empty (1905484479067697884) -->
diff --git a/packages/SystemUI/res/values-tl/strings.xml b/packages/SystemUI/res/values-tl/strings.xml
index 240f181..900de9f 100644
--- a/packages/SystemUI/res/values-tl/strings.xml
+++ b/packages/SystemUI/res/values-tl/strings.xml
@@ -35,7 +35,7 @@
<!-- no translation found for invalid_charger (4549105996740522523) -->
<skip />
<string name="battery_low_why" msgid="7279169609518386372">"Paggamit ng baterya"</string>
- <!-- no translation found for system_panel_settings_button (7832600575390861653) -->
+ <!-- no translation found for status_bar_settings_settings_button (7832600575390861653) -->
<skip />
<string name="recent_tasks_title" msgid="3691764623638127888">"Kamakailan"</string>
<!-- no translation found for recent_tasks_empty (1905484479067697884) -->
diff --git a/packages/SystemUI/res/values-tr-xlarge/strings.xml b/packages/SystemUI/res/values-tr-xlarge/strings.xml
index 008006d..cc36b93 100644
--- a/packages/SystemUI/res/values-tr-xlarge/strings.xml
+++ b/packages/SystemUI/res/values-tr-xlarge/strings.xml
@@ -21,11 +21,11 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<!-- no translation found for status_bar_clear_all_button (4722520806446512408) -->
<skip />
- <string name="system_panel_signal_meter_disconnected" msgid="2123001074951934237">"internet bağlantısı yok"</string>
- <!-- no translation found for system_panel_signal_meter_wifi_ssid_format (6261810256542749384) -->
+ <string name="status_bar_settings_signal_meter_disconnected" msgid="2123001074951934237">"internet bağlantısı yok"</string>
+ <!-- no translation found for status_bar_settings_signal_meter_wifi_ssid_format (6261810256542749384) -->
<skip />
- <string name="system_panel_signal_meter_wifi_nossid" msgid="160846667119240422">"Kablosuz: bağlı"</string>
- <string name="system_panel_signal_meter_wifi_connecting" msgid="4087640898624652649">"Kablosuz: bağlanıyor..."</string>
- <string name="system_panel_signal_meter_data_connected" msgid="2171100321540926054">"Mobil veri: bağlı"</string>
- <string name="system_panel_signal_meter_data_connecting" msgid="7183001278053801143">"Mob veri: bağlnyr..."</string>
+ <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="160846667119240422">"Kablosuz: bağlı"</string>
+ <string name="status_bar_settings_signal_meter_wifi_connecting" msgid="4087640898624652649">"Kablosuz: bağlanıyor..."</string>
+ <string name="status_bar_settings_signal_meter_data_connected" msgid="2171100321540926054">"Mobil veri: bağlı"</string>
+ <string name="status_bar_settings_signal_meter_data_connecting" msgid="7183001278053801143">"Mob veri: bağlnyr..."</string>
</resources>
diff --git a/packages/SystemUI/res/values-tr/strings.xml b/packages/SystemUI/res/values-tr/strings.xml
index cef5539..31451e1 100644
--- a/packages/SystemUI/res/values-tr/strings.xml
+++ b/packages/SystemUI/res/values-tr/strings.xml
@@ -35,7 +35,7 @@
<!-- no translation found for invalid_charger (4549105996740522523) -->
<skip />
<string name="battery_low_why" msgid="7279169609518386372">"Pil kullanımı"</string>
- <!-- no translation found for system_panel_settings_button (7832600575390861653) -->
+ <!-- no translation found for status_bar_settings_settings_button (7832600575390861653) -->
<skip />
<string name="recent_tasks_title" msgid="3691764623638127888">"En Son Görevler"</string>
<!-- no translation found for recent_tasks_empty (1905484479067697884) -->
diff --git a/packages/SystemUI/res/values-uk/strings.xml b/packages/SystemUI/res/values-uk/strings.xml
index cbc7881..e7b9f19 100644
--- a/packages/SystemUI/res/values-uk/strings.xml
+++ b/packages/SystemUI/res/values-uk/strings.xml
@@ -35,7 +35,7 @@
<!-- no translation found for invalid_charger (4549105996740522523) -->
<skip />
<string name="battery_low_why" msgid="7279169609518386372">"Викор. батареї"</string>
- <!-- no translation found for system_panel_settings_button (7832600575390861653) -->
+ <!-- no translation found for status_bar_settings_settings_button (7832600575390861653) -->
<skip />
<string name="recent_tasks_title" msgid="3691764623638127888">"Останні"</string>
<!-- no translation found for recent_tasks_empty (1905484479067697884) -->
diff --git a/packages/SystemUI/res/values-vi/strings.xml b/packages/SystemUI/res/values-vi/strings.xml
index 0a559da..fe11324 100644
--- a/packages/SystemUI/res/values-vi/strings.xml
+++ b/packages/SystemUI/res/values-vi/strings.xml
@@ -35,7 +35,7 @@
<!-- no translation found for invalid_charger (4549105996740522523) -->
<skip />
<string name="battery_low_why" msgid="7279169609518386372">"Sử dụng pin"</string>
- <!-- no translation found for system_panel_settings_button (7832600575390861653) -->
+ <!-- no translation found for status_bar_settings_settings_button (7832600575390861653) -->
<skip />
<string name="recent_tasks_title" msgid="3691764623638127888">"Gần đây"</string>
<!-- no translation found for recent_tasks_empty (1905484479067697884) -->
diff --git a/packages/SystemUI/res/values-xlarge/strings.xml b/packages/SystemUI/res/values-xlarge/strings.xml
index e305681..e3e5148 100644
--- a/packages/SystemUI/res/values-xlarge/strings.xml
+++ b/packages/SystemUI/res/values-xlarge/strings.xml
@@ -25,14 +25,14 @@
<!-- Text to display underneath the graphical signal strength meter when
no connection is available. [CHAR LIMIT=20] -->
- <string name="system_panel_signal_meter_disconnected">
+ <string name="status_bar_settings_signal_meter_disconnected">
no internet connection
</string>
<!-- Text to display underneath the graphical signal strength meter when
it is displaying information about a connected, named Wi-Fi network.
[CHAR LIMIT=20] -->
- <string name="system_panel_signal_meter_wifi_ssid_format">
+ <string name="status_bar_settings_signal_meter_wifi_ssid_format">
<xliff:g id="ssid">%s</xliff:g>
</string>
@@ -40,14 +40,14 @@
it is displaying Wi-Fi status and Wi-Fi is connected to a network
whose SSID is not available.
[CHAR LIMIT=20] -->
- <string name="system_panel_signal_meter_wifi_nossid">
+ <string name="status_bar_settings_signal_meter_wifi_nossid">
Wi-Fi: connected
</string>
<!-- Text to display underneath the graphical signal strength meter when
it is displaying Wi-Fi status and Wi-Fi is in the process of
connecting to a network. [CHAR LIMIT=20] -->
- <string name="system_panel_signal_meter_wifi_connecting">
+ <string name="status_bar_settings_signal_meter_wifi_connecting">
Wi-Fi: connecting…
</string>
@@ -55,7 +55,7 @@
it is displaying mobile data (3G) status and a network connection is
available.
[CHAR LIMIT=20] -->
- <string name="system_panel_signal_meter_data_connected">
+ <string name="status_bar_settings_signal_meter_data_connected">
Mobile data: connected
</string>
@@ -63,7 +63,7 @@
it is displaying mobile data (3G) status and a network connection is
unavailable.
[CHAR LIMIT=20] -->
- <string name="system_panel_signal_meter_data_connecting">
+ <string name="status_bar_settings_signal_meter_data_connecting">
Mobile data: connecting…
</string>
</resources>
diff --git a/packages/SystemUI/res/values-xlarge/styles.xml b/packages/SystemUI/res/values-xlarge/styles.xml
new file mode 100644
index 0000000..fb10a24
--- /dev/null
+++ b/packages/SystemUI/res/values-xlarge/styles.xml
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2010 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android">
+
+ <style name="StatusBarNotificationText">
+ <item name="android:textSize">16sp</item>
+ <item name="android:textColor">#ff999999</item>
+ </style>
+
+ <style name="StatusBarPanelSettingsRow">
+ <item name="android:layout_height">64dp</item>
+ <item name="android:layout_width">match_parent</item>
+ <item name="android:orientation">horizontal</item>
+ </style>
+
+ <style name="StatusBarPanelSettingsIcon">
+ <item name="android:layout_height">match_parent</item>
+ <item name="android:layout_width">64dp</item>
+ <item name="android:scaleType">center</item>
+ </style>
+
+ <style name="StatusBarPanelSettingsContents">
+ <item name="android:layout_height">wrap_content</item>
+ <item name="android:layout_width">0dp</item>
+ <item name="android:layout_weight">1</item>
+ <item name="android:layout_gravity">left|center_vertical</item>
+ <item name="android:textColor">?android:attr/textColorPrimary</item>
+ </style>
+
+ <style name="StatusBarPanelSettingsPanelSeparator">
+ <item name="android:layout_width">match_parent</item>
+ <item name="android:layout_height">1dp</item>
+ <item name="android:background">@android:drawable/divider_horizontal_dark</item>
+ </style>
+
+</resources>
diff --git a/packages/SystemUI/res/values-zh-rCN-xlarge/strings.xml b/packages/SystemUI/res/values-zh-rCN-xlarge/strings.xml
index 68b0fac..072bcb0 100644
--- a/packages/SystemUI/res/values-zh-rCN-xlarge/strings.xml
+++ b/packages/SystemUI/res/values-zh-rCN-xlarge/strings.xml
@@ -21,11 +21,11 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<!-- no translation found for status_bar_clear_all_button (4722520806446512408) -->
<skip />
- <string name="system_panel_signal_meter_disconnected" msgid="2123001074951934237">"无互联网连接"</string>
- <!-- no translation found for system_panel_signal_meter_wifi_ssid_format (6261810256542749384) -->
+ <string name="status_bar_settings_signal_meter_disconnected" msgid="2123001074951934237">"无互联网连接"</string>
+ <!-- no translation found for status_bar_settings_signal_meter_wifi_ssid_format (6261810256542749384) -->
<skip />
- <string name="system_panel_signal_meter_wifi_nossid" msgid="160846667119240422">"Wi-Fi:已连接"</string>
- <string name="system_panel_signal_meter_wifi_connecting" msgid="4087640898624652649">"Wi-Fi:正在连接..."</string>
- <string name="system_panel_signal_meter_data_connected" msgid="2171100321540926054">"移动数据:已连接"</string>
- <string name="system_panel_signal_meter_data_connecting" msgid="7183001278053801143">"移动数据:正在连接..."</string>
+ <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="160846667119240422">"Wi-Fi:已连接"</string>
+ <string name="status_bar_settings_signal_meter_wifi_connecting" msgid="4087640898624652649">"Wi-Fi:正在连接..."</string>
+ <string name="status_bar_settings_signal_meter_data_connected" msgid="2171100321540926054">"移动数据:已连接"</string>
+ <string name="status_bar_settings_signal_meter_data_connecting" msgid="7183001278053801143">"移动数据:正在连接..."</string>
</resources>
diff --git a/packages/SystemUI/res/values-zh-rCN/strings.xml b/packages/SystemUI/res/values-zh-rCN/strings.xml
index 9ed98c9..48218c0 100644
--- a/packages/SystemUI/res/values-zh-rCN/strings.xml
+++ b/packages/SystemUI/res/values-zh-rCN/strings.xml
@@ -35,7 +35,7 @@
<!-- no translation found for invalid_charger (4549105996740522523) -->
<skip />
<string name="battery_low_why" msgid="7279169609518386372">"电量使用情况"</string>
- <!-- no translation found for system_panel_settings_button (7832600575390861653) -->
+ <!-- no translation found for status_bar_settings_settings_button (7832600575390861653) -->
<skip />
<string name="recent_tasks_title" msgid="3691764623638127888">"近期任务"</string>
<!-- no translation found for recent_tasks_empty (1905484479067697884) -->
diff --git a/packages/SystemUI/res/values-zh-rTW-xlarge/strings.xml b/packages/SystemUI/res/values-zh-rTW-xlarge/strings.xml
index bc41d11..0d06aad 100644
--- a/packages/SystemUI/res/values-zh-rTW-xlarge/strings.xml
+++ b/packages/SystemUI/res/values-zh-rTW-xlarge/strings.xml
@@ -21,11 +21,11 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<!-- no translation found for status_bar_clear_all_button (4722520806446512408) -->
<skip />
- <string name="system_panel_signal_meter_disconnected" msgid="2123001074951934237">"沒有網際網路連線"</string>
- <!-- no translation found for system_panel_signal_meter_wifi_ssid_format (6261810256542749384) -->
+ <string name="status_bar_settings_signal_meter_disconnected" msgid="2123001074951934237">"沒有網際網路連線"</string>
+ <!-- no translation found for status_bar_settings_signal_meter_wifi_ssid_format (6261810256542749384) -->
<skip />
- <string name="system_panel_signal_meter_wifi_nossid" msgid="160846667119240422">"Wi-F:已連線"</string>
- <string name="system_panel_signal_meter_wifi_connecting" msgid="4087640898624652649">"Wi-Fi:連線中..."</string>
- <string name="system_panel_signal_meter_data_connected" msgid="2171100321540926054">"行動數據:已連線"</string>
- <string name="system_panel_signal_meter_data_connecting" msgid="7183001278053801143">"行動數據:連線中..."</string>
+ <string name="status_bar_settings_signal_meter_wifi_nossid" msgid="160846667119240422">"Wi-F:已連線"</string>
+ <string name="status_bar_settings_signal_meter_wifi_connecting" msgid="4087640898624652649">"Wi-Fi:連線中..."</string>
+ <string name="status_bar_settings_signal_meter_data_connected" msgid="2171100321540926054">"行動數據:已連線"</string>
+ <string name="status_bar_settings_signal_meter_data_connecting" msgid="7183001278053801143">"行動數據:連線中..."</string>
</resources>
diff --git a/packages/SystemUI/res/values-zh-rTW/strings.xml b/packages/SystemUI/res/values-zh-rTW/strings.xml
index 4dc323b..10c08d0 100644
--- a/packages/SystemUI/res/values-zh-rTW/strings.xml
+++ b/packages/SystemUI/res/values-zh-rTW/strings.xml
@@ -35,7 +35,7 @@
<!-- no translation found for invalid_charger (4549105996740522523) -->
<skip />
<string name="battery_low_why" msgid="7279169609518386372">"電池使用狀況"</string>
- <!-- no translation found for system_panel_settings_button (7832600575390861653) -->
+ <!-- no translation found for status_bar_settings_settings_button (7832600575390861653) -->
<skip />
<string name="recent_tasks_title" msgid="3691764623638127888">"最新的"</string>
<!-- no translation found for recent_tasks_empty (1905484479067697884) -->
diff --git a/packages/SystemUI/res/values/strings.xml b/packages/SystemUI/res/values/strings.xml
index e8c3c91..ed31a34 100644
--- a/packages/SystemUI/res/values/strings.xml
+++ b/packages/SystemUI/res/values/strings.xml
@@ -72,10 +72,19 @@
<string name="battery_low_why">Battery use</string>
<!-- Name of the button that links to the Settings app. [CHAR LIMIT=NONE] -->
- <string name="system_panel_settings_button">Settings</string>
+ <string name="status_bar_settings_settings_button">Settings</string>
+
+ <!-- Label in the system panel for airplane mode (all radios are turned off)[CHAR LIMIT=30] -->
+ <string name="status_bar_settings_airplane">Airplane mode</string>
+
+ <!-- Label in system panel saying the device will use the orientation sensor to rotate [CHAR LIMIT=30] -->
+ <string name="status_bar_settings_rotation_lock">Lock screen orientation</string>
+
+ <!-- Label in system panel saying the device will show notifications [CHAR LIMIT=30] -->
+ <string name="status_bar_settings_notifications">Notifications</string>
<!-- Text to display next to the graphical battery meter. [CHAR LIMIT=3] -->
- <string name="system_panel_battery_meter_format" translatable="false">
+ <string name="status_bar_settings_battery_meter_format" translatable="false">
<xliff:g id="number">%d</xliff:g><xliff:g id="percent">%%</xliff:g>
</string>
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
index 5391178..0d6c5f6 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
@@ -505,7 +505,7 @@
// create the row view
LayoutInflater inflater = (LayoutInflater)mContext.getSystemService(
Context.LAYOUT_INFLATER_SERVICE);
- View row = inflater.inflate(R.layout.status_bar_latest_event, parent, false);
+ View row = inflater.inflate(R.layout.status_bar_notification_row, parent, false);
// bind the click event to the content area
ViewGroup content = (ViewGroup)row.findViewById(R.id.content);
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/AirplaneModeController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/AirplaneModeController.java
new file mode 100644
index 0000000..da60f0d
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/AirplaneModeController.java
@@ -0,0 +1,92 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.statusbar.policy;
+
+import android.content.BroadcastReceiver;
+import android.content.ContentResolver;
+import android.content.Context;
+import android.content.Intent;
+import android.content.IntentFilter;
+import android.os.RemoteException;
+import android.os.ServiceManager;
+import android.provider.Settings;
+import android.util.Slog;
+import android.widget.CompoundButton;
+
+public class AirplaneModeController extends BroadcastReceiver
+ implements CompoundButton.OnCheckedChangeListener {
+ private static final String TAG = "StatusBar.AirplaneModeController";
+
+ private Context mContext;
+ private CompoundButton mCheckBox;
+
+ private boolean mAirplaneMode;
+
+ public AirplaneModeController(Context context, CompoundButton checkbox) {
+ mContext = context;
+ mAirplaneMode = getAirplaneMode();
+ mCheckBox = checkbox;
+ checkbox.setChecked(mAirplaneMode);
+ checkbox.setOnCheckedChangeListener(this);
+
+ IntentFilter filter = new IntentFilter();
+ filter.addAction(Intent.ACTION_AIRPLANE_MODE_CHANGED);
+ context.registerReceiver(this, filter);
+
+ }
+
+ public void release() {
+ mContext.unregisterReceiver(this);
+ }
+
+ public void onCheckedChanged(CompoundButton view, boolean checked) {
+ Slog.d(TAG, "onCheckedChanged checked=" + checked + " mAirplaneMode=" + mAirplaneMode);
+ if (checked != mAirplaneMode) {
+ mAirplaneMode = checked;
+ unsafe(checked);
+ }
+ }
+
+ public void onReceive(Context context, Intent intent) {
+ if (Intent.ACTION_AIRPLANE_MODE_CHANGED.equals(intent.getAction())) {
+ final boolean enabled = intent.getBooleanExtra("state", false);
+ if (enabled != mAirplaneMode) {
+ mAirplaneMode = enabled;
+ mCheckBox.setChecked(enabled);
+ }
+ }
+ }
+
+ private boolean getAirplaneMode() {
+ ContentResolver cr = mContext.getContentResolver();
+ return 0 != Settings.System.getInt(cr, Settings.System.AIRPLANE_MODE_ON, 0);
+ }
+
+ // TODO: Fix this racy API by adding something better to TelephonyManager or
+ // ConnectivityService.
+ private void unsafe(boolean enabled) {
+ Settings.System.putInt(
+ mContext.getContentResolver(),
+ Settings.System.AIRPLANE_MODE_ON,
+ enabled ? 1 : 0);
+ Intent intent = new Intent(Intent.ACTION_AIRPLANE_MODE_CHANGED);
+ intent.addFlags(Intent.FLAG_RECEIVER_REPLACE_PENDING);
+ intent.putExtra("state", enabled);
+ mContext.sendBroadcast(intent);
+ }
+}
+
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/AutoRotateController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/AutoRotateController.java
new file mode 100644
index 0000000..866e5fc
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/AutoRotateController.java
@@ -0,0 +1,73 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.statusbar.policy;
+
+import android.content.ContentResolver;
+import android.content.Context;
+import android.os.RemoteException;
+import android.os.ServiceManager;
+import android.provider.Settings;
+import android.util.Slog;
+import android.view.IWindowManager;
+import android.widget.CompoundButton;
+
+/**
+ * TODO: Listen for changes to the setting.
+ */
+public class AutoRotateController implements CompoundButton.OnCheckedChangeListener {
+ private static final String TAG = "StatusBar.AutoRotateController";
+
+ private Context mContext;
+ private CompoundButton mCheckBox;
+
+ private boolean mLockRotation;
+
+ public AutoRotateController(Context context, CompoundButton checkbox) {
+ mContext = context;
+ mLockRotation = getLockRotation();
+ mCheckBox = checkbox;
+ checkbox.setChecked(mLockRotation);
+ checkbox.setOnCheckedChangeListener(this);
+ }
+
+ public void onCheckedChanged(CompoundButton view, boolean checked) {
+ Slog.d(TAG, "onCheckedChanged checked=" + checked + " mLockRotation=" + mLockRotation);
+ if (checked != mLockRotation) {
+ setLockRotation(checked);
+ }
+ }
+
+ private boolean getLockRotation() {
+ ContentResolver cr = mContext.getContentResolver();
+ return 0 == Settings.System.getInt(cr, Settings.System.ACCELEROMETER_ROTATION, 0);
+ }
+
+ private void setLockRotation(boolean locked) {
+ mLockRotation = locked;
+ try {
+ IWindowManager wm = IWindowManager.Stub.asInterface(ServiceManager.getService(
+ Context.WINDOW_SERVICE));
+ ContentResolver cr = mContext.getContentResolver();
+ if (locked) {
+ wm.freezeRotation();
+ } else {
+ wm.thawRotation();
+ }
+ } catch (RemoteException exc) {
+ }
+ }
+}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/BatteryController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/BatteryController.java
index a1efdd4..ae2b6b2 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/BatteryController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/BatteryController.java
@@ -67,7 +67,7 @@
for (int i=0; i<N; i++) {
//final boolean plugged = intent.getIntExtra(BatteryManager.EXTRA_PLUGGED, 0) != 0;
TextView v = mLabelViews.get(i);
- v.setText(mContext.getString(R.string.system_panel_battery_meter_format, level));
+ v.setText(mContext.getString(R.string.status_bar_settings_battery_meter_format, level));
}
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java
index 18003dd..ec23a3d 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java
@@ -616,18 +616,18 @@
if (mWifiConnected) {
if (mWifiSsid == null) {
- label = context.getString(R.string.system_panel_signal_meter_wifi_nossid);
+ label = context.getString(R.string.status_bar_settings_signal_meter_wifi_nossid);
} else {
- label = context.getString(R.string.system_panel_signal_meter_wifi_ssid_format,
+ label = context.getString(R.string.status_bar_settings_signal_meter_wifi_ssid_format,
mWifiSsid);
}
combinedSignalIconId = mWifiIconId;
dataTypeIconId = 0;
} else {
if (mDataConnected) {
- label = context.getString(R.string.system_panel_signal_meter_data_connected);
+ label = context.getString(R.string.status_bar_settings_signal_meter_data_connected);
} else {
- label = context.getString(R.string.system_panel_signal_meter_disconnected);
+ label = context.getString(R.string.status_bar_settings_signal_meter_disconnected);
}
combinedSignalIconId = mDataSignalIconId;
dataTypeIconId = mDataTypeIconId;
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationPanel.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationPanel.java
index 5f49d8c..baf4a0f 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationPanel.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationPanel.java
@@ -37,7 +37,7 @@
View mNotificationButton;
View mNotificationScroller;
FrameLayout mContentFrame;
- View mSettingsPanel;
+ View mSettingsView;
public NotificationPanel(Context context, AttributeSet attrs) {
this(context, attrs, 0);
@@ -68,6 +68,7 @@
// when we hide, put back the notifications
if (!isShown()) {
switchToNotificationMode();
+ mNotificationScroller.scrollTo(0, 0);
}
}
@@ -103,15 +104,15 @@
}
public void switchToSettingsMode() {
- removeSettingsPanel();
- addSettingsPanel();
+ removeSettingsView();
+ addSettingsView();
mSettingsButton.setVisibility(View.INVISIBLE);
mNotificationScroller.setVisibility(View.GONE);
mNotificationButton.setVisibility(View.VISIBLE);
}
public void switchToNotificationMode() {
- removeSettingsPanel();
+ removeSettingsView();
mSettingsButton.setVisibility(View.VISIBLE);
mNotificationScroller.setVisibility(View.VISIBLE);
mNotificationButton.setVisibility(View.INVISIBLE);
@@ -125,17 +126,17 @@
return x >= l && x < r && y >= t && y < b;
}
- void removeSettingsPanel() {
- if (mSettingsPanel != null) {
- mContentFrame.removeView(mSettingsPanel);
- mSettingsPanel = null;
+ void removeSettingsView() {
+ if (mSettingsView != null) {
+ mContentFrame.removeView(mSettingsView);
+ mSettingsView = null;
}
}
- void addSettingsPanel() {
+ void addSettingsView() {
LayoutInflater infl = LayoutInflater.from(getContext());
- mSettingsPanel = infl.inflate(R.layout.sysbar_panel_settings, mContentFrame, false);
- mContentFrame.addView(mSettingsPanel);
+ mSettingsView = infl.inflate(R.layout.status_bar_settings_view, mContentFrame, false);
+ mContentFrame.addView(mSettingsView);
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/RecentAppsPanel.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/RecentAppsPanel.java
index 0c31304..546750b 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/RecentAppsPanel.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/RecentAppsPanel.java
@@ -224,7 +224,7 @@
final int last = Math.min(mActivityDescriptions.size(), DISPLAY_TASKS) - 1;
for (int i = last; i >= first; i--) {
ActivityDescription activityDescription = mActivityDescriptions.get(i);
- View view = View.inflate(mContext, R.layout.sysbar_panel_recent_item, null);
+ View view = View.inflate(mContext, R.layout.status_bar_recent_item, null);
ImageView appThumbnail = (ImageView) view.findViewById(R.id.app_thumbnail);
ImageView appIcon = (ImageView) view.findViewById(R.id.app_icon);
TextView appDescription = (TextView) view.findViewById(R.id.app_label);
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/SettingsPanel.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/SettingsPanel.java
deleted file mode 100644
index 9013f5c..0000000
--- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/SettingsPanel.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright (C) 2010 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.systemui.statusbar.tablet;
-
-import android.content.Context;
-import android.util.AttributeSet;
-import android.util.Slog;
-import android.widget.LinearLayout;
-import android.view.View;
-
-import com.android.systemui.R;
-
-public class SettingsPanel extends LinearLayout {
- static final String TAG = "SettingsPanel";
-
- public SettingsPanel(Context context, AttributeSet attrs) {
- this(context, attrs, 0);
- }
-
- public SettingsPanel(Context context, AttributeSet attrs, int defStyle) {
- super(context, attrs, defStyle);
- }
-}
-
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/SettingsView.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/SettingsView.java
new file mode 100644
index 0000000..f9ba908
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/SettingsView.java
@@ -0,0 +1,99 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.statusbar.tablet;
+
+import android.app.StatusBarManager;
+import android.content.Context;
+import android.content.Intent;
+import android.provider.Settings;
+import android.util.AttributeSet;
+import android.util.Slog;
+import android.widget.LinearLayout;
+import android.view.View;
+import android.widget.CompoundButton;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import com.android.systemui.R;
+import com.android.systemui.statusbar.policy.AirplaneModeController;
+import com.android.systemui.statusbar.policy.AutoRotateController;
+
+public class SettingsView extends LinearLayout implements View.OnClickListener {
+ static final String TAG = "SettingsView";
+
+ AirplaneModeController mAirplane;
+ AutoRotateController mRotate;
+
+ public SettingsView(Context context, AttributeSet attrs) {
+ this(context, attrs, 0);
+ }
+
+ public SettingsView(Context context, AttributeSet attrs, int defStyle) {
+ super(context, attrs, defStyle);
+ }
+
+ @Override
+ protected void onFinishInflate() {
+ super.onFinishInflate();
+
+ final Context context = getContext();
+
+ mAirplane = new AirplaneModeController(context,
+ (CompoundButton)findViewById(R.id.airplane_checkbox));
+ findViewById(R.id.network).setOnClickListener(this);
+ mRotate = new AutoRotateController(context,
+ (CompoundButton)findViewById(R.id.rotate_checkbox));
+ findViewById(R.id.settings).setOnClickListener(this);
+ }
+
+ @Override
+ protected void onDetachedFromWindow() {
+ super.onDetachedFromWindow();
+ mAirplane.release();
+ }
+
+ public void onClick(View v) {
+ switch (v.getId()) {
+ case R.id.network:
+ onClickNetwork();
+ break;
+ case R.id.settings:
+ onClickSettings();
+ break;
+ }
+ }
+
+ private StatusBarManager getStatusBarManager() {
+ return (StatusBarManager)getContext().getSystemService(Context.STATUS_BAR_SERVICE);
+ }
+
+ // Network
+ // ----------------------------
+ private void onClickNetwork() {
+ Slog.d(TAG, "onClickNetwork");
+ }
+
+ // Settings
+ // ----------------------------
+ private void onClickSettings() {
+ Slog.d(TAG, "onClickSettings");
+ getContext().startActivity(new Intent(Settings.ACTION_SETTINGS)
+ .setFlags(Intent.FLAG_ACTIVITY_NEW_TASK));
+ getStatusBarManager().collapse();
+ }
+}
+
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/ShirtPocket.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/ShirtPocket.java
index 0cb9249..d1e61a9 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/ShirtPocket.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/ShirtPocket.java
@@ -184,7 +184,7 @@
};
private void setupWindow() {
- mWindow = View.inflate(getContext(), R.layout.sysbar_panel_pocket, null);
+ mWindow = View.inflate(getContext(), R.layout.status_bar_pocket_panel, null);
mPreviewIcon = (ImageView) mWindow.findViewById(R.id.icon);
mDescription = (TextView) mWindow.findViewById(R.id.description);
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/SystemPanel.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/SystemPanel.java
deleted file mode 100644
index 41b44c2..0000000
--- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/SystemPanel.java
+++ /dev/null
@@ -1,403 +0,0 @@
-/*
- * Copyright (C) 2010 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.systemui.statusbar.tablet;
-
-import android.bluetooth.BluetoothAdapter;
-import android.content.BroadcastReceiver;
-import android.content.ContentResolver;
-import android.content.Context;
-import android.content.Intent;
-import android.content.IntentFilter;
-import android.location.LocationManager;
-import android.media.AudioManager;
-import android.telephony.PhoneStateListener;
-import android.telephony.ServiceState;
-import android.os.IPowerManager;
-import android.os.RemoteException;
-import android.os.ServiceManager;
-import android.provider.Settings;
-import android.util.AttributeSet;
-import android.util.Slog;
-import android.view.View;
-import android.view.IWindowManager;
-import android.view.WindowManager;
-import android.view.WindowManagerImpl;
-import android.widget.ImageButton;
-import android.widget.LinearLayout;
-import android.widget.TextView;
-import android.widget.Toast;
-
-import com.android.internal.telephony.IccCard;
-import com.android.internal.telephony.TelephonyIntents;
-import com.android.internal.telephony.cdma.EriInfo;
-import com.android.internal.telephony.cdma.TtyIntent;
-
-import com.android.server.WindowManagerService;
-
-import com.android.systemui.statusbar.*;
-import com.android.systemui.R;
-
-public class SystemPanel extends LinearLayout implements StatusBarPanel {
- private static final String TAG = "SystemPanel";
- private static final boolean DEBUG = TabletStatusBar.DEBUG;
-
- private static final int MINIMUM_BACKLIGHT = android.os.Power.BRIGHTNESS_DIM + 5;
- private static final int MAXIMUM_BACKLIGHT = android.os.Power.BRIGHTNESS_ON;
- private static final int DEFAULT_BACKLIGHT = (int) (android.os.Power.BRIGHTNESS_ON * 0.4f);
-
- private TabletStatusBar mBar;
- private boolean mAirplaneMode;
-
- private ImageButton mBrightnessButton;
- private ImageButton mSoundButton;
- private ImageButton mOrientationButton;
- private ImageButton mAirplaneButton;
- private ImageButton mGpsButton;
- private ImageButton mBluetoothButton;
-
- private final IWindowManager mWM;
-
- private final AudioManager mAudioManager;
- private final BluetoothAdapter mBluetoothAdapter;
-
- public boolean isInContentArea(int x, int y) {
- final int l = getPaddingLeft();
- final int r = getWidth() - getPaddingRight();
- final int t = getPaddingTop();
- final int b = getHeight() - getPaddingBottom();
- return x >= l && x < r && y >= t && y < b;
- }
-
- private BroadcastReceiver mReceiver = new BroadcastReceiver() {
- @Override
- public void onReceive(Context context, Intent intent) {
- final String action = intent.getAction();
- if (action.equals(AudioManager.RINGER_MODE_CHANGED_ACTION)) {
- refreshSound();
- } else if (action.equals(BluetoothAdapter.ACTION_STATE_CHANGED)) {
- refreshBluetooth();
- }
- }
- };
-
- public void setBar(TabletStatusBar bar) {
- mBar = bar;
- }
-
- public SystemPanel(Context context, AttributeSet attrs) {
- this(context, attrs, 0);
- }
-
- public SystemPanel(Context context, AttributeSet attrs, int defStyle) {
- super(context, attrs, defStyle);
-
- // our mighty overlord
- mWM = IWindowManager.Stub.asInterface(
- ServiceManager.getService("window"));
-
- // audio status
- mAudioManager = (AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE);
-
- // Bluetooth
- mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
- }
-
- public void onAttachedToWindow() {
- TextView settingsButton = (TextView)findViewById(R.id.settings_button);
- settingsButton.setOnClickListener(new View.OnClickListener() {
- public void onClick(View v) {
- getContext().startActivity(new Intent(android.provider.Settings.ACTION_SETTINGS)
- .setFlags(Intent.FLAG_ACTIVITY_NEW_TASK));
- mBar.animateCollapse();
- }});
-
- mBrightnessButton = (ImageButton)findViewById(R.id.brightness);
- mBrightnessButton.setOnClickListener(new View.OnClickListener() {
- public void onClick(View v) {
- rotateBrightness();
- }
- });
-
- mSoundButton = (ImageButton)findViewById(R.id.sound);
- mSoundButton.setAlpha(getSilentMode() ? 0x7F : 0xFF);
- mSoundButton.setOnClickListener(new View.OnClickListener() {
- public void onClick(View v) {
- setSilentMode(!getSilentMode());
- mSoundButton.setAlpha(getSilentMode() ? 0x7F : 0xFF);
- }
- });
- mOrientationButton = (ImageButton)findViewById(R.id.orientation);
- mOrientationButton.setImageResource(
- getAutoRotate()
- ? R.drawable.ic_sysbar_rotate_on
- : R.drawable.ic_sysbar_rotate_off);
- mOrientationButton.setOnClickListener(new View.OnClickListener() {
- public void onClick(View v) {
- setAutoRotate(!getAutoRotate());
- mOrientationButton.setImageResource(
- getAutoRotate()
- ? R.drawable.ic_sysbar_rotate_on
- : R.drawable.ic_sysbar_rotate_off);
- Toast.makeText(getContext(),
- getAutoRotate()
- ? R.string.toast_rotation_free
- : R.string.toast_rotation_locked,
- Toast.LENGTH_SHORT).show();
- }
- });
-
- mAirplaneButton = (ImageButton)findViewById(R.id.airplane);
- mAirplaneButton.setAlpha(mAirplaneMode ? 0xFF : 0x7F);
- mAirplaneButton.setOnClickListener(new View.OnClickListener() {
- public void onClick(View v) {
- boolean newMode = !getAirplaneMode();
- Toast.makeText(getContext(), "Attempting to turn "
- + (newMode ? "on" : "off") + " airplane mode (flaky).",
- Toast.LENGTH_SHORT).show();
- setAirplaneMode(newMode);
- }
- });
-
- mGpsButton = (ImageButton)findViewById(R.id.gps);
- mGpsButton.setOnClickListener(new View.OnClickListener() {
- public void onClick(View v) {
- toggleGps();
- refreshGps();
- }
- });
-
- mBluetoothButton = (ImageButton)findViewById(R.id.bluetooth);
- mBluetoothButton.setOnClickListener(new View.OnClickListener() {
- public void onClick(View v) {
- toggleBluetooth();
- refreshBluetooth();
- }
- });
-
- // register for broadcasts
- IntentFilter filter = new IntentFilter();
- filter.addAction(AudioManager.RINGER_MODE_CHANGED_ACTION);
- filter.addAction(BluetoothAdapter.ACTION_STATE_CHANGED);
- getContext().registerReceiver(mReceiver, filter);
-
- refreshBluetooth();
- refreshGps();
- }
-
- public void onDetachedFromWindow() {
- getContext().unregisterReceiver(mReceiver);
- }
-
- // ----------------------------------------------------------------------
-
-// private boolean isAutoBrightness() {
-// Context context = getContext();
-// try {
-// IPowerManager power = IPowerManager.Stub.asInterface(
-// ServiceManager.getService("power"));
-// if (power != null) {
-// int brightnessMode = Settings.System.getInt(context.getContentResolver(),
-// Settings.System.SCREEN_BRIGHTNESS_MODE);
-// return brightnessMode == Settings.System.SCREEN_BRIGHTNESS_MODE_AUTOMATIC;
-// }
-// } catch (RemoteException e) {
-// } catch (Settings.SettingNotFoundException e) {
-// }
-// return false;
-// }
-
- private void rotateBrightness() {
- int icon = R.drawable.ic_sysbar_brightness;
- int bg = R.drawable.sysbar_toggle_bg_on;
- Context context = getContext();
- try {
- IPowerManager power = IPowerManager.Stub.asInterface(
- ServiceManager.getService("power"));
- if (power != null) {
- ContentResolver cr = context.getContentResolver();
- int brightness = Settings.System.getInt(cr,
- Settings.System.SCREEN_BRIGHTNESS);
- int brightnessMode = Settings.System.SCREEN_BRIGHTNESS_MODE_MANUAL;
- //Only get brightness setting if available
- if (context.getResources().getBoolean(
- com.android.internal.R.bool.config_automatic_brightness_available)) {
- brightnessMode = Settings.System.getInt(cr,
- Settings.System.SCREEN_BRIGHTNESS_MODE);
- }
-
- // Rotate AUTO -> MINIMUM -> DEFAULT -> MAXIMUM
- // Technically, not a toggle...
- if (brightnessMode == Settings.System.SCREEN_BRIGHTNESS_MODE_AUTOMATIC) {
- brightness = MINIMUM_BACKLIGHT;
- icon = R.drawable.ic_sysbar_brightness_low;
- brightnessMode = Settings.System.SCREEN_BRIGHTNESS_MODE_MANUAL;
- } else if (brightness < DEFAULT_BACKLIGHT) {
- brightness = DEFAULT_BACKLIGHT;
- } else if (brightness < MAXIMUM_BACKLIGHT) {
- brightness = MAXIMUM_BACKLIGHT;
- } else {
- brightnessMode = Settings.System.SCREEN_BRIGHTNESS_MODE_AUTOMATIC;
- brightness = MINIMUM_BACKLIGHT;
- icon = R.drawable.ic_sysbar_brightness_auto;
- }
-
- if (context.getResources().getBoolean(
- com.android.internal.R.bool.config_automatic_brightness_available)) {
- // Set screen brightness mode (automatic or manual)
- Settings.System.putInt(context.getContentResolver(),
- Settings.System.SCREEN_BRIGHTNESS_MODE,
- brightnessMode);
- } else {
- // Make sure we set the brightness if automatic mode isn't available
- brightnessMode = Settings.System.SCREEN_BRIGHTNESS_MODE_MANUAL;
- }
- if (brightnessMode == Settings.System.SCREEN_BRIGHTNESS_MODE_MANUAL) {
- power.setBacklightBrightness(brightness);
- Settings.System.putInt(cr, Settings.System.SCREEN_BRIGHTNESS, brightness);
- }
- }
- } catch (RemoteException e) {
- } catch (Settings.SettingNotFoundException e) {
- }
-
- mBrightnessButton.setImageResource(icon);
- mBrightnessButton.setBackgroundResource(bg);
- }
-
- PhoneStateListener mPhoneStateListener = new PhoneStateListener() {
- @Override
- public void onServiceStateChanged(ServiceState serviceState) {
- if (DEBUG) {
- Slog.d(TAG, "phone service state changed: " + serviceState.getState());
- }
- mAirplaneMode = serviceState.getState() == ServiceState.STATE_POWER_OFF;
- if (mAirplaneButton != null) {
- mAirplaneButton.setImageResource(mAirplaneMode
- ? R.drawable.ic_sysbar_airplane_on
- : R.drawable.ic_sysbar_airplane_off);
- mAirplaneButton.setBackgroundResource(mAirplaneMode
- ? R.drawable.sysbar_toggle_bg_on
- : R.drawable.sysbar_toggle_bg_off);
- }
- }
- };
-
- private boolean getAirplaneMode() {
- return mAirplaneMode;
- }
-
- private void setAirplaneMode(boolean on) {
- Settings.System.putInt(
- mContext.getContentResolver(),
- Settings.System.AIRPLANE_MODE_ON,
- on ? 1 : 0);
- Intent intent = new Intent(Intent.ACTION_AIRPLANE_MODE_CHANGED);
- intent.addFlags(Intent.FLAG_RECEIVER_REPLACE_PENDING);
- intent.putExtra("state", on);
- getContext().sendBroadcast(intent);
- }
-
- boolean getSilentMode() {
- return mAudioManager.getRingerMode() != AudioManager.RINGER_MODE_NORMAL;
- }
-
- void setSilentMode(boolean on) {
- if (on) {
- mAudioManager.setRingerMode((Settings.System.getInt(mContext.getContentResolver(),
- Settings.System.VIBRATE_IN_SILENT, 1) == 1)
- ? AudioManager.RINGER_MODE_VIBRATE
- : AudioManager.RINGER_MODE_SILENT);
- } else {
- mAudioManager.setRingerMode(AudioManager.RINGER_MODE_NORMAL);
- }
- }
-
- void refreshSound() {
- boolean silent = getSilentMode();
- mSoundButton.setImageResource(!silent
- ? R.drawable.ic_sysbar_sound_on
- : R.drawable.ic_sysbar_sound_off);
- mSoundButton.setBackgroundResource(!silent
- ? R.drawable.sysbar_toggle_bg_on
- : R.drawable.sysbar_toggle_bg_off);
- }
-
- void toggleBluetooth() {
- if (mBluetoothAdapter == null) return;
- if (mBluetoothAdapter.isEnabled()) {
- mBluetoothAdapter.disable();
- } else {
- mBluetoothAdapter.enable();
- }
- }
-
- void refreshBluetooth() {
- boolean on = mBluetoothAdapter != null && mBluetoothAdapter.isEnabled();
- mBluetoothButton.setImageResource(on ? R.drawable.ic_sysbar_bluetooth_on
- : R.drawable.ic_sysbar_bluetooth_off);
- mBluetoothButton.setBackgroundResource(on
- ? R.drawable.sysbar_toggle_bg_on
- : R.drawable.sysbar_toggle_bg_off);
- }
-
- private boolean isGpsEnabled() {
- ContentResolver res = mContext.getContentResolver();
- return Settings.Secure.isLocationProviderEnabled(
- res, LocationManager.GPS_PROVIDER);
- }
-
- private void toggleGps() {
- Settings.Secure.setLocationProviderEnabled(mContext.getContentResolver(),
- LocationManager.GPS_PROVIDER, !isGpsEnabled());
- }
-
- private void refreshGps() {
- boolean on = isGpsEnabled();
- mGpsButton.setImageResource(on ? R.drawable.ic_sysbar_gps_on
- : R.drawable.ic_sysbar_gps_off);
- mGpsButton.setBackgroundResource(on
- ? R.drawable.sysbar_toggle_bg_on
- : R.drawable.sysbar_toggle_bg_off);
- }
-
- void setAutoRotate(boolean rot) {
- try {
- ContentResolver cr = getContext().getContentResolver();
- if (rot) {
- mWM.thawRotation();
- } else {
- mWM.freezeRotation();
- }
- } catch (RemoteException exc) {
- }
- }
-
- boolean getAutoRotate() {
- ContentResolver cr = getContext().getContentResolver();
- return 1 == Settings.System.getInt(cr,
- Settings.System.ACCELEROMETER_ROTATION,
- 1);
- }
-
- int getDisplayRotation() {
- try {
- return mWM.getRotation();
- } catch (RemoteException exc) {
- return 0;
- }
- }
-}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java
index 6db5b2b..3cae088 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java
@@ -102,7 +102,7 @@
NotificationIconArea mNotificationIconArea;
View mNavigationArea;
- View mBackButton;
+ ImageView mBackButton;
View mHomeButton;
View mMenuButton;
View mRecentButton;
@@ -145,11 +145,11 @@
final Resources res = context.getResources();
final int barHeight= res.getDimensionPixelSize(
- com.android.internal.R.dimen.status_bar_height);
+ com.android.internal.R.dimen.status_bar_height);
// Notification Panel
mNotificationPanel = (NotificationPanel)View.inflate(context,
- R.layout.sysbar_panel_notifications, null);
+ R.layout.status_bar_notification_panel, null);
mNotificationPanel.setVisibility(View.GONE);
mNotificationPanel.setOnTouchListener(
new TouchOutsideListener(MSG_CLOSE_NOTIFICATION_PANEL, mNotificationPanel));
@@ -180,11 +180,11 @@
// Notification preview window
mNotificationPeekWindow = (NotificationPeekPanel) View.inflate(context,
- R.layout.sysbar_panel_notification_peek, null);
+ R.layout.status_bar_notification_peek, null);
mNotificationPeekRow = (ViewGroup) mNotificationPeekWindow.findViewById(R.id.content);
mNotificationPeekWindow.setVisibility(View.GONE);
mNotificationPeekWindow.setOnTouchListener(
- new TouchOutsideListener(MSG_CLOSE_NOTIFICATION_PANEL, mNotificationPeekWindow));
+ new TouchOutsideListener(MSG_CLOSE_NOTIFICATION_PEEK, mNotificationPeekWindow));
mNotificationPeekScrubRight = new LayoutTransition();
mNotificationPeekScrubRight.setAnimator(LayoutTransition.APPEARING,
ObjectAnimator.ofInt(null, "left", -512, 0));
@@ -216,8 +216,8 @@
// Recents Panel
if (USE_2D_RECENTS) {
- mRecentsPanel = (RecentAppsPanel) View.inflate(context, R.layout.sysbar_panel_recent,
- null);
+ mRecentsPanel = (RecentAppsPanel) View.inflate(context,
+ R.layout.status_bar_recent_panel, null);
mRecentsPanel.setVisibility(View.GONE);
mRecentsPanel.setOnTouchListener(new TouchOutsideListener(MSG_CLOSE_RECENTS_PANEL,
mRecentsPanel));
@@ -287,7 +287,7 @@
// The navigation buttons
mNavigationArea = sb.findViewById(R.id.navigationArea);
- mBackButton = mNavigationArea.findViewById(R.id.back);
+ mBackButton = (ImageView)mNavigationArea.findViewById(R.id.back);
mHomeButton = mNavigationArea.findViewById(R.id.home);
mMenuButton = mNavigationArea.findViewById(R.id.menu);
mRecentButton = mNavigationArea.findViewById(R.id.recent_apps);
@@ -388,6 +388,7 @@
mNotificationPanel.setVisibility(View.VISIBLE);
// synchronize with current shadow state
mShadowController.hideElement(mNotificationArea);
+ mTicker.halt();
}
break;
case MSG_CLOSE_NOTIFICATION_PANEL:
@@ -458,12 +459,7 @@
if (DEBUG) Slog.d(TAG, "addNotification(" + key + " -> " + notification + ")");
addNotificationViews(key, notification);
- boolean immersive = false;
- try {
- immersive = ActivityManagerNative.getDefault().isTopActivityImmersive();
- //Slog.d(TAG, "Top activity is " + (immersive?"immersive":"not immersive"));
- } catch (RemoteException ex) {
- }
+ final boolean immersive = isImmersive();
if (false && immersive) {
// TODO: immersive mode popups for tablet
} else if (notification.notification.fullScreenIntent != null) {
@@ -475,7 +471,7 @@
} catch (PendingIntent.CanceledException e) {
}
} else {
- tick(notification);
+ tick(key, notification);
}
setAreThereNotifications();
@@ -549,7 +545,14 @@
removeNotificationViews(key);
addNotificationViews(key, notification);
}
- // TODO: ticker; immersive mode
+ // fullScreenIntent doesn't happen on updates. You need to clear & repost a new
+ // notification.
+ final boolean immersive = isImmersive();
+ if (false && immersive) {
+ // TODO: immersive mode
+ } else {
+ tick(key, notification);
+ }
setAreThereNotifications();
}
@@ -557,6 +560,7 @@
public void removeNotification(IBinder key) {
if (DEBUG) Slog.d(TAG, "removeNotification(" + key + ") // TODO");
removeNotificationViews(key);
+ mTicker.remove(key);
setAreThereNotifications();
}
@@ -603,7 +607,7 @@
return n.tickerView != null || !TextUtils.isEmpty(n.tickerText);
}
- private void tick(StatusBarNotification n) {
+ private void tick(IBinder key, StatusBarNotification n) {
// Don't show the ticker when the windowshade is open.
if (mNotificationPanel.getVisibility() == View.VISIBLE) {
return;
@@ -615,7 +619,7 @@
if (hasTicker(n.notification) && mStatusBarView.getWindowToken() != null) {
if (0 == (mDisabled & (StatusBarManager.DISABLE_NOTIFICATION_ICONS
| StatusBarManager.DISABLE_NOTIFICATION_TICKER))) {
- mTicker.add(n);
+ mTicker.add(key, n);
}
}
}
@@ -653,8 +657,20 @@
}
mInputMethodSwitchButton.setIMEButtonVisible(token, visible);
mInputMethodShortcutButton.setIMEButtonVisible(token, visible);
+ mBackButton.setImageResource(
+ visible ? R.drawable.ic_sysbar_back_ime : R.drawable.ic_sysbar_back);
}
+ private boolean isImmersive() {
+ try {
+ return ActivityManagerNative.getDefault().isTopActivityImmersive();
+ //Slog.d(TAG, "Top activity is " + (immersive?"immersive":"not immersive"));
+ } catch (RemoteException ex) {
+ // the end is nigh
+ return false;
+ }
+ }
+
private void setAreThereNotifications() {
final boolean hasClearable = mNotns.hasClearableItems();
@@ -818,8 +834,7 @@
case MotionEvent.ACTION_MOVE:
// peek and switch icons if necessary
int numIcons = mIconLayout.getChildCount();
- int peekIndex =
- (int)((float)event.getX() * numIcons / mIconLayout.getWidth());
+ int peekIndex = (int)((float)event.getX() * numIcons / mIconLayout.getWidth());
if (peekIndex > numIcons - 1) peekIndex = numIcons - 1;
else if (peekIndex < 0) peekIndex = 0;
@@ -831,8 +846,7 @@
mHandler.removeMessages(MSG_OPEN_NOTIFICATION_PEEK);
// no delay if we're scrubbing left-right
- mHandler.sendMessageDelayed(peekMsg,
- peeking ? 0 : mNotificationPeekTapDuration);
+ mHandler.sendMessage(peekMsg);
}
// check for fling
@@ -854,7 +868,7 @@
case MotionEvent.ACTION_CANCEL:
mHandler.removeMessages(MSG_OPEN_NOTIFICATION_PEEK);
if (peeking) {
- mHandler.sendEmptyMessageDelayed(MSG_CLOSE_NOTIFICATION_PEEK, 250);
+ mHandler.sendEmptyMessageDelayed(MSG_CLOSE_NOTIFICATION_PEEK, 5000);
}
mVT.recycle();
mVT = null;
@@ -987,7 +1001,7 @@
// create the row view
LayoutInflater inflater = (LayoutInflater)mContext.getSystemService(
Context.LAYOUT_INFLATER_SERVICE);
- View row = inflater.inflate(R.layout.status_bar_latest_event, parent, false);
+ View row = inflater.inflate(R.layout.status_bar_notification_row, parent, false);
workAroundBadLayerDrawableOpacity(row);
View vetoButton = row.findViewById(R.id.veto);
if (entry.notification.isClearable()) {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletTicker.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletTicker.java
index b05fe1a..b3aed03 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletTicker.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletTicker.java
@@ -25,6 +25,7 @@
import android.graphics.PixelFormat;
import android.graphics.drawable.Drawable;
import android.os.Handler;
+import android.os.IBinder;
import android.os.Message;
import android.util.Slog;
import android.view.Gravity;
@@ -47,6 +48,9 @@
public class TabletTicker extends Handler {
private static final String TAG = "StatusBar.TabletTicker";
+ // 3 is enough to let us see most cases, but not get so far behind that it's too annoying.
+ private static final int QUEUE_LENGTH = 3;
+
private static final int MSG_ADVANCE = 1;
private static final int ADVANCE_DELAY = 5000; // 5 seconds
@@ -54,42 +58,77 @@
private Context mContext;
private ViewGroup mWindow;
+ private IBinder mCurrentKey;
private StatusBarNotification mCurrentNotification;
private View mCurrentView;
- private StatusBarNotification[] mQueue;
+ private IBinder[] mKeys = new IBinder[QUEUE_LENGTH];
+ private StatusBarNotification[] mQueue = new StatusBarNotification[QUEUE_LENGTH];
private int mQueuePos;
public TabletTicker(Context context) {
mContext = context;
-
- // TODO: Make this a configuration value.
- // 3 is enough to let us see most cases, but not get so far behind that it's annoying.
- mQueue = new StatusBarNotification[3];
}
- public void add(StatusBarNotification notification) {
+ public void add(IBinder key, StatusBarNotification notification) {
if (false) {
- Slog.d(TAG, "add mCurrentNotification=" + mCurrentNotification
+ Slog.d(TAG, "add 1 mCurrentNotification=" + mCurrentNotification
+ " mQueuePos=" + mQueuePos + " mQueue=" + Arrays.toString(mQueue));
}
+
+ // If it's already in here, remove whatever's in there and put the new one at the end.
+ remove(key, false);
+
+ mKeys[mQueuePos] = key;
mQueue[mQueuePos] = notification;
- // If nothing is running now, start the next one
- if (mCurrentNotification == null) {
+ // If nothing is running now, start the next one.
+ if (mQueuePos == 0 && mCurrentNotification == null) {
sendEmptyMessage(MSG_ADVANCE);
}
- if (mQueuePos < mQueue.length - 1) {
+ if (mQueuePos < QUEUE_LENGTH - 1) {
mQueuePos++;
}
}
+ public void remove(IBinder key) {
+ remove(key, true);
+ }
+
+ public void remove(IBinder key, boolean advance) {
+ if (mCurrentKey == key) {
+ Slog.d(TAG, "removed current");
+ // Showing now
+ if (advance) {
+ removeMessages(MSG_ADVANCE);
+ sendEmptyMessage(MSG_ADVANCE);
+ }
+ } else {
+ // In the queue
+ for (int i=0; i<QUEUE_LENGTH; i++) {
+ if (mKeys[i] == key) {
+ Slog.d(TAG, "removed from queue: " + i);
+ for (; i<QUEUE_LENGTH-1; i++) {
+ mKeys[i] = mKeys[i+1];
+ mQueue[i] = mQueue[i+1];
+ }
+ mKeys[QUEUE_LENGTH-1] = null;
+ mQueue[QUEUE_LENGTH-1] = null;
+ if (mQueuePos > 0) {
+ mQueuePos--;
+ }
+ break;
+ }
+ }
+ }
+ }
+
public void halt() {
removeMessages(MSG_ADVANCE);
- if (mCurrentView != null) {
- final int N = mQueue.length;
- for (int i=0; i<N; i++) {
+ if (mCurrentView != null || mQueuePos != 0) {
+ for (int i=0; i<QUEUE_LENGTH; i++) {
+ mKeys[i] = null;
mQueue[i] = null;
}
mQueuePos = 0;
@@ -110,14 +149,14 @@
if (mCurrentView != null) {
mWindow.removeView(mCurrentView);
mCurrentView = null;
+ mCurrentKey = null;
mCurrentNotification = null;
}
// In with the new...
- StatusBarNotification next = dequeue();
- while (next != null) {
- mCurrentNotification = next;
- mCurrentView = makeTickerView(next);
+ dequeue();
+ while (mCurrentNotification != null) {
+ mCurrentView = makeTickerView(mCurrentNotification);
if (mCurrentView != null) {
if (mWindow == null) {
mWindow = makeWindow();
@@ -127,31 +166,33 @@
sendEmptyMessageDelayed(MSG_ADVANCE, ADVANCE_DELAY);
break;
}
- next = dequeue();
+ dequeue();
}
// if there's nothing left, close the window
// TODO: Do this when the animation is done instead
- if (mCurrentView == null) {
+ if (mCurrentView == null && mWindow != null) {
WindowManagerImpl.getDefault().removeView(mWindow);
mWindow = null;
}
}
- private StatusBarNotification dequeue() {
- StatusBarNotification notification = mQueue[0];
+ private void dequeue() {
+ mCurrentKey = mKeys[0];
+ mCurrentNotification = mQueue[0];
if (false) {
Slog.d(TAG, "dequeue mQueuePos=" + mQueuePos + " mQueue=" + Arrays.toString(mQueue));
}
final int N = mQueuePos;
for (int i=0; i<N; i++) {
+ mKeys[i] = mKeys[i+1];
mQueue[i] = mQueue[i+1];
}
+ mKeys[N] = null;
mQueue[N] = null;
if (mQueuePos > 0) {
mQueuePos--;
}
- return notification;
}
private ViewGroup makeWindow() {
@@ -187,7 +228,7 @@
iconId = R.id.left_icon;
}
if (n.tickerView != null) {
- group = (ViewGroup)inflater.inflate(R.layout.ticker, null, false);
+ group = (ViewGroup)inflater.inflate(R.layout.status_bar_ticker_panel, null, false);
View expanded = null;
Exception exception = null;
try {
@@ -209,7 +250,7 @@
lp.gravity = Gravity.BOTTOM;
group.addView(expanded, lp);
} else if (n.tickerText != null) {
- group = (ViewGroup)inflater.inflate(R.layout.ticker_compat, mWindow, false);
+ group = (ViewGroup)inflater.inflate(R.layout.status_bar_ticker_compat, mWindow, false);
final Drawable icon = StatusBarIconView.getIcon(mContext,
new StatusBarIcon(notification.pkg, n.icon, n.iconLevel, 0));
ImageView iv = (ImageView)group.findViewById(iconId);
diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
index f892e9e..1373627 100755
--- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
+++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
@@ -588,7 +588,7 @@
// We can't initialize this in init() since the configuration hasn't been loaded yet.
if (mLongPressOnHomeBehavior < 0) {
mLongPressOnHomeBehavior
- = mContext.getResources().getInteger(R.integer.config_longPressOnPowerBehavior);
+ = mContext.getResources().getInteger(R.integer.config_longPressOnHomeBehavior);
if (mLongPressOnHomeBehavior < LONG_PRESS_HOME_NOTHING ||
mLongPressOnHomeBehavior > LONG_PRESS_HOME_RECENT_ACTIVITY) {
mLongPressOnHomeBehavior = LONG_PRESS_HOME_NOTHING;
@@ -600,7 +600,6 @@
sendCloseSystemWindows(SYSTEM_DIALOG_REASON_RECENT_APPS);
}
- // Use 3d Recents dialog
if (mLongPressOnHomeBehavior == LONG_PRESS_HOME_RECENT_DIALOG) {
// Fallback to dialog if we fail to launch the above.
if (mRecentAppsDialog == null) {
diff --git a/services/camera/libcameraservice/CameraService.cpp b/services/camera/libcameraservice/CameraService.cpp
index a0013d0..535f07f 100644
--- a/services/camera/libcameraservice/CameraService.cpp
+++ b/services/camera/libcameraservice/CameraService.cpp
@@ -277,10 +277,6 @@
void CameraService::playSound(sound_kind kind) {
LOG1("playSound(%d)", kind);
- // FIXME: temporarily disable sound while working on audio HAL issues preventing simultaneous
- // playback and record
- if (kind == SOUND_RECORDING) return;
-
Mutex::Autolock lock(mSoundLock);
sp<MediaPlayer> player = mSoundPlayer[kind];
if (player != 0) {
diff --git a/services/java/com/android/server/ScreenRotationAnimation.java b/services/java/com/android/server/ScreenRotationAnimation.java
index 299567a..1cc6a2a 100644
--- a/services/java/com/android/server/ScreenRotationAnimation.java
+++ b/services/java/com/android/server/ScreenRotationAnimation.java
@@ -16,6 +16,7 @@
package com.android.server; // TODO: use com.android.server.wm, once things move there
+import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
@@ -28,38 +29,60 @@
import android.view.Display;
import android.view.Surface;
import android.view.SurfaceSession;
+import android.view.animation.Animation;
+import android.view.animation.AnimationUtils;
+import android.view.animation.Transformation;
class ScreenRotationAnimation {
- private static final String TAG = "ScreenRotationAnimation";
+ static final String TAG = "ScreenRotationAnimation";
+ static final boolean DEBUG = false;
+ final Context mContext;
+ final Display mDisplay;
Surface mSurface;
int mWidth, mHeight;
- int mBaseRotation;
+ int mSnapshotRotation;
+ int mSnapshotDeltaRotation;
+ int mOriginalRotation;
+ int mOriginalWidth, mOriginalHeight;
int mCurRotation;
- int mDeltaRotation;
- final Matrix mMatrix = new Matrix();
+ Animation mExitAnimation;
+ final Transformation mExitTransformation = new Transformation();
+ Animation mEnterAnimation;
+ final Transformation mEnterTransformation = new Transformation();
+ boolean mStarted;
+
+ final DisplayMetrics mDisplayMetrics = new DisplayMetrics();
+ final Matrix mSnapshotInitialMatrix = new Matrix();
+ final Matrix mSnapshotFinalMatrix = new Matrix();
final float[] mTmpFloats = new float[9];
- public ScreenRotationAnimation(Display display, SurfaceSession session) {
- final DisplayMetrics dm = new DisplayMetrics();
- display.getMetrics(dm);
+ public ScreenRotationAnimation(Context context, Display display, SurfaceSession session) {
+ mContext = context;
+ mDisplay = display;
+
+ display.getMetrics(mDisplayMetrics);
Bitmap screenshot = Surface.screenshot(0, 0);
if (screenshot != null) {
// Screenshot does NOT include rotation!
- mBaseRotation = 0;
+ mSnapshotRotation = 0;
mWidth = screenshot.getWidth();
mHeight = screenshot.getHeight();
} else {
// Just in case.
- mBaseRotation = display.getRotation();
- mWidth = dm.widthPixels;
- mHeight = dm.heightPixels;
+ mSnapshotRotation = display.getRotation();
+ mWidth = mDisplayMetrics.widthPixels;
+ mHeight = mDisplayMetrics.heightPixels;
}
+ mOriginalRotation = display.getRotation();
+ mOriginalWidth = mDisplayMetrics.widthPixels;
+ mOriginalHeight = mDisplayMetrics.heightPixels;
+
Surface.openTransaction();
if (mSurface != null) {
mSurface.destroy();
@@ -102,43 +125,24 @@
screenshot.recycle();
}
- // Must be called while in a transaction.
- public void setRotation(int rotation) {
- mCurRotation = rotation;
- int delta = mCurRotation - mBaseRotation;
+ static int deltaRotation(int oldRotation, int newRotation) {
+ int delta = newRotation - oldRotation;
if (delta < 0) delta += 4;
- mDeltaRotation = delta;
+ return delta;
+ }
- switch (delta) {
- case Surface.ROTATION_0:
- mMatrix.reset();
- break;
- case Surface.ROTATION_90:
- mMatrix.setRotate(90, 0, 0);
- mMatrix.postTranslate(0, mWidth);
- break;
- case Surface.ROTATION_180:
- mMatrix.setRotate(180, 0, 0);
- mMatrix.postTranslate(mWidth, mHeight);
- break;
- case Surface.ROTATION_270:
- mMatrix.setRotate(270, 0, 0);
- mMatrix.postTranslate(mHeight, 0);
- break;
- }
-
- mMatrix.getValues(mTmpFloats);
+ void setSnapshotTransform(Matrix matrix, float alpha) {
+ matrix.getValues(mTmpFloats);
mSurface.setPosition((int)mTmpFloats[Matrix.MTRANS_X],
(int)mTmpFloats[Matrix.MTRANS_Y]);
mSurface.setMatrix(
- mTmpFloats[Matrix.MSCALE_X], mTmpFloats[Matrix.MSKEW_X],
- mTmpFloats[Matrix.MSKEW_Y], mTmpFloats[Matrix.MSCALE_Y]);
-
- if (false) {
+ mTmpFloats[Matrix.MSCALE_X], mTmpFloats[Matrix.MSKEW_Y],
+ mTmpFloats[Matrix.MSKEW_X], mTmpFloats[Matrix.MSCALE_Y]);
+ mSurface.setAlpha(alpha);
+ if (DEBUG) {
float[] srcPnts = new float[] { 0, 0, mWidth, mHeight };
- float[] dstPnts = new float[8];
- mMatrix.mapPoints(dstPnts, srcPnts);
- Slog.i(TAG, "**** ROTATION: " + delta);
+ float[] dstPnts = new float[4];
+ matrix.mapPoints(dstPnts, srcPnts);
Slog.i(TAG, "Original : (" + srcPnts[0] + "," + srcPnts[1]
+ ")-(" + srcPnts[2] + "," + srcPnts[3] + ")");
Slog.i(TAG, "Transformed: (" + dstPnts[0] + "," + dstPnts[1]
@@ -146,7 +150,165 @@
}
}
- public void dismiss() {
- mSurface.destroy();
+ // Must be called while in a transaction.
+ public void setRotation(int rotation) {
+ mCurRotation = rotation;
+
+ // Compute the transformation matrix that must be applied
+ // to the snapshot to make it stay in the same original position
+ // with the current screen rotation.
+ int delta = deltaRotation(rotation, mSnapshotRotation);
+ switch (delta) {
+ case Surface.ROTATION_0:
+ mSnapshotInitialMatrix.reset();
+ break;
+ case Surface.ROTATION_90:
+ mSnapshotInitialMatrix.setRotate(90, 0, 0);
+ mSnapshotInitialMatrix.postTranslate(mHeight, 0);
+ break;
+ case Surface.ROTATION_180:
+ mSnapshotInitialMatrix.setRotate(180, 0, 0);
+ mSnapshotInitialMatrix.postTranslate(mWidth, mHeight);
+ break;
+ case Surface.ROTATION_270:
+ mSnapshotInitialMatrix.setRotate(270, 0, 0);
+ mSnapshotInitialMatrix.postTranslate(0, mWidth);
+ break;
+ }
+
+ if (DEBUG) Slog.v(TAG, "**** ROTATION: " + delta);
+ setSnapshotTransform(mSnapshotInitialMatrix, 1.0f);
+ }
+
+ /**
+ * Returns true if animating.
+ */
+ public boolean dismiss(long maxAnimationDuration, float animationScale) {
+ // Figure out how the screen has moved from the original rotation.
+ int delta = deltaRotation(mCurRotation, mOriginalRotation);
+ if (false && delta == 0) {
+ // Nothing changed, just remove the snapshot.
+ if (mSurface != null) {
+ mSurface.destroy();
+ mSurface = null;
+ }
+ return false;
+ }
+
+ switch (delta) {
+ case Surface.ROTATION_0:
+ mExitAnimation = AnimationUtils.loadAnimation(mContext,
+ com.android.internal.R.anim.screen_rotate_0_exit);
+ mEnterAnimation = AnimationUtils.loadAnimation(mContext,
+ com.android.internal.R.anim.screen_rotate_0_enter);
+ break;
+ case Surface.ROTATION_90:
+ mExitAnimation = AnimationUtils.loadAnimation(mContext,
+ com.android.internal.R.anim.screen_rotate_plus_90_exit);
+ mEnterAnimation = AnimationUtils.loadAnimation(mContext,
+ com.android.internal.R.anim.screen_rotate_plus_90_enter);
+ break;
+ case Surface.ROTATION_180:
+ mExitAnimation = AnimationUtils.loadAnimation(mContext,
+ com.android.internal.R.anim.screen_rotate_180_exit);
+ mEnterAnimation = AnimationUtils.loadAnimation(mContext,
+ com.android.internal.R.anim.screen_rotate_180_enter);
+ break;
+ case Surface.ROTATION_270:
+ mExitAnimation = AnimationUtils.loadAnimation(mContext,
+ com.android.internal.R.anim.screen_rotate_minus_90_exit);
+ mEnterAnimation = AnimationUtils.loadAnimation(mContext,
+ com.android.internal.R.anim.screen_rotate_minus_90_enter);
+ break;
+ }
+
+ mDisplay.getMetrics(mDisplayMetrics);
+
+ // Initialize the animations. This is a hack, redefining what "parent"
+ // means to allow supplying the last and next size. In this definition
+ // "%p" is the original (let's call it "previous") size, and "%" is the
+ // screen's current/new size.
+ mEnterAnimation.initialize(mDisplayMetrics.widthPixels, mDisplayMetrics.heightPixels,
+ mOriginalWidth, mOriginalHeight);
+ mExitAnimation.initialize(mDisplayMetrics.widthPixels, mDisplayMetrics.heightPixels,
+ mOriginalWidth, mOriginalHeight);
+ mStarted = false;
+
+ mExitAnimation.restrictDuration(maxAnimationDuration);
+ mExitAnimation.scaleCurrentDuration(animationScale);
+ mEnterAnimation.restrictDuration(maxAnimationDuration);
+ mEnterAnimation.scaleCurrentDuration(animationScale);
+
+ return true;
+ }
+
+ public void kill() {
+ if (mSurface != null) {
+ mSurface.destroy();
+ mSurface = null;
+ }
+ if (mExitAnimation != null) {
+ mExitAnimation.cancel();
+ mExitAnimation = null;
+ }
+ if (mEnterAnimation != null) {
+ mEnterAnimation.cancel();
+ mEnterAnimation = null;
+ }
+ }
+
+ public boolean isAnimating() {
+ return mEnterAnimation != null || mExitAnimation != null;
+ }
+
+ public boolean stepAnimation(long now) {
+ if (mEnterAnimation == null && mExitAnimation == null) {
+ return false;
+ }
+
+ if (!mStarted) {
+ mEnterAnimation.setStartTime(now);
+ mExitAnimation.setStartTime(now);
+ mStarted = true;
+ }
+
+ mExitTransformation.clear();
+ boolean moreExit = false;
+ if (mExitAnimation != null) {
+ moreExit = mExitAnimation.getTransformation(now, mExitTransformation);
+ if (DEBUG) Slog.v(TAG, "Stepped exit: " + mExitTransformation);
+ if (!moreExit) {
+ if (DEBUG) Slog.v(TAG, "Exit animation done!");
+ mExitAnimation.cancel();
+ mExitAnimation = null;
+ mExitTransformation.clear();
+ if (mSurface != null) {
+ mSurface.destroy();
+ mSurface = null;
+ }
+ }
+ }
+
+ mEnterTransformation.clear();
+ boolean moreEnter = false;
+ if (mEnterAnimation != null) {
+ moreEnter = mEnterAnimation.getTransformation(now, mEnterTransformation);
+ if (!moreEnter) {
+ mEnterAnimation.cancel();
+ mEnterAnimation = null;
+ mEnterTransformation.clear();
+ }
+ }
+
+ if (mSurface != null) {
+ mSnapshotFinalMatrix.setConcat(mExitTransformation.getMatrix(), mSnapshotInitialMatrix);
+ setSnapshotTransform(mSnapshotFinalMatrix, mExitTransformation.getAlpha());
+ }
+
+ return moreEnter || moreExit;
+ }
+
+ public Transformation getEnterTransformation() {
+ return mEnterTransformation;
}
}
diff --git a/services/java/com/android/server/WindowManagerService.java b/services/java/com/android/server/WindowManagerService.java
index 89512ae..cbb35c6 100644
--- a/services/java/com/android/server/WindowManagerService.java
+++ b/services/java/com/android/server/WindowManagerService.java
@@ -7487,8 +7487,10 @@
}
}
+ final boolean screenAnimation = mScreenRotationAnimation != null
+ && mScreenRotationAnimation.isAnimating();
if (selfTransformation || attachedTransformation != null
- || appTransformation != null) {
+ || appTransformation != null || screenAnimation) {
// cache often used attributes locally
final Rect frame = mFrame;
final float tmpFloats[] = mTmpFloats;
@@ -7506,6 +7508,10 @@
if (appTransformation != null) {
tmpMatrix.postConcat(appTransformation.getMatrix());
}
+ if (screenAnimation) {
+ tmpMatrix.postConcat(
+ mScreenRotationAnimation.getEnterTransformation().getMatrix());
+ }
// "convert" it into SurfaceFlinger's format
// (a 2x2 matrix + an offset)
@@ -7515,8 +7521,8 @@
tmpMatrix.getValues(tmpFloats);
mDsDx = tmpFloats[Matrix.MSCALE_X];
- mDtDx = tmpFloats[Matrix.MSKEW_X];
- mDsDy = tmpFloats[Matrix.MSKEW_Y];
+ mDtDx = tmpFloats[Matrix.MSKEW_Y];
+ mDsDy = tmpFloats[Matrix.MSKEW_X];
mDtDy = tmpFloats[Matrix.MSCALE_Y];
int x = (int)tmpFloats[Matrix.MTRANS_X] + mXOffset;
int y = (int)tmpFloats[Matrix.MTRANS_Y] + mYOffset;
@@ -7544,6 +7550,10 @@
if (appTransformation != null) {
mShownAlpha *= appTransformation.getAlpha();
}
+ if (screenAnimation) {
+ mShownAlpha *=
+ mScreenRotationAnimation.getEnterTransformation().getAlpha();
+ }
} else {
//Slog.i(TAG, "Not applying alpha transform");
}
@@ -9397,6 +9407,16 @@
animating = tokensAnimating;
+ if (mScreenRotationAnimation != null) {
+ if (mScreenRotationAnimation.isAnimating()) {
+ if (mScreenRotationAnimation.stepAnimation(currentTime)) {
+ animating = true;
+ } else {
+ mScreenRotationAnimation = null;
+ }
+ }
+ }
+
boolean tokenMayBeDrawn = false;
boolean wallpaperMayChange = false;
boolean forceHiding = false;
@@ -10841,8 +10861,13 @@
}
if (CUSTOM_SCREEN_ROTATION) {
+ if (mScreenRotationAnimation != null && mScreenRotationAnimation.isAnimating()) {
+ mScreenRotationAnimation.kill();
+ mScreenRotationAnimation = null;
+ }
if (mScreenRotationAnimation == null) {
- mScreenRotationAnimation = new ScreenRotationAnimation(mDisplay, mFxSession);
+ mScreenRotationAnimation = new ScreenRotationAnimation(mContext,
+ mDisplay, mFxSession);
}
} else {
Surface.freezeDisplay(0);
@@ -10866,8 +10891,12 @@
if (CUSTOM_SCREEN_ROTATION) {
if (mScreenRotationAnimation != null) {
- mScreenRotationAnimation.dismiss();
- mScreenRotationAnimation = null;
+ if (mScreenRotationAnimation.dismiss(MAX_ANIMATION_DURATION,
+ mTransitionAnimationScale)) {
+ requestAnimationLocked(0);
+ } else {
+ mScreenRotationAnimation = null;
+ }
}
} else {
Surface.unfreezeDisplay(0);
diff --git a/telephony/java/com/android/internal/telephony/DataConnectionTracker.java b/telephony/java/com/android/internal/telephony/DataConnectionTracker.java
index cc01bc5..069e1b8 100644
--- a/telephony/java/com/android/internal/telephony/DataConnectionTracker.java
+++ b/telephony/java/com/android/internal/telephony/DataConnectionTracker.java
@@ -110,7 +110,7 @@
public static final int EVENT_CLEAN_UP_CONNECTION = 34;
protected static final int EVENT_CDMA_OTA_PROVISION = 35;
protected static final int EVENT_RESTART_RADIO = 36;
- protected static final int EVENT_SET_MASTER_DATA_ENABLE = 37;
+ protected static final int EVENT_SET_INTERNAL_DATA_ENABLE = 37;
protected static final int EVENT_RESET_DONE = 38;
/***** Constants *****/
@@ -126,8 +126,9 @@
protected static final int DISABLED = 0;
protected static final int ENABLED = 1;
- // responds to the setDataEnabled call - used independently from the APN requests
- protected boolean mMasterDataEnabled = true;
+ // responds to the setInternalDataEnabled call - used internally to turn off data
+ // for example during emergency calls
+ protected boolean mInternalDataEnabled = true;
protected boolean[] dataEnabled = new boolean[APN_NUM_TYPES];
@@ -489,9 +490,9 @@
onCleanUpConnection(tearDown, (String) msg.obj);
break;
- case EVENT_SET_MASTER_DATA_ENABLE:
+ case EVENT_SET_INTERNAL_DATA_ENABLE:
boolean enabled = (msg.arg1 == ENABLED) ? true : false;
- onSetDataEnabled(enabled);
+ onSetInternalDataEnabled(enabled);
break;
case EVENT_RESET_DONE:
@@ -505,23 +506,13 @@
}
/**
- * Report the current state of data connectivity (enabled or disabled)
- *
- * @return {@code false} if data connectivity has been explicitly disabled,
- * {@code true} otherwise.
- */
- public synchronized boolean getDataEnabled() {
- return (mMasterDataEnabled && dataEnabled[APN_DEFAULT_ID]);
- }
-
- /**
* Report on whether data connectivity is enabled
*
* @return {@code false} if data connectivity has been explicitly disabled,
* {@code true} otherwise.
*/
public synchronized boolean getAnyDataEnabled() {
- return (mMasterDataEnabled && (enabledCount != 0));
+ return (mInternalDataEnabled && (enabledCount != 0));
}
protected abstract void startNetStatPoll();
@@ -676,7 +667,7 @@
*/
protected boolean isDataPossible() {
boolean possible = (isDataAllowed()
- && !(getDataEnabled() && (mState == State.FAILED || mState == State.IDLE)));
+ && !(getAnyDataEnabled() && (mState == State.FAILED || mState == State.IDLE)));
if (!possible && DBG && isDataAllowed()) {
log("Data not possible. No coverage: dataState = " + mState);
}
@@ -847,20 +838,20 @@
* {@code false}) data
* @return {@code true} if the operation succeeded
*/
- public boolean setDataEnabled(boolean enable) {
+ public boolean setInternalDataEnabled(boolean enable) {
if (DBG)
- log("setDataEnabled(" + enable + ")");
+ log("setInternalDataEnabled(" + enable + ")");
- Message msg = obtainMessage(EVENT_SET_MASTER_DATA_ENABLE);
+ Message msg = obtainMessage(EVENT_SET_INTERNAL_DATA_ENABLE);
msg.arg1 = (enable ? ENABLED : DISABLED);
sendMessage(msg);
return true;
}
- protected void onSetDataEnabled(boolean enable) {
- if (mMasterDataEnabled != enable) {
+ protected void onSetInternalDataEnabled(boolean enable) {
+ if (mInternalDataEnabled != enable) {
synchronized (this) {
- mMasterDataEnabled = enable;
+ mInternalDataEnabled = enable;
}
if (enable) {
mRetryMgr.resetRetryCount();
diff --git a/telephony/java/com/android/internal/telephony/Phone.java b/telephony/java/com/android/internal/telephony/Phone.java
index 69b7de6..25ad48d 100644
--- a/telephony/java/com/android/internal/telephony/Phone.java
+++ b/telephony/java/com/android/internal/telephony/Phone.java
@@ -1325,36 +1325,6 @@
SimulatedRadioControl getSimulatedRadioControl();
/**
- * Allow mobile data connections.
- * @return {@code true} if the operation started successfully
- * <br/>{@code false} if it
- * failed immediately.<br/>
- * Even in the {@code true} case, it may still fail later
- * during setup, in which case an asynchronous indication will
- * be supplied.
- */
- boolean enableDataConnectivity();
-
- /**
- * Disallow mobile data connections, and terminate any that
- * are in progress.
- * @return {@code true} if the operation started successfully
- * <br/>{@code false} if it
- * failed immediately.<br/>
- * Even in the {@code true} case, it may still fail later
- * during setup, in which case an asynchronous indication will
- * be supplied.
- */
- boolean disableDataConnectivity();
-
- /**
- * Report the current state of data connectivity (enabled or disabled)
- * @return {@code false} if data connectivity has been explicitly disabled,
- * {@code true} otherwise.
- */
- boolean isDataConnectivityEnabled();
-
- /**
* Enables the specified APN type. Only works for "special" APN types,
* i.e., not the default APN.
* @param type The desired APN type. Cannot be {@link #APN_TYPE_DEFAULT}.
diff --git a/telephony/java/com/android/internal/telephony/PhoneBase.java b/telephony/java/com/android/internal/telephony/PhoneBase.java
index fe4fdb3..fce7b9b 100644
--- a/telephony/java/com/android/internal/telephony/PhoneBase.java
+++ b/telephony/java/com/android/internal/telephony/PhoneBase.java
@@ -941,10 +941,6 @@
logUnexpectedCdmaMethodCall("unsetOnEcbModeExitResponse");
}
- public boolean isDataConnectivityEnabled() {
- return mDataConnection.getDataEnabled();
- }
-
public String[] getActiveApnTypes() {
return mDataConnection.getActiveApnTypes();
}
diff --git a/telephony/java/com/android/internal/telephony/PhoneProxy.java b/telephony/java/com/android/internal/telephony/PhoneProxy.java
index 2e79762..219efbb 100644
--- a/telephony/java/com/android/internal/telephony/PhoneProxy.java
+++ b/telephony/java/com/android/internal/telephony/PhoneProxy.java
@@ -650,14 +650,6 @@
return mActivePhone.getSimulatedRadioControl();
}
- public boolean enableDataConnectivity() {
- return mActivePhone.enableDataConnectivity();
- }
-
- public boolean disableDataConnectivity() {
- return mActivePhone.disableDataConnectivity();
- }
-
public int enableApnType(String type) {
return mActivePhone.enableApnType(type);
}
@@ -666,10 +658,6 @@
return mActivePhone.disableApnType(type);
}
- public boolean isDataConnectivityEnabled() {
- return mActivePhone.isDataConnectivityEnabled();
- }
-
public boolean isDataConnectivityPossible() {
return mActivePhone.isDataConnectivityPossible();
}
diff --git a/telephony/java/com/android/internal/telephony/cdma/CDMAPhone.java b/telephony/java/com/android/internal/telephony/cdma/CDMAPhone.java
index 099bc30..1e77589 100755
--- a/telephony/java/com/android/internal/telephony/cdma/CDMAPhone.java
+++ b/telephony/java/com/android/internal/telephony/cdma/CDMAPhone.java
@@ -478,10 +478,6 @@
return mSST.cellLoc;
}
- public boolean disableDataConnectivity() {
- return mDataConnection.setDataEnabled(false);
- }
-
public CdmaCall getForegroundCall() {
return mCT.foregroundCall;
}
@@ -761,21 +757,6 @@
return ret;
}
- public boolean enableDataConnectivity() {
-
- // block data activities when phone is in emergency callback mode
- if (mIsPhoneInEcmState) {
- Intent intent = new Intent(TelephonyIntents.ACTION_SHOW_NOTICE_ECM_BLOCK_OTHERS);
- ActivityManagerNative.broadcastStickyIntent(intent, null);
- return false;
- } else if ((mCT.state == Phone.State.OFFHOOK) && mCT.isInEmergencyCall()) {
- // Do not allow data call to be enabled when emergency call is going on
- return false;
- } else {
- return mDataConnection.setDataEnabled(true);
- }
- }
-
public boolean getIccRecordsLoaded() {
return mRuimRecords.getRecordsLoaded();
}
@@ -921,7 +902,7 @@
// send an Intent
sendEmergencyCallbackModeChange();
// Re-initiate data connection
- mDataConnection.setDataEnabled(true);
+ mDataConnection.setInternalDataEnabled(true);
}
}
diff --git a/telephony/java/com/android/internal/telephony/cdma/CdmaCallTracker.java b/telephony/java/com/android/internal/telephony/cdma/CdmaCallTracker.java
index 325c2e1..a89f783 100644
--- a/telephony/java/com/android/internal/telephony/cdma/CdmaCallTracker.java
+++ b/telephony/java/com/android/internal/telephony/cdma/CdmaCallTracker.java
@@ -1058,7 +1058,7 @@
if (PhoneNumberUtils.isEmergencyNumber(dialString)) {
if (Phone.DEBUG_PHONE) log("disableDataCallInEmergencyCall");
mIsInEmergencyCall = true;
- phone.disableDataConnectivity();
+ phone.mDataConnection.setInternalDataEnabled(false);
}
}
@@ -1075,8 +1075,7 @@
}
if (inEcm.compareTo("false") == 0) {
// Re-initiate data connection
- // TODO - can this be changed to phone.enableDataConnectivity();
- phone.mDataConnection.setDataEnabled(true);
+ phone.mDataConnection.setInternalDataEnabled(true);
}
}
}
diff --git a/telephony/java/com/android/internal/telephony/cdma/CdmaDataConnectionTracker.java b/telephony/java/com/android/internal/telephony/cdma/CdmaDataConnectionTracker.java
index f7664ca5..b005cd3 100644
--- a/telephony/java/com/android/internal/telephony/cdma/CdmaDataConnectionTracker.java
+++ b/telephony/java/com/android/internal/telephony/cdma/CdmaDataConnectionTracker.java
@@ -204,7 +204,7 @@
(mCdmaPhone.mSST.isConcurrentVoiceAndData() ||
mPhone.getState() == Phone.State.IDLE) &&
!roaming &&
- mMasterDataEnabled &&
+ mInternalDataEnabled &&
desiredPowerState &&
!mPendingRestartRadio &&
!mCdmaPhone.needsOtaServiceProvisioning();
@@ -222,7 +222,7 @@
reason += " - concurrentVoiceAndData not allowed and state= " + mPhone.getState();
}
if (roaming) reason += " - Roaming";
- if (!mMasterDataEnabled) reason += " - mMasterDataEnabled= false";
+ if (!mInternalDataEnabled) reason += " - mInternalDataEnabled= false";
if (!desiredPowerState) reason += " - desiredPowerState= false";
if (mPendingRestartRadio) reason += " - mPendingRestartRadio= true";
if (mCdmaPhone.needsOtaServiceProvisioning()) reason += " - needs Provisioning";
diff --git a/telephony/java/com/android/internal/telephony/gsm/GSMPhone.java b/telephony/java/com/android/internal/telephony/gsm/GSMPhone.java
index fc03d1a..628f11a 100644
--- a/telephony/java/com/android/internal/telephony/gsm/GSMPhone.java
+++ b/telephony/java/com/android/internal/telephony/gsm/GSMPhone.java
@@ -1084,14 +1084,6 @@
mDataConnection.setDataOnRoamingEnabled(enable);
}
- public boolean enableDataConnectivity() {
- return mDataConnection.setDataEnabled(true);
- }
-
- public boolean disableDataConnectivity() {
- return mDataConnection.setDataEnabled(false);
- }
-
/**
* Removes the given MMI from the pending list and notifies
* registrants that it is complete.
diff --git a/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java b/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java
index b41402c..4713c24 100644
--- a/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java
+++ b/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java
@@ -284,7 +284,7 @@
(gprsState == ServiceState.STATE_IN_SERVICE || mAutoAttachOnCreation) &&
mGsmPhone.mSIMRecords.getRecordsLoaded() &&
mPhone.getState() == Phone.State.IDLE &&
- mMasterDataEnabled &&
+ mInternalDataEnabled &&
(!mPhone.getServiceState().getRoaming() || getDataOnRoamingEnabled()) &&
!mIsPsRestricted &&
desiredPowerState;
@@ -297,7 +297,7 @@
if (mPhone.getState() != Phone.State.IDLE) {
reason += " - PhoneState= " + mPhone.getState();
}
- if (!mMasterDataEnabled) reason += " - mMasterDataEnabled= false";
+ if (!mInternalDataEnabled) reason += " - mInternalDataEnabled= false";
if (mPhone.getServiceState().getRoaming() && !getDataOnRoamingEnabled()) {
reason += " - Roaming and data roaming not enabled";
}
diff --git a/tools/layoutlib/bridge/src/android/graphics/Canvas_Delegate.java b/tools/layoutlib/bridge/src/android/graphics/Canvas_Delegate.java
index 08f3c7a..b901e0d 100644
--- a/tools/layoutlib/bridge/src/android/graphics/Canvas_Delegate.java
+++ b/tools/layoutlib/bridge/src/android/graphics/Canvas_Delegate.java
@@ -366,13 +366,59 @@
/*package*/ static void native_concat(int nCanvas, int nMatrix) {
- // FIXME
- throw new UnsupportedOperationException();
+ // get the delegate from the native int.
+ Canvas_Delegate canvasDelegate = sManager.getDelegate(nCanvas);
+ if (canvasDelegate == null) {
+ assert false;
+ return;
+ }
+
+ Matrix_Delegate matrixDelegate = Matrix_Delegate.getDelegate(nMatrix);
+ if (matrixDelegate == null) {
+ assert false;
+ return;
+ }
+
+ // get the current top graphics2D object.
+ Graphics2D g = canvasDelegate.getGraphics2d();
+
+ // get its current matrix
+ AffineTransform currentTx = g.getTransform();
+ // get the AffineTransform of the given matrix
+ AffineTransform matrixTx = matrixDelegate.getAffineTransform();
+
+ // combine them so that the given matrix is applied after.
+ currentTx.preConcatenate(matrixTx);
+
+ // give it to the graphics2D as a new matrix replacing all previous transform
+ g.setTransform(currentTx);
}
/*package*/ static void native_setMatrix(int nCanvas, int nMatrix) {
- // FIXME
- throw new UnsupportedOperationException();
+ // get the delegate from the native int.
+ Canvas_Delegate canvasDelegate = sManager.getDelegate(nCanvas);
+ if (canvasDelegate == null) {
+ assert false;
+ }
+
+ Matrix_Delegate matrixDelegate = Matrix_Delegate.getDelegate(nMatrix);
+ if (matrixDelegate == null) {
+ assert false;
+ }
+
+ // get the current top graphics2D object.
+ Graphics2D g = canvasDelegate.getGraphics2d();
+
+ // get the AffineTransform of the given matrix
+ AffineTransform matrixTx = matrixDelegate.getAffineTransform();
+
+ // give it to the graphics2D as a new matrix replacing all previous transform
+ g.setTransform(matrixTx);
+
+ // FIXME: log
+// if (mLogger != null && matrixDelegate.hasPerspective()) {
+// mLogger.warning("android.graphics.Canvas#setMatrix(android.graphics.Matrix) only supports affine transformations in the Layout Editor.");
+// }
}
/*package*/ static boolean native_clipRect(int nCanvas,
diff --git a/tools/layoutlib/bridge/src/android/graphics/Matrix_Delegate.java b/tools/layoutlib/bridge/src/android/graphics/Matrix_Delegate.java
index 6e80268..b2333f6 100644
--- a/tools/layoutlib/bridge/src/android/graphics/Matrix_Delegate.java
+++ b/tools/layoutlib/bridge/src/android/graphics/Matrix_Delegate.java
@@ -64,7 +64,7 @@
return null;
}
- return getAffineTransform(delegate);
+ return delegate.getAffineTransform();
}
public static boolean hasPerspective(Matrix m) {
@@ -74,7 +74,7 @@
return false;
}
- return (delegate.mValues[6] != 0 || delegate.mValues[7] != 0 || delegate.mValues[8] != 1);
+ return delegate.hasPerspective();
}
/**
@@ -106,6 +106,18 @@
return true;
}
+ /**
+ * Returns an {@link AffineTransform} matching the matrix.
+ */
+ public AffineTransform getAffineTransform() {
+ return getAffineTransform(mValues);
+ }
+
+ public boolean hasPerspective() {
+ return (mValues[6] != 0 || mValues[7] != 0 || mValues[8] != 1);
+ }
+
+
// ---- native methods ----
@@ -599,7 +611,7 @@
try {
- AffineTransform affineTransform = getAffineTransform(d);
+ AffineTransform affineTransform = d.getAffineTransform();
AffineTransform inverseTransform = affineTransform.createInverse();
inv_mtx.mValues[0] = (float)inverseTransform.getScaleX();
inv_mtx.mValues[1] = (float)inverseTransform.getShearX();
@@ -713,10 +725,6 @@
// ---- Private helper methods ----
- private static AffineTransform getAffineTransform(Matrix_Delegate d) {
- return getAffineTransform(d.mValues);
- }
-
/*package*/ static AffineTransform getAffineTransform(float[] matrix) {
// the AffineTransform constructor takes the value in a different order
// for a matrix [ 0 1 2 ]
diff --git a/tools/layoutlib/bridge/src/android/os/Handler_Delegate.java b/tools/layoutlib/bridge/src/android/os/Handler_Delegate.java
new file mode 100644
index 0000000..4d4ec7f4
--- /dev/null
+++ b/tools/layoutlib/bridge/src/android/os/Handler_Delegate.java
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.os;
+
+
+/**
+ * Delegate overriding selected methods of android.os.Handler
+ *
+ * Through the layoutlib_create tool, selected methods of Handler have been replaced
+ * by calls to methods of the same name in this delegate class.
+ *
+ *
+ */
+public class Handler_Delegate {
+
+ // -------- Delegate methods
+
+ /*package*/ static boolean sendMessageAtTime(Handler handler, Message msg, long uptimeMillis) {
+ // get the callback
+ IHandlerCallback callback = sCallbacks.get();
+ if (callback != null) {
+ callback.sendMessageAtTime(handler, msg, uptimeMillis);
+ }
+ return true;
+ }
+
+ // -------- Delegate implementation
+
+ public interface IHandlerCallback {
+ void sendMessageAtTime(Handler handler, Message msg, long uptimeMillis);
+ }
+
+ private final static ThreadLocal<IHandlerCallback> sCallbacks =
+ new ThreadLocal<IHandlerCallback>();
+
+ public static void setCallback(IHandlerCallback callback) {
+ sCallbacks.set(callback);
+ }
+
+}
diff --git a/tools/layoutlib/bridge/src/android/os/SystemClock_Delegate.java b/tools/layoutlib/bridge/src/android/os/SystemClock_Delegate.java
new file mode 100644
index 0000000..be222fc
--- /dev/null
+++ b/tools/layoutlib/bridge/src/android/os/SystemClock_Delegate.java
@@ -0,0 +1,66 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.os;
+
+import com.android.layoutlib.bridge.impl.DelegateManager;
+
+/**
+ * Delegate implementing the native methods of android.os.SystemClock
+ *
+ * Through the layoutlib_create tool, the original native methods of SystemClock have been replaced
+ * by calls to methods of the same name in this delegate class.
+ *
+ * Because it's a stateless class to start with, there's no need to keep a {@link DelegateManager}
+ * around to map int to instance of the delegate.
+ *
+ */
+public class SystemClock_Delegate {
+ private static long sBootTime = System.currentTimeMillis();
+
+ /*package*/ static boolean setCurrentTimeMillis(long millis) {
+ return true;
+ }
+
+ /**
+ * Returns milliseconds since boot, not counting time spent in deep sleep.
+ * <b>Note:</b> This value may get reset occasionally (before it would
+ * otherwise wrap around).
+ *
+ * @return milliseconds of non-sleep uptime since boot.
+ */
+ /*package*/ static long uptimeMillis() {
+ return System.currentTimeMillis() - sBootTime;
+ }
+
+ /**
+ * Returns milliseconds since boot, including time spent in sleep.
+ *
+ * @return elapsed milliseconds since boot.
+ */
+ /*package*/ static long elapsedRealtime() {
+ return System.currentTimeMillis() - sBootTime;
+ }
+
+ /**
+ * Returns milliseconds running in the current thread.
+ *
+ * @return elapsed milliseconds in the thread
+ */
+ /*package*/ static long currentThreadTimeMillis() {
+ return System.currentTimeMillis();
+ }
+}
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/Bridge.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/Bridge.java
index 35ba73d..2de1cbb 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/Bridge.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/Bridge.java
@@ -40,6 +40,7 @@
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
+import java.util.concurrent.locks.ReentrantLock;
/**
* Main entry point of the LayoutLib Bridge.
@@ -57,6 +58,12 @@
}
/**
+ * Lock to ensure only one rendering/inflating happens at a time.
+ * This is due to some singleton in the Android framework.
+ */
+ private final static ReentrantLock sLock = new ReentrantLock();
+
+ /**
* Maps from id to resource name/type. This is for android.R only.
*/
private final static Map<Integer, String[]> sRMap = new HashMap<Integer, String[]>();
@@ -160,7 +167,6 @@
BridgeAssetManager.initSystem();
-
// When DEBUG_LAYOUT is set and is not 0 or false, setup a default listener
// on static (native) methods which prints the signature on the console and
// throws an exception.
@@ -252,27 +258,6 @@
}
/**
- * Sets a 9 patch chunk in a project cache or in the framework cache.
- * @param value the path of the 9 patch
- * @param ninePatch the 9 patch object
- * @param projectKey the key of the project, or null to put the bitmap in the framework cache.
- */
- public static void setCached9Patch(String value, NinePatchChunk ninePatch, Object projectKey) {
- if (projectKey != null) {
- Map<String, SoftReference<NinePatchChunk>> map = sProject9PatchCache.get(projectKey);
-
- if (map == null) {
- map = new HashMap<String, SoftReference<NinePatchChunk>>();
- sProject9PatchCache.put(projectKey, map);
- }
-
- map.put(value, new SoftReference<NinePatchChunk>(ninePatch));
- } else {
- sFramework9PatchCache.put(value, new SoftReference<NinePatchChunk>(ninePatch));
- }
- }
-
- /**
* Starts a layout session by inflating and rendering it. The method returns a
* {@link ILayoutScene} on which further actions can be taken.
*
@@ -306,27 +291,25 @@
public BridgeLayoutScene createScene(SceneParams params) {
try {
SceneResult lastResult = SceneResult.SUCCESS;
- LayoutSceneImpl scene = null;
- synchronized (this) {
- try {
- scene = new LayoutSceneImpl(params);
-
- scene.prepare();
+ LayoutSceneImpl scene = new LayoutSceneImpl(params);
+ try {
+ scene.prepareThread();
+ lastResult = scene.init(params.getTimeout());
+ if (lastResult == SceneResult.SUCCESS) {
lastResult = scene.inflate();
if (lastResult == SceneResult.SUCCESS) {
lastResult = scene.render();
}
- } finally {
- if (scene != null) {
- scene.cleanup();
- }
}
+ } finally {
+ scene.release();
+ scene.cleanupThread();
}
- return new BridgeLayoutScene(this, scene, lastResult);
+ return new BridgeLayoutScene(scene, lastResult);
} catch (Throwable t) {
t.printStackTrace();
- return new BridgeLayoutScene(this, null, new SceneResult("error!", t));
+ return new BridgeLayoutScene(null, new SceneResult("error!", t));
}
}
@@ -343,6 +326,13 @@
}
/**
+ * Returns the lock for the bridge
+ */
+ public static ReentrantLock getLock() {
+ return sLock;
+ }
+
+ /**
* Returns details of a framework resource from its integer value.
* @param value the integer value
* @return an array of 2 strings containing the resource name and type, or null if the id
@@ -461,4 +451,27 @@
return null;
}
+
+ /**
+ * Sets a 9 patch chunk in a project cache or in the framework cache.
+ * @param value the path of the 9 patch
+ * @param ninePatch the 9 patch object
+ * @param projectKey the key of the project, or null to put the bitmap in the framework cache.
+ */
+ public static void setCached9Patch(String value, NinePatchChunk ninePatch, Object projectKey) {
+ if (projectKey != null) {
+ Map<String, SoftReference<NinePatchChunk>> map = sProject9PatchCache.get(projectKey);
+
+ if (map == null) {
+ map = new HashMap<String, SoftReference<NinePatchChunk>>();
+ sProject9PatchCache.put(projectKey, map);
+ }
+
+ map.put(value, new SoftReference<NinePatchChunk>(ninePatch));
+ } else {
+ sFramework9PatchCache.put(value, new SoftReference<NinePatchChunk>(ninePatch));
+ }
+ }
+
+
}
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/BridgeLayoutScene.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/BridgeLayoutScene.java
index 8b67166..97bf857 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/BridgeLayoutScene.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/BridgeLayoutScene.java
@@ -17,6 +17,7 @@
package com.android.layoutlib.bridge;
import com.android.layoutlib.api.LayoutScene;
+import com.android.layoutlib.api.SceneParams;
import com.android.layoutlib.api.SceneResult;
import com.android.layoutlib.api.ViewInfo;
import com.android.layoutlib.bridge.impl.LayoutSceneImpl;
@@ -33,7 +34,6 @@
*/
public class BridgeLayoutScene extends LayoutScene {
- private final Bridge mBridge;
private final LayoutSceneImpl mScene;
private SceneResult mLastResult;
@@ -58,15 +58,34 @@
}
@Override
- public SceneResult render() {
-
- synchronized (mBridge) {
- try {
- mScene.prepare();
+ public SceneResult render(long timeout) {
+ try {
+ mScene.prepareThread();
+ mLastResult = mScene.acquire(timeout);
+ if (mLastResult == SceneResult.SUCCESS) {
mLastResult = mScene.render();
- } finally {
- mScene.cleanup();
}
+ } finally {
+ mScene.release();
+ mScene.cleanupThread();
+ }
+
+ return mLastResult;
+ }
+
+ @Override
+ public SceneResult animate(Object targetObject, String animationName,
+ boolean isFrameworkAnimation, IAnimationListener listener) {
+ try {
+ mScene.prepareThread();
+ mLastResult = mScene.acquire(SceneParams.DEFAULT_TIMEOUT);
+ if (mLastResult == SceneResult.SUCCESS) {
+ mLastResult = mScene.animate(targetObject, animationName, isFrameworkAnimation,
+ listener);
+ }
+ } finally {
+ mScene.release();
+ mScene.cleanupThread();
}
return mLastResult;
@@ -78,8 +97,7 @@
}
- /*package*/ BridgeLayoutScene(Bridge bridge, LayoutSceneImpl scene, SceneResult lastResult) {
- mBridge = bridge;
+ /*package*/ BridgeLayoutScene(LayoutSceneImpl scene, SceneResult lastResult) {
mScene = scene;
mLastResult = lastResult;
}
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeResources.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeResources.java
index 1011173..affd1c6 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeResources.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeResources.java
@@ -261,6 +261,41 @@
}
@Override
+ public XmlResourceParser getAnimation(int id) throws NotFoundException {
+ IResourceValue value = getResourceValue(id, mPlatformResourceFlag);
+
+ if (value != null) {
+ XmlPullParser parser = null;
+
+ try {
+ File xml = new File(value.getValue());
+ if (xml.isFile()) {
+ // we need to create a pull parser around the layout XML file, and then
+ // give that to our XmlBlockParser
+ parser = new KXmlParser();
+ parser.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, true);
+ parser.setInput(new FileReader(xml));
+
+ return new BridgeXmlBlockParser(parser, mContext, mPlatformResourceFlag[0]);
+ }
+ } catch (XmlPullParserException e) {
+ mContext.getLogger().error(e);
+ // we'll return null below.
+ } catch (FileNotFoundException e) {
+ // this shouldn't happen since we check above.
+ }
+
+ }
+
+ // id was not found or not resolved. Throw a NotFoundException.
+ throwException(id);
+
+ // this is not used since the method above always throws
+ return null;
+ }
+
+
+ @Override
public TypedArray obtainAttributes(AttributeSet set, int[] attrs) {
return mContext.obtainStyledAttributes(set, attrs);
}
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/AnimationThread.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/AnimationThread.java
new file mode 100644
index 0000000..c20bdfd
--- /dev/null
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/AnimationThread.java
@@ -0,0 +1,121 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.layoutlib.bridge.impl;
+
+import com.android.layoutlib.api.SceneResult;
+import com.android.layoutlib.api.LayoutScene.IAnimationListener;
+
+import android.animation.Animator;
+import android.animation.ValueAnimator;
+import android.os.Handler;
+import android.os.Handler_Delegate;
+import android.os.Message;
+import android.os.Handler_Delegate.IHandlerCallback;
+
+import java.util.LinkedList;
+import java.util.Queue;
+
+public class AnimationThread extends Thread {
+
+ private static class MessageBundle {
+ final Handler mTarget;
+ final Message mMessage;
+ final long mUptimeMillis;
+
+ MessageBundle(Handler target, Message message, long uptimeMillis) {
+ mTarget = target;
+ mMessage = message;
+ mUptimeMillis = uptimeMillis;
+ }
+ }
+
+ private final LayoutSceneImpl mScene;
+ private final Animator mAnimator;
+
+ Queue<MessageBundle> mQueue = new LinkedList<MessageBundle>();
+ private final IAnimationListener mListener;
+
+ public AnimationThread(LayoutSceneImpl scene, Animator animator, IAnimationListener listener) {
+ mScene = scene;
+ mAnimator = animator;
+ mListener = listener;
+ }
+
+ @Override
+ public void run() {
+ mScene.prepareThread();
+ try {
+ Handler_Delegate.setCallback(new IHandlerCallback() {
+ public void sendMessageAtTime(Handler handler, Message msg, long uptimeMillis) {
+ if (msg.what == ValueAnimator.ANIMATION_START ||
+ msg.what == ValueAnimator.ANIMATION_FRAME) {
+ mQueue.add(new MessageBundle(handler, msg, uptimeMillis));
+ } else {
+ // just ignore.
+ }
+ }
+ });
+
+ // start the animation. This will send a message to the handler right away, so
+ // mQueue is filled when this method returns.
+ mAnimator.start();
+
+ // loop the animation
+ do {
+ // get the next message.
+ MessageBundle bundle = mQueue.poll();
+ if (bundle == null) {
+ break;
+ }
+
+ // sleep enough for this bundle to be on time
+ long currentTime = System.currentTimeMillis();
+ if (currentTime < bundle.mUptimeMillis) {
+ try {
+ sleep(bundle.mUptimeMillis - currentTime);
+ } catch (InterruptedException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+
+ // ready to do the work, acquire the scene.
+ SceneResult result = mScene.acquire(250);
+ if (result != SceneResult.SUCCESS) {
+ mListener.done(result);
+ return;
+ }
+
+ // process the bundle. If the animation is not finished, this will enqueue
+ // the next message, so mQueue will have another one.
+ try {
+ bundle.mTarget.handleMessage(bundle.mMessage);
+ if (mScene.render() == SceneResult.SUCCESS) {
+ mListener.onNewFrame(mScene.getImage());
+ }
+ } finally {
+ mScene.release();
+ }
+ } while (mQueue.size() > 0);
+
+ mListener.done(SceneResult.SUCCESS);
+ } finally {
+ Handler_Delegate.setCallback(null);
+ mScene.cleanupThread();
+ }
+ }
+}
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/LayoutSceneImpl.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/LayoutSceneImpl.java
index f7d249e..0859976 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/LayoutSceneImpl.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/LayoutSceneImpl.java
@@ -16,6 +16,10 @@
package com.android.layoutlib.bridge.impl;
+import static com.android.layoutlib.api.SceneResult.SceneStatus.ERROR_LOCK_INTERRUPTED;
+import static com.android.layoutlib.api.SceneResult.SceneStatus.ERROR_TIMEOUT;
+import static com.android.layoutlib.api.SceneResult.SceneStatus.SUCCESS;
+
import com.android.internal.util.XmlUtils;
import com.android.layoutlib.api.IProjectCallback;
import com.android.layoutlib.api.IResourceValue;
@@ -25,7 +29,9 @@
import com.android.layoutlib.api.SceneResult;
import com.android.layoutlib.api.ViewInfo;
import com.android.layoutlib.api.IDensityBasedResourceValue.Density;
+import com.android.layoutlib.api.LayoutScene.IAnimationListener;
import com.android.layoutlib.api.SceneParams.RenderingMode;
+import com.android.layoutlib.bridge.Bridge;
import com.android.layoutlib.bridge.BridgeConstants;
import com.android.layoutlib.bridge.android.BridgeContext;
import com.android.layoutlib.bridge.android.BridgeInflater;
@@ -33,6 +39,8 @@
import com.android.layoutlib.bridge.android.BridgeWindowSession;
import com.android.layoutlib.bridge.android.BridgeXmlBlockParser;
+import android.animation.AnimatorInflater;
+import android.animation.ObjectAnimator;
import android.app.Fragment_Delegate;
import android.graphics.Bitmap;
import android.graphics.Bitmap_Delegate;
@@ -59,6 +67,8 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.locks.ReentrantLock;
/**
* Class managing a layout "scene".
@@ -73,6 +83,12 @@
private static final int DEFAULT_TITLE_BAR_HEIGHT = 25;
private static final int DEFAULT_STATUS_BAR_HEIGHT = 25;
+ /**
+ * The current context being rendered. This is set through {@link #acquire(long)} and
+ * {@link #init(long)}, and unset in {@link #release()}.
+ */
+ private static BridgeContext sCurrentContext = null;
+
private final SceneParams mParams;
// scene state
@@ -98,22 +114,35 @@
/**
* Creates a layout scene with all the information coming from the layout bridge API.
- *
- * This also calls {@link LayoutSceneImpl#prepare()}.
* <p>
- * <b>THIS MUST BE INSIDE A SYNCHRONIZED BLOCK on the BRIDGE OBJECT.<b>
+ * This <b>must</b> be followed by a call to {@link LayoutSceneImpl#init()}, which act as a
+ * call to {@link LayoutSceneImpl#acquire(long)}
*
* @see LayoutBridge#createScene(com.android.layoutlib.api.SceneParams)
*/
public LayoutSceneImpl(SceneParams params) {
- // we need to make sure the Looper has been initialized for this thread.
- // this is required for View that creates Handler objects.
- if (Looper.myLooper() == null) {
- Looper.prepare();
- }
-
// copy the params.
mParams = new SceneParams(params);
+ }
+
+ /**
+ * Initializes and acquires the scene, creating various Android objects such as context,
+ * inflater, and parser.
+ *
+ * @param timeout the time to wait if another rendering is happening.
+ *
+ * @return whether the scene was prepared
+ *
+ * @see #acquire(long)
+ * @see #release()
+ */
+ public SceneResult init(long timeout) {
+ // acquire the lock. if the result is null, lock was just acquired, otherwise, return
+ // the result.
+ SceneResult result = acquireLock(timeout);
+ if (result != null) {
+ return result;
+ }
// setup the display Metrics.
DisplayMetrics metrics = new DisplayMetrics();
@@ -138,6 +167,9 @@
mParams.getProjectResources(), mParams.getFrameworkResources(),
styleParentMap, mParams.getProjectCallback(), mParams.getLogger());
+ // set the current rendering context
+ sCurrentContext = mContext;
+
// make sure the Resources object references the context (and other objects) for this
// scene
mContext.initResources();
@@ -149,7 +181,8 @@
mWindowBackground = mContext.findItemInStyle(mCurrentTheme, "windowBackground");
mWindowBackground = mContext.resolveResValue(mWindowBackground);
- mScreenOffset = getScreenOffset(mParams.getFrameworkResources(), mCurrentTheme, mContext);
+ mScreenOffset = getScreenOffset(mParams.getFrameworkResources(), mCurrentTheme,
+ mContext);
}
// build the inflater and parser.
@@ -159,44 +192,144 @@
mBlockParser = new BridgeXmlBlockParser(mParams.getLayoutDescription(),
mContext, false /* platformResourceFlag */);
+
+ return SceneResult.SUCCESS;
}
/**
- * Prepares the scene for action.
- * <p>
- * <b>THIS MUST BE INSIDE A SYNCHRONIZED BLOCK on the BRIDGE OBJECT.<b>
+ * Prepares the current thread for rendering.
+ *
+ * Note that while this can be called several time, the first call to {@link #cleanupThread()}
+ * will do the clean-up, and make the thread unable to do further scene actions.
*/
- public void prepare() {
+ public void prepareThread() {
// we need to make sure the Looper has been initialized for this thread.
// this is required for View that creates Handler objects.
if (Looper.myLooper() == null) {
Looper.prepare();
}
+ }
+
+ /**
+ * Cleans up thread-specific data. After this, the thread cannot be used for scene actions.
+ * <p>
+ * Note that it doesn't matter how many times {@link #prepareThread()} was called, a single
+ * call to this will prevent the thread from doing further scene actions
+ */
+ public void cleanupThread() {
+ // clean up the looper
+ Looper.sThreadLocal.remove();
+ }
+
+ /**
+ * Prepares the scene for action.
+ * <p>
+ * This call is blocking if another rendering/inflating is currently happening, and will return
+ * whether the preparation worked.
+ *
+ * The preparation can fail if another rendering took too long and the timeout was elapsed.
+ *
+ * More than one call to this from the same thread will have no effect and will return
+ * {@link SceneResult#SUCCESS}.
+ *
+ * After scene actions have taken place, only one call to {@link #release()} must be
+ * done.
+ *
+ * @param timeout the time to wait if another rendering is happening.
+ *
+ * @return whether the scene was prepared
+ *
+ * @see #release()
+ *
+ * @throws IllegalStateException if {@link #init(long)} was never called.
+ */
+ public SceneResult acquire(long timeout) {
+ if (mContext == null) {
+ throw new IllegalStateException("After scene creation, #init() must be called");
+ }
+
+ // acquire the lock. if the result is null, lock was just acquired, otherwise, return
+ // the result.
+ SceneResult result = acquireLock(timeout);
+ if (result != null) {
+ return result;
+ }
// make sure the Resources object references the context (and other objects) for this
// scene
mContext.initResources();
+ sCurrentContext = mContext;
+
+ return SUCCESS.getResult();
+ }
+
+ /**
+ * Acquire the lock so that the scene can be acted upon.
+ * <p>
+ * This returns null if the lock was just acquired, otherwise it returns
+ * {@link SceneResult#SUCCESS} if the lock already belonged to that thread, or another
+ * instance (see {@link SceneResult#getStatus()}) if an error occurred.
+ *
+ * @param timeout the time to wait if another rendering is happening.
+ * @return null if the lock was just acquire or another result depending on the state.
+ *
+ * @throws IllegalStateException if the current context is different than the one owned by
+ * the scene.
+ */
+ private SceneResult acquireLock(long timeout) {
+ ReentrantLock lock = Bridge.getLock();
+ if (lock.isHeldByCurrentThread() == false) {
+ try {
+ boolean acquired = lock.tryLock(timeout, TimeUnit.MILLISECONDS);
+
+ if (acquired == false) {
+ return ERROR_TIMEOUT.getResult();
+ }
+ } catch (InterruptedException e) {
+ return ERROR_LOCK_INTERRUPTED.getResult();
+ }
+ } else {
+ // This thread holds the lock already. Checks that this wasn't for a different context.
+ // If this is called by init, mContext will be null and so should sCurrentContext
+ // anyway
+ if (mContext != sCurrentContext) {
+ throw new IllegalStateException("Acquiring different scenes from same thread without releases");
+ }
+ return SUCCESS.getResult();
+ }
+
+ return null;
}
/**
* Cleans up the scene after an action.
- * <p>
- * <b>THIS MUST BE INSIDE A SYNCHRONIZED BLOCK on the BRIDGE OBJECT.<b>
*/
- public void cleanup() {
- // clean up the looper
- Looper.sThreadLocal.remove();
+ public void release() {
+ ReentrantLock lock = Bridge.getLock();
- // Make sure to remove static references, otherwise we could not unload the lib
- mContext.disposeResources();
+ // with the use of finally blocks, it is possible to find ourself calling this
+ // without a successful call to prepareScene. This test makes sure that unlock() will
+ // not throw IllegalMonitorStateException.
+ if (lock.isHeldByCurrentThread()) {
+ // Make sure to remove static references, otherwise we could not unload the lib
+ mContext.disposeResources();
+ sCurrentContext = null;
+
+ lock.unlock();
+ }
}
/**
* Inflates the layout.
* <p>
- * <b>THIS MUST BE INSIDE A SYNCHRONIZED BLOCK on the BRIDGE OBJECT.<b>
+ * {@link #acquire(long)} must have been called before this.
+ *
+ * @throws IllegalStateException if the current context is different than the one owned by
+ * the scene, or if {@link #init(long)} was not called.
*/
public SceneResult inflate() {
+ checkLock();
+
try {
mViewRoot = new FrameLayout(mContext);
@@ -247,10 +380,16 @@
/**
* Renders the scene.
* <p>
- * <b>THIS MUST BE INSIDE A SYNCHRONIZED BLOCK on the BRIDGE OBJECT.<b>
+ * {@link #acquire(long)} must have been called before this.
+ *
+ * @throws IllegalStateException if the current context is different than the one owned by
+ * the scene, or if {@link #acquire(long)} was not called.
*/
public SceneResult render() {
+ checkLock();
+
try {
+ long current = System.currentTimeMillis();
if (mViewRoot == null) {
return new SceneResult("Layout has not been inflated!");
}
@@ -329,6 +468,8 @@
mViewInfo = visit(((ViewGroup)mViewRoot).getChildAt(0), mContext);
+ System.out.println("rendering (ms): " + (System.currentTimeMillis() - current));
+
// success!
return SceneResult.SUCCESS;
} catch (Throwable e) {
@@ -346,6 +487,71 @@
}
/**
+ * Animate an object
+ * <p>
+ * {@link #acquire(long)} must have been called before this.
+ *
+ * @throws IllegalStateException if the current context is different than the one owned by
+ * the scene, or if {@link #acquire(long)} was not called.
+ */
+ public SceneResult animate(Object targetObject, String animationName,
+ boolean isFrameworkAnimation, IAnimationListener listener) {
+ checkLock();
+
+ // find the animation file.
+ IResourceValue animationResource = null;
+ int animationId = 0;
+ if (isFrameworkAnimation) {
+ animationResource = mContext.getFrameworkResource("anim", animationName);
+ if (animationResource != null) {
+ animationId = Bridge.getResourceValue("anim", animationName);
+ }
+ } else {
+ animationResource = mContext.getProjectResource("anim", animationName);
+ if (animationResource != null) {
+ animationId = mContext.getProjectCallback().getResourceValue("anim", animationName);
+ }
+ }
+
+ if (animationResource != null) {
+ try {
+ ObjectAnimator anim = (ObjectAnimator) AnimatorInflater.loadAnimator(
+ mContext, animationId);
+ if (anim != null) {
+ anim.setTarget(targetObject);
+
+ new AnimationThread(this, anim, listener).start();
+
+ return SceneResult.SUCCESS;
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ return new SceneResult("", e);
+ }
+ }
+
+ return new SceneResult("Failed to find animation");
+ }
+
+ /**
+ * Checks that the lock is owned by the current thread and that the current context is the one
+ * from this scene.
+ *
+ * @throws IllegalStateException if the current context is different than the one owned by
+ * the scene, or if {@link #acquire(long)} was not called.
+ */
+ private void checkLock() {
+ ReentrantLock lock = Bridge.getLock();
+ if (lock.isHeldByCurrentThread() == false) {
+ throw new IllegalStateException("scene must be acquired first. see #acquire(long)");
+ }
+ if (sCurrentContext != mContext) {
+ throw new IllegalStateException("Thread acquired a scene but is rendering a different one");
+ }
+ }
+
+
+ /**
* Compute style information from the given list of style for the project and framework.
* @param themeName the name of the current theme. In order to differentiate project and
* platform themes sharing the same name, all project themes must be prepended with
diff --git a/tools/layoutlib/create/src/com/android/tools/layoutlib/create/CreateInfo.java b/tools/layoutlib/create/src/com/android/tools/layoutlib/create/CreateInfo.java
index bb2e6b3..4440685 100644
--- a/tools/layoutlib/create/src/com/android/tools/layoutlib/create/CreateInfo.java
+++ b/tools/layoutlib/create/src/com/android/tools/layoutlib/create/CreateInfo.java
@@ -95,6 +95,7 @@
*/
private final static String[] DELEGATE_METHODS = new String[] {
"android.app.Fragment#instantiate", //(Landroid/content/Context;Ljava/lang/String;Landroid/os/Bundle;)Landroid/app/Fragment;",
+ "android.os.Handler#sendMessageAtTime",
"android.view.View#isInEditMode",
// TODO: comment out once DelegateClass is working
// "android.content.res.Resources$Theme#obtainStyledAttributes",
@@ -118,6 +119,7 @@
"android.graphics.SweepGradient",
"android.graphics.Typeface",
"android.graphics.Xfermode",
+ "android.os.SystemClock",
"android.util.FloatMath",
};