Merge "Handle fatal errors from calling bccRegisterSymbolCallback (if any)." into honeycomb
diff --git a/api/11.xml b/api/11.xml
index d668883..52d48b6 100644
--- a/api/11.xml
+++ b/api/11.xml
@@ -13977,17 +13977,6 @@
visibility="public"
>
</field>
-<field name="up"
- type="int"
- transient="false"
- volatile="false"
- value="16908334"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
<field name="widget_frame"
type="int"
transient="false"
@@ -21602,17 +21591,6 @@
<parameter name="setSelected" type="boolean">
</parameter>
</method>
-<method name="getCustomNavigationView"
- return="android.view.View"
- abstract="true"
- native="false"
- synchronized="false"
- static="false"
- final="false"
- deprecated="deprecated"
- visibility="public"
->
-</method>
<method name="getCustomView"
return="android.view.View"
abstract="true"
@@ -21679,17 +21657,6 @@
visibility="public"
>
</method>
-<method name="getSelectedNavigationItem"
- return="int"
- abstract="true"
- native="false"
- synchronized="false"
- static="false"
- final="false"
- deprecated="deprecated"
- visibility="public"
->
-</method>
<method name="getSelectedTab"
return="android.app.ActionBar.Tab"
abstract="true"
@@ -21856,19 +21823,6 @@
<parameter name="d" type="android.graphics.drawable.Drawable">
</parameter>
</method>
-<method name="setCustomNavigationMode"
- return="void"
- abstract="true"
- native="false"
- synchronized="false"
- static="false"
- final="false"
- deprecated="deprecated"
- visibility="public"
->
-<parameter name="view" type="android.view.View">
-</parameter>
-</method>
<method name="setCustomView"
return="void"
abstract="true"
@@ -22003,38 +21957,6 @@
<parameter name="useLogo" type="boolean">
</parameter>
</method>
-<method name="setDropdownNavigationMode"
- return="void"
- abstract="true"
- native="false"
- synchronized="false"
- static="false"
- final="false"
- deprecated="deprecated"
- visibility="public"
->
-<parameter name="adapter" type="android.widget.SpinnerAdapter">
-</parameter>
-<parameter name="callback" type="android.app.ActionBar.OnNavigationListener">
-</parameter>
-</method>
-<method name="setDropdownNavigationMode"
- return="void"
- abstract="true"
- native="false"
- synchronized="false"
- static="false"
- final="false"
- deprecated="deprecated"
- visibility="public"
->
-<parameter name="adapter" type="android.widget.SpinnerAdapter">
-</parameter>
-<parameter name="callback" type="android.app.ActionBar.OnNavigationListener">
-</parameter>
-<parameter name="defaultSelectedPosition" type="int">
-</parameter>
-</method>
<method name="setListNavigationCallbacks"
return="void"
abstract="true"
@@ -22076,17 +21998,6 @@
<parameter name="position" type="int">
</parameter>
</method>
-<method name="setStandardNavigationMode"
- return="void"
- abstract="true"
- native="false"
- synchronized="false"
- static="false"
- final="false"
- deprecated="deprecated"
- visibility="public"
->
-</method>
<method name="setSubtitle"
return="void"
abstract="true"
@@ -22113,17 +22024,6 @@
<parameter name="resId" type="int">
</parameter>
</method>
-<method name="setTabNavigationMode"
- return="void"
- abstract="true"
- native="false"
- synchronized="false"
- static="false"
- final="false"
- deprecated="deprecated"
- visibility="public"
->
-</method>
<method name="setTitle"
return="void"
abstract="true"
@@ -22161,17 +22061,6 @@
visibility="public"
>
</method>
-<field name="DISPLAY_HIDE_HOME"
- type="int"
- transient="false"
- volatile="false"
- value="4096"
- static="true"
- final="true"
- deprecated="deprecated"
- visibility="public"
->
-</field>
<field name="DISPLAY_HOME_AS_UP"
type="int"
transient="false"
@@ -22227,17 +22116,6 @@
visibility="public"
>
</field>
-<field name="NAVIGATION_MODE_DROPDOWN_LIST"
- type="int"
- transient="false"
- volatile="false"
- value="1"
- static="true"
- final="true"
- deprecated="deprecated"
- visibility="public"
->
-</field>
<field name="NAVIGATION_MODE_LIST"
type="int"
transient="false"
@@ -39712,6 +39590,16 @@
visibility="public"
>
</field>
+<field name="previewImage"
+ type="int"
+ transient="false"
+ volatile="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
<field name="provider"
type="android.content.ComponentName"
transient="false"
@@ -146705,6 +146593,17 @@
visibility="public"
>
</method>
+<method name="detectActivityLeaks"
+ return="android.os.StrictMode.VmPolicy.Builder"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</method>
<method name="detectAll"
return="android.os.StrictMode.VmPolicy.Builder"
abstract="false"
@@ -163566,6 +163465,17 @@
visibility="public"
>
</field>
+<field name="EXTRA_INPUT_METHOD_ID"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value=""input_method_id""
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
</class>
<class name="Settings.NameValueTable"
extends="java.lang.Object"
@@ -168715,7 +168625,7 @@
deprecated="not deprecated"
visibility="public"
>
-<parameter name="v" type="android.renderscript.Int2">
+<parameter name="v" type="android.renderscript.Long2">
</parameter>
</method>
<method name="addU32"
@@ -168728,7 +168638,7 @@
deprecated="not deprecated"
visibility="public"
>
-<parameter name="v" type="android.renderscript.Int3">
+<parameter name="v" type="android.renderscript.Long3">
</parameter>
</method>
<method name="addU32"
@@ -168741,7 +168651,7 @@
deprecated="not deprecated"
visibility="public"
>
-<parameter name="v" type="android.renderscript.Int4">
+<parameter name="v" type="android.renderscript.Long4">
</parameter>
</method>
<method name="addU64"
@@ -231394,8 +231304,21 @@
visibility="public"
>
</method>
-<method name="getSubtypes"
- return="java.util.ArrayList<android.view.inputmethod.InputMethodSubtype>"
+<method name="getSubtypeAt"
+ return="android.view.inputmethod.InputMethodSubtype"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="index" type="int">
+</parameter>
+</method>
+<method name="getSubtypeCount"
+ return="int"
abstract="false"
native="false"
synchronized="false"
@@ -249455,7 +249378,7 @@
deprecated="not deprecated"
visibility="public"
>
-<parameter name="onValueChangedListener" type="android.widget.NumberPicker.OnValueChangedListener">
+<parameter name="onValueChangedListener" type="android.widget.NumberPicker.OnValueChangeListener">
</parameter>
</method>
<method name="setValue"
@@ -249562,7 +249485,7 @@
>
</field>
</interface>
-<interface name="NumberPicker.OnValueChangedListener"
+<interface name="NumberPicker.OnValueChangeListener"
abstract="true"
static="true"
final="false"
@@ -253747,19 +253670,6 @@
<parameter name="listener" type="android.widget.SearchView.OnCloseListener">
</parameter>
</method>
-<method name="setOnQueryChangeListener"
- return="void"
- abstract="false"
- native="false"
- synchronized="false"
- static="false"
- final="false"
- deprecated="not deprecated"
- visibility="public"
->
-<parameter name="listener" type="android.widget.SearchView.OnQueryChangeListener">
-</parameter>
-</method>
<method name="setOnQueryTextFocusChangeListener"
return="void"
abstract="false"
@@ -253773,6 +253683,19 @@
<parameter name="listener" type="android.view.View.OnFocusChangeListener">
</parameter>
</method>
+<method name="setOnQueryTextListener"
+ return="void"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="listener" type="android.widget.SearchView.OnQueryTextListener">
+</parameter>
+</method>
<method name="setOnSearchClickListener"
return="void"
abstract="false"
@@ -253786,7 +253709,7 @@
<parameter name="listener" type="android.view.View.OnClickListener">
</parameter>
</method>
-<method name="setOnSuggestionSelectionListener"
+<method name="setOnSuggestionListener"
return="void"
abstract="false"
native="false"
@@ -253796,7 +253719,7 @@
deprecated="not deprecated"
visibility="public"
>
-<parameter name="listener" type="android.widget.SearchView.OnSuggestionSelectionListener">
+<parameter name="listener" type="android.widget.SearchView.OnSuggestionListener">
</parameter>
</method>
<method name="setQuery"
@@ -253899,14 +253822,14 @@
>
</method>
</interface>
-<interface name="SearchView.OnQueryChangeListener"
+<interface name="SearchView.OnQueryTextListener"
abstract="true"
static="true"
final="false"
deprecated="not deprecated"
visibility="public"
>
-<method name="onQueryTextChanged"
+<method name="onQueryTextChange"
return="boolean"
abstract="true"
native="false"
@@ -253919,7 +253842,7 @@
<parameter name="newText" type="java.lang.String">
</parameter>
</method>
-<method name="onSubmitQuery"
+<method name="onQueryTextSubmit"
return="boolean"
abstract="true"
native="false"
@@ -253933,14 +253856,14 @@
</parameter>
</method>
</interface>
-<interface name="SearchView.OnSuggestionSelectionListener"
+<interface name="SearchView.OnSuggestionListener"
abstract="true"
static="true"
final="false"
deprecated="not deprecated"
visibility="public"
>
-<method name="onSuggestionClicked"
+<method name="onSuggestionClick"
return="boolean"
abstract="true"
native="false"
@@ -253953,7 +253876,7 @@
<parameter name="position" type="int">
</parameter>
</method>
-<method name="onSuggestionSelected"
+<method name="onSuggestionSelect"
return="boolean"
abstract="true"
native="false"
@@ -260326,7 +260249,7 @@
deprecated="not deprecated"
visibility="public"
>
-<parameter name="arg0" type="T">
+<parameter name="t" type="T">
</parameter>
</method>
</interface>
diff --git a/api/current.xml b/api/current.xml
index a63a867..52d48b6 100644
--- a/api/current.xml
+++ b/api/current.xml
@@ -13977,17 +13977,6 @@
visibility="public"
>
</field>
-<field name="up"
- type="int"
- transient="false"
- volatile="false"
- value="16908334"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
<field name="widget_frame"
type="int"
transient="false"
@@ -21602,17 +21591,6 @@
<parameter name="setSelected" type="boolean">
</parameter>
</method>
-<method name="getCustomNavigationView"
- return="android.view.View"
- abstract="true"
- native="false"
- synchronized="false"
- static="false"
- final="false"
- deprecated="deprecated"
- visibility="public"
->
-</method>
<method name="getCustomView"
return="android.view.View"
abstract="true"
@@ -21679,17 +21657,6 @@
visibility="public"
>
</method>
-<method name="getSelectedNavigationItem"
- return="int"
- abstract="true"
- native="false"
- synchronized="false"
- static="false"
- final="false"
- deprecated="deprecated"
- visibility="public"
->
-</method>
<method name="getSelectedTab"
return="android.app.ActionBar.Tab"
abstract="true"
@@ -21856,19 +21823,6 @@
<parameter name="d" type="android.graphics.drawable.Drawable">
</parameter>
</method>
-<method name="setCustomNavigationMode"
- return="void"
- abstract="true"
- native="false"
- synchronized="false"
- static="false"
- final="false"
- deprecated="deprecated"
- visibility="public"
->
-<parameter name="view" type="android.view.View">
-</parameter>
-</method>
<method name="setCustomView"
return="void"
abstract="true"
@@ -22003,38 +21957,6 @@
<parameter name="useLogo" type="boolean">
</parameter>
</method>
-<method name="setDropdownNavigationMode"
- return="void"
- abstract="true"
- native="false"
- synchronized="false"
- static="false"
- final="false"
- deprecated="deprecated"
- visibility="public"
->
-<parameter name="adapter" type="android.widget.SpinnerAdapter">
-</parameter>
-<parameter name="callback" type="android.app.ActionBar.OnNavigationListener">
-</parameter>
-</method>
-<method name="setDropdownNavigationMode"
- return="void"
- abstract="true"
- native="false"
- synchronized="false"
- static="false"
- final="false"
- deprecated="deprecated"
- visibility="public"
->
-<parameter name="adapter" type="android.widget.SpinnerAdapter">
-</parameter>
-<parameter name="callback" type="android.app.ActionBar.OnNavigationListener">
-</parameter>
-<parameter name="defaultSelectedPosition" type="int">
-</parameter>
-</method>
<method name="setListNavigationCallbacks"
return="void"
abstract="true"
@@ -22076,17 +21998,6 @@
<parameter name="position" type="int">
</parameter>
</method>
-<method name="setStandardNavigationMode"
- return="void"
- abstract="true"
- native="false"
- synchronized="false"
- static="false"
- final="false"
- deprecated="deprecated"
- visibility="public"
->
-</method>
<method name="setSubtitle"
return="void"
abstract="true"
@@ -22113,17 +22024,6 @@
<parameter name="resId" type="int">
</parameter>
</method>
-<method name="setTabNavigationMode"
- return="void"
- abstract="true"
- native="false"
- synchronized="false"
- static="false"
- final="false"
- deprecated="deprecated"
- visibility="public"
->
-</method>
<method name="setTitle"
return="void"
abstract="true"
@@ -22161,17 +22061,6 @@
visibility="public"
>
</method>
-<field name="DISPLAY_HIDE_HOME"
- type="int"
- transient="false"
- volatile="false"
- value="4096"
- static="true"
- final="true"
- deprecated="deprecated"
- visibility="public"
->
-</field>
<field name="DISPLAY_HOME_AS_UP"
type="int"
transient="false"
@@ -22227,17 +22116,6 @@
visibility="public"
>
</field>
-<field name="NAVIGATION_MODE_DROPDOWN_LIST"
- type="int"
- transient="false"
- volatile="false"
- value="1"
- static="true"
- final="true"
- deprecated="deprecated"
- visibility="public"
->
-</field>
<field name="NAVIGATION_MODE_LIST"
type="int"
transient="false"
@@ -163587,6 +163465,17 @@
visibility="public"
>
</field>
+<field name="EXTRA_INPUT_METHOD_ID"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value=""input_method_id""
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
</class>
<class name="Settings.NameValueTable"
extends="java.lang.Object"
@@ -168736,7 +168625,7 @@
deprecated="not deprecated"
visibility="public"
>
-<parameter name="v" type="android.renderscript.Int2">
+<parameter name="v" type="android.renderscript.Long2">
</parameter>
</method>
<method name="addU32"
@@ -168749,7 +168638,7 @@
deprecated="not deprecated"
visibility="public"
>
-<parameter name="v" type="android.renderscript.Int3">
+<parameter name="v" type="android.renderscript.Long3">
</parameter>
</method>
<method name="addU32"
@@ -168762,7 +168651,7 @@
deprecated="not deprecated"
visibility="public"
>
-<parameter name="v" type="android.renderscript.Int4">
+<parameter name="v" type="android.renderscript.Long4">
</parameter>
</method>
<method name="addU64"
@@ -231415,8 +231304,21 @@
visibility="public"
>
</method>
-<method name="getSubtypes"
- return="java.util.ArrayList<android.view.inputmethod.InputMethodSubtype>"
+<method name="getSubtypeAt"
+ return="android.view.inputmethod.InputMethodSubtype"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="index" type="int">
+</parameter>
+</method>
+<method name="getSubtypeCount"
+ return="int"
abstract="false"
native="false"
synchronized="false"
@@ -249476,7 +249378,7 @@
deprecated="not deprecated"
visibility="public"
>
-<parameter name="onValueChangedListener" type="android.widget.NumberPicker.OnValueChangedListener">
+<parameter name="onValueChangedListener" type="android.widget.NumberPicker.OnValueChangeListener">
</parameter>
</method>
<method name="setValue"
@@ -249583,7 +249485,7 @@
>
</field>
</interface>
-<interface name="NumberPicker.OnValueChangedListener"
+<interface name="NumberPicker.OnValueChangeListener"
abstract="true"
static="true"
final="false"
@@ -253768,19 +253670,6 @@
<parameter name="listener" type="android.widget.SearchView.OnCloseListener">
</parameter>
</method>
-<method name="setOnQueryChangeListener"
- return="void"
- abstract="false"
- native="false"
- synchronized="false"
- static="false"
- final="false"
- deprecated="not deprecated"
- visibility="public"
->
-<parameter name="listener" type="android.widget.SearchView.OnQueryChangeListener">
-</parameter>
-</method>
<method name="setOnQueryTextFocusChangeListener"
return="void"
abstract="false"
@@ -253794,6 +253683,19 @@
<parameter name="listener" type="android.view.View.OnFocusChangeListener">
</parameter>
</method>
+<method name="setOnQueryTextListener"
+ return="void"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="listener" type="android.widget.SearchView.OnQueryTextListener">
+</parameter>
+</method>
<method name="setOnSearchClickListener"
return="void"
abstract="false"
@@ -253807,7 +253709,7 @@
<parameter name="listener" type="android.view.View.OnClickListener">
</parameter>
</method>
-<method name="setOnSuggestionSelectionListener"
+<method name="setOnSuggestionListener"
return="void"
abstract="false"
native="false"
@@ -253817,7 +253719,7 @@
deprecated="not deprecated"
visibility="public"
>
-<parameter name="listener" type="android.widget.SearchView.OnSuggestionSelectionListener">
+<parameter name="listener" type="android.widget.SearchView.OnSuggestionListener">
</parameter>
</method>
<method name="setQuery"
@@ -253920,14 +253822,14 @@
>
</method>
</interface>
-<interface name="SearchView.OnQueryChangeListener"
+<interface name="SearchView.OnQueryTextListener"
abstract="true"
static="true"
final="false"
deprecated="not deprecated"
visibility="public"
>
-<method name="onQueryTextChanged"
+<method name="onQueryTextChange"
return="boolean"
abstract="true"
native="false"
@@ -253940,7 +253842,7 @@
<parameter name="newText" type="java.lang.String">
</parameter>
</method>
-<method name="onSubmitQuery"
+<method name="onQueryTextSubmit"
return="boolean"
abstract="true"
native="false"
@@ -253954,14 +253856,14 @@
</parameter>
</method>
</interface>
-<interface name="SearchView.OnSuggestionSelectionListener"
+<interface name="SearchView.OnSuggestionListener"
abstract="true"
static="true"
final="false"
deprecated="not deprecated"
visibility="public"
>
-<method name="onSuggestionClicked"
+<method name="onSuggestionClick"
return="boolean"
abstract="true"
native="false"
@@ -253974,7 +253876,7 @@
<parameter name="position" type="int">
</parameter>
</method>
-<method name="onSuggestionSelected"
+<method name="onSuggestionSelect"
return="boolean"
abstract="true"
native="false"
diff --git a/core/java/android/app/ActionBar.java b/core/java/android/app/ActionBar.java
index 8d5a6da..fc5fac6 100644
--- a/core/java/android/app/ActionBar.java
+++ b/core/java/android/app/ActionBar.java
@@ -49,12 +49,6 @@
* e.g. this might be presented to the user as a dropdown list.
*/
public static final int NAVIGATION_MODE_LIST = 1;
-
- /**
- * @deprecated use NAVIGATION_MODE_LIST
- */
- @Deprecated
- public static final int NAVIGATION_MODE_DROPDOWN_LIST = 1;
/**
* Tab navigation mode. Instead of static title text this mode
@@ -81,13 +75,6 @@
public static final int DISPLAY_SHOW_HOME = 0x2;
/**
- * @deprecated Display flags are now positive for consistency - 'show' instead of 'hide'.
- * Use DISPLAY_SHOW_HOME.
- */
- @Deprecated
- public static final int DISPLAY_HIDE_HOME = 0x1000;
-
- /**
* Display the 'home' element such that it appears as an 'up' affordance.
* e.g. show an arrow to the left indicating the action that will be taken.
*
@@ -173,28 +160,6 @@
public abstract void setCustomView(int resId);
/**
- * @param view
- * @deprecated Use {@link #setCustomView(View)} and {@link #setDisplayOptions(int)} instead.
- */
- @Deprecated
- public abstract void setCustomNavigationMode(View view);
-
- /**
- * Set the action bar into dropdown navigation mode and supply an adapter
- * that will provide views for navigation choices.
- *
- * @param adapter An adapter that will provide views both to display
- * the current navigation selection and populate views
- * within the dropdown navigation menu.
- * @param callback A OnNavigationListener that will receive events when the user
- * selects a navigation item.
- * @deprecated See setListNavigationCallbacks.
- */
- @Deprecated
- public abstract void setDropdownNavigationMode(SpinnerAdapter adapter,
- OnNavigationListener callback);
-
- /**
* Set the adapter and navigation callback for list navigation mode.
*
* The supplied adapter will provide views for the expanded list as well as
@@ -213,23 +178,6 @@
OnNavigationListener callback);
/**
- * Set the action bar into dropdown navigation mode and supply an adapter that will
- * provide views for navigation choices.
- *
- * @param adapter An adapter that will provide views both to display the current
- * navigation selection and populate views within the dropdown
- * navigation menu.
- * @param callback A OnNavigationListener that will receive events when the user
- * selects a navigation item.
- * @param defaultSelectedPosition Position within the provided adapter that should be
- * selected from the outset.
- * @deprecated See setListNavigationCallbacks and setSelectedNavigationItem.
- */
- @Deprecated
- public abstract void setDropdownNavigationMode(SpinnerAdapter adapter,
- OnNavigationListener callback, int defaultSelectedPosition);
-
- /**
* Set the selected navigation item in list or tabbed navigation modes.
*
* @param position Position of the item to select.
@@ -240,15 +188,6 @@
* Get the position of the selected navigation item in list or tabbed navigation modes.
*
* @return Position of the selected item.
- * @deprecated Use {@link #getSelectedNavigationIndex()} instead.
- */
- @Deprecated
- public abstract int getSelectedNavigationItem();
-
- /**
- * Get the position of the selected navigation item in list or tabbed navigation modes.
- *
- * @return Position of the selected item.
*/
public abstract int getSelectedNavigationIndex();
@@ -260,17 +199,6 @@
public abstract int getNavigationItemCount();
/**
- * Set the action bar into standard navigation mode, using the currently set title
- * and/or subtitle.
- *
- * Standard navigation mode is default. The title is automatically set to the name of
- * your Activity on startup if an action bar is present.
- * @deprecated See setNavigationMode
- */
- @Deprecated
- public abstract void setStandardNavigationMode();
-
- /**
* Set the action bar's title. This will only be displayed if
* {@link #DISPLAY_SHOW_TITLE} is set.
*
@@ -410,13 +338,6 @@
* @param d Background drawable
*/
public abstract void setBackgroundDrawable(Drawable d);
-
- /**
- * @return The current custom navigation view.
- * @deprecated Method has been renamed. Use {@link #getCustomView()}.
- */
- @Deprecated
- public abstract View getCustomNavigationView();
/**
* @return The current custom view.
@@ -476,18 +397,6 @@
public abstract int getDisplayOptions();
/**
- * Set the action bar into tabbed navigation mode.
- *
- * @see #addTab(Tab)
- * @see #insertTab(Tab, int)
- * @see #removeTab(Tab)
- * @see #removeTabAt(int)
- *
- * @deprecated See {@link #setNavigationMode(int)}
- */
- public abstract void setTabNavigationMode();
-
- /**
* Create and return a new {@link Tab}.
* This tab will not be included in the action bar until it is added.
*
diff --git a/core/java/android/app/Activity.java b/core/java/android/app/Activity.java
index ec6eaaa..22971a2 100644
--- a/core/java/android/app/Activity.java
+++ b/core/java/android/app/Activity.java
@@ -859,7 +859,6 @@
mFragments.restoreAllState(p, mLastNonConfigurationInstances != null
? mLastNonConfigurationInstances.fragments : null);
}
- StrictMode.noteActivityClass(this.getClass());
mFragments.dispatchCreate();
mCalled = true;
}
@@ -1762,8 +1761,11 @@
/**
* Set the activity content from a layout resource. The resource will be
* inflated, adding all top-level views to the activity.
- *
+ *
* @param layoutResID Resource ID to be inflated.
+ *
+ * @see #setContentView(android.view.View)
+ * @see #setContentView(android.view.View, android.view.ViewGroup.LayoutParams)
*/
public void setContentView(int layoutResID) {
getWindow().setContentView(layoutResID);
@@ -1773,9 +1775,17 @@
/**
* Set the activity content to an explicit view. This view is placed
* directly into the activity's view hierarchy. It can itself be a complex
- * view hierarhcy.
+ * view hierarchy. When calling this method, the layout parameters of the
+ * specified view are ignored. Both the width and the height of the view are
+ * set by default to {@link ViewGroup.LayoutParams#MATCH_PARENT}. To use
+ * your own layout parameters, invoke
+ * {@link #setContentView(android.view.View, android.view.ViewGroup.LayoutParams)}
+ * instead.
*
* @param view The desired content to display.
+ *
+ * @see #setContentView(int)
+ * @see #setContentView(android.view.View, android.view.ViewGroup.LayoutParams)
*/
public void setContentView(View view) {
getWindow().setContentView(view);
@@ -1785,10 +1795,13 @@
/**
* Set the activity content to an explicit view. This view is placed
* directly into the activity's view hierarchy. It can itself be a complex
- * view hierarhcy.
+ * view hierarchy.
*
* @param view The desired content to display.
* @param params Layout parameters for the view.
+ *
+ * @see #setContentView(android.view.View)
+ * @see #setContentView(int)
*/
public void setContentView(View view, ViewGroup.LayoutParams params) {
getWindow().setContentView(view, params);
diff --git a/core/java/android/app/ActivityThread.java b/core/java/android/app/ActivityThread.java
index 7cf60f9..2389f01 100644
--- a/core/java/android/app/ActivityThread.java
+++ b/core/java/android/app/ActivityThread.java
@@ -1616,6 +1616,7 @@
java.lang.ClassLoader cl = r.packageInfo.getClassLoader();
activity = mInstrumentation.newActivity(
cl, component.getClassName(), r.intent);
+ StrictMode.incrementExpectedActivityCount(activity.getClass());
r.intent.setExtrasClassLoader(cl);
if (r.state != null) {
r.state.setClassLoader(cl);
@@ -2686,8 +2687,10 @@
private final ActivityClientRecord performDestroyActivity(IBinder token, boolean finishing,
int configChanges, boolean getNonConfigInstance) {
ActivityClientRecord r = mActivities.get(token);
+ Class activityClass = null;
if (localLOGV) Slog.v(TAG, "Performing finish of " + r);
if (r != null) {
+ activityClass = r.activity.getClass();
r.activity.mConfigChangeFlags |= configChanges;
if (finishing) {
r.activity.mFinished = true;
@@ -2765,7 +2768,7 @@
}
}
mActivities.remove(token);
-
+ StrictMode.decrementExpectedActivityCount(activityClass);
return r;
}
diff --git a/core/java/android/app/ApplicationPackageManager.java b/core/java/android/app/ApplicationPackageManager.java
index 079d4cf..50e56c7 100644
--- a/core/java/android/app/ApplicationPackageManager.java
+++ b/core/java/android/app/ApplicationPackageManager.java
@@ -570,6 +570,9 @@
} catch (NameNotFoundException e) {
Log.w("PackageManager", "Failure retrieving resources for"
+ appInfo.packageName);
+ } catch (Resources.NotFoundException e) {
+ Log.w("PackageManager", "Failure retrieving resources for"
+ + appInfo.packageName + ": " + e.getMessage());
} catch (RuntimeException e) {
// If an exception was thrown, fall through to return
// default icon.
diff --git a/core/java/android/app/FragmentBreadCrumbs.java b/core/java/android/app/FragmentBreadCrumbs.java
index 72a8e9a..3f045ac 100644
--- a/core/java/android/app/FragmentBreadCrumbs.java
+++ b/core/java/android/app/FragmentBreadCrumbs.java
@@ -29,9 +29,9 @@
/**
* Helper class for showing "bread crumbs" representing the fragment
* stack in an activity. This is intended to be used with
- * {@link ActionBar#setCustomNavigationMode(View)
- * ActionBar.setCustomNavigationMode(View)} to place the bread crumbs in
- * the navigation area of the action bar.
+ * {@link ActionBar#setCustomView(View)
+ * ActionBar.setCustomView(View)} to place the bread crumbs in
+ * the action bar.
*
* <p>The default style for this view is
* {@link android.R.style#Widget_FragmentBreadCrumbs}.
diff --git a/core/java/android/app/LoaderManager.java b/core/java/android/app/LoaderManager.java
index ffe2a5d..fc5f5fc 100644
--- a/core/java/android/app/LoaderManager.java
+++ b/core/java/android/app/LoaderManager.java
@@ -203,20 +203,25 @@
boolean mStarted;
boolean mRetaining;
boolean mRetainingStarted;
+
+ boolean mCreatingLoader;
final class LoaderInfo implements Loader.OnLoadCompleteListener<Object> {
final int mId;
final Bundle mArgs;
LoaderManager.LoaderCallbacks<Object> mCallbacks;
Loader<Object> mLoader;
+ boolean mHaveData;
+ boolean mDeliveredData;
Object mData;
- Object mDeliveredData;
boolean mStarted;
boolean mRetaining;
boolean mRetainingStarted;
boolean mDestroyed;
boolean mListenerRegistered;
+ LoaderInfo mPendingLoader;
+
public LoaderInfo(int id, Bundle args, LoaderManager.LoaderCallbacks<Object> callbacks) {
mId = id;
mArgs = args;
@@ -280,7 +285,7 @@
}
}
- if (mStarted && mData != null) {
+ if (mStarted && mHaveData) {
// This loader has retained its data, either completely across
// a configuration change or just whatever the last data set
// was after being restarted from a stop, and now at the point of
@@ -307,9 +312,9 @@
void destroy() {
if (DEBUG) Log.v(TAG, " Destroying: " + this);
mDestroyed = true;
- boolean needReset = mDeliveredData != null;
- mDeliveredData = null;
- if (mCallbacks != null && mLoader != null && mData != null && needReset) {
+ boolean needReset = mDeliveredData;
+ mDeliveredData = false;
+ if (mCallbacks != null && mLoader != null && mHaveData && needReset) {
if (DEBUG) Log.v(TAG, " Reseting: " + this);
String lastBecause = null;
if (mActivity != null) {
@@ -326,6 +331,7 @@
}
mCallbacks = null;
mData = null;
+ mHaveData = false;
if (mLoader != null) {
if (mListenerRegistered) {
mListenerRegistered = false;
@@ -333,20 +339,44 @@
}
mLoader.reset();
}
+ if (mPendingLoader != null) {
+ mPendingLoader.destroy();
+ }
}
@Override public void onLoadComplete(Loader<Object> loader, Object data) {
if (DEBUG) Log.v(TAG, "onLoadComplete: " + this);
-
+
if (mDestroyed) {
if (DEBUG) Log.v(TAG, " Ignoring load complete -- destroyed");
return;
}
+
+ if (mLoaders.get(mId) != this) {
+ // This data is not coming from the current active loader.
+ // We don't care about it.
+ if (DEBUG) Log.v(TAG, " Ignoring load complete -- not active");
+ return;
+ }
+
+ LoaderInfo pending = mPendingLoader;
+ if (pending != null) {
+ // There is a new request pending and we were just
+ // waiting for the old one to complete before starting
+ // it. So now it is time, switch over to the new loader.
+ if (DEBUG) Log.v(TAG, " Switching to pending loader: " + pending);
+ mPendingLoader = null;
+ mLoaders.put(mId, null);
+ destroy();
+ installLoader(pending);
+ return;
+ }
// Notify of the new data so the app can switch out the old data before
// we try to destroy it.
- if (data == null || mData != data) {
+ if (mData != data || !mHaveData) {
mData = data;
+ mHaveData = true;
if (mStarted) {
callOnLoadFinished(loader, data);
}
@@ -360,7 +390,7 @@
// clean it up.
LoaderInfo info = mInactiveLoaders.get(mId);
if (info != null && info != this) {
- info.mDeliveredData = null;
+ info.mDeliveredData = false;
info.destroy();
mInactiveLoaders.remove(mId);
}
@@ -382,7 +412,7 @@
mActivity.mFragments.mNoTransactionsBecause = lastBecause;
}
}
- mDeliveredData = data;
+ mDeliveredData = true;
}
}
@@ -407,13 +437,21 @@
if (mLoader != null) {
mLoader.dump(prefix + " ", fd, writer, args);
}
- writer.print(prefix); writer.print("mData="); writer.println(mData);
- writer.print(prefix); writer.print("mDeliveredData="); writer.println(mDeliveredData);
+ if (mHaveData || mDeliveredData) {
+ writer.print(prefix); writer.print("mHaveData="); writer.print(mHaveData);
+ writer.print(" mDeliveredData="); writer.println(mDeliveredData);
+ writer.print(prefix); writer.print("mData="); writer.println(mData);
+ }
writer.print(prefix); writer.print("mStarted="); writer.print(mStarted);
writer.print(" mRetaining="); writer.print(mRetaining);
writer.print(" mDestroyed="); writer.println(mDestroyed);
writer.print(prefix); writer.print("mListenerRegistered=");
writer.println(mListenerRegistered);
+ if (mPendingLoader != null) {
+ writer.print(prefix); writer.println("Pending Loader ");
+ writer.print(mPendingLoader); writer.println(":");
+ mPendingLoader.dump(prefix + " ", fd, writer, args);
+ }
}
}
@@ -429,34 +467,77 @@
private LoaderInfo createLoader(int id, Bundle args,
LoaderManager.LoaderCallbacks<Object> callback) {
LoaderInfo info = new LoaderInfo(id, args, (LoaderManager.LoaderCallbacks<Object>)callback);
- mLoaders.put(id, info);
Loader<Object> loader = callback.onCreateLoader(id, args);
info.mLoader = (Loader<Object>)loader;
+ return info;
+ }
+
+ private LoaderInfo createAndInstallLoader(int id, Bundle args,
+ LoaderManager.LoaderCallbacks<Object> callback) {
+ try {
+ mCreatingLoader = true;
+ LoaderInfo info = createLoader(id, args, callback);
+ installLoader(info);
+ return info;
+ } finally {
+ mCreatingLoader = false;
+ }
+ }
+
+ void installLoader(LoaderInfo info) {
+ mLoaders.put(info.mId, info);
if (mStarted) {
// The activity will start all existing loaders in it's onStart(),
// so only start them here if we're past that point of the activitiy's
// life cycle
info.start();
}
- return info;
}
+ /**
+ * Call to initialize a particular ID with a Loader. If this ID already
+ * has a Loader associated with it, it is left unchanged and any previous
+ * callbacks replaced with the newly provided ones. If there is not currently
+ * a Loader for the ID, a new one is created and started.
+ *
+ * <p>This function should generally be used when a component is initializing,
+ * to ensure that a Loader it relies on is created. This allows it to re-use
+ * an existing Loader's data if there already is one, so that for example
+ * when an {@link Activity} is re-created after a configuration change it
+ * does not need to re-create its loaders.
+ *
+ * <p>Note that in the case where an existing Loader is re-used, the
+ * <var>args</var> given here <em>will be ignored</em> because you will
+ * continue using the previous Loader.
+ *
+ * @param id A unique (to this LoaderManager instance) identifier under
+ * which to manage the new Loader.
+ * @param args Optional arguments that will be propagated to
+ * {@link LoaderCallbacks#onCreateLoader(int, Bundle) LoaderCallbacks.onCreateLoader()}.
+ * @param callback Interface implementing management of this Loader. Required.
+ * Its onCreateLoader() method will be called while inside of the function to
+ * instantiate the Loader object.
+ */
@SuppressWarnings("unchecked")
public <D> Loader<D> initLoader(int id, Bundle args, LoaderManager.LoaderCallbacks<D> callback) {
+ if (mCreatingLoader) {
+ throw new IllegalStateException("Called while creating a loader");
+ }
+
LoaderInfo info = mLoaders.get(id);
if (DEBUG) Log.v(TAG, "initLoader in " + this + ": args=" + args);
if (info == null) {
// Loader doesn't already exist; create.
- info = createLoader(id, args, (LoaderManager.LoaderCallbacks<Object>)callback);
+ info = createAndInstallLoader(id, args, (LoaderManager.LoaderCallbacks<Object>)callback);
if (DEBUG) Log.v(TAG, " Created new loader " + info);
} else {
if (DEBUG) Log.v(TAG, " Re-using existing loader " + info);
info.mCallbacks = (LoaderManager.LoaderCallbacks<Object>)callback;
}
- if (info.mData != null && mStarted) {
+ if (info.mHaveData && mStarted) {
// If the loader has already generated its data, report it now.
info.callOnLoadFinished(info.mLoader, info.mData);
}
@@ -464,29 +545,73 @@
return (Loader<D>)info.mLoader;
}
+ /**
+ * Call to re-create the Loader associated with a particular ID. If there
+ * is currently a Loader associated with this ID, it will be
+ * canceled/stopped/destroyed as appropriate. A new Loader with the given
+ * arguments will be created and its data delivered to you once available.
+ *
+ * <p>This function does some throttling of Loaders. If too many Loaders
+ * have been created for the given ID but not yet generated their data,
+ * new calls to this function will create and return a new Loader but not
+ * actually start it until some previous loaders have completed.
+ *
+ * <p>After calling this function, any previous Loaders associated with
+ * this ID will be considered invalid, and you will receive no further
+ * data updates from them.
+ *
+ * @param id A unique (to this LoaderManager instance) identifier under
+ * which to manage the new Loader.
+ * @param args Optional arguments that will be propagated to
+ * {@link LoaderCallbacks#onCreateLoader(int, Bundle) LoaderCallbacks.onCreateLoader()}.
+ * @param callback Interface implementing management of this Loader. Required.
+ * Its onCreateLoader() method will be called while inside of the function to
+ * instantiate the Loader object.
+ */
@SuppressWarnings("unchecked")
public <D> Loader<D> restartLoader(int id, Bundle args, LoaderManager.LoaderCallbacks<D> callback) {
+ if (mCreatingLoader) {
+ throw new IllegalStateException("Called while creating a loader");
+ }
+
LoaderInfo info = mLoaders.get(id);
if (DEBUG) Log.v(TAG, "restartLoader in " + this + ": args=" + args);
if (info != null) {
LoaderInfo inactive = mInactiveLoaders.get(id);
if (inactive != null) {
- if (info.mData != null) {
+ if (info.mHaveData) {
// This loader now has data... we are probably being
// called from within onLoadComplete, where we haven't
// yet destroyed the last inactive loader. So just do
// that now.
if (DEBUG) Log.v(TAG, " Removing last inactive loader: " + info);
- inactive.mDeliveredData = null;
+ inactive.mDeliveredData = false;
inactive.destroy();
mInactiveLoaders.put(id, info);
} else {
// We already have an inactive loader for this ID that we are
- // waiting for! Now we have three active loaders... let's just
- // drop the one in the middle, since we are still waiting for
- // its result but that result is already out of date.
- if (DEBUG) Log.v(TAG, " Removing intermediate loader: " + info);
- info.destroy();
+ // waiting for! What to do, what to do...
+ if (!info.mStarted) {
+ // The current Loader has not been started... we thus
+ // have no reason to keep it around, so bam, slam,
+ // thank-you-ma'am.
+ if (DEBUG) Log.v(TAG, " Current loader is stopped; replacing");
+ mLoaders.put(id, null);
+ info.destroy();
+ } else {
+ // Now we have three active loaders... we'll queue
+ // up this request to be processed once one of the other loaders
+ // finishes.
+ if (info.mPendingLoader != null) {
+ if (DEBUG) Log.v(TAG, " Removing pending loader: " + info.mPendingLoader);
+ info.mPendingLoader.destroy();
+ info.mPendingLoader = null;
+ }
+ if (DEBUG) Log.v(TAG, " Enqueuing as new pending loader");
+ info.mPendingLoader = createLoader(id, args,
+ (LoaderManager.LoaderCallbacks<Object>)callback);
+ return (Loader<D>)info.mPendingLoader.mLoader;
+ }
}
} else {
// Keep track of the previous instance of this loader so we can destroy
@@ -496,11 +621,22 @@
}
}
- info = createLoader(id, args, (LoaderManager.LoaderCallbacks<Object>)callback);
+ info = createAndInstallLoader(id, args, (LoaderManager.LoaderCallbacks<Object>)callback);
return (Loader<D>)info.mLoader;
}
+ /**
+ * Rip down, tear apart, shred to pieces a current Loader ID. After returning
+ * from this function, any Loader objects associated with this ID are
+ * destroyed. Any data associated with them is destroyed. You better not
+ * be using it when you do this.
+ * @param id Identifier of the Loader to be destroyed.
+ */
public void destroyLoader(int id) {
+ if (mCreatingLoader) {
+ throw new IllegalStateException("Called while creating a loader");
+ }
+
if (DEBUG) Log.v(TAG, "destroyLoader in " + this + " of " + id);
int idx = mLoaders.indexOfKey(id);
if (idx >= 0) {
@@ -516,11 +652,22 @@
}
}
+ /**
+ * Return the most recent Loader object associated with the
+ * given ID.
+ */
@SuppressWarnings("unchecked")
public <D> Loader<D> getLoader(int id) {
+ if (mCreatingLoader) {
+ throw new IllegalStateException("Called while creating a loader");
+ }
+
LoaderInfo loaderInfo = mLoaders.get(id);
if (loaderInfo != null) {
- return (Loader<D>)mLoaders.get(id).mLoader;
+ if (loaderInfo.mPendingLoader != null) {
+ return (Loader<D>)loaderInfo.mPendingLoader.mLoader;
+ }
+ return (Loader<D>)loaderInfo.mLoader;
}
return null;
}
diff --git a/core/java/android/app/SearchDialog.java b/core/java/android/app/SearchDialog.java
index 4d19b62..e95a23d 100644
--- a/core/java/android/app/SearchDialog.java
+++ b/core/java/android/app/SearchDialog.java
@@ -164,8 +164,8 @@
mSearchView = (SearchView) findViewById(com.android.internal.R.id.search_view);
mSearchView.setSubmitButtonEnabled(true);
mSearchView.setOnCloseListener(mOnCloseListener);
- mSearchView.setOnQueryChangeListener(mOnQueryChangeListener);
- mSearchView.setOnSuggestionSelectionListener(mOnSuggestionSelectionListener);
+ mSearchView.setOnQueryTextListener(mOnQueryChangeListener);
+ mSearchView.setOnSuggestionListener(mOnSuggestionSelectionListener);
// TODO: Move the badge logic to SearchView or move the badge to search_bar.xml
mBadgeLabel = (TextView) mSearchView.findViewById(com.android.internal.R.id.search_badge);
@@ -678,27 +678,27 @@
}
};
- private final SearchView.OnQueryChangeListener mOnQueryChangeListener =
- new SearchView.OnQueryChangeListener() {
+ private final SearchView.OnQueryTextListener mOnQueryChangeListener =
+ new SearchView.OnQueryTextListener() {
- public boolean onSubmitQuery(String query) {
+ public boolean onQueryTextSubmit(String query) {
dismiss();
return false;
}
- public boolean onQueryTextChanged(String newText) {
+ public boolean onQueryTextChange(String newText) {
return false;
}
};
- private final SearchView.OnSuggestionSelectionListener mOnSuggestionSelectionListener =
- new SearchView.OnSuggestionSelectionListener() {
+ private final SearchView.OnSuggestionListener mOnSuggestionSelectionListener =
+ new SearchView.OnSuggestionListener() {
- public boolean onSuggestionSelected(int position) {
+ public boolean onSuggestionSelect(int position) {
return false;
}
- public boolean onSuggestionClicked(int position) {
+ public boolean onSuggestionClick(int position) {
dismiss();
return false;
}
diff --git a/core/java/android/bluetooth/BluetoothAdapter.java b/core/java/android/bluetooth/BluetoothAdapter.java
index b2185ad..fb3744d 100644
--- a/core/java/android/bluetooth/BluetoothAdapter.java
+++ b/core/java/android/bluetooth/BluetoothAdapter.java
@@ -1025,17 +1025,18 @@
return null;
}
- /*
+ /**
* Get the profile proxy object associated with the profile.
*
- * <p>Profile can be one of {@link BluetoothProfile.HEADSET} or
- * {@link BluetoothProfile.A2DP}. Clients must implements
+ * <p>Profile can be one of {@link BluetoothProfile#HEADSET} or
+ * {@link BluetoothProfile#A2DP}. Clients must implements
* {@link BluetoothProfile.ServiceListener} to get notified of
* the connection status and to get the proxy object.
*
* @param context Context of the application
* @param listener The service Listener for connection callbacks.
- * @param profile
+ * @param profile The Bluetooth profile; either {@link BluetoothProfile#HEADSET}
+ * or {@link BluetoothProfile#A2DP}.
* @return true on success, false on error
*/
public boolean getProfileProxy(Context context, BluetoothProfile.ServiceListener listener,
diff --git a/core/java/android/inputmethodservice/InputMethodService.java b/core/java/android/inputmethodservice/InputMethodService.java
index 4d25bac..f35a438 100644
--- a/core/java/android/inputmethodservice/InputMethodService.java
+++ b/core/java/android/inputmethodservice/InputMethodService.java
@@ -393,6 +393,10 @@
if (onShowInputRequested(flags, false)) {
showWindow(true);
}
+ // If user uses hard keyboard, IME button should always be shown.
+ if (!onEvaluateInputViewShown()) {
+ mImm.setIMEButtonVisible(mToken, true);
+ }
if (resultReceiver != null) {
resultReceiver.send(wasVis != isInputViewShown()
? InputMethodManager.RESULT_SHOWN
@@ -557,7 +561,7 @@
*/
public int touchableInsets;
}
-
+
/**
* You can call this to customize the theme used by your IME's window.
* This theme should typically be one that derives from
@@ -573,7 +577,7 @@
}
mTheme = theme;
}
-
+
@Override public void onCreate() {
mTheme = Resources.selectSystemTheme(mTheme,
getApplicationInfo().targetSdkVersion,
@@ -699,6 +703,10 @@
// Otherwise hide the window.
hideWindow();
}
+ // If user uses hard keyboard, IME button should always be shown.
+ if (!onEvaluateInputViewShown()) {
+ mImm.setIMEButtonVisible(mToken, true);
+ }
}
}
@@ -1386,10 +1394,10 @@
}
mInputViewStarted = false;
mCandidatesViewStarted = false;
+ mImm.setIMEButtonVisible(mToken, false);
if (mWindowVisible) {
mWindow.hide();
mWindowVisible = false;
- mImm.setIMEButtonVisible(mToken, false);
onWindowHidden();
mWindowWasVisible = false;
}
diff --git a/core/java/android/inputmethodservice/Keyboard.java b/core/java/android/inputmethodservice/Keyboard.java
index 75c945b..10386f8 100644
--- a/core/java/android/inputmethodservice/Keyboard.java
+++ b/core/java/android/inputmethodservice/Keyboard.java
@@ -97,11 +97,11 @@
private boolean mShifted;
/** Key instance for the shift key, if present */
- private Key mShiftKey;
-
+ private Key[] mShiftKeys = { null, null };
+
/** Key index for the shift key, if present */
- private int mShiftKeyIndex = -1;
-
+ private int[] mShiftKeyIndices = {-1, -1};
+
/** Current key width, while loading the keyboard */
private int mKeyWidth;
@@ -656,8 +656,10 @@
}
public boolean setShifted(boolean shiftState) {
- if (mShiftKey != null) {
- mShiftKey.on = shiftState;
+ for (Key shiftKey : mShiftKeys) {
+ if (shiftKey != null) {
+ shiftKey.on = shiftState;
+ }
}
if (mShifted != shiftState) {
mShifted = shiftState;
@@ -670,8 +672,15 @@
return mShifted;
}
+ /**
+ * @hide
+ */
+ public int[] getShiftKeyIndices() {
+ return mShiftKeyIndices;
+ }
+
public int getShiftKeyIndex() {
- return mShiftKeyIndex;
+ return mShiftKeyIndices[0];
}
private void computeNearestNeighbors() {
@@ -760,8 +769,14 @@
key = createKeyFromXml(res, currentRow, x, y, parser);
mKeys.add(key);
if (key.codes[0] == KEYCODE_SHIFT) {
- mShiftKey = key;
- mShiftKeyIndex = mKeys.size()-1;
+ // Find available shift key slot and put this shift key in it
+ for (int i = 0; i < mShiftKeys.length; i++) {
+ if (mShiftKeys[i] == null) {
+ mShiftKeys[i] = key;
+ mShiftKeyIndices[i] = mKeys.size()-1;
+ break;
+ }
+ }
mModifierKeys.add(key);
} else if (key.codes[0] == KEYCODE_ALT) {
mModifierKeys.add(key);
diff --git a/core/java/android/os/StrictMode.java b/core/java/android/os/StrictMode.java
index ae92b09..1375a29 100644
--- a/core/java/android/os/StrictMode.java
+++ b/core/java/android/os/StrictMode.java
@@ -37,6 +37,7 @@
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
+import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;
/**
@@ -243,13 +244,20 @@
public static final int PENALTY_GATHER = 0x100;
/**
- * Mask of all the penalty bits.
+ * Mask of all the penalty bits valid for thread policies.
*/
- private static final int PENALTY_MASK =
+ private static final int THREAD_PENALTY_MASK =
PENALTY_LOG | PENALTY_DIALOG | PENALTY_DEATH | PENALTY_DROPBOX | PENALTY_GATHER |
PENALTY_DEATH_ON_NETWORK | PENALTY_FLASH;
+ /**
+ * Mask of all the penalty bits valid for VM policies.
+ */
+ private static final int VM_PENALTY_MASK =
+ PENALTY_LOG | PENALTY_DEATH | PENALTY_DROPBOX;
+
+
// TODO: wrap in some ImmutableHashMap thing.
// Note: must be before static initialization of sVmPolicy.
private static final HashMap<Class, Integer> EMPTY_CLASS_LIMIT_MAP = new HashMap<Class, Integer>();
@@ -1116,7 +1124,7 @@
// TODO: if in gather mode, ignore Looper.myLooper() and always
// go into this immediate mode?
if (looper == null ||
- (info.policy & PENALTY_MASK) == PENALTY_DEATH) {
+ (info.policy & THREAD_PENALTY_MASK) == PENALTY_DEATH) {
info.durationMillis = -1; // unknown (redundant, already set)
handleViolation(info);
return;
@@ -1253,7 +1261,7 @@
violationMaskSubset |= violationBit;
final int savedPolicyMask = getThreadPolicyMask();
- final boolean justDropBox = (info.policy & PENALTY_MASK) == PENALTY_DROPBOX;
+ final boolean justDropBox = (info.policy & THREAD_PENALTY_MASK) == PENALTY_DROPBOX;
if (justDropBox) {
// If all we're going to ask the activity manager
// to do is dropbox it (the common case during
@@ -1370,8 +1378,9 @@
}
Runtime.getRuntime().gc();
// Note: classInstanceLimit is immutable, so this is lock-free
- for (Class klass : policy.classInstanceLimit.keySet()) {
- int limit = policy.classInstanceLimit.get(klass);
+ for (Map.Entry<Class, Integer> entry : policy.classInstanceLimit.entrySet()) {
+ Class klass = entry.getKey();
+ int limit = entry.getValue();
long instances = VMDebug.countInstancesOfClass(klass, false);
if (instances <= limit) {
continue;
@@ -1382,7 +1391,7 @@
}
private static long sLastInstanceCountCheckMillis = 0;
- private static boolean sIsIdlerRegistered = false; // guarded by sProcessIdleHandler
+ private static boolean sIsIdlerRegistered = false; // guarded by StrictMode.class
private static final MessageQueue.IdleHandler sProcessIdleHandler =
new MessageQueue.IdleHandler() {
public boolean queueIdle() {
@@ -1403,16 +1412,18 @@
* @param policy the policy to put into place
*/
public static void setVmPolicy(final VmPolicy policy) {
- sVmPolicy = policy;
- sVmPolicyMask = policy.mask;
- setCloseGuardEnabled(vmClosableObjectLeaksEnabled());
+ synchronized (StrictMode.class) {
+ sVmPolicy = policy;
+ sVmPolicyMask = policy.mask;
+ setCloseGuardEnabled(vmClosableObjectLeaksEnabled());
- Looper looper = Looper.getMainLooper();
- if (looper != null) {
- MessageQueue mq = looper.mQueue;
- synchronized (sProcessIdleHandler) {
- if (policy.classInstanceLimit.size() == 0) {
+ Looper looper = Looper.getMainLooper();
+ if (looper != null) {
+ MessageQueue mq = looper.mQueue;
+ if (policy.classInstanceLimit.size() == 0 ||
+ (sVmPolicyMask & VM_PENALTY_MASK) == 0) {
mq.removeIdleHandler(sProcessIdleHandler);
+ sIsIdlerRegistered = false;
} else if (!sIsIdlerRegistered) {
mq.addIdleHandler(sProcessIdleHandler);
sIsIdlerRegistered = true;
@@ -1425,7 +1436,9 @@
* Gets the current VM policy.
*/
public static VmPolicy getVmPolicy() {
- return sVmPolicy;
+ synchronized (StrictMode.class) {
+ return sVmPolicy;
+ }
}
/**
@@ -1480,6 +1493,11 @@
final boolean penaltyLog = (sVmPolicyMask & PENALTY_LOG) != 0;
final ViolationInfo info = new ViolationInfo(originStack, sVmPolicyMask);
+ // Erase stuff not relevant for process-wide violations
+ info.numAnimationsRunning = 0;
+ info.tags = null;
+ info.broadcastIntentAction = null;
+
final Integer fingerprint = info.hashCode();
final long now = SystemClock.uptimeMillis();
long lastViolationTime = 0;
@@ -1494,8 +1512,6 @@
}
}
- Log.d(TAG, "Time since last vm violation: " + timeSinceLastViolationMillis);
-
if (penaltyLog && timeSinceLastViolationMillis > MIN_LOG_INTERVAL_MS) {
Log.e(TAG, message, originStack);
}
@@ -1799,18 +1815,57 @@
((AndroidBlockGuardPolicy) policy).onWriteToDisk();
}
+ // Guarded by StrictMode.class
+ private static final HashMap<Class, Integer> sExpectedActivityInstanceCount =
+ new HashMap<Class, Integer>();
+
/**
* @hide
*/
- public static void noteActivityClass(Class klass) {
- if ((sVmPolicy.mask & DETECT_VM_ACTIVITY_LEAKS) == 0) {
+ public static void incrementExpectedActivityCount(Class klass) {
+ if (klass == null || (sVmPolicy.mask & DETECT_VM_ACTIVITY_LEAKS) == 0) {
return;
}
- if (sVmPolicy.classInstanceLimit.containsKey(klass)) {
+ synchronized (StrictMode.class) {
+ Integer expected = sExpectedActivityInstanceCount.get(klass);
+ Integer newExpected = expected == null ? 1 : expected + 1;
+ sExpectedActivityInstanceCount.put(klass, newExpected);
+ // Note: adding 1 here to give some breathing room during
+ // orientation changes. (shouldn't be necessary, though?)
+ setExpectedClassInstanceCount(klass, newExpected + 1);
+ }
+ }
+
+ /**
+ * @hide
+ */
+ public static void decrementExpectedActivityCount(Class klass) {
+ if (klass == null || (sVmPolicy.mask & DETECT_VM_ACTIVITY_LEAKS) == 0) {
return;
}
- // Note: capping at 2, not 1, to give some breathing room.
- setVmPolicy(new VmPolicy.Builder(sVmPolicy).setClassInstanceLimit(klass, 2).build());
+ synchronized (StrictMode.class) {
+ Integer expected = sExpectedActivityInstanceCount.get(klass);
+ Integer newExpected = (expected == null || expected == 0) ? 0 : expected - 1;
+ if (newExpected == 0) {
+ sExpectedActivityInstanceCount.remove(klass);
+ } else {
+ sExpectedActivityInstanceCount.put(klass, newExpected);
+ }
+ // Note: adding 1 here to give some breathing room during
+ // orientation changes. (shouldn't be necessary, though?)
+ setExpectedClassInstanceCount(klass, newExpected + 1);
+ }
+ }
+
+ /**
+ * @hide
+ */
+ public static void setExpectedClassInstanceCount(Class klass, int count) {
+ synchronized (StrictMode.class) {
+ setVmPolicy(new VmPolicy.Builder(sVmPolicy)
+ .setClassInstanceLimit(klass, count)
+ .build());
+ }
}
/**
@@ -2020,15 +2075,13 @@
final long mInstances;
final int mLimit;
- private static final StackTraceElement[] FAKE_STACK = new StackTraceElement[1];
- static {
- FAKE_STACK[0] = new StackTraceElement("android.os.StrictMode", "setClassInstanceLimit",
- "StrictMode.java", 1);
- }
+ private static final StackTraceElement[] FAKE_STACK = {
+ new StackTraceElement("android.os.StrictMode", "setClassInstanceLimit",
+ "StrictMode.java", 1)
+ };
public InstanceCountViolation(Class klass, long instances, int limit) {
- // Note: now including instances here, otherwise signatures would all be different.
- super(klass.toString() + "; limit=" + limit);
+ super(klass.toString() + "; instances=" + instances + "; limit=" + limit);
setStackTrace(FAKE_STACK);
mClass = klass;
mInstances = instances;
diff --git a/core/java/android/preference/PreferenceActivity.java b/core/java/android/preference/PreferenceActivity.java
index 3883451..2b609ea 100644
--- a/core/java/android/preference/PreferenceActivity.java
+++ b/core/java/android/preference/PreferenceActivity.java
@@ -998,7 +998,9 @@
mFragmentBreadCrumbs = new FragmentBreadCrumbs(this);
ActionBar actionBar = getActionBar();
if (actionBar != null) {
- actionBar.setCustomNavigationMode(mFragmentBreadCrumbs);
+ actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM,
+ ActionBar.DISPLAY_SHOW_TITLE | ActionBar.DISPLAY_SHOW_CUSTOM);
+ actionBar.setCustomView(mFragmentBreadCrumbs);
}
}
mFragmentBreadCrumbs.setMaxVisible(2);
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
index 1d817ea..6f23215 100644
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -285,6 +285,13 @@
* In some cases, a matching Activity may not exist, so ensure you
* safeguard against this.
* <p>
+ * To tell which input method's subtypes are displayed in the settings, add
+ * {@link #EXTRA_INPUT_METHOD_ID} extra to this Intent with the input method id.
+ * If there is no extra in this Intent, subtypes from all installed input methods
+ * will be displayed in the settings.
+ *
+ * @see android.view.inputmethod.InputMethodInfo#getId
+ * <p>
* Input: Nothing.
* <p>
* Output: Nothing.
@@ -555,6 +562,8 @@
public static final String EXTRA_AUTHORITIES =
"authorities";
+ public static final String EXTRA_INPUT_METHOD_ID = "input_method_id";
+
private static final String JID_RESOURCE_PREFIX = "android";
public static final String AUTHORITY = "settings";
diff --git a/core/java/android/view/DragEvent.java b/core/java/android/view/DragEvent.java
index 25b680e6..4d83891 100644
--- a/core/java/android/view/DragEvent.java
+++ b/core/java/android/view/DragEvent.java
@@ -130,12 +130,13 @@
}
private void init(int action, float x, float y, ClipDescription description, ClipData data,
- boolean result) {
+ Object localState, boolean result) {
mAction = action;
mX = x;
mY = y;
mClipDescription = description;
mClipData = data;
+ mLocalState = localState;
mDragResult = result;
}
@@ -150,7 +151,7 @@
synchronized (gRecyclerLock) {
if (gRecyclerTop == null) {
ev = new DragEvent();
- ev.init(action, x, y, description, data, result);
+ ev.init(action, x, y, description, data, localState, result);
return ev;
}
ev = gRecyclerTop;
@@ -161,7 +162,7 @@
ev.mRecycled = false;
ev.mNext = null;
- ev.init(action, x, y, description, data, result);
+ ev.init(action, x, y, description, data, localState, result);
return ev;
}
diff --git a/core/java/android/view/GLES20Canvas.java b/core/java/android/view/GLES20Canvas.java
index d82f051..e47dc93 100644
--- a/core/java/android/view/GLES20Canvas.java
+++ b/core/java/android/view/GLES20Canvas.java
@@ -630,9 +630,32 @@
@Override
public void drawBitmapMesh(Bitmap bitmap, int meshWidth, int meshHeight, float[] verts,
int vertOffset, int[] colors, int colorOffset, Paint paint) {
- // TODO: Implement
+ if (meshWidth < 0 || meshHeight < 0 || vertOffset < 0 || colorOffset < 0) {
+ throw new ArrayIndexOutOfBoundsException();
+ }
+
+ if (meshWidth == 0 || meshHeight == 0) {
+ return;
+ }
+
+ final int count = (meshWidth + 1) * (meshHeight + 1);
+ checkRange(verts.length, vertOffset, count * 2);
+
+ // TODO: Colors are ignored for now
+ colors = null;
+ colorOffset = 0;
+
+ boolean hasColorFilter = paint != null && setupColorFilter(paint);
+ final int nativePaint = paint == null ? 0 : paint.mNativePaint;
+ nDrawBitmapMesh(mRenderer, bitmap.mNativeBitmap, bitmap.mBuffer, meshWidth, meshHeight,
+ verts, vertOffset, colors, colorOffset, nativePaint);
+ if (hasColorFilter) nResetModifiers(mRenderer);
}
+ private native void nDrawBitmapMesh(int renderer, int bitmap, byte[] buffer,
+ int meshWidth, int meshHeight, float[] verts, int vertOffset,
+ int[] colors, int colorOffset, int paint);
+
@Override
public void drawCircle(float cx, float cy, float radius, Paint paint) {
boolean hasModifier = setupModifiers(paint);
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index 2447f8c..811a633 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -5027,6 +5027,15 @@
focusTaken = requestFocus();
}
+ if (prepressed) {
+ // The button is being released before we actually
+ // showed it as pressed. Make it show the pressed
+ // state now (before scheduling the click) to ensure
+ // the user sees it.
+ mPrivateFlags |= PRESSED;
+ refreshDrawableState();
+ }
+
if (!mHasPerformedLongPress) {
// This is a tap, so remove the longpress check
removeLongPressCallback();
@@ -5050,8 +5059,6 @@
}
if (prepressed) {
- mPrivateFlags |= PRESSED;
- refreshDrawableState();
postDelayed(mUnsetPressedState,
ViewConfiguration.getPressedStateDuration());
} else if (!post(mUnsetPressedState)) {
diff --git a/core/java/android/view/ViewRoot.java b/core/java/android/view/ViewRoot.java
index 1f15628..2c6ec71 100644
--- a/core/java/android/view/ViewRoot.java
+++ b/core/java/android/view/ViewRoot.java
@@ -228,7 +228,7 @@
/* Drag/drop */
ClipDescription mDragDescription;
View mCurrentDragView;
- Object mLocalDragState;
+ volatile Object mLocalDragState;
final PointF mDragPoint = new PointF();
final PointF mLastTouchPoint = new PointF();
@@ -489,17 +489,17 @@
// Try to enable hardware acceleration if requested
if (attrs != null &&
(attrs.flags & WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED) != 0) {
- // Don't enable hardware acceleration when we're not on the main thread
- if (Looper.getMainLooper() != Looper.myLooper()) {
- Log.w(HardwareRenderer.LOG_TAG, "Attempting to initialize hardware acceleration "
- + "outside of the main thread, aborting");
- return;
- }
-
// Only enable hardware acceleration if we are not in the system process
// The window manager creates ViewRoots to display animated preview windows
// of launching apps and we don't want those to be hardware accelerated
if (!HardwareRenderer.sRendererDisabled) {
+ // Don't enable hardware acceleration when we're not on the main thread
+ if (Looper.getMainLooper() != Looper.myLooper()) {
+ Log.w(HardwareRenderer.LOG_TAG, "Attempting to initialize hardware "
+ + "acceleration outside of the main thread, aborting");
+ return;
+ }
+
final boolean translucent = attrs.format != PixelFormat.OPAQUE;
if (mAttachInfo.mHardwareRenderer != null) {
mAttachInfo.mHardwareRenderer.destroy(true);
@@ -2051,7 +2051,9 @@
} break;
case DISPATCH_DRAG_EVENT:
case DISPATCH_DRAG_LOCATION_EVENT: {
- handleDragEvent((DragEvent)msg.obj);
+ DragEvent event = (DragEvent)msg.obj;
+ event.mLocalState = mLocalDragState; // only present when this app called startDrag()
+ handleDragEvent(event);
} break;
}
}
@@ -3133,7 +3135,6 @@
} else {
what = DISPATCH_DRAG_EVENT;
}
- event.mLocalState = mLocalDragState; // only present when this app called startDrag()
Message msg = obtainMessage(what, event);
sendMessage(msg);
}
diff --git a/core/java/android/view/inputmethod/InputMethodInfo.java b/core/java/android/view/inputmethod/InputMethodInfo.java
index defd104..32eec9f 100644
--- a/core/java/android/view/inputmethod/InputMethodInfo.java
+++ b/core/java/android/view/inputmethod/InputMethodInfo.java
@@ -265,10 +265,19 @@
}
/**
- * Return the subtypes of Input Method.
+ * Return the count of the subtypes of Input Method.
*/
- public ArrayList<InputMethodSubtype> getSubtypes() {
- return mSubtypes;
+ public int getSubtypeCount() {
+ return mSubtypes.size();
+ }
+
+ /**
+ * Return the Input Method's subtype at the specified index.
+ *
+ * @param index the index of the subtype to return.
+ */
+ public InputMethodSubtype getSubtypeAt(int index) {
+ return mSubtypes.get(index);
}
/**
diff --git a/core/java/android/view/inputmethod/InputMethodSubtype.java b/core/java/android/view/inputmethod/InputMethodSubtype.java
index 39a0c19..ba425a6 100644
--- a/core/java/android/view/inputmethod/InputMethodSubtype.java
+++ b/core/java/android/view/inputmethod/InputMethodSubtype.java
@@ -22,13 +22,10 @@
import java.util.Arrays;
/**
- * Information given to an {@link InputMethod} about a client connecting
- * to it.
- */
-/**
- * InputMethodSubtype is a subtype contained in the input method. Subtype can describe
- * locales (e.g. en_US, fr_FR...) and modes (e.g. voice, keyboard...), and is used for
- * IME switch. The subtype allows the system to call the specified subtype of IME directly.
+ * This class is used to specify meta information of a subtype contained in an input method.
+ * Subtype can describe locale (e.g. en_US, fr_FR...) and mode (e.g. voice, keyboard...), and is
+ * used for IME switch and settings. The input method subtype allows the system to bring up the
+ * specified subtype of the designated input method directly.
*/
public final class InputMethodSubtype implements Parcelable {
private final int mSubtypeNameResId;
diff --git a/core/java/android/webkit/BrowserFrame.java b/core/java/android/webkit/BrowserFrame.java
index e246717..ec3c329 100644
--- a/core/java/android/webkit/BrowserFrame.java
+++ b/core/java/android/webkit/BrowserFrame.java
@@ -1177,6 +1177,17 @@
contentDisposition, mimeType, contentLength);
}
+ /**
+ * Called by JNI when we load a page over SSL.
+ */
+ private void setCertificate(String issuedTo, String issuedBy,
+ long validNotBeforeMillis, long validNotAfterMillis) {
+ Date validNotBefore = new Date(validNotBeforeMillis);
+ Date validNotAfter = new Date(validNotAfterMillis);
+ mCallbackProxy.onReceivedCertificate(new SslCertificate(
+ issuedTo, issuedBy, validNotBefore, validNotAfter));
+ }
+
//==========================================================================
// native functions
//==========================================================================
diff --git a/core/java/android/webkit/CacheManager.java b/core/java/android/webkit/CacheManager.java
index 6073f7a..a553a459 100644
--- a/core/java/android/webkit/CacheManager.java
+++ b/core/java/android/webkit/CacheManager.java
@@ -244,6 +244,9 @@
* obtained from {@link android.webkit.CacheManager.CacheResult#getLocalPath}, this
* identifies the cache file.
*
+ * Cache files are not guaranteed to be in this directory before
+ * CacheManager#getCacheFile(String, Map<String, String>) is called.
+ *
* @return File The base directory of the cache.
*
* @deprecated Access to the HTTP cache will be removed in a future release.
@@ -611,8 +614,9 @@
return true;
}
// delete rows in the cache database
- WebViewWorker.getHandler().sendEmptyMessage(
- WebViewWorker.MSG_CLEAR_CACHE);
+ if (!JniUtil.useChromiumHttpStack())
+ WebViewWorker.getHandler().sendEmptyMessage(WebViewWorker.MSG_CLEAR_CACHE);
+
// delete cache files in a separate thread to not block UI.
final Runnable clearCache = new Runnable() {
public void run() {
diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java
index 82e6964..f5ad6fe 100644
--- a/core/java/android/webkit/WebView.java
+++ b/core/java/android/webkit/WebView.java
@@ -5405,6 +5405,7 @@
case MotionEvent.ACTION_DOWN: {
mPreventDefault = PREVENT_DEFAULT_NO;
mConfirmMove = false;
+ mIsHandlingMultiTouch = false;
mInitialHitTestResult = null;
if (!mScroller.isFinished()) {
// stop the current scroll animation, but if this is
diff --git a/core/java/android/webkit/WebViewCore.java b/core/java/android/webkit/WebViewCore.java
index c56f252..4fe1678 100644
--- a/core/java/android/webkit/WebViewCore.java
+++ b/core/java/android/webkit/WebViewCore.java
@@ -1770,7 +1770,7 @@
private void clearCache(boolean includeDiskFiles) {
mBrowserFrame.clearCache();
- if (includeDiskFiles && !JniUtil.useChromiumHttpStack()) {
+ if (includeDiskFiles) {
CacheManager.removeAllCacheFiles();
}
}
diff --git a/core/java/android/widget/AdapterViewAnimator.java b/core/java/android/widget/AdapterViewAnimator.java
index 4c1279ff..6eb06ad 100644
--- a/core/java/android/widget/AdapterViewAnimator.java
+++ b/core/java/android/widget/AdapterViewAnimator.java
@@ -323,20 +323,6 @@
setDisplayedChild(mWhichChild - 1);
}
- /**
- * Shows only the specified child. The other displays Views exit the screen,
- * optionally with the with the {@link #getOutAnimation() out animation} and
- * the specified child enters the screen, optionally with the
- * {@link #getInAnimation() in animation}.
- *
- * @param childIndex The index of the child to be shown.
- * @param animate Whether or not to use the in and out animations, defaults
- * to true.
- */
- void showOnly(int childIndex, boolean animate) {
- showOnly(childIndex, animate, false);
- }
-
int modulo(int pos, int size) {
if (size > 0) {
return (size + (pos % size)) % size;
@@ -363,7 +349,7 @@
int getNumActiveViews() {
if (mAdapter != null) {
- return Math.min(mAdapter.getCount() + 1, mMaxNumActiveViews);
+ return Math.min(getCount() + 1, mMaxNumActiveViews);
} else {
return mMaxNumActiveViews;
}
@@ -371,7 +357,7 @@
int getWindowSize() {
if (mAdapter != null) {
- int adapterCount = mAdapter.getCount();
+ int adapterCount = getCount();
if (adapterCount <= getNumActiveViews() && mLoopViews) {
return adapterCount*mMaxNumActiveViews;
} else {
@@ -396,16 +382,16 @@
for (int i = mCurrentWindowStart; i <= mCurrentWindowEnd; i++) {
int index = modulo(i, getWindowSize());
- int adapterCount = mAdapter.getCount();
+ int adapterCount = getCount();
// get the fresh child from the adapter
- View updatedChild = mAdapter.getView(modulo(i, adapterCount), null, this);
+ final View updatedChild = mAdapter.getView(modulo(i, adapterCount), null, this);
if (mViewsMap.containsKey(index)) {
- FrameLayout fl = (FrameLayout) mViewsMap.get(index).view;
- // flush out the old child
- fl.removeAllViewsInLayout();
+ final FrameLayout fl = (FrameLayout) mViewsMap.get(index).view;
// add the new child to the frame, if it exists
if (updatedChild != null) {
+ // flush out the old child
+ fl.removeAllViewsInLayout();
fl.addView(updatedChild);
}
}
@@ -423,9 +409,19 @@
return new FrameLayout(mContext);
}
- void showOnly(int childIndex, boolean animate, boolean onLayout) {
+ /**
+ * Shows only the specified child. The other displays Views exit the screen,
+ * optionally with the with the {@link #getOutAnimation() out animation} and
+ * the specified child enters the screen, optionally with the
+ * {@link #getInAnimation() in animation}.
+ *
+ * @param childIndex The index of the child to be shown.
+ * @param animate Whether or not to use the in and out animations, defaults
+ * to true.
+ */
+ void showOnly(int childIndex, boolean animate) {
if (mAdapter == null) return;
- final int adapterCount = mAdapter.getCount();
+ final int adapterCount = getCount();
if (adapterCount == 0) return;
for (int i = 0; i < mPreviousViews.size(); i++) {
@@ -463,7 +459,7 @@
// This section clears out any items that are in our active views list
// but are outside the effective bounds of our window (this is becomes an issue
// at the extremities of the list, eg. where newWindowStartUnbounded < 0 or
- // newWindowEndUnbounded > mAdapter.getCount() - 1
+ // newWindowEndUnbounded > adapterCount - 1
for (Integer index : mViewsMap.keySet()) {
boolean remove = false;
if (!wrap && (index < rangeStart || index > rangeEnd)) {
@@ -531,22 +527,8 @@
mCurrentWindowEnd = newWindowEnd;
mCurrentWindowStartUnbounded = newWindowStartUnbounded;
}
-
- mFirstTime = false;
- if (!onLayout) {
- requestLayout();
- invalidate();
- } else {
- // If the Adapter tries to layout the current view when we get it using getView
- // above the layout will end up being ignored since we are currently laying out, so
- // we post a delayed requestLayout and invalidate
- mMainQueue.post(new Runnable() {
- public void run() {
- requestLayout();
- invalidate();
- }
- });
- }
+ requestLayout();
+ invalidate();
}
private void addChild(View child) {
@@ -702,21 +684,30 @@
measureChildren();
}
- @Override
- protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
+ void checkForAndHandleDataChanged() {
boolean dataChanged = mDataChanged;
if (dataChanged) {
- handleDataChanged();
+ post(new Runnable() {
+ public void run() {
+ handleDataChanged();
+ // if the data changes, mWhichChild might be out of the bounds of the adapter
+ // in this case, we reset mWhichChild to the beginning
+ if (mWhichChild >= getWindowSize()) {
+ mWhichChild = 0;
- // if the data changes, mWhichChild might be out of the bounds of the adapter
- // in this case, we reset mWhichChild to the beginning
- if (mWhichChild >= mAdapter.getCount()) {
- mWhichChild = 0;
-
- showOnly(mWhichChild, true, true);
- }
- refreshChildren();
+ showOnly(mWhichChild, true);
+ }
+ refreshChildren();
+ requestLayout();
+ }
+ });
}
+ mDataChanged = false;
+ }
+
+ @Override
+ protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
+ checkForAndHandleDataChanged();
final int childCount = getChildCount();
for (int i = 0; i < childCount; i++) {
@@ -727,7 +718,6 @@
child.layout(mPaddingLeft, mPaddingTop, childRight, childBottom);
}
- mDataChanged = false;
}
static class SavedState extends BaseSavedState {
@@ -921,8 +911,10 @@
if (mAdapter != null) {
mDataSetObserver = new AdapterDataSetObserver();
mAdapter.registerDataSetObserver(mDataSetObserver);
+ mItemCount = mAdapter.getCount();
}
setFocusable(true);
+ setDisplayedChild(0);
}
/**
diff --git a/core/java/android/widget/DatePicker.java b/core/java/android/widget/DatePicker.java
index af5de8a..f1786e2 100644
--- a/core/java/android/widget/DatePicker.java
+++ b/core/java/android/widget/DatePicker.java
@@ -30,7 +30,7 @@
import android.util.Log;
import android.util.SparseArray;
import android.view.LayoutInflater;
-import android.widget.NumberPicker.OnValueChangedListener;
+import android.widget.NumberPicker.OnValueChangeListener;
import java.text.ParseException;
import java.text.SimpleDateFormat;
@@ -154,7 +154,7 @@
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
inflater.inflate(layoutResourceId, this, true);
- OnValueChangedListener onChangeListener = new OnValueChangedListener() {
+ OnValueChangeListener onChangeListener = new OnValueChangeListener() {
public void onValueChange(NumberPicker picker, int oldVal, int newVal) {
updateDate(mYearSpinner.getValue(), mMonthSpinner.getValue(), mDaySpinner
.getValue());
diff --git a/core/java/android/widget/NumberPicker.java b/core/java/android/widget/NumberPicker.java
index ba1c0ec..08db207 100644
--- a/core/java/android/widget/NumberPicker.java
+++ b/core/java/android/widget/NumberPicker.java
@@ -32,6 +32,7 @@
import android.graphics.Paint;
import android.graphics.Rect;
import android.graphics.Paint.Align;
+import android.graphics.drawable.Drawable;
import android.text.InputFilter;
import android.text.InputType;
import android.text.Spanned;
@@ -39,6 +40,7 @@
import android.text.method.NumberKeyListener;
import android.util.AttributeSet;
import android.util.SparseArray;
+import android.util.TypedValue;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.MotionEvent;
@@ -46,7 +48,7 @@
import android.view.View;
import android.view.ViewConfiguration;
import android.view.LayoutInflater.Filter;
-import android.view.animation.OvershootInterpolator;
+import android.view.animation.DecelerateInterpolator;
import android.view.inputmethod.InputMethodManager;
/**
@@ -109,6 +111,11 @@
private static final float TOP_AND_BOTTOM_FADING_EDGE_STRENGTH = 0.9f;
/**
+ * The default unscaled height of the selection divider.
+ */
+ private final int UNSCALED_DEFAULT_SELECTION_DIVIDER_HEIGHT = 2;
+
+ /**
* The numbers accepted by the input text's {@link Filter}
*/
private static final char[] DIGIT_CHARACTERS = new char[] {
@@ -181,7 +188,7 @@
/**
* Listener to be notified upon current value change.
*/
- private OnValueChangedListener mOnValueChangedListener;
+ private OnValueChangeListener mOnValueChangeListener;
/**
* Listener to be notified upon scroll state change.
@@ -328,6 +335,16 @@
private final boolean mFlingable;
/**
+ * Divider for showing item to be selected while scrolling
+ */
+ private final Drawable mSelectionDivider;
+
+ /**
+ * The height of the selection divider.
+ */
+ private final int mSelectionDividerHeight;
+
+ /**
* Reusable {@link Rect} instance.
*/
private final Rect mTempRect = new Rect();
@@ -338,9 +355,14 @@
private int mScrollState = OnScrollListener.SCROLL_STATE_IDLE;
/**
+ * The duration of the animation for showing the input controls.
+ */
+ private final long mShowInputControlsAnimimationDuration;
+
+ /**
* Interface to listen for changes of the current value.
*/
- public interface OnValueChangedListener {
+ public interface OnValueChangeListener {
/**
* Called upon a change of the current value.
@@ -432,8 +454,17 @@
R.styleable.NumberPicker, defStyle, 0);
mSolidColor = attributesArray.getColor(R.styleable.NumberPicker_solidColor, 0);
mFlingable = attributesArray.getBoolean(R.styleable.NumberPicker_flingable, true);
+ mSelectionDivider = attributesArray.getDrawable(R.styleable.NumberPicker_selectionDivider);
+ int defSelectionDividerHeight = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,
+ UNSCALED_DEFAULT_SELECTION_DIVIDER_HEIGHT,
+ getResources().getDisplayMetrics());
+ mSelectionDividerHeight = attributesArray.getDimensionPixelSize(
+ R.styleable.NumberPicker_selectionDividerHeight, defSelectionDividerHeight);
attributesArray.recycle();
+ mShowInputControlsAnimimationDuration = getResources().getInteger(
+ R.integer.config_longAnimTime);
+
// By default Linearlayout that we extend is not drawn. This is
// its draw() method is not called but dispatchDraw() is called
// directly (see ViewGroup.drawChild()). However, this class uses
@@ -523,8 +554,6 @@
mShowInputControlsAnimator = new AnimatorSet();
mShowInputControlsAnimator.playTogether(fadeScroller, showIncrementButton,
showDecrementButton);
- mShowInputControlsAnimator.setDuration(getResources().getInteger(
- R.integer.config_longAnimTime));
mShowInputControlsAnimator.addListener(new AnimatorListenerAdapter() {
private boolean mCanceled = false;
@@ -549,18 +578,25 @@
// create the fling and adjust scrollers
mFlingScroller = new Scroller(getContext(), null, true);
- mAdjustScroller = new Scroller(getContext(), new OvershootInterpolator());
+ mAdjustScroller = new Scroller(getContext(), new DecelerateInterpolator(2.5f));
updateInputTextView();
updateIncrementAndDecrementButtonsVisibilityState();
+
+ if (mFlingable) {
+ // Start with shown selector wheel and hidden controls. When made
+ // visible hide the selector and fade-in the controls to suggest
+ // fling interaction.
+ setDrawSelectorWheel(true);
+ hideInputControls();
+ }
}
@Override
- public void onWindowFocusChanged(boolean hasWindowFocus) {
- super.onWindowFocusChanged(hasWindowFocus);
- if (!hasWindowFocus) {
- removeAllCallbacks();
- }
+ protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
+ super.onLayout(changed, left, top, right, bottom);
+ // need to do this when we know our size
+ initializeScrollWheel();
}
@Override
@@ -580,7 +616,7 @@
if (!scrollersFinished) {
mFlingScroller.forceFinished(true);
mAdjustScroller.forceFinished(true);
- tryNotifyScrollListener(OnScrollListener.SCROLL_STATE_IDLE);
+ onScrollStateChange(OnScrollListener.SCROLL_STATE_IDLE);
}
mBeginEditOnUpEvent = scrollersFinished;
mAdjustScrollerOnUpEvent = true;
@@ -599,7 +635,7 @@
int deltaDownY = (int) Math.abs(currentMoveY - mLastDownEventY);
if (deltaDownY > mTouchSlop) {
mBeginEditOnUpEvent = false;
- tryNotifyScrollListener(OnScrollListener.SCROLL_STATE_TOUCH_SCROLL);
+ onScrollStateChange(OnScrollListener.SCROLL_STATE_TOUCH_SCROLL);
setDrawSelectorWheel(true);
hideInputControls();
return true;
@@ -627,7 +663,7 @@
int deltaDownY = (int) Math.abs(currentMoveY - mLastDownEventY);
if (deltaDownY > mTouchSlop) {
mBeginEditOnUpEvent = false;
- tryNotifyScrollListener(OnScrollListener.SCROLL_STATE_TOUCH_SCROLL);
+ onScrollStateChange(OnScrollListener.SCROLL_STATE_TOUCH_SCROLL);
}
}
int deltaMoveY = (int) (currentMoveY - mLastMotionEventY);
@@ -638,7 +674,7 @@
case MotionEvent.ACTION_UP:
if (mBeginEditOnUpEvent) {
setDrawSelectorWheel(false);
- showInputControls();
+ showInputControls(mShowInputControlsAnimimationDuration);
mInputText.requestFocus();
InputMethodManager imm = (InputMethodManager) getContext().getSystemService(
Context.INPUT_METHOD_SERVICE);
@@ -651,7 +687,7 @@
int initialVelocity = (int) velocityTracker.getYVelocity();
if (Math.abs(initialVelocity) > mMinimumFlingVelocity) {
fling(initialVelocity);
- tryNotifyScrollListener(OnScrollListener.SCROLL_STATE_FLING);
+ onScrollStateChange(OnScrollListener.SCROLL_STATE_FLING);
} else {
if (mAdjustScrollerOnUpEvent) {
if (mFlingScroller.isFinished() && mAdjustScroller.isFinished()) {
@@ -733,18 +769,6 @@
@Override
public void scrollBy(int x, int y) {
int[] selectorIndices = getSelectorIndices();
- if (mInitialScrollOffset == Integer.MIN_VALUE) {
- int totalTextHeight = selectorIndices.length * mTextSize;
- int totalTextGapHeight = (mBottom - mTop) - totalTextHeight;
- int textGapCount = selectorIndices.length - 1;
- int selectorTextGapHeight = totalTextGapHeight / textGapCount;
- // compensate for integer division loss of the components used to
- // calculate the text gap
- int integerDivisionLoss = (mTextSize + mBottom - mTop) % textGapCount;
- mInitialScrollOffset = mCurrentScrollOffset = mTextSize - integerDivisionLoss / 2;
- mSelectorElementHeight = mTextSize + selectorTextGapHeight;
- }
-
if (!mWrapSelectorWheel && y > 0
&& selectorIndices[SELECTOR_MIDDLE_ITEM_INDEX] <= mMinValue) {
mCurrentScrollOffset = mInitialScrollOffset;
@@ -784,8 +808,8 @@
*
* @param onValueChangedListener The listener.
*/
- public void setOnValueChangedListener(OnValueChangedListener onValueChangedListener) {
- mOnValueChangedListener = onValueChangedListener;
+ public void setOnValueChangedListener(OnValueChangeListener onValueChangedListener) {
+ mOnValueChangeListener = onValueChangedListener;
}
/**
@@ -815,6 +839,7 @@
}
mFormatter = formatter;
resetSelectorWheelIndices();
+ updateInputTextView();
}
/**
@@ -1023,6 +1048,17 @@
}
@Override
+ protected void onAttachedToWindow() {
+ super.onAttachedToWindow();
+ // make sure we show the controls only the very
+ // first time the user sees this widget
+ if (mFlingable) {
+ // animate a bit slower the very first time
+ showInputControls(mShowInputControlsAnimimationDuration * 2);
+ }
+ }
+
+ @Override
protected void onDetachedFromWindow() {
removeAllCallbacks();
}
@@ -1041,9 +1077,7 @@
// However, in View.draw(), the fading is applied after all the children
// have been drawn and we do not want this fading to be applied to the
// buttons which are currently showing in. Therefore, we draw our
- // children
- // after we have completed drawing ourselves.
-
+ // children after we have completed drawing ourselves.
super.draw(canvas);
// Draw our children if we are not showing the selector wheel of fading
@@ -1069,6 +1103,7 @@
float x = (mRight - mLeft) / 2;
float y = mCurrentScrollOffset;
+ // draw the selector wheel
int[] selectorIndices = getSelectorIndices();
for (int i = 0; i < selectorIndices.length; i++) {
int selectorIndex = selectorIndices[i];
@@ -1076,6 +1111,23 @@
canvas.drawText(scrollSelectorValue, x, y, mSelectorPaint);
y += mSelectorElementHeight;
}
+
+ // draw the selection dividers (only if scrolling and drawable specified)
+ if (mSelectionDivider != null) {
+ mSelectionDivider.setAlpha(mSelectorPaint.getAlpha());
+ // draw the top divider
+ int topOfTopDivider =
+ (getHeight() - mSelectorElementHeight - mSelectionDividerHeight) / 2;
+ int bottomOfTopDivider = topOfTopDivider + mSelectionDividerHeight;
+ mSelectionDivider.setBounds(0, topOfTopDivider, mRight, bottomOfTopDivider);
+ mSelectionDivider.draw(canvas);
+
+ // draw the bottom divider
+ int topOfBottomDivider = topOfTopDivider + mSelectorElementHeight;
+ int bottomOfBottomDivider = bottomOfTopDivider + mSelectorElementHeight;
+ mSelectionDivider.setBounds(0, topOfBottomDivider, mRight, bottomOfBottomDivider);
+ mSelectionDivider.draw(canvas);
+ }
}
/**
@@ -1141,26 +1193,46 @@
setVerticalFadingEdgeEnabled(drawSelectorWheel);
}
+ private void initializeScrollWheel() {
+ if (mInitialScrollOffset != Integer.MIN_VALUE) {
+ return;
+
+ }
+ int[] selectorIndices = getSelectorIndices();
+ int totalTextHeight = selectorIndices.length * mTextSize;
+ int totalTextGapHeight = (mBottom - mTop) - totalTextHeight;
+ int textGapCount = selectorIndices.length - 1;
+ int selectorTextGapHeight = totalTextGapHeight / textGapCount;
+ // compensate for integer division loss of the components used to
+ // calculate the text gap
+ int integerDivisionLoss = (mTextSize + mBottom - mTop) % textGapCount;
+ mInitialScrollOffset = mCurrentScrollOffset = mTextSize - integerDivisionLoss / 2;
+ mSelectorElementHeight = mTextSize + selectorTextGapHeight;
+ updateInputTextView();
+ }
+
/**
* Callback invoked upon completion of a given <code>scroller</code>.
*/
private void onScrollerFinished(Scroller scroller) {
if (scroller == mFlingScroller) {
postAdjustScrollerCommand(0);
- tryNotifyScrollListener(OnScrollListener.SCROLL_STATE_IDLE);
+ onScrollStateChange(OnScrollListener.SCROLL_STATE_IDLE);
} else {
updateInputTextView();
- showInputControls();
+ showInputControls(mShowInputControlsAnimimationDuration);
}
}
/**
- * Notifies the scroll listener for the given <code>scrollState</code>
- * if the scroll state differs from the current scroll state.
+ * Handles transition to a given <code>scrollState</code>
*/
- private void tryNotifyScrollListener(int scrollState) {
- if (mOnScrollListener != null && mScrollState != scrollState) {
- mScrollState = scrollState;
+ private void onScrollStateChange(int scrollState) {
+ if (mScrollState == scrollState) {
+ return;
+ }
+ mScrollState = scrollState;
+ if (mOnScrollListener != null) {
mOnScrollListener.onScrollStateChange(this, scrollState);
}
}
@@ -1206,10 +1278,13 @@
/**
* Show the input controls by making them visible and animating the alpha
* property up/down arrows.
+ *
+ * @param animationDuration The duration of the animation.
*/
- private void showInputControls() {
+ private void showInputControls(long animationDuration) {
updateIncrementAndDecrementButtonsVisibilityState();
mInputText.setVisibility(VISIBLE);
+ mShowInputControlsAnimator.setDuration(animationDuration);
mShowInputControlsAnimator.start();
}
@@ -1334,9 +1409,9 @@
/**
* Updates the view of this NumberPicker. If displayValues were specified in
- * {@link #setRange}, the string corresponding to the index specified by the
- * current value will be returned. Otherwise, the formatter specified in
- * {@link #setFormatter} will be used to format the number.
+ * the string corresponding to the index specified by the current value will
+ * be returned. Otherwise, the formatter specified in {@link #setFormatter}
+ * will be used to format the number.
*/
private void updateInputTextView() {
/*
@@ -1357,8 +1432,8 @@
* NumberPicker.
*/
private void notifyChange(int previous, int current) {
- if (mOnValueChangedListener != null) {
- mOnValueChangedListener.onValueChange(this, previous, mValue);
+ if (mOnValueChangeListener != null) {
+ mOnValueChangeListener.onValueChange(this, previous, mValue);
}
}
@@ -1540,7 +1615,7 @@
mPreviousScrollerY = 0;
if (mInitialScrollOffset == mCurrentScrollOffset) {
updateInputTextView();
- showInputControls();
+ showInputControls(mShowInputControlsAnimimationDuration);
return;
}
// adjust to the closest value
@@ -1548,9 +1623,7 @@
if (Math.abs(deltaY) > mSelectorElementHeight / 2) {
deltaY += (deltaY > 0) ? -mSelectorElementHeight : mSelectorElementHeight;
}
- float delayCoef = (float) Math.abs(deltaY) / (float) mTextSize;
- int duration = (int) (delayCoef * SELECTOR_ADJUSTMENT_DURATION_MILLIS);
- mAdjustScroller.startScroll(0, 0, 0, deltaY, duration);
+ mAdjustScroller.startScroll(0, 0, 0, deltaY, SELECTOR_ADJUSTMENT_DURATION_MILLIS);
invalidate();
}
}
diff --git a/core/java/android/widget/SearchView.java b/core/java/android/widget/SearchView.java
index 585dcf2..b86366c 100644
--- a/core/java/android/widget/SearchView.java
+++ b/core/java/android/widget/SearchView.java
@@ -72,10 +72,10 @@
private static final boolean DBG = false;
private static final String LOG_TAG = "SearchView";
- private OnQueryChangeListener mOnQueryChangeListener;
+ private OnQueryTextListener mOnQueryChangeListener;
private OnCloseListener mOnCloseListener;
private OnFocusChangeListener mOnQueryTextFocusChangeListener;
- private OnSuggestionSelectionListener mOnSuggestionListener;
+ private OnSuggestionListener mOnSuggestionListener;
private OnClickListener mOnSearchClickListener;
private boolean mIconifiedByDefault;
@@ -109,7 +109,7 @@
/**
* Callbacks for changes to the query text.
*/
- public interface OnQueryChangeListener {
+ public interface OnQueryTextListener {
/**
* Called when the user submits the query. This could be due to a key press on the
@@ -123,7 +123,7 @@
* @return true if the query has been handled by the listener, false to let the
* SearchView perform the default action.
*/
- boolean onSubmitQuery(String query);
+ boolean onQueryTextSubmit(String query);
/**
* Called when the query text is changed by the user.
@@ -133,7 +133,7 @@
* @return false if the SearchView should perform the default action of showing any
* suggestions if available, true if the action was handled by the listener.
*/
- boolean onQueryTextChanged(String newText);
+ boolean onQueryTextChange(String newText);
}
public interface OnCloseListener {
@@ -151,7 +151,7 @@
* Callback interface for selection events on suggestions. These callbacks
* are only relevant when a SearchableInfo has been specified by {@link #setSearchableInfo}.
*/
- public interface OnSuggestionSelectionListener {
+ public interface OnSuggestionListener {
/**
* Called when a suggestion was selected by navigating to it.
@@ -160,7 +160,7 @@
* @return true if the listener handles the event and wants to override the default
* behavior of possibly rewriting the query based on the selected item, false otherwise.
*/
- boolean onSuggestionSelected(int position);
+ boolean onSuggestionSelect(int position);
/**
* Called when a suggestion was clicked.
@@ -170,7 +170,7 @@
* behavior of launching any intent or submitting a search query specified on that item.
* Return false otherwise.
*/
- boolean onSuggestionClicked(int position);
+ boolean onSuggestionClick(int position);
}
public SearchView(Context context) {
@@ -282,7 +282,7 @@
* @param listener the listener object that receives callbacks when the user performs
* actions in the SearchView such as clicking on buttons or typing a query.
*/
- public void setOnQueryChangeListener(OnQueryChangeListener listener) {
+ public void setOnQueryTextListener(OnQueryTextListener listener) {
mOnQueryChangeListener = listener;
}
@@ -309,7 +309,7 @@
*
* @param listener the listener to inform of suggestion selection events.
*/
- public void setOnSuggestionSelectionListener(OnSuggestionSelectionListener listener) {
+ public void setOnSuggestionListener(OnSuggestionListener listener) {
mOnSuggestionListener = listener;
}
@@ -865,7 +865,7 @@
updateCloseButton();
updateSubmitArea();
if (mOnQueryChangeListener != null) {
- mOnQueryChangeListener.onQueryTextChanged(newText.toString());
+ mOnQueryChangeListener.onQueryTextChange(newText.toString());
}
}
@@ -873,7 +873,7 @@
CharSequence query = mQueryTextView.getText();
if (!TextUtils.isEmpty(query)) {
if (mOnQueryChangeListener == null
- || !mOnQueryChangeListener.onSubmitQuery(query.toString())) {
+ || !mOnQueryChangeListener.onQueryTextSubmit(query.toString())) {
if (mSearchable != null) {
launchQuerySearch(KeyEvent.KEYCODE_UNKNOWN, null, query.toString());
setImeVisibility(false);
@@ -940,7 +940,7 @@
private boolean onItemClicked(int position, int actionKey, String actionMsg) {
if (mOnSuggestionListener == null
- || !mOnSuggestionListener.onSuggestionClicked(position)) {
+ || !mOnSuggestionListener.onSuggestionClick(position)) {
launchSuggestion(position, KeyEvent.KEYCODE_UNKNOWN, null);
setImeVisibility(false);
dismissSuggestions();
@@ -951,7 +951,7 @@
private boolean onItemSelected(int position) {
if (mOnSuggestionListener == null
- || !mOnSuggestionListener.onSuggestionSelected(position)) {
+ || !mOnSuggestionListener.onSuggestionSelect(position)) {
rewriteQueryFromSuggestion(position);
return true;
}
diff --git a/core/java/android/widget/StackView.java b/core/java/android/widget/StackView.java
index 22edf6d..9ec4b74 100644
--- a/core/java/android/widget/StackView.java
+++ b/core/java/android/widget/StackView.java
@@ -384,8 +384,8 @@
}
@Override
- void showOnly(int childIndex, boolean animate, boolean onLayout) {
- super.showOnly(childIndex, animate, onLayout);
+ void showOnly(int childIndex, boolean animate) {
+ super.showOnly(childIndex, animate);
// Here we need to make sure that the z-order of the children is correct
for (int i = mCurrentWindowEnd; i >= mCurrentWindowStart; i--) {
@@ -529,7 +529,7 @@
requestDisallowInterceptTouchEvent(true);
if (mAdapter == null) return;
- final int adapterCount = mAdapter.getCount();
+ final int adapterCount = getCount();
int activeIndex;
if (mStackMode == ITEMS_SLIDE_UP) {
@@ -951,19 +951,6 @@
}
}
- /**
- * {@inheritDoc}
- */
- @Override
- public void onRemoteAdapterConnected() {
- super.onRemoteAdapterConnected();
- // On first run, we want to set the stack to the end.
- if (mWhichChild == -1) {
- mWhichChild = 0;
- }
- setDisplayedChild(mWhichChild);
- }
-
LayoutParams createOrReuseLayoutParams(View v) {
final ViewGroup.LayoutParams currentLp = v.getLayoutParams();
if (currentLp instanceof LayoutParams) {
@@ -979,18 +966,7 @@
@Override
protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
- boolean dataChanged = mDataChanged;
- if (dataChanged) {
- handleDataChanged();
-
- // if the data changes, mWhichChild might be out of the bounds of the adapter
- // in this case, we reset mWhichChild to the beginning
- if (mWhichChild >= mAdapter.getCount())
- mWhichChild = 0;
-
- showOnly(mWhichChild, true, true);
- refreshChildren();
- }
+ checkForAndHandleDataChanged();
final int childCount = getChildCount();
for (int i = 0; i < childCount; i++) {
@@ -1004,8 +980,6 @@
childRight + lp.horizontalOffset, childBottom + lp.verticalOffset);
}
-
- mDataChanged = false;
onLayout();
}
@@ -1014,7 +988,7 @@
long timeSinceLastInteraction = System.currentTimeMillis() - mLastInteractionTime;
if (mAdapter == null) return;
- final int adapterCount = mAdapter.getCount();
+ final int adapterCount = getCount();
if (adapterCount == 1 && mLoopViews) return;
if (mSwipeGestureType == GESTURE_NONE &&
@@ -1089,6 +1063,7 @@
heightSpecSize = height;
} else {
heightSpecSize |= MEASURED_STATE_TOO_SMALL;
+
}
} else {
heightSpecSize = 0;
@@ -1112,7 +1087,6 @@
widthSpecSize = 0;
}
}
-
setMeasuredDimension(widthSpecSize, heightSpecSize);
measureChildren();
}
@@ -1294,4 +1268,4 @@
mask.recycle();
}
}
-}
\ No newline at end of file
+}
diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java
index 1895d79..d09e52f 100644
--- a/core/java/android/widget/TextView.java
+++ b/core/java/android/widget/TextView.java
@@ -3426,8 +3426,7 @@
setError(null, null);
} else {
Drawable dr = getContext().getResources().
- getDrawable(com.android.internal.R.drawable.
- indicator_input_error);
+ getDrawable(com.android.internal.R.drawable.indicator_input_error);
dr.setBounds(0, 0, dr.getIntrinsicWidth(), dr.getIntrinsicHeight());
setError(error, dr);
@@ -3450,8 +3449,7 @@
mErrorWasChanged = true;
final Drawables dr = mDrawables;
if (dr != null) {
- setCompoundDrawables(dr.mDrawableLeft, dr.mDrawableTop,
- icon, dr.mDrawableBottom);
+ setCompoundDrawables(dr.mDrawableLeft, dr.mDrawableTop, icon, dr.mDrawableBottom);
} else {
setCompoundDrawables(null, null, icon, null);
}
@@ -3479,8 +3477,8 @@
if (mPopup == null) {
LayoutInflater inflater = LayoutInflater.from(getContext());
- final TextView err = (TextView) inflater.inflate(com.android.internal.R.layout.textview_hint,
- null);
+ final TextView err = (TextView) inflater.inflate(
+ com.android.internal.R.layout.textview_hint, null);
final float scale = getResources().getDisplayMetrics().density;
mPopup = new ErrorPopup(err, (int) (200 * scale + 0.5f),
diff --git a/core/java/android/widget/TimePicker.java b/core/java/android/widget/TimePicker.java
index 26fbbbd..2688b95 100644
--- a/core/java/android/widget/TimePicker.java
+++ b/core/java/android/widget/TimePicker.java
@@ -26,7 +26,7 @@
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
-import android.widget.NumberPicker.OnValueChangedListener;
+import android.widget.NumberPicker.OnValueChangeListener;
import java.text.DateFormatSymbols;
import java.util.Calendar;
@@ -125,7 +125,7 @@
// hour
mHourSpinner = (NumberPicker) findViewById(R.id.hour);
- mHourSpinner.setOnValueChangedListener(new NumberPicker.OnValueChangedListener() {
+ mHourSpinner.setOnValueChangedListener(new NumberPicker.OnValueChangeListener() {
public void onValueChange(NumberPicker spinner, int oldVal, int newVal) {
if (!is24HourView()) {
int minValue = mHourSpinner.getMinValue();
@@ -154,7 +154,7 @@
mMinuteSpinner.setMaxValue(59);
mMinuteSpinner.setOnLongPressUpdateInterval(100);
mMinuteSpinner.setFormatter(NumberPicker.TWO_DIGIT_FORMATTER);
- mMinuteSpinner.setOnValueChangedListener(new NumberPicker.OnValueChangedListener() {
+ mMinuteSpinner.setOnValueChangedListener(new NumberPicker.OnValueChangeListener() {
public void onValueChange(NumberPicker spinner, int oldVal, int newVal) {
int minValue = mMinuteSpinner.getMinValue();
int maxValue = mMinuteSpinner.getMaxValue();
@@ -200,7 +200,7 @@
mAmPmSpinner.setMinValue(0);
mAmPmSpinner.setMaxValue(1);
mAmPmSpinner.setDisplayedValues(mAmPmStrings);
- mAmPmSpinner.setOnValueChangedListener(new OnValueChangedListener() {
+ mAmPmSpinner.setOnValueChangedListener(new OnValueChangeListener() {
public void onValueChange(NumberPicker picker, int oldVal, int newVal) {
picker.requestFocus();
mIsAm = !mIsAm;
diff --git a/core/java/com/android/internal/app/ActionBarImpl.java b/core/java/com/android/internal/app/ActionBarImpl.java
index a8eb6fe..b1b5d71 100644
--- a/core/java/com/android/internal/app/ActionBarImpl.java
+++ b/core/java/com/android/internal/app/ActionBarImpl.java
@@ -277,36 +277,6 @@
setSubtitle(mContext.getString(resId));
}
- public void setCustomNavigationMode(View view) {
- cleanupTabs();
- setCustomView(view);
- setDisplayOptions(DISPLAY_SHOW_CUSTOM, DISPLAY_SHOW_CUSTOM | DISPLAY_SHOW_TITLE);
- mActionView.setNavigationMode(NAVIGATION_MODE_STANDARD);
- mActionView.setCallback(null);
- }
-
- public void setDropdownNavigationMode(SpinnerAdapter adapter, OnNavigationListener callback) {
- setDropdownNavigationMode(adapter, callback, -1);
- }
-
- public void setDropdownNavigationMode(SpinnerAdapter adapter, OnNavigationListener callback,
- int defaultSelectedPosition) {
- cleanupTabs();
- setDisplayOptions(0, DISPLAY_SHOW_CUSTOM | DISPLAY_SHOW_TITLE);
- mActionView.setNavigationMode(NAVIGATION_MODE_LIST);
- setListNavigationCallbacks(adapter, callback);
- if (defaultSelectedPosition >= 0) {
- mActionView.setDropdownSelectedPosition(defaultSelectedPosition);
- }
- }
-
- public void setStandardNavigationMode() {
- cleanupTabs();
- setDisplayOptions(DISPLAY_SHOW_TITLE, DISPLAY_SHOW_TITLE | DISPLAY_SHOW_CUSTOM);
- mActionView.setNavigationMode(NAVIGATION_MODE_STANDARD);
- mActionView.setCallback(null);
- }
-
public void setSelectedNavigationItem(int position) {
switch (mActionView.getNavigationMode()) {
case NAVIGATION_MODE_TABS:
@@ -321,10 +291,6 @@
}
}
- public int getSelectedNavigationItem() {
- return getSelectedNavigationIndex();
- }
-
public void removeAllTabs() {
cleanupTabs();
}
@@ -359,10 +325,6 @@
mContainerView.setBackgroundDrawable(d);
}
- public View getCustomNavigationView() {
- return getCustomView();
- }
-
public View getCustomView() {
return mActionView.getCustomNavigationView();
}
@@ -477,16 +439,6 @@
}
@Override
- public void setTabNavigationMode() {
- if (mActivity == null) {
- throw new IllegalStateException(
- "Tab navigation mode cannot be used outside of an Activity");
- }
- setDisplayOptions(0, DISPLAY_SHOW_TITLE | DISPLAY_SHOW_CUSTOM);
- mActionView.setNavigationMode(NAVIGATION_MODE_TABS);
- }
-
- @Override
public void selectTab(Tab tab) {
if (getNavigationMode() != NAVIGATION_MODE_TABS) {
mSavedTabPosition = tab != null ? tab.getPosition() : INVALID_POSITION;
diff --git a/core/java/com/android/internal/widget/ActionBarView.java b/core/java/com/android/internal/widget/ActionBarView.java
index 297dde7..d44d4a5 100644
--- a/core/java/com/android/internal/widget/ActionBarView.java
+++ b/core/java/com/android/internal/widget/ActionBarView.java
@@ -370,12 +370,6 @@
}
public void setDisplayOptions(int options) {
- // TODO Remove this once DISPLAY_HIDE_HOME is removed
- if ((options & ActionBar.DISPLAY_HIDE_HOME) != 0) {
- options &= ~(ActionBar.DISPLAY_HIDE_HOME | ActionBar.DISPLAY_SHOW_HOME);
- }
- // End TODO
-
final int flagsChanged = options ^ mDisplayOptions;
mDisplayOptions = options;
if ((flagsChanged & DISPLAY_RELAYOUT_MASK) != 0) {
diff --git a/core/java/com/android/internal/widget/EditableInputConnection.java b/core/java/com/android/internal/widget/EditableInputConnection.java
index 6a1beb4..e992e7c 100644
--- a/core/java/com/android/internal/widget/EditableInputConnection.java
+++ b/core/java/com/android/internal/widget/EditableInputConnection.java
@@ -142,10 +142,6 @@
boolean success = super.commitText(text, newCursorPosition);
CharSequence errorAfter = mTextView.getError();
- if (errorAfter != null && errorBefore == errorAfter) {
- mTextView.setError(null, null);
- }
-
return success;
}
}
diff --git a/core/java/com/android/internal/widget/PasswordEntryKeyboard.java b/core/java/com/android/internal/widget/PasswordEntryKeyboard.java
index facda36..3c01c69 100644
--- a/core/java/com/android/internal/widget/PasswordEntryKeyboard.java
+++ b/core/java/com/android/internal/widget/PasswordEntryKeyboard.java
@@ -20,16 +20,9 @@
import android.content.Context;
import android.content.res.Resources;
import android.content.res.XmlResourceParser;
-import android.graphics.Bitmap;
-import android.graphics.Canvas;
-import android.graphics.Paint;
-import android.graphics.PorterDuff;
-import android.graphics.Paint.Align;
-import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.inputmethodservice.Keyboard;
import android.inputmethodservice.KeyboardView;
-import android.util.Log;
import com.android.internal.R;
/**
@@ -40,7 +33,6 @@
* keypad with alpha characters hints.
*/
public class PasswordEntryKeyboard extends Keyboard {
- private static final String TAG = "PasswordEntryKeyboard";
private static final int SHIFT_OFF = 0;
private static final int SHIFT_ON = 1;
private static final int SHIFT_LOCKED = 2;
@@ -48,17 +40,14 @@
private Drawable mShiftIcon;
private Drawable mShiftLockIcon;
- private Drawable mShiftLockPreviewIcon;
- private Drawable mOldShiftIcon;
- private Drawable mOldShiftPreviewIcon;
- private Drawable mSpaceIcon;
- private Key mShiftKey;
+
+ // These two arrays must be the same length
+ private Drawable[] mOldShiftIcons = { null, null };
+ private Key[] mShiftKeys = { null, null };
+
private Key mEnterKey;
private Key mF1Key;
private Key mSpaceKey;
- private Locale mLocale;
- private Resources mRes;
- private int mExtensionResId;
private int mShiftState = SHIFT_OFF;
static int sSpacebarVerticalCorrection;
@@ -84,14 +73,8 @@
private void init(Context context) {
final Resources res = context.getResources();
- mRes = res;
mShiftIcon = res.getDrawable(R.drawable.sym_keyboard_shift);
mShiftLockIcon = res.getDrawable(R.drawable.sym_keyboard_shift_locked);
- mShiftLockPreviewIcon = res.getDrawable(R.drawable.sym_keyboard_feedback_shift_locked);
- mShiftLockPreviewIcon.setBounds(0, 0,
- mShiftLockPreviewIcon.getIntrinsicWidth(),
- mShiftLockPreviewIcon.getIntrinsicHeight());
- mSpaceIcon = res.getDrawable(R.drawable.sym_keyboard_space);
sSpacebarVerticalCorrection = res.getDimensionPixelOffset(
R.dimen.password_keyboard_spacebar_vertical_correction);
}
@@ -157,14 +140,16 @@
*
*/
void enableShiftLock() {
- int index = getShiftKeyIndex();
- if (index >= 0) {
- mShiftKey = getKeys().get(index);
- if (mShiftKey instanceof LatinKey) {
- ((LatinKey)mShiftKey).enableShiftLock();
+ int i = 0;
+ for (int index : getShiftKeyIndices()) {
+ if (index >= 0 && i < mShiftKeys.length) {
+ mShiftKeys[i] = getKeys().get(index);
+ if (mShiftKeys[i] instanceof LatinKey) {
+ ((LatinKey)mShiftKeys[i]).enableShiftLock();
+ }
+ mOldShiftIcons[i] = mShiftKeys[i].icon;
+ i++;
}
- mOldShiftIcon = mShiftKey.icon;
- mOldShiftPreviewIcon = mShiftKey.iconPreview;
}
}
@@ -176,17 +161,13 @@
* @param shiftLocked
*/
void setShiftLocked(boolean shiftLocked) {
- if (mShiftKey != null) {
- if (shiftLocked) {
- mShiftKey.on = true;
- mShiftKey.icon = mShiftLockIcon;
- mShiftState = SHIFT_LOCKED;
- } else {
- mShiftKey.on = false;
- mShiftKey.icon = mShiftLockIcon;
- mShiftState = SHIFT_ON;
+ for (Key shiftKey : mShiftKeys) {
+ if (shiftKey != null) {
+ shiftKey.on = shiftLocked;
+ shiftKey.icon = mShiftLockIcon;
}
}
+ mShiftState = shiftLocked ? SHIFT_LOCKED : SHIFT_ON;
}
/**
@@ -199,20 +180,25 @@
@Override
public boolean setShifted(boolean shiftState) {
boolean shiftChanged = false;
- if (mShiftKey != null) {
- if (shiftState == false) {
- shiftChanged = mShiftState != SHIFT_OFF;
- mShiftState = SHIFT_OFF;
- mShiftKey.on = false;
- mShiftKey.icon = mOldShiftIcon;
- } else if (mShiftState == SHIFT_OFF) {
- shiftChanged = mShiftState == SHIFT_OFF;
- mShiftState = SHIFT_ON;
- mShiftKey.on = false;
- mShiftKey.icon = mShiftIcon;
+ if (shiftState == false) {
+ shiftChanged = mShiftState != SHIFT_OFF;
+ mShiftState = SHIFT_OFF;
+ } else if (mShiftState == SHIFT_OFF) {
+ shiftChanged = mShiftState == SHIFT_OFF;
+ mShiftState = SHIFT_ON;
+ }
+ for (int i = 0; i < mShiftKeys.length; i++) {
+ if (mShiftKeys[i] != null) {
+ if (shiftState == false) {
+ mShiftKeys[i].on = false;
+ mShiftKeys[i].icon = mOldShiftIcons[i];
+ } else if (mShiftState == SHIFT_OFF) {
+ mShiftKeys[i].on = false;
+ mShiftKeys[i].icon = mShiftIcon;
+ }
+ } else {
+ // return super.setShifted(shiftState);
}
- } else {
- return super.setShifted(shiftState);
}
return shiftChanged;
}
@@ -223,7 +209,7 @@
*/
@Override
public boolean isShifted() {
- if (mShiftKey != null) {
+ if (mShiftKeys[0] != null) {
return mShiftState != SHIFT_OFF;
} else {
return super.isShifted();
diff --git a/core/java/com/android/internal/widget/PasswordEntryKeyboardView.java b/core/java/com/android/internal/widget/PasswordEntryKeyboardView.java
index 3e6f6f3..b37adff 100644
--- a/core/java/com/android/internal/widget/PasswordEntryKeyboardView.java
+++ b/core/java/com/android/internal/widget/PasswordEntryKeyboardView.java
@@ -36,4 +36,15 @@
super(context, attrs, defStyle);
}
+ @Override
+ public boolean setShifted(boolean shifted) {
+ boolean result = super.setShifted(shifted);
+ // invalidate both shift keys
+ int[] indices = getKeyboard().getShiftKeyIndices();
+ for (int index : indices) {
+ invalidateKey(index);
+ }
+ return result;
+ }
+
}
diff --git a/core/jni/android_util_AssetManager.cpp b/core/jni/android_util_AssetManager.cpp
index 619a293..1bce332 100644
--- a/core/jni/android_util_AssetManager.cpp
+++ b/core/jni/android_util_AssetManager.cpp
@@ -1111,6 +1111,7 @@
if (value.dataType == Res_value::TYPE_REFERENCE && value.data == 0) {
DEBUG_STYLES(LOGI("-> Setting to @null!"));
value.dataType = Res_value::TYPE_NULL;
+ block = kXmlBlock;
}
DEBUG_STYLES(LOGI("Attribute 0x%08x: type=0x%x, data=0x%08x",
diff --git a/core/jni/android_view_GLES20Canvas.cpp b/core/jni/android_view_GLES20Canvas.cpp
index bfd2b58e..554e336f 100644
--- a/core/jni/android_view_GLES20Canvas.cpp
+++ b/core/jni/android_view_GLES20Canvas.cpp
@@ -271,6 +271,22 @@
renderer->drawBitmap(bitmap, matrix, paint);
}
+static void android_view_GLES20Canvas_drawBitmapMesh(JNIEnv* env, jobject canvas,
+ OpenGLRenderer* renderer, SkBitmap* bitmap, jbyteArray buffer,
+ jint meshWidth, jint meshHeight, jfloatArray vertices, jint offset,
+ jintArray colors, jint colorOffset, SkPaint* paint) {
+ // This object allows the renderer to allocate a global JNI ref to the buffer object.
+ JavaHeapBitmapRef bitmapRef(env, bitmap, buffer);
+
+ jfloat* verticesArray = vertices ? env->GetFloatArrayElements(vertices, NULL) + offset : NULL;
+ jint* colorsArray = colors ? env->GetIntArrayElements(colors, NULL) + colorOffset : NULL;
+
+ renderer->drawBitmapMesh(bitmap, meshWidth, meshHeight, verticesArray, colorsArray, paint);
+
+ if (vertices) env->ReleaseFloatArrayElements(vertices, verticesArray, 0);
+ if (colors) env->ReleaseIntArrayElements(colors, colorsArray, 0);
+}
+
static void android_view_GLES20Canvas_drawPatch(JNIEnv* env, jobject canvas,
OpenGLRenderer* renderer, SkBitmap* bitmap, jbyteArray buffer, jbyteArray chunks,
float left, float top, float right, float bottom, SkPaint* paint) {
@@ -393,24 +409,24 @@
}
static void android_view_GLES20Canvas_drawTextArray(JNIEnv* env, jobject canvas,
- OpenGLRenderer* renderer, jcharArray text, int index, int count,
- jfloat x, jfloat y, int flags, SkPaint* paint) {
+ OpenGLRenderer* renderer, jcharArray text, jint index, jint count,
+ jfloat x, jfloat y, jint flags, SkPaint* paint) {
jchar* textArray = env->GetCharArrayElements(text, NULL);
renderText(renderer, textArray + index, count, x, y, flags, paint);
env->ReleaseCharArrayElements(text, textArray, JNI_ABORT);
}
static void android_view_GLES20Canvas_drawText(JNIEnv* env, jobject canvas,
- OpenGLRenderer* renderer, jstring text, int start, int end,
- jfloat x, jfloat y, int flags, SkPaint* paint) {
+ OpenGLRenderer* renderer, jstring text, jint start, jint end,
+ jfloat x, jfloat y, jint flags, SkPaint* paint) {
const jchar* textArray = env->GetStringChars(text, NULL);
renderText(renderer, textArray + start, end - start, x, y, flags, paint);
env->ReleaseStringChars(text, textArray);
}
static void android_view_GLES20Canvas_drawTextRunArray(JNIEnv* env, jobject canvas,
- OpenGLRenderer* renderer, jcharArray text, int index, int count,
- int contextIndex, int contextCount, jfloat x, jfloat y, int dirFlags,
+ OpenGLRenderer* renderer, jcharArray text, jint index, jint count,
+ jint contextIndex, jint contextCount, jfloat x, jfloat y, jint dirFlags,
SkPaint* paint) {
jchar* textArray = env->GetCharArrayElements(text, NULL);
renderTextRun(renderer, textArray + contextIndex, index - contextIndex,
@@ -419,8 +435,8 @@
}
static void android_view_GLES20Canvas_drawTextRun(JNIEnv* env, jobject canvas,
- OpenGLRenderer* renderer, jstring text, int start, int end,
- int contextStart, int contextEnd, jfloat x, jfloat y, int dirFlags,
+ OpenGLRenderer* renderer, jstring text, jint start, jint end,
+ jint contextStart, int contextEnd, jfloat x, jfloat y, jint dirFlags,
SkPaint* paint) {
const jchar* textArray = env->GetStringChars(text, NULL);
jint count = end - start;
@@ -573,10 +589,13 @@
{ "nGetMatrix", "(II)V", (void*) android_view_GLES20Canvas_getMatrix },
{ "nConcatMatrix", "(II)V", (void*) android_view_GLES20Canvas_concatMatrix },
- { "nDrawBitmap", "(II[BFFI)V", (void*) android_view_GLES20Canvas_drawBitmap },
- { "nDrawBitmap", "(II[BFFFFFFFFI)V", (void*) android_view_GLES20Canvas_drawBitmapRect },
- { "nDrawBitmap", "(II[BII)V", (void*) android_view_GLES20Canvas_drawBitmapMatrix },
- { "nDrawPatch", "(II[B[BFFFFI)V", (void*) android_view_GLES20Canvas_drawPatch },
+ { "nDrawBitmap", "(II[BFFI)V", (void*) android_view_GLES20Canvas_drawBitmap },
+ { "nDrawBitmap", "(II[BFFFFFFFFI)V",(void*) android_view_GLES20Canvas_drawBitmapRect },
+ { "nDrawBitmap", "(II[BII)V", (void*) android_view_GLES20Canvas_drawBitmapMatrix },
+
+ { "nDrawBitmapMesh", "(II[BII[FI[III)V",(void*) android_view_GLES20Canvas_drawBitmapMesh },
+
+ { "nDrawPatch", "(II[B[BFFFFI)V", (void*) android_view_GLES20Canvas_drawPatch },
{ "nDrawColor", "(III)V", (void*) android_view_GLES20Canvas_drawColor },
{ "nDrawRect", "(IFFFFI)V", (void*) android_view_GLES20Canvas_drawRect },
diff --git a/core/res/res/drawable-hdpi/numberpicker_selection_divider.9.png b/core/res/res/drawable-hdpi/numberpicker_selection_divider.9.png
new file mode 100644
index 0000000..7719df8
--- /dev/null
+++ b/core/res/res/drawable-hdpi/numberpicker_selection_divider.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/numberpicker_selection_divider.9.png b/core/res/res/drawable-mdpi/numberpicker_selection_divider.9.png
new file mode 100644
index 0000000..a933d9a
--- /dev/null
+++ b/core/res/res/drawable-mdpi/numberpicker_selection_divider.9.png
Binary files differ
diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml
index 457baa6..fbd5b5e 100755
--- a/core/res/res/values/attrs.xml
+++ b/core/res/res/values/attrs.xml
@@ -3093,6 +3093,10 @@
<attr name="solidColor" format="color|reference" />
<!-- @hide Whether the number picker supports fligning. -->
<attr name="flingable" format="boolean" />
+ <!-- @hide The divider for making the selection area. -->
+ <attr name="selectionDivider" format="reference" />
+ <!-- @hide The height of the selection divider. -->
+ <attr name="selectionDividerHeight" format="dimension" />
</declare-styleable>
<declare-styleable name="TimePicker">
@@ -4644,8 +4648,6 @@
<flag name="homeAsUp" value="0x4" />
<flag name="showTitle" value="0x8" />
<flag name="showCustom" value="0x10" />
- <!-- DEPRECATED - Remove this later!! -->
- <flag name="hideHome" value="0x1000" />
</attr>
<!-- Specifies title text used for navigationMode="normal" -->
<attr name="title" />
diff --git a/core/res/res/values/public.xml b/core/res/res/values/public.xml
index a30e316..786c4d0 100644
--- a/core/res/res/values/public.xml
+++ b/core/res/res/values/public.xml
@@ -1468,7 +1468,6 @@
<!-- Context menu ID for the "Select text..." menu item to switch to text
selection context mode in text views. -->
<public type="id" name="selectTextMode" />
- <public type="id" name="up" />
<public type="dimen" name="dialog_min_width_major" />
<public type="dimen" name="dialog_min_width_minor" />
diff --git a/core/res/res/values/styles.xml b/core/res/res/values/styles.xml
index b7b43e0..939e9ef 100644
--- a/core/res/res/values/styles.xml
+++ b/core/res/res/values/styles.xml
@@ -1514,6 +1514,8 @@
<style name="Widget.Holo.NumberPicker" parent="Widget.NumberPicker">
<item name="android:solidColor">@android:color/transparent</item>
<item name="android:flingable">true</item>
+ <item name="android:selectionDivider">@android:drawable/numberpicker_selection_divider</item>
+ <item name="android:selectionDividerHeight">2dip</item>
</style>
<style name="Widget.Holo.TimePicker" parent="Widget.TimePicker">
diff --git a/docs/html/guide/developing/device.jd b/docs/html/guide/developing/device.jd
index 4bed963c..657f549 100644
--- a/docs/html/guide/developing/device.jd
+++ b/docs/html/guide/developing/device.jd
@@ -13,8 +13,12 @@
</ol>
<h2>See also</h2>
<ol>
+ <li><a href="{@docRoot}sdk/win-usb.html">Google USB Driver</a></li>
+ <li><a href="{@docRoot}sdk/oem-usb.html">OEM USB Drivers</a></li>
<li><a
- href="{@docRoot}sdk/win-usb.html">USB Driver for Windows</a></li>
+href="{@docRoot}guide/developing/eclipse-adt.html">Developing in Eclipse, with ADT</a></li>
+ <li><a
+href="{@docRoot}guide/developing/other-ide.html">Developing in other IDEs</a></li>
</ol>
</div>
</div>
@@ -66,8 +70,10 @@
<li>Setup your system to detect your device.
<ul>
<li>If you're developing on Windows, you need to install a USB driver
- for adb. See the <a href="{@docRoot}sdk/win-usb.html">Windows USB
- Driver</a> documentation.</li>
+ for adb. If you're using an Android Developer Phone (ADP), Nexus One, or Nexus S,
+ see the <a href="{@docRoot}sdk/win-usb.html">Google Windows USB
+ Driver</a>. Otherwise, you can find a link to the appropriate OEM driver in the
+ <a href="{@docRoot}sdk/oem-usb.html">OEM USB Drivers</a> document.</li>
<li>If you're developing on Mac OS X, it just works. Skip this step.</li>
<li>If you're developing on Ubuntu Linux, you need to add a rules file
that contains a USB configuration for each type of device you want to use for
diff --git a/docs/html/guide/topics/manifest/supports-screens-element.jd b/docs/html/guide/topics/manifest/supports-screens-element.jd
index 620d3b2..64a7a58 100644
--- a/docs/html/guide/topics/manifest/supports-screens-element.jd
+++ b/docs/html/guide/topics/manifest/supports-screens-element.jd
@@ -9,6 +9,7 @@
<supports-screens android:<a href="#small">smallScreens</a>=["true" | "false"]
android:<a href="#normal">normalScreens</a>=["true" | "false"]
android:<a href="#large">largeScreens</a>=["true" | "false"]
+ android:<a href="#xlarge">xlargeScreens</a>=["true" | "false"]
android:<a href="#any">anyDensity</a>=["true" | "false"] />
</pre>
</dd>
@@ -31,7 +32,7 @@
The screen density is expressed as dots-per-inch (dpi).</p>
<p>For more information, see
-<a href="{@docRoot}guide/practices/screens_support.html">Multiple Screens Support</a>.</p>
+<a href="{@docRoot}guide/practices/screens_support.html">Supporting Multiple Screens</a>.</p>
<dt>attributes:</dt>
@@ -43,8 +44,10 @@
the "normal" (traditional HVGA) screen. An application that does
not support small screens <em>will not be available</em> for
small screen devices, because there is little the platform can do
- to make such an application work on a smaller screen. Applications using
- API Level 4 or higher default this to "true", others are "false".
+ to make such an application work on a smaller screen. If the application has set the <a
+href="{@docRoot}guide/topics/manifest/uses-sdk-element.html">{@code <uses-sdk>}</a> element's
+{@code android:minSdkVersion} or {@code android:targetSdkVersion} attribute to "4" or higher,
+the default value for this is "true", any value less than "4" results in this set to "false".
</dd>
<dt><a name="normal"></a>{@code android:normalScreens}</dt>
@@ -60,15 +63,33 @@
A large screen is defined as a screen that is significantly larger
than a "normal" phone screen, and thus may require some special care
on the application's part to make good use of it. An application that
- does not support large screens will be placed as a "postage stamp" on
- such a screen, so that it retains the dimensions it was originally
- designed for. Applications using API Level 4 or higher default
- to "true", others are "false".
+ does not support large screens (declares this "false")—but does support "normal" or
+"small" screens—will be placed as a "postage stamp" on
+ a large screen, so that it retains the dimensions it was originally
+ designed for. If the application has set the <a
+href="{@docRoot}guide/topics/manifest/uses-sdk-element.html">{@code <uses-sdk>}</a> element's
+{@code android:minSdkVersion} or {@code android:targetSdkVersion} attribute to "4" or higher,
+the default value for this is "true", any value less than "4" results in this set to "false".
+ </dd>
+
+ <dt><a name="xlarge"></a>{@code android:xlargeScreens}</dt>
+ <dd>Indicates whether the application supports extra large screen form-factors.
+ An xlarge screen is defined as a screen that is significantly larger
+ than a "large" screen, such as a tablet (or something larger) and may require special care
+ on the application's part to make good use of it. An application that
+ does not support xlarge screens (declares this "false")—but does support "large",
+"normal", or "small" screens—will be placed as a "postage stamp" on
+ an xlarge screen, so that it retains the dimensions it was originally
+ designed for. If the application has set the <a
+href="{@docRoot}guide/topics/manifest/uses-sdk-element.html">{@code <uses-sdk>}</a> element's
+{@code android:minSdkVersion} or {@code android:targetSdkVersion} attribute to "4" or higher,
+the default value for this is "true", any value less than "4" results in this set to "false".
+ <p>This attribute was introduced in API Level 9.</p>
</dd>
<dt><a name="any"></a>{@code android:anyDensity}</dt>
- <dd>Indicates whether the application can accommodate any screen
- density. Older applications (pre API Level 4) are assumed unable to
+ <dd>Indicates whether the application includes resources to accommodate any screen
+ density. Older applications (before API Level 4) are assumed unable to
accomodate all densities and this is "false" by default. Applications using
API Level 4 or higher are assumed able to and this is "true" by default.
You can explicitly supply your abilities here.
@@ -84,7 +105,8 @@
<dt>see also:</dt>
<dd>
<ul>
- <li><a href="{@docRoot}guide/practices/screens_support.html">Multiple Screens Support</a></li>
+ <li><a href="{@docRoot}guide/practices/screens_support.html">Supporting Multiple
+Screens</a></li>
<li>{@link android.util.DisplayMetrics}</li>
</ul>
</dd>
diff --git a/docs/html/guide/topics/ui/actionbar.jd b/docs/html/guide/topics/ui/actionbar.jd
index c17fc3c..376bf6a 100644
--- a/docs/html/guide/topics/ui/actionbar.jd
+++ b/docs/html/guide/topics/ui/actionbar.jd
@@ -425,7 +425,7 @@
<p>If your activity is stopped, you should retain the currently selected tab with the saved state so
that when the user returns to your application, you can open the tab. When it's time to save the
state, you can query the currently selected tab with {@link
-android.app.ActionBar#getSelectedNavigationItem()}. This returns the index position of the selected
+android.app.ActionBar#getSelectedNavigationIndex()}. This returns the index position of the selected
tab.</p>
<p class="caution"><strong>Caution:</strong> It's important that you save
diff --git a/docs/html/guide/tutorials/views/hello-webview.jd b/docs/html/guide/tutorials/views/hello-webview.jd
index c4388ea..a927b04 100644
--- a/docs/html/guide/tutorials/views/hello-webview.jd
+++ b/docs/html/guide/tutorials/views/hello-webview.jd
@@ -12,8 +12,8 @@
<pre>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
android:orientation="vertical">
<WebView
@@ -69,7 +69,7 @@
<li>Now, in the <code>onCreate()</code> method, set an instance of the <code>HelloWebViewClient</code>
as our WebViewClient:
- <pre>webview.setWebViewClient(new WebViewClientDemo());</pre>
+ <pre>webview.setWebViewClient(new HelloWebViewClient());</pre>
<p>This line should immediately follow the initialization of our WebView object.</p>
<p>What we've done is create a WebViewClient that will load any URL selected in our
diff --git a/docs/html/images/developing/sdk-usb-driver.png b/docs/html/images/developing/sdk-usb-driver.png
new file mode 100644
index 0000000..207d3d7
--- /dev/null
+++ b/docs/html/images/developing/sdk-usb-driver.png
Binary files differ
diff --git a/docs/html/sdk/android-3.0.jd b/docs/html/sdk/android-3.0.jd
new file mode 100644
index 0000000..6896f52
--- /dev/null
+++ b/docs/html/sdk/android-3.0.jd
@@ -0,0 +1,668 @@
+page.title=Android 3.0 Platform
+@jd:body
+
+<div id="qv-wrapper">
+<div id="qv">
+
+<h2>In this document</h2>
+<ol>
+ <li><a href="#api">API Overview</a></li>
+ <li><a href="#api-level">API Level</a></li>
+ <li><a href="#apps">Built-in Applications</a></li>
+ <li><a href="#locs">Locales</a></li>
+ <li><a href="#skins">Emulator Skins</a></li>
+</ol>
+
+<h2>Reference</h2>
+<ol>
+<li><a
+href="{@docRoot}sdk/api_diff/honeycomb/changes.html">API
+Differences Report »</a> </li>
+</ol>
+
+<h2>See Also</h2>
+<ol>
+ <li><a href="{@docRoot}sdk/preview/start.html">Getting Started</a></li>
+</ol>
+
+</div>
+</div>
+
+</p>API Level: <b>Honeycomb</b></p>
+
+<p>For developers, the Android 3.0 preview is available as a downloadable component for the
+Android SDK. The downloadable platform includes an Android library and system image, as well as a
+set of emulator skins and more. The downloadable platform includes no external libraries.</p>
+
+
+
+
+<h2 id="#api">API Overview</h2>
+
+<p>The sections below provide a technical overview of what's new for developers in Android 3.0,
+including new features and changes in the framework API since the previous version.</p>
+
+
+
+
+<h3>Fragments</h3>
+
+<p>A fragment is a new framework component that allows you to separate distinct elements of an
+activity into self-contained modules that define their own UI and lifecycle. To create a
+fragment, you must extend the {@link android.app.Fragment} class and implement several lifecycle
+callback methods, similar to an {@link android.app.Activity}. You can then combine multiple
+fragments in a single activity to build a multi-pane UI in which each
+pane manages its own lifecycle and user inputs.</p>
+
+<p>You can also use a fragment without providing a UI and instead use the fragment as a worker
+for the activity, such as to manage the progress of a download that occurs only while the
+activity is running.</p>
+
+<p>Additionally:</p>
+
+<ul>
+ <li>Fragments are self-contained and can be reused in multiple activities</li>
+ <li>Fragments can be added, removed, replaced and animated inside the activity</li>
+ <li>Fragment can be added to a back stack managed by the activity, preserving the state of
+fragments as they are changed and allowing the user to navigate backward through the different
+states</li>
+ <li>By <a
+href="{@docRoot}guide/topics/resources/providing-resources.html#AlternativeResources">providing
+alternative resources</a>, you can mix and match fragments, based
+on the screen size and orientation</li>
+ <li>Fragments have direct access to their container activity and can contribute items to the
+activity's Action Bar (discussed next)</li>
+</ul>
+
+<p>To manage the fragments in your activity, you must use the {@link
+android.app.FragmentManager}, which provides several APIs for interacting with fragments, such
+as finding fragments in the activity and popping fragments off the back stack to restore them
+after they've been removed or hidden.</p>
+
+<p>To perform transactions, such as add or remove fragments, you must create a {@link
+android.app.FragmentTransaction}. You can then call methods such as {@link
+android.app.FragmentTransaction#add add()} {@link android.app.FragmentTransaction#remove
+remove()}, {@link android.app.FragmentTransaction#replace replace()}. Once you've applied all
+the changes you want to perform for the transaction, you must call {@link
+android.app.FragmentTransaction#commit commit()} and the system will apply the transaction to
+the activity.</p>
+
+<p>For more information about using fragments in your application, read the <a
+href="{@docRoot}guide/topics/fundamentals/fragments.html">Fragments</a> developer guide.</p>
+
+
+
+
+<h3>Action Bar</h3>
+
+<p>The Action Bar is a replacement for the traditional title bar at the top of the activity
+window. It includes the application logo in the left corner and also replaces the previous Options
+Menu UI with a drop-down list for the menu items. Additionally, the Action Bar allows you
+to:</p></p>
+
+<ul>
+ <li>Include select menu items directly in the Action Bar—as "action
+items"—for quick access to global actions.
+ <p>In your XML declaration for the menu item, include the attribute, {@code
+android:showAsAction} with a value of {@code "ifRoom"}. When there's enough room in the
+Action Bar, the menu item appears directly in the bar. Otherwise, it is placed in the
+overflow menu, revealed by the icon on the right side of the Action Bar.</p></li>
+ <li>Add interactive widgets ("action views"), such as a search box.
+ <p>In your XML, include the attribute, {@code android:actionViewLayout} with a layout
+resource for the action view, or {@code android:actionViewClass} with the class name of the
+widget. Like action items, an action view appears only when there's room for it in the Action
+Bar. If there's not enough room, it is placed in the overflow menu and behaves like a regular
+menu item (for example, an item can provide a {@link android.widget.SearchView} as an action
+view, but when in the overflow menu, selecting the item will activate the search dialog).</p>
+ <p></p></li>
+ <li>Add an action to the application logo when tapped and replace it with a custom logo
+ <p>The application logo is automatically assigned the {@code android.R.id.home} ID,
+which is delivered to your activity's {@link android.app.Activity#onOptionsItemSelected
+onOptionsItemSelected()} callback when tapped. Simply respond to this ID in your callback
+method to perform an action such as go to your application's "home" activity.</p>
+ <p>If your activity does not respond to the icon action, you should hide it by calling {@link
+android.app.ActionBar#setDisplayShowHomeEnabled setDisplayShowHomeEnabled(false)}.</p>
+ <p>By default, this is true, so the icon will visually respond when pressed, even if you don't
+respond. Thus, you should remove the icon if you don't respond to it.</p></li>
+ <li>Add breadcrumbs for navigating backward through fragments</li>
+ <li>Add built in tabs and a drop-down list for navigation</li>
+ <li>Customize the Action Bar themes and custom backgrounds</li>
+</ul>
+
+<p>The Action Bar is standard for all applications that set either the <a
+href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#min">{@code
+android:minSdkVersion}</a> or <a
+href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target">{@code
+android:targetSdkVersion}</a> to {@code "Honeycomb"}. (The "Honeycomb" API Level is provisional
+and effective only while using the preview SDK—you must change it to the official API
+Level when the final SDK becomes available.)</p>
+
+<p>For more information, read the <a href="{@docRoot}guide/topics/ui/actionbar.html">Action
+Bar</a> developer guide.</p>
+
+
+
+
+<h3>System clipboard</h3>
+
+<p>Applications can now copy and paste data (beyond mere text) to and from the system-wide
+clipboard. Clipped data can be plain text, a URI, or an intent.</p>
+
+<p>By providing the system access to your data in a content provider, the user can copy complex
+content (such as an image or data structure) from your application and paste it into another
+application that supports that type of content.</p>
+
+<p>To start using the clipboard, get the global {@link android.content.ClipboardManager} object
+by calling {@link android.content.Context#getSystemService getSystemService(CLIPBOARD_SERVICE)}.</p>
+
+<p>To create an item to attach to the clipboard, you need to create a new {@link
+android.content.ClipData} object, which holds one or more {@link android.content.ClipData.Item}
+objects, each describing a single entity. To create a {@link android.content.ClipData} object with
+just one {@link android.content.ClipData.Item}, you can use one of the helper methods such as,
+{@link android.content.ClipData#newPlainText newPlainText()}, {@link
+android.content.ClipData#newUri newUri()}, and {@link android.content.ClipData#newIntent
+newIntent()}, which each return a {@link android.content.ClipData} object pre-loaded with the
+appropriate {@link android.content.ClipData.Item}.</p>
+
+<p>To add the {@link android.content.ClipData} to the clipboard, pass it to {@link
+android.content.ClipboardManager#setPrimaryClip setPrimaryClip()} for your instance of {@link
+android.content.ClipboardManager}.</p>
+
+<p>You can then acquire ("paste") a file from the clipboard by calling {@link
+android.content.ClipboardManager#getPrimaryClip()} on the {@link
+android.content.ClipboardManager}. Handling the {@link android.content.ClipData} you receive can
+be more complicated and you need to be sure you can actually handle the data type.</p>
+
+<p>For more information, see the {@link android.content.ClipData} class reference. You can also see
+an example implementation of copy and paste in the <a
+href="{@docRoot}resources/samples/NotePad/index.html">NotePad</a> sample application.</p>
+
+
+
+
+<h3>Drag and drop</h3>
+
+<p>New APIs now facilitate the ability for your application to implement drag and drop
+functionality in the UI.</p>
+
+<p>To drag a {@link android.view.View} in your activity, call {@link android.view.View#startDrag
+startDrag()} on the object, providing a {@link android.content.ClipData} object that represents the
+information to drag, a {@link android.view.View.DragShadowBuilder} to facilitate the "shadow" that
+the user sees while dragging, and an {@link java.lang.Object} that can share information about the
+drag object with views that may receive the object. However, </p>
+
+<p>To accept a drag object (receive the "drop") in a
+{@link android.view.View}, register the view with an {@link android.view.View.OnDragListener} by
+calling {@link android.view.View#setOnDragListener setOnDragListener()}. When a drag event occurs on
+the view, the system calls {@link android.view.View.OnDragListener#onDrag onDrag()} for the {@link
+android.view.View.OnDragListener}, which receives a {@link android.view.DragEvent} describing
+the type of event has occurred (such as "drag started", "drag ended", and "drop"). The receiving
+view can inquire the event type delivered to {@link
+android.view.View#onDragEvent onDragEvent()} by calling {@link
+android.view.DragEvent#getAction getAction()} on the {@link android.view.DragEvent}.</p>
+
+<p>Although a drag event may carry a {@link android.content.ClipData} object, drag and drop does
+not depend on the clipboard. The data being dragged is sent to the system as {@link
+android.content.ClipData} and the system sends it to {@link android.view.View} objects in the
+{@link android.view.DragEvent}. A drag and drop operation should never put the dragged data on the
+clipboard.</p>
+
+
+
+<h3>Multiple-choice selection for ListView and GridView</h3>
+
+<p>New {@link android.widget.AbsListView#CHOICE_MODE_MULTIPLE_MODAL} mode for {@link
+android.widget.AbsListView#setChoiceMode setChoiceMode()} allows for selecting multiple items
+from a {@link android.widget.ListView} and {@link android.widget.GridView}.</p>
+
+<p>To enable multiple-choice selection, call {@link
+android.widget.AbsListView#setChoiceMode setChoiceMode(CHOICE_MODE_MULTIPLE_MODAL)} and register a
+{@link android.widget.AbsListView.MultiChoiceModeListener} with {@link
+android.widget.AbsListView#setMultiChoiceModeListener setMultiChoiceModeListener()}.</p>
+
+<p>When the user performs a long-press on an item, the Action Bar switches to the Multi-choice
+Action Mode. The system notifies the {@link android.widget.AbsListView.MultiChoiceModeListener}
+when items are selected by calling {@link
+android.widget.AbsListView.MultiChoiceModeListener#onItemCheckedStateChanged
+onItemCheckedStateChanged()}.</p>
+
+<p>For an example of multiple-choice selection, see the <a
+href="{@docRoot}resources/samples/ApiDemos/src/com/example/android/apis/view/List15.html">List15.java</a>
+class in the API Demos sample application.</p>
+
+
+
+
+<h3>Content loaders</h3>
+
+<p>New framework APIs facilitate asynchronous loading of data using the {@link
+android.content.Loader} class. You can use it in combination with UI components such as views and
+fragments to dynamically load data from background threads. The {@link
+android.content.CursorLoader} subclass is specially designed to help do so for data queried from
+a {@link android.content.ContentResolver}.</p>
+
+
+
+<h3>Extended app widgets</h3>
+
+<p>App widgets can now be more interactive with scrolling list views, grid views, view flippers, and
+a new 3D stack widget.</p>
+
+<p>Android 3.0 supports several new widget classes for App Widgets, including:</p>
+<ul>
+ <li>{@link android.widget.GridView}</li>
+ <li>{@link android.widget.ListView}</li>
+ <li>{@link android.widget.StackView}</li>
+ <li>{@link android.widget.ViewFlipper}</li>
+ <li>{@link android.widget.AdapterViewFlipper}</li>
+</ul>
+
+<p>You can use the new {@link android.widget.RemoteViewsService} to populate the new remote
+collection views ({@link android.widget.GridView}, {@link android.widget.ListView}, and {@link
+android.widget.StackView}).</p>
+
+<p>You can also use two new {@link android.appwidget.AppWidgetProviderInfo} fields. The {@link
+android.appwidget.AppWidgetProviderInfo#autoAdvanceViewId} field lets you specify the view ID of the
+app widget subview, which is auto-advanced by the app widget’s host. The
+{@link android.appwidget.AppWidgetProviderInfo#previewImage} field specifies a preview of what the
+App Widget looks like and is shown to the user from the widget picker. If this field is not
+supplied, the app widget's icon is used for the preview.</p>
+
+<p>Android also provides a new widget preview tool (WidgetPreview), located in the SDK tools. The
+tool lets you take a screenshot of your app widget, which you can use to populate the customization
+tray.</p>
+
+
+
+
+
+<h3>Extended status bar notifications</h3>
+
+<p>The {@link android.app.Notification} APIs have been extended to support more content-rich status
+bar notifications, plus a new {@link android.app.Notification.Builder} class allows you to easily
+control the notification properties. New features include:</p>
+<ul>
+ <li>Support for a large icon in the notification. This is usually for
+social applications to show the contact photo of the person who is the source of the
+notification or for media apps to show an album thumbnail. Set using {@link
+android.app.Notification.Builder#setLargeIcon setLargeIcon()}.</li>
+ <li>Support for custom layouts in the status bar ticker, using {@link
+android.app.Notification.Builder#setTicker(CharSequence,RemoteViews) setTicker()}.</li>
+ <li>Support for custom notification layouts to include buttons with {@link
+android.app.PendingIntent}s, for more interactive notification widgets
+(such as to control ongoing music in the background).</li>
+</ul>
+
+
+
+
+<h3>New animation framework</h3>
+
+<p>An all new flexible animation framework that allows you to animate the properties of any object
+(View, Drawable, Fragment, Object, anything). It allows you to define many aspects of an animation,
+such as:</p>
+<ul>
+ <li>Duration</li>
+ <li>Repeat amount and behavior</li>
+ <li>Type of time interpolation</li>
+ <li>Animator sets to play animations together, sequentially, or after specified delays</li>
+ <li>Frame refresh delay</li>
+</ul>
+
+ <p>You can define these animation aspects, and others, for an object's int, float, and hexadecimal
+color values, by default. To animate any other type of value, you tell the system how to calculate
+the values for that given type, by implementing the {@link android.animation.TypeEvaluator}
+interface.</p>
+
+<p>There are two animators that you can use to animate values of a property: {@link
+android.animation.ValueAnimator} and {@link android.animation.ObjectAnimator}. The {@link
+android.animation.ValueAnimator} computes the animation values, but is not aware of the specific
+object or property that is animated as a result. It simply performs the calculations, and you must
+listen for the updates and process the data with your own logic. The {@link
+android.animation.ObjectAnimator} is a subclass of {@link android.animation.ValueAnimator} and
+allows you to set the object and property to animate, so you do not have to listen for updates.</p>
+
+<p>For more information, see the <a
+href="{@docRoot}guide/topics/graphics/animation.html">Animation</a> developer guide.</p>
+
+
+
+
+
+<h3>New widgets</h3>
+
+<ul>
+
+<li>{@link android.widget.AdapterViewAnimator}
+<p>Base class for an {@link android.widget.AdapterView} that performs animations when switching
+between its views.</p></li>
+
+<li>{@link android.widget.AdapterViewFlipper}
+<p>Simple {@link android.widget.ViewAnimator} that animates between two or more views that have
+been added to it. Only one child is shown at a time. If requested, it can automatically flip between
+each child at a regular interval.</p></li>
+
+<li>{@link android.widget.CalendarView}
+<p>Allows users to select dates from a calendar and you can configure the range of dates
+available. A user can select a date by tapping on it and can scroll and fling
+the calendar to a desired date.</p></li>
+
+<li>{@link android.widget.ListPopupWindow}
+<p>Anchors itself to a host view and displays a list of choices, such as for a list of
+suggestions when typing into an {@link android.widget.EditText} view.</p></li>
+
+<li>{@link android.widget.NumberPicker}
+<p>Enables the user to select a number from a predefined range. The widget presents an
+input field and up and down buttons for selecting a number. Touching the input field shows a
+scroll wheel that allows the user to scroll through values or touch again to directly edit the
+current value. It also allows you to map from positions to strings, so that
+the corresponding string is displayed instead of the position index.</p></li>
+
+<li>{@link android.widget.PopupMenu}
+<p>Displays a {@link android.view.Menu} in a modal popup window that's anchored to a view. The popup
+appears below the anchor view if there is room, or above it if there is not. If the IME (soft
+keyboard) is visible, the popup does not overlap it until it is touched.</p></li>
+
+<li>{@link android.widget.SearchView}
+<p>Provides a search box that works in conjunction with a search provider (in the same manner as
+the traditional <a href="{@docRoot}guide/topics/search/search-dialog.html">search dialog</a>). It
+also displays recent query suggestions or custom suggestions as configured by the search
+provider. This widget is particularly useful for offering search in the Action Bar.</p></li>
+
+<li>{@link android.widget.StackView}
+<p>A view that displays its children in a 3D stack and allows users to discretely swipe through the
+children.</p></li>
+
+</ul>
+
+
+
+
+
+<h3>Redesigned widgets</h3>
+
+<p>Android 3.0 offers an updated set of UI widgets that developers can use to quickly add new types
+of content to their applications. The new UI widgets are redesigned for use on larger screens such
+as tablets and incorporate the new holographic UI theme. Several new widget types are available,
+including a 3D stack, search box, a date/time picker, number picker, stack, calendar View etc.
+SearchView, PopupMenu, and others. Most of the redesigned widgets can now be used as remote views in
+homescreen widgets. Applications written for earlier versions can inherit the new widget designs and
+themes.</p>
+
+
+
+
+<h3>Holographic themes</h3>
+
+<p>The standard system widgets and overall look have been redesigned for use on larger screens
+such as tablets and incorporate the new holographic UI theme. These style changes are applied
+using the standard <a href="{@docRoot}guide/topics/ui/themes.html">style and theme</a> system.
+Any application that targets the Android 3.0 platform inherit the holographic theme by default.
+However, if your application also applies its own styles, then it will override the holographic
+theme, unless you update your styles to inherit them.</p>
+
+<p>To apply the holographic theme to individual activities or to inherit them in your own theme
+definitions, you can use one of several new {@link android.R.style#Theme_Holo Theme.Holo}
+themes.</p>
+
+
+
+<h3>Bluetooth A2DP and headset APIs</h3>
+
+<p>Android now includes APIs for applications to verify the state of connected Bluetooth A2DP and
+headset profile devices. You can initialize the respective {@link
+android.bluetooth.BluetoothProfile} by calling {@link
+android.bluetooth.BluetoothAdapter#getProfileProxy getProfileProxy()} with either the {@link
+android.bluetooth.BluetoothProfile#A2DP} or {@link android.bluetooth.BluetoothProfile#HEADSET}
+profile constant and a {@link android.bluetooth.BluetoothProfile.ServiceListener} to receive
+callbacks when the client is connected or disconnected.</p>
+
+
+<!--
+<h3>WebKit</h3>
+<h3>JSON (utilities)</h3>
+ -->
+
+
+<h3>Graphics</h3>
+
+<ul>
+ <li><h4>Hardware accelerated 2D graphics</h4>
+
+<p>You can now enable the OpenGL renderer for your application by setting {@code
+android:hardwareAccelerated="true"} in your manifest element's <a
+href="{@docRoot}guide/topics/manifest/application-element.html">{@code <application>}</a>
+element or for individual <a
+href="{@docRoot}guide/topics/manifest/activity-element.html">{@code <activity>}</a>
+elements.</p>
+
+<p>This flag helps applications by making them draw faster. This results in smoother animations,
+smoother scrolling, and overall better performance and response to user interaction.</p></li>
+
+ <li><h4>Renderscript 3D graphics engine</h4>
+
+<p>Renderscript is a runtime 3D framework that provides both an API for building 3D scenes as well
+as a special, platform-independent shader language for maximum performance. Using Renderscript, you
+can accelerate graphics operations and data processing. Renderscript is an ideal way to create
+high-performance 3D effects for applications, wallpapers, carousels, and more.</p></li>
+</ul>
+
+
+
+
+
+<h3>Media</h3>
+
+
+<ul>
+ <li><h4>Camcorder profiles</h4>
+
+<p>New {@link android.media.CamcorderProfile#hasProfile hasProfile()} method and several video
+quality profiles, such as {@link android.media.CamcorderProfile#QUALITY_1080P}, {@link
+android.media.CamcorderProfile#QUALITY_720P}, {@link
+android.media.CamcorderProfile#QUALITY_CIF}, and more, to determine the camcorder quality
+profiles.</p></li>
+
+ <li><h4>Time lapse video mode</h4>
+
+<p>Camcorder APIs now support the ability to record time lapse video. The {@link
+android.media.MediaRecorder#setCaptureRate setCaptureRate()} sets the rate at which frames
+should be captured.</p></li>
+
+ <li><h4>Digital media file transfer</h4>
+
+<p>The platform includes built-in support for Media/Picture Transfer Protocol (MTP/PTP) over USB,
+which lets users easily transfer any type of media files between devices and to a host computer.
+Developers can take advantage of this to create applications that let users create or manage files
+that they may want to transfer across devices.</p></li>
+
+ <li><h4>Digital Media File Transfer</h4>
+
+<p>The platform includes built-in support for Media/Picture Transfer Protocol (MTP/PTP) over USB,
+which lets users easily transfer any type of media files between devices and to a host computer.
+Developers can build on this support, creating applications that let users create or manage rich
+media files that they may want to transfer or share across devices. </p></li>
+
+ <li><h4>Digital rights management (DRM)</h4>
+
+<p>New extensible digital rights management (DRM) framework for checking and enforcing digital
+rights. It's implemented in two architectural layers:</p>
+<ul>
+ <li>A DRM framework API, which is exposed to applications and runs through the Dalvik VM for
+standard applications.</li>
+ <li>A native code DRM manager that implements the framework API and exposes an interface for DRM
+plug-ins to handle rights management and decryption for various DRM schemes.</li>
+</ul>
+
+<p>For application developers, the framework offers an abstract, unified API that simplifies the
+management of protected content. The API hides the complexity of DRM operations and allows a
+consistent operation mode for both protected and unprotected content, and across a variety of DRM
+schemes.</p>
+
+<p>For device manufacturers, content owners, and Internet digital media providers the DRM
+framework?s plugin API provides a means of adding support for a DRM scheme of choice into the
+Android system, for secure enforcement of content protection.</p>
+
+<p>The preview release does not provide any native DRM plug-ins for checking and enforcing digital
+rights. However, device manufacturers may ship DRM plug-ins with their devices.</p>
+
+<p>You can find all of the DRM APIs in the {@link android.drm} package.</p></li>
+
+</ul>
+
+
+
+
+
+
+
+
+<h2 id="api-level">API Level</h2>
+
+<p>The Android 3.0 platform delivers an updated version of
+the framework API. Because this is a preview of the Android 3.0 API, it uses a provisional API
+level of "Honeycomb", instead of an integer identifier, which will be provided when the final SDK
+is made available and all APIs are final.</p>
+
+<p>To use APIs introduced in Android 3.0 in your application, you need compile the application
+against the Android library that is provided in the Android 3.0 preview SDK platform and you must
+declare this API Level in your manifest as <code>android:minSdkVersion="Honeycomb"</code>, in the
+<code><uses-sdk></code> element in the application's manifest.</p>
+
+<p>For more information about using this provisional API Level and setting up your environment
+to use the preview SDK, please see the <a href="{@docRoot}sdk/preview/start.html">Getting
+Started</a> document.</p>
+
+
+
+
+<h2 id="apps">Built-in Applications</h2>
+
+<p>The system image included in the downloadable platform provides these
+built-in applications:</p>
+
+<table style="border:0;padding-bottom:0;margin-bottom:0;">
+<tr>
+<td style="border:0;padding-bottom:0;margin-bottom:0;">
+<ul>
+<li>Browser</li>
+<li>Calculator</li>
+<li>Camera</li>
+<li>Clock</li>
+<li>Contacts</li>
+<li>Custom Locale</li>
+<li>Dev Tools</li>
+<li>Downloads</li>
+<li>Email</li>
+</ul>
+</td>
+<td style="border:0;padding-bottom:0;margin-bottom:0;padding-left:5em;">
+<ul>
+<li>Gallery</li>
+<li>Music</li>
+<li>Search</li>
+<li>Settings</li>
+<li>Spare Parts (developer app)</li>
+<li>Speech Recorder</li>
+</ul>
+</td>
+</tr>
+</table>
+
+
+<h2 id="locs" style="margin-top:.75em;">Locales</h2>
+
+<p>The system image included in the downloadable SDK platform provides a variety of
+built-in locales. In some cases, region-specific strings are available for the
+locales. In other cases, a default version of the language is used. The
+languages that are available in the Android 3.0 system
+image are listed below (with <em>language</em>_<em>country/region</em> locale
+descriptor).</p>
+
+<table style="border:0;padding-bottom:0;margin-bottom:0;">
+<tr>
+<td style="border:0;padding-bottom:0;margin-bottom:0;">
+<ul>
+<li>Arabic, Egypt (ar_EG)</li>
+<li>Arabic, Israel (ar_IL)</li>
+<li>Bulgarian, Bulgaria (bg_BG)</li>
+<li>Catalan, Spain (ca_ES)</li>
+<li>Czech, Czech Republic (cs_CZ)</li>
+<li>Danish, Denmark(da_DK)</li>
+<li>German, Austria (de_AT)</li>
+<li>German, Switzerland (de_CH)</li>
+<li>German, Germany (de_DE)</li>
+<li>German, Liechtenstein (de_LI)</li>
+<li>Greek, Greece (el_GR)</li>
+<li>English, Australia (en_AU)</li>
+<li>English, Canada (en_CA)</li>
+<li>English, Britain (en_GB)</li>
+<li>English, Ireland (en_IE)</li>
+<li>English, India (en_IN)</li>
+<li>English, New Zealand (en_NZ)</li>
+<li>English, Singapore(en_SG)</li>
+<li>English, US (en_US)</li>
+<li>English, Zimbabwe (en_ZA)</li>
+<li>Spanish (es_ES)</li>
+<li>Spanish, US (es_US)</li>
+<li>Finnish, Finland (fi_FI)</li>
+<li>French, Belgium (fr_BE)</li>
+<li>French, Canada (fr_CA)</li>
+<li>French, Switzerland (fr_CH)</li>
+<li>French, France (fr_FR)</li>
+<li>Hebrew, Israel (he_IL)</li>
+<li>Hindi, India (hi_IN)</li>
+</ul>
+</td>
+<td style="border:0;padding-bottom:0;margin-bottom:0;padding-left:5em;">
+<li>Croatian, Croatia (hr_HR)</li>
+<li>Hungarian, Hungary (hu_HU)</li>
+<li>Indonesian, Indonesia (id_ID)</li>
+<li>Italian, Switzerland (it_CH)</li>
+<li>Italian, Italy (it_IT)</li>
+<li>Japanese (ja_JP)</li>
+<li>Korean (ko_KR)</li>
+<li>Lithuanian, Lithuania (lt_LT)</li>
+<li>Latvian, Latvia (lv_LV)</li>
+<li>Norwegian bokmål, Norway (nb_NO)</li>
+<li>Dutch, Belgium (nl_BE)</li>
+<li>Dutch, Netherlands (nl_NL)</li>
+<li>Polish (pl_PL)</li>
+<li>Portuguese, Brazil (pt_BR)</li>
+<li>Portuguese, Portugal (pt_PT)</li>
+<li>Romanian, Romania (ro_RO)</li>
+<li>Russian (ru_RU)</li></li>
+<li>Slovak, Slovakia (sk_SK)</li>
+<li>Slovenian, Slovenia (sl_SI)</li>
+<li>Serbian (sr_RS)</li>
+<li>Swedish, Sweden (sv_SE)</li>
+<li>Thai, Thailand (th_TH)</li>
+<li>Tagalog, Philippines (tl_PH)</li>
+<li>Turkish, Turkey (tr_TR)</li>
+<li>Ukrainian, Ukraine (uk_UA)</li>
+<li>Vietnamese, Vietnam (vi_VN)</li>
+<li>Chinese, PRC (zh_CN)</li>
+<li>Chinese, Taiwan (zh_TW)</li>
+</td>
+</tr>
+</table>
+
+<p class="note"><strong>Note:</strong> The Android platform may support more
+locales than are included in the SDK system image. All of the supported locales
+are available in the <a href="http://source.android.com/">Android Open Source
+Project</a>.</p>
+
+<h2 id="skins">Emulator Skins</h2>
+
+<p>The downloadable platform includes the following emulator skin:</p>
+
+<ul>
+ <li>
+ WXGA (1280x800, medium density, xlarge screen)
+ </li>
+</ul>
+
+<p>For more information about how to develop an application that displays
+and functions properly on all Android-powered devices, see <a
+href="{@docRoot}guide/practices/screens_support.html">Supporting Multiple
+Screens</a>.</p>
\ No newline at end of file
diff --git a/docs/html/sdk/eclipse-adt.jd b/docs/html/sdk/eclipse-adt.jd
index d0fa727..a83ca8e 100644
--- a/docs/html/sdk/eclipse-adt.jd
+++ b/docs/html/sdk/eclipse-adt.jd
@@ -100,6 +100,115 @@
<a href="#" onclick="return toggleDiv(this)">
<img src="{@docRoot}assets/images/triangle-opened.png" class="toggle-img" height="9px"
width="9px" />
+ADT 9.0.0</a> <em>(January 2011)</em>
+ <div class="toggleme">
+
+<dl>
+
+<dt>Dependencies:</dt>
+
+<dd>ADT 9.0.0 is designed for use with SDK Tools r9. If you haven't
+already installed SDK Tools r9 into your SDK, use the Android SDK and AVD Manager to do
+so.</dd>
+
+<dt>General notes:</dt>
+<dd>
+ <ul>
+ <li>"Go To Declaration" hyperlink support: You can jump directly from code references (such as
+ <code>R.id.main</code>) to the corresponding XML declaration, or from XML attributes (such as
+ <code>@string</code>) to the corresponding resource definition, or from manifest XML
+ registrations to activities and services.</li>
+ <li>Improvements were made to name refactoring.</li>
+ <li>AVDs now automatically save their state, so they can restart almost instantly. You can enable this feature when
+ creating an AVD or by editing an AVD with the AVD Manager.</li>
+ <li>Improvements to the Visual Layout Editor:
+ <ul>
+ <li>Support for rendering targets: You can now choose an arbitrary Android platform to
+ render the current page, regardless of the project's minimum platform. This makes it
+ easy to verify the layout and appearance of your activity on different versions of
+ the platform.
+ </li>
+ <li>Improved support for empty and nested layouts: Dragging items over nested and
+ invisible layouts automatically enlarges and highlights these layouts, so that they
+ can receive drops.
+ </li>
+ <li>XML formatting improvements: The editor generates cleaner XML and you can now enable
+ XML auto-formatting in the <strong>Preferences</strong> menu.</li>
+ <li>Improved Outline labels: The Outline tab now displays additional information about each
+ View. Textual Views display a snippet of the actual text. Views with a source
+ (such as ImageView) displays the resource name. Included Views display the name of the View.
+ </li>
+ <li>When you right click a View in the Layout Editor,
+ the context menu now contains <strong>Edit ID...</strong> and <strong>Edit Text...</strong>
+ items. The <strong>Properties...</strong> context menus now list all of the properties and
+ provide a way to edit them
+ (<a href="http://tools.android.com/recent/editidtextandotherpropertiesviamenu">Details</a>).
+ </li>
+ <li>The layout editor now properly handles
+ <a href="{@docRoot}guide/topics/resources/layout-resource.html#include-element"><code><include></code></a>
+ and <a href="{@docRoot}guide/topics/resources/layout-resource.html#merge-element"><code><merge></code></a>
+ tags (<a href="http://tools.android.com/recent/supportforincludeandmerge">Details</a>).</li>
+ <li>"Extract as Include" refactoring: The Layout Editor has a new refactoring that allows
+ you to select one or more views in a layout, and extract it into a separate layout
+ (<a href="http://tools.android.com/recent/extractasincluderefactoring">Details</a>).</li>
+ <li>Improved diagnostics for class loading and rendering errors: Class loading and rendering
+ error messages are more useful and provide better information about the root cause of the
+ error.</li>
+ <li>Improved error handling to prevent drag and reordering operations from adding children
+ into an {@link android.widget.AdapterView}.</li>
+ <li>Outline reordering: Reordering your views in the Outline tab is much easier
+ (<a href="http://tools.android.com/recent/outlineimprovements">Details</a>).</li>
+ <li>Fix for keybinding bug where keyboard shortcuts did not work (Issues
+ <a href="http://code.google.com/p/android/issues/detail?id=13231">13231</a> and
+ <a href="http://code.google.com/p/android/issues/detail?id=13134">13134</a>).</li>
+ <li>Fix for problems with Custom layout attribute menu (Issue
+ <a href="http://code.google.com/p/android/issues/detail?id=13134">13134</a>).</li>
+ <li>Automatic configuration for various view types: Certain views have properties configured
+ by default. For example, the width of an {@link android.widget.EditText} object is set to
+ <code>match_parent</code> when added to a vertical {@link android.widget.LinearLayout}
+ or a default image is added to an {@link android.widget.ImageButton}.</li>
+ <li>Previews during dragging: Dragging from the palette or dragging within the layout editor
+ now shows live previews of the dragged item.</li>
+ <li>Navigation improvements: In the Layout Editor, double-clicking Views jumps to the
+ corresponding XML element. In the Outline view, double-clicking opens the Properties view.</li>
+ <li>The editor has Honeycomb style animation preview support.</li>
+ <li>Improved rendering support for various Views (such as TabHosts and SlidingDrawers) in
+ Honeycomb (Issues <a href="http://code.google.com/p/android/issues/detail?id=3162">3162</a>
+ and <a href="http://code.google.com/p/android/issues/detail?id=13092">13092</a>).</li>
+ <li>Included layouts can be rendered and edited in the context of the layouts that include
+ them. From a layout using an <a href="{@docRoot}guide/topics/resources/layout-resource.html#include-element">
+ <code><include></code></a> tag, double-clicking on the
+ <a href="{@docRoot}guide/topics/resources/layout-resource.html#include-element">
+ <code><include></code></a> element edits the referenced layout in the context of the
+ current layout. Additionally, when editing a layout that is included by other layouts,
+ you can quickly change between context layouts, by right clicking in the editor and choosing
+ <strong>Show included in...</strong>. This feature is only available in Honeycomb.</li>
+ </ul>
+ </li>
+ <li>This release fixes many other bugs, but the most important ones are listed below:
+ <ul>
+ <li>Fixed issue that prevented launching debug builds on productions devices when
+ <code>debuggable=true</code> was not set in the Android manifest.</li>
+ <li>The LogCat view in DDMS properly handles UTF-8 characters.</li>
+ <li>The SDK Manager is more reliable on Windows
+ (<a href="http://tools.android.com/recent/sdkmanagerfixes">Details</a>).</li>
+ <li>A JUnit initialization bug that prevented you from working with JUnit tests was fixed
+ (Issue <a href="http://code.google.com/p/android/issues/detail?id=12411">12411</a>).</li>
+ </ul>
+</li>
+ </ul>
+</dd>
+</dl>
+</div>
+</div>
+
+
+
+
+<div class="toggleable closed">
+ <a href="#" onclick="return toggleDiv(this)">
+ <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-img" height="9px"
+width="9px" />
ADT 8.0.1</a> <em>(December 2010)</em>
<div class="toggleme">
@@ -121,7 +230,7 @@
<p>Also see the recent release notes for 8.0.0, below.</p>
</dd>
</dl>
- </div>
+</div>
</div>
diff --git a/docs/html/sdk/ndk/index.jd b/docs/html/sdk/ndk/index.jd
index 8b27f37..2c3fd6a 100644
--- a/docs/html/sdk/ndk/index.jd
+++ b/docs/html/sdk/ndk/index.jd
@@ -59,11 +59,64 @@
}
</style>
+
<div class="toggleable open">
<a href="#"
onclick="return toggleDiv(this)"><img src="{@docRoot}assets/images/triangle-opened.png"
class="toggle-img"
height="9px"
+ width="9px" /> Android NDK, Revision 5b</a> <em>(January 2011)</em>
+
+ <div class="toggleme">
+ <p>This release of the NDK does not include any new features compared to r5. The r5b release addresses the
+ following problems in the r5 release:
+ </p>
+ <ul>
+ <li>The r5 binaries required glibc 2.11, but the r5b binaries are generated with a special
+ toolchain that targets glibc 2.7 or higher instead. The Linux toolchain binaries now run on Ubuntu 8.04 or higher. </li>
+ <li>Fixes a compiler bug in the arm-linux-androideabi-4.4.3 toolchain.
+ The previous binary generated invalid thumb instruction sequences when
+ dealing with signed chars.</li>
+ <li>Adds missing documentation for the
+ "gnustl_static" value for APP_STL, that allows you to link against
+ a static library version of GNU libstdc++. </li>
+ <li>The following <code>ndk-build</code> issues are fixed:
+ <ul>
+ <li>A bug that created inconsistent dependency files when a
+ compilation error occured on Windows. This prevented a proper build after
+ the error was fixed in the source code.</li>
+ <li>A Cygwin-specific bug where using very short paths for
+ the Android NDK installation or the project path led to the
+ generation of invalid dependency files. This made incremental builds
+ impossible.</li>
+ <li>A typo that prevented the cpufeatures library from working correctly
+ with the new NDK toolchain.</li>
+ <li>Builds in Cygwin are faster by avoiding calls to <code>cygpath -m</code>
+ from GNU Make for every source or object file, which caused problems
+ with very large source trees. In case this doesn't work properly, define <code>NDK_USE_CYGPATH=1</code> in your
+ environment to use <code>cygpath -m</code> again.</li>
+ <li>The Cygwin installation now notifies the user of invalid installation paths that contain spaces. Previously, an invalid path
+ would output an error that complained about an incorrect version of GNU Make, even if the right one was installed.
+ </ul>
+ </li>
+ <li>Fixed a typo that prevented the <code>NDK_MODULE_PATH</code> environment variable from working properly when
+ it contained multiple directories separated with a colon. </li>
+ <li>The <code>prebuilt-common.sh</code> script contains fixes to check the compiler for 64-bit
+ generated machine code, instead of relying on the host tag, which
+ allows the 32-bit toolchain to rebuild properly on Snow Leopard. The toolchain rebuild scripts now also support
+ using a 32-bit host toolchain.</li>
+ <li>A missing declaration for <code>INET_ADDRSTRLEN</code> was added to <code><netinet/in.h></code>.</li>
+ <li>Missing declarations for <code>IN6_IS_ADDR_MC_NODELOCAL</code> and <code>IN6_IS_ADDR_MC_GLOBAL</code> were added to <code><netinet/in6.h></code>.</li>
+ <li>'asm' was replaced with '__asm__' in <code><asm/byteorder.h></code> to allow compilation with <code>-std=c99</code>.</li>
+ </ul>
+ </div>
+ </div>
+
+<div class="toggleable closed">
+ <a href="#"
+ onclick="return toggleDiv(this)"><img src="{@docRoot}assets/images/triangle-closed.png"
+ class="toggle-img"
+ height="9px"
width="9px" /> Android NDK, Revision 5</a> <em>(December 2010)</em>
<div class="toggleme">
@@ -73,7 +126,7 @@
graphics and window management, assets, and storage. Developers can also implement the
Android application lifecycle in native code with help from the new
{@link android.app.NativeActivity} class. For detailed information describing the changes in this
- release, read the CHANGES.HTML document included in the downloaded NDK package.
+ release, read the <code>CHANGES.HTML</code> document included in the downloaded NDK package.
</p>
<dl>
<dt>General notes:</dt>
diff --git a/docs/html/sdk/oem-usb.jd b/docs/html/sdk/oem-usb.jd
new file mode 100644
index 0000000..14015f5
--- /dev/null
+++ b/docs/html/sdk/oem-usb.jd
@@ -0,0 +1,81 @@
+page.title=OEM USB Drivers
+@jd:body
+
+<div id="qv-wrapper">
+<div id="qv">
+ <h2>See also</h2>
+ <ol>
+ <li><a href="{@docRoot}guide/developing/device.html">Developing on a Device</a></li>
+ <li><a href="{@docRoot}sdk/win-usb.html">Google USB Driver</a></li>
+ </ol>
+</div>
+</div>
+
+<p>If you are developing on Windows and would like to connect an Android-powered device
+ to test your applications, then you need to install the appropriate USB driver. This document
+provides links to the web sites for several device original equipment manufacturers (OEMs),
+where you can download the appropriate USB driver for your device. However, this list is
+not exhaustive for all available Android-powered devices.</p>
+
+<p>If your device is one of the Android Developer Phones (ADP), a Nexus One, or a Nexus S,
+then you should instead use the <a href="{@docRoot}sdk/win-usb.html">Google USB Driver</a>.</p>
+
+<p class="note"><strong>Note:</strong> If you're developing on Mac OS X or Linux, then you probably
+ don't need to install a USB driver. Refer to <a
+ href="{@docRoot}guide/developing/device.html#setting-up">Setting up a Device</a> to start
+ development with a device.</p>
+
+<p>For instructions about how to install the driver on Windows, follow the guide for <a
+ href="{@docRoot}sdk/win-usb.html#InstallingDriver">Installing the USB Driver</a>.</p>
+
+<p class="table-caption"><strong>Table 1.</strong> Links to OEM USB drivers</p>
+<table><tr>
+ <th>OEM</th>
+ <th>Driver URL</th></tr>
+<tr><td>Acer</td> <td><a
+href="http://www.acer.com/worldwide/support/mobile.html">http://www.acer.com/worldwide/support/
+mobile.html</a>
+ </td></tr>
+
+<tr><td>Dell</td> <td>
+ <a href="http://support.dell.com/support/downloads/index.aspx?c=us&cs=19&l=en&s=dhs&~ck=anavml">http://support.dell.com/support/downloads/index.aspx?c=us&cs=19&l=en&s=dhs&~ck=anavml</a> </td></tr>
+
+<tr><td>Foxconn</td> <td><a
+href="http://drivers.cmcs.com.tw/">http://drivers.cmcs.com.tw/</a></td>
+</tr><tr><td>Garmin-Asus</td> <td><a
+href="https://www.garminasus.com/en_US/support/pcsync/">https://www.garminasus.com/en_US/support/
+pcsync/</a></td>
+</tr><tr><td>HTC</td> <td><a href="http://www.htc.com ">http://www.htc.com </a> <br>Click on the
+support tab to select your products/device. Different regions will have different links.</td>
+</tr>
+<tr><td>Huawei</td> <td><a
+href="http://www.huaweidevice.com/worldwide/downloadCenter.do?method=list&flay=software&directoryId=
+20&treeId=0">http://www.huaweidevice.com/worldwide/downloadCenter.do?method=list&flay=software&
+directoryId=20&treeId=0</a></td>
+</tr><tr><td>KT Tech</td> <td><a
+href="http://www.kttech.co.kr/cscenter/download05.asp">http://www.kttech.co.kr/cscenter/download05.
+asp</a> for EV-S100(Take)</td>
+</tr><tr><td>LGE</td> <td><a
+href="http://www.lg.com/us/mobile-phones/mobile-support/mobile-lg-mobile-phone-support.jsp">http://
+www.lg.com/us/mobile-phones/mobile-support/mobile-lg-mobile-phone-support.jsp</a></td>
+</tr><tr><td>Motorola</td> <td><a
+href="http://developer.motorola.com/docstools/USB_Drivers/">http://developer.motorola.com/docstools/
+USB_Drivers/</a></td>
+</tr><tr><td>Pantech</td> <td><a
+href="http://www.isky.co.kr/cs/software/software.sky?fromUrl=index">http://www.isky.co.kr/cs/
+software/software.sky?fromUrl=index</a></td>
+</tr><tr><td>Samsung</td> <td><a
+href="http://www.samsung.com/us/support/downloads">http://www.samsung.com/us/support/downloads</a></
+td>
+</tr><tr><td>Sharp</td> <td><a
+href="http://k-tai.sharp.co.jp/support/">http://k-tai.sharp.co.jp/support/</a></td>
+</tr><tr><td>SK Telesys</td> <td><a
+href="http://www.sk-w.com/service/wDownload/wDownload.jsp">http://www.sk-w.com/service/wDownload/
+wDownload.jsp</a></td></tr><tr>
+<td>Sony Ericsson</td> <td><a
+href="http://developer.sonyericsson.com/wportal/devworld/search-downloads/android">http://developer.
+sonyericsson.com/wportal/devworld/search-downloads/android</a></td></tr><tr>
+<td>ZTE</td> <td><a
+href="http://www.zte.com.cn/cn/products/mobile/services_support/index.jsp">http://www.zte.com.cn/cn/
+products/mobile/services_support/index.jsp</a></td></tr>
+</table>
diff --git a/docs/html/sdk/preview/start.jd b/docs/html/sdk/preview/start.jd
new file mode 100644
index 0000000..7e816c1
--- /dev/null
+++ b/docs/html/sdk/preview/start.jd
@@ -0,0 +1,265 @@
+page.title=Getting Started with the Android 3.0 Preview
+@jd:body
+
+<p>Welcome to Android 3.0!</p>
+
+<p>Android 3.0 is the next major release of the Android platform and is optimized for tablet
+devices. We're offering a preview SDK so you can get a head-start developing
+applications for it or simply optimize your existing application for upcoming
+tablets.</p>
+
+
+<h3>What is the preview SDK?</h3>
+
+<p>The Android 3.0 preview SDK is an early look at the upcoming version of Android 3.0, for
+developers only.</p>
+
+<p>The preview SDK includes:</p>
+<ul>
+ <li>An early Android 3.0 system image for use in the Android emulator</li>
+ <li>An Android 3.0 library with non-final APIs</li>
+ <li>A new WXGA emulator skin for an extra large Android Virtual Device</li>
+ <li>New documentation for Android 3.0, including a complete API reference, new developer guides,
+and an API differences report between Android 3.0 and 2.3.</li>
+</ul>
+
+<div class="note">
+<p><strong>Be aware that:</strong></p>
+<ul>
+ <li>The APIs in the preview SDK are <strong>not final</strong>. Some APIs may change in behavior
+or availability when the final SDK is made available.</li>
+ <li>You <strong>cannot</strong> publish an application that's built against the preview
+SDK—you can only run an application built against the preview SDK on the Android
+emulator.</li>
+ <li>The documentation on <a href="http://developer.android.com">developer.android.com</a>
+does <strong>not</strong> include the Android 3.0 documentation—to read the API reference and
+developer guides for Android 3.0, you must install the Android 3.0 preview documentation from
+the AVD and SDK Manager.</li>
+</ul>
+</div>
+
+
+
+<h3>How do I start?</h3>
+
+<ol>
+ <li><a href="#Setup">Set up the preview SDK</a></li>
+ <li>Then choose your app adventure:
+ <ol type="a">
+ <li><a href="#Optimize">Optimize Your App for Tablets</a>
+ <p>When you have an existing application and you want to maintain compatibility with
+older versions of Android.</p>
+ </li>
+ <li><a href="#Upgrade">Upgrade or Develop a New App for Tablets</a>
+ <p>When you want to upgrade your application to use APIs introduced in Android 3.0 or
+ create an all new application targeted to tablet devices.</p></li>
+ </ol>
+ </li>
+</ol>
+
+
+
+
+<h2 id="Setup">Set Up the Preview SDK</h2>
+
+<p>To start using the Android 3.0 preview SDK, set up your existing Android SDK with the new
+platform:</p>
+<p>(If you don't have an existing SDK, <a href="{@docRoot}sdk/index.html">download it
+now</a>.)</p>
+<ol>
+ <li><a href="{@docRoot}sdk/adding-components.html#launching">Launch the Android SDK and AVD
+Manager</a> and install the following:
+ <ul>
+ <li>SDK Platform Android 3.0 Preview</li>
+ <li>Android SDK Tools, revision 9</li>
+ <li>Documentation for Android 'Honeycomb' Preview</li>
+ <li>Samples for SDK API Honeycomb Preview</li>
+ </ul>
+ </li>
+ <li><a href="{@docRoot}guide/developing/other-ide.html#AVD">Create an AVD</a> for tablets: set
+the target to "Android 3.0 (Preview)" and the skin to "WXGA".</li>
+</ol>
+
+
+<h3>About Emulator Performance</h3>
+
+<p>Because the Android emulator must simulate the ARM instruction set architecture on your
+computer and the WXGA screen is significantly larger than what the emulator
+normally handles, emulator performance is much slower than usual.</p>
+
+<p>We're working hard to resolve the performance issues and it will improve in future releases.
+Unfortunately, the emulator will perform slowly during your trial with the preview SDK. Please
+continue to use the emulator to evaluate your application's appearance and functionality on Android
+3.0.</p>
+
+<p class="note"><strong>Tip:</strong> To improve the startup time for the emulator, enable
+snapshots for the AVD when you create it with the SDK and AVD Manager (there's a checkbox in
+the GUI). Then, start the AVD from the manager and check <b>Launch from snapshot</b> and <b>Save to
+snapshot</b>. This way, when you close the emulator, a snapshot of the AVD state is saved and
+used to quickly relaunch the AVD next time. However, when you choose to save a snapshot, the
+emulator will be slow to close, so you might want to enable <b>Save to
+snapshot</b> only for the first time you launch the AVD.</p>
+
+
+
+<h2 id="Optimize">Optimize Your Application for Tablets</h2>
+
+<p>If you've already developed an application for Android, there are a few things you can do
+to optimize it for a tablet experience, without changing the minimum platform version required (you
+don't need to change the manifest {@code minSdkVersion}).</p>
+
+<p class="note"><strong>Note:</strong> All Android applications are forward-compatible, so
+there's nothing you <em>have to</em> do—if your application is a good citizen of the Android
+APIs, your app should work fine on devices running Android 3.0. However, in order to provide users
+a better experience when running your app on an Android 3.0 tablet, we recommend that you update
+your application to adapt to the new system theme and add optimize your application for larger
+screens.</p>
+
+<p>Here's what you can do to optimize your application for tablets running Android
+3.0:</p>
+
+<ol>
+ <li><b>Test your current application on Android 3.0</b>
+ <ol>
+ <li>Build your application as-is and install it on your WXGA AVD (created above).</li>
+ <li>Perform your usual tests to be sure everything works and looks as expected.</li>
+ </ol>
+ </li>
+
+ <li><b>Apply the new "Holographic" theme to your application</b>
+ <ol>
+ <li>Open your manifest file and update the <a
+href="{@docRoot}guide/topics/manifest/uses-sdk-element.html">{@code <uses-sdk>}</a> element to
+set {@code android:targetSdkVersion} to {@code "Honeycomb"}. For example:
+<pre>
+<manifest ... >
+ <uses-sdk android:minSdkVersion="4"
+ android:targetSdkVersion="Honeycomb" />
+ <application ... >
+ ...
+ <application>
+</manifest>
+</pre>
+ <p class="note"><strong>Note:</strong> The API Level value "Honeycomb" is a provisional API
+Level that is valid only while testing against the preview SDK. You
+<strong>should not</strong> publish your application using this API Level. When the final version of
+the Android 3.0 SDK is made available, you must change this value to the real API Level that will be
+specified for Android 3.0. For more information, read about <a
+href="{@docRoot}guide/appendix/api-levels.html">Android API Levels</a>.</p>
+ <p>By targeting the Android 3.0 platform, the system automatically applies the Holographic theme
+to each of your activities, when running on an Android 3.0 device.</p>
+ </li>
+ <li>Continue to build against your application's {@code minSdkVersion}, but install it
+on the Android 3.0 AVD. Perform more testing on your application to be sure that your user interface
+works well with the Holographic theme.
+ <p class="note"><strong>Note:</strong> If you've applied themes to your activities already,
+they will override the Holographic theme that the system applies when you set the {@code
+android:targetSdkVersion} to {@code "Honeycomb"}.
+Once the Android 3.0 APIs are finalized and an official API Level is assigned, you can use
+the <a href="{@docRoot}guide/topics/resources/providing-resources.html#VersionQualifier">system
+version qualifier</a> to provide an alternative theme that's based on the Holographic theme when
+your application is running on Android 3.0.</p>
+ </ol>
+ </li>
+
+ <li><b>Supply alternative layout resources for xlarge screens</b>
+ <p>As discussed in the guide to <a
+href="{@docRoot}guide/practices/screens_support.html">Supporting Multiple Screens</a>, Android
+2.3 and above support the <code>xlarge</code> resource qualifier, which you should use to supply
+alternative layouts for extra large screens.</p>
+ <p>By providing alternative layouts for some of your activities when running on extra large
+screens, you can improve the user experience of your application on a tablet without using any
+new APIs.</p>
+ <p>For example, here are some things to consider when creating a new layout for tables:</p>
+ <ul>
+ <li>Landscape layout: The "normal" orientation for tablets is usually landscape (wide), so
+you should be sure that your activities offer an appropriate layout for such a wide viewing
+area.</li>
+ <li>Button position: Consider whether the position of the most common buttons in your UI are
+easily accessible while holding a tablet with two hands.</li>
+ </ul>
+ </li>
+</ol>
+
+ <p>In general, always be sure that your application follows the <a
+href="{@docRoot}guide/practices/screens_support.html#screen-independence">Best Practices
+for Screen Independence</a>.</p>
+
+
+
+
+<h2 id="Upgrade">Upgrade or Develop a New App for Tablets</h2>
+
+<p>If you want to develop something truly for tablets running Android 3.0, then you need to use new
+APIs available in Android 3.0. This section introduces some of the new features that you
+should use.</p>
+
+<p>The first thing to do when you create a project with the Android 3.0 preview is set the <a
+href="{@docRoot}guide/topics/manifest/uses-sdk-element.html">{@code <uses-sdk>}</a> element to
+use {@code "Honeycomb"} for the {@code android:minSdkVersion}. For example:</p>
+
+<pre>
+<manifest ... >
+ <uses-sdk android:minSdkVersion="Honeycomb" />
+ <application ... >
+ ...
+ <application>
+</manifest>
+</pre>
+
+<p class="note"><strong>Note:</strong> The API Level value "Honeycomb" is a provisional API
+Level that is valid only while building and testing against the preview SDK. You
+<strong>cannot</strong> publish your application using this API Level. When the final version of the
+Android 3.0 SDK is made available, you must change this value to the real API Level that is
+specified for Android 3.0. For more information, read about <a
+href="{@docRoot}guide/appendix/api-levels.html">Android API Levels</a>.</p>
+
+<p>Be sure that the <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html">{@code
+<uses-sdk>}</a> element appears <strong>before</strong> the <a
+href="{@docRoot}guide/topics/manifest/application-element.html">{@code <application>}</a>
+element.</p>
+
+<p>By targeting the Android 3.0 platform (and declaring it before <a
+href="{@docRoot}guide/topics/manifest/application-element.html">{@code <application>}</a>),
+the system automatically applies the new Holographic theme to each of your
+activities.</p>
+
+
+
+<h3>Publishing your app for tablets only</h3>
+
+<p>Additionally, you should decide whether your application is for <em>only</em> tablet devices
+(specifically, <em>xlarge</em> devices) or for devices of all sizes that may run Android 3.0.</p>
+
+<p>If your application is <em>only</em> for tablets (<em>xlarge</em> screens; not for mobile
+devices/phones), then you should include the <a
+href="{@docRoot}guide/topics/manifest/supports-screens-element.html">{@code
+<supports-screens>}</a> element in your manifest with all sizes except for xlarge declared
+false. For example:</p>
+
+<pre>
+<manifest ... >
+ <uses-sdk android:minSdkVersion="Honeycomb" />
+ <supports-screens android:smallScreens="false"
+ android:normalScreens="false"
+ android:largeScreens="false"
+ android:xlargeScreens="true" />
+ <application ... >
+ ...
+ <application>
+</manifest>
+</pre>
+
+<p>With this declaration, you indicate that your application does not support any screen size except
+extra large. External services such as Android Market may use this to filter your application
+from devices that do not have an extra large screen.</p>
+
+<p>Otherwise, if you want your application to be available to both small devices (phones) and large
+devices (tablets), do <em>not</em> include the <a
+href="{@docRoot}guide/topics/manifest/supports-screens-element.html">{@code
+<supports-screens>}</a> element.</p>
+
+<div class="special">
+<p>To learn more about some of the new APIs,
+see the <a href="{@docRoot}sdk/android-3.0.html">Android 3.0 Platform</a> document.</p>
+</div>
diff --git a/docs/html/sdk/sdk_toc.cs b/docs/html/sdk/sdk_toc.cs
index 2780135..226f880 100644
--- a/docs/html/sdk/sdk_toc.cs
+++ b/docs/html/sdk/sdk_toc.cs
@@ -42,11 +42,11 @@
<ul>
<li><a href="<?cs var:toroot ?>sdk/preview/start.html">Getting Started</a> <span class="new">new!</span></li>
<li class="toggle-list">
- <div><a href="<?cs var:toroot ?>sdk/preview/platform.html">
+ <div><a href="<?cs var:toroot ?>sdk/android-3.0.html">
<span class="en">Android 3.0 Platform</span></a> <span class="new">new!</span></div>
<ul>
- <li><a href="<?cs var:toroot ?>sdk/preview/highlights.html">Platform Highlights</a></li>
- <li><a href="<?cs var:toroot ?>sdk/api_diff/honeycomb/changes.html">API Differences Report »</a></li>
+ <li><a href="<?cs var:toroot ?>sdk/api_diff/honeycomb/changes.html">API Differences Report
+»</a></li>
</ul>
</li>
</ul>
@@ -99,8 +99,7 @@
</ul>
<ul>
<li><a href="<?cs var:toroot ?>sdk/tools-notes.html">SDK Tools, r8</a> <span class="new">new!</span></li>
- <li><a href="<?cs var:toroot ?>sdk/win-usb.html">USB Driver for
- Windows, r4</a> <span class="new">new!</span>
+ <li><a href="<?cs var:toroot ?>sdk/win-usb.html">Google USB Driver, r4</a> <span class="new">new!</span>
</li>
</ul>
</li>
@@ -156,6 +155,9 @@
<span style="display:none" class="zh-TW"></span>
</h2>
<ul>
+ <li><a href="<?cs var:toroot ?>sdk/oem-usb.html">
+ <span class="en">OEM USB Drivers</span>
+ </a></li>
<li><a href="<?cs var:toroot ?>sdk/requirements.html">SDK System Requirements</a></li>
<!-- <li><a href="<?cs var:toroot ?>sdk/RELEASENOTES.html">SDK Release
Notes</a></li> -->
diff --git a/docs/html/sdk/tools-notes.jd b/docs/html/sdk/tools-notes.jd
index fb8636e..b832628 100644
--- a/docs/html/sdk/tools-notes.jd
+++ b/docs/html/sdk/tools-notes.jd
@@ -15,6 +15,7 @@
href="{@docRoot}sdk/adding-components.html#UpdatingComponents">Updating SDK
Components</a>. </p>
+
<h2 id="notes">Revisions</h2>
<p>The sections below provide notes about successive releases of
@@ -64,6 +65,58 @@
<div class="toggleable opened">
<a href="#" onclick="return toggleDiv(this)">
<img src="{@docRoot}assets/images/triangle-opened.png" class="toggle-img" height="9px" width="9px" />
+SDK Tools, Revision 9</a> <em>(January 2011)</em>
+ <div class="toggleme">
+ <dl>
+<dt>Dependencies:</dt>
+<dd>
+<p>If you are developing in Eclipse with ADT, note that the SDK Tools r9 is
+designed for use with ADT 9.0.0 and later. After installing SDK Tools r9, we
+highly recommend updating your ADT Plugin to 9.0.0.</p>
+
+<p>If you are developing outside Eclipse, you must have <a href="http://ant.apache.org/">Apache
+Ant</a> 1.8 or later.</p>
+
+<dt>Upgrading to SDK Tools r9:</dt>
+<dd>
+<p>If you are upgrading to SDK Tools r9 from SDK Tools r7 or earlier, the default installed location
+for the <code>adb</code> tool has changed from <code><<em>SDK</em>>/tools/adb</code> to
+<code><<em>SDK</em>>/platform-tools/adb</code>. This means that you should
+add the new location to your PATH and modify any custom build scripts to
+reference the new location. Copying the <code>adb</code> executable from the new
+location to the old is not recommended, since subsequent updates to the SDK
+Tools will delete the file.</p>
+</dd>
+
+<dt>General notes:</dt>
+<dd>
+ <ul>
+ <li>The default ProGuard configuration, <code>proguard.cfg</code>, now ignores the following classes:
+ <ul>
+ <li>classes that extend {@link android.preference.Preference}</li>
+ <li>classes that extend {@link android.app.backup.BackupAgentHelper}</li>
+ </ul>
+ </li>
+ <li>Ant lib rules now allow you to override <code>java.encoding</code>, <code>java.source</code>,
+ and <code>java.target</code> properties.</li>
+ <li>The default encoding for the <code>javac</code> Ant task is now UTF-8.</li>
+ <li>The LogCat view in DDMS now properly displays UTF-8 characters.</li>
+ <li>The SDK Manager is more reliable on Windows. For details on the improvements, see the
+ <a href="http://tools.android.com/recent/sdkmanagerfixes">Android Tools Project Site</a>. </li>
+ <li>If you enabled snapshots for an AVD, they are automatically captured. The emulator also now restores to the state when
+ it last closed almost instantly.</li>
+ <li>Fixed the missing JAR file error that prevented <code>draw9patch</code> from running.</li>
+ <li>Fixed the Windows launch scripts <code>hierarchyviewer</code> and <code>ddms</code> to support
+ the new location of <code>adb</code>.</li>
+ </ul>
+</dd>
+</dl>
+</div>
+</div>
+
+<div class="toggleable closed">
+ <a href="#" onclick="return toggleDiv(this)">
+ <img src="{@docRoot}assets/images/triangle-closed.png" class="toggle-img" height="9px" width="9px" />
SDK Tools, Revision 8</a> <em>(December 2010)</em>
<div class="toggleme">
diff --git a/docs/html/sdk/win-usb.jd b/docs/html/sdk/win-usb.jd
index 1f74ffe..ffaec4c 100644
--- a/docs/html/sdk/win-usb.jd
+++ b/docs/html/sdk/win-usb.jd
@@ -1,4 +1,4 @@
-page.title=USB Driver for Windows
+page.title=Google USB Driver
@jd:body
<div id="qv-wrapper">
@@ -6,27 +6,48 @@
<h2>In this document</h2>
<ol>
<li><a href="#notes">Revisions</a></li>
- <li><a href="#WinUsbDriver">Installing the USB Driver for Windows</a></li>
+ <li><a href="#WinUsbDriver">Downloading the Google USB Driver</a></li>
+ <li><a href="#InstallingDriver">Installing the USB Driver</a>
+ <ol>
+ <li><a href="#Win7">Windows 7</a></li>
+ <li><a href="#WinXp">Windows XP</a></li>
+ <li><a href="#WinVista">Windows Vista</a></li>
+ </ol>
+ </li>
</ol>
<h2>See also</h2>
<ol>
- <li><a
- href="{@docRoot}guide/developing/device.html">Developing on a
- Device</a></li>
- <li><a
- href="adding-components.html">Adding SDK Components</a></li>
+ <li><a href="{@docRoot}guide/developing/device.html">Developing on a Device</a></li>
+ <li><a href="{@docRoot}sdk/adding-components.html">Adding SDK Components</a></li>
+ <li><a href="{@docRoot}sdk/oem-usb.html">OEM USB Drivers</a></li>
</ol>
</div>
</div>
-<p>The USB driver for Windows is a downloadable component for the
-Android SDK. If you are developing on Windows and would like to
-connect an Android-powered device to test your applications, then you will need
-to install the USB driver.</p>
+<p>The Google USB driver is a downloadable component for Windows developers, available
+for download from the AVD and SDK Manager.</p>
-<p>This document provides information about the latest version of the
-USB driver and a guide to installing the driver on your development
-computer.</p>
+<p>The Google USB Driver is only for Android Developer Phones (ADP), Nexus One, and Nexus S.
+If you're using a different Android-powered device,
+then you need to get a USB driver from the device OEM. For help finding the appropriate
+driver, see the list of <a href="{@docRoot}sdk/oem-usb.html">OEM USB Drivers</a>.</p>
+
+<div class="sidebox-wrapper">
+<div class="sidebox">
+ <p>The Google USB driver for Windows provides support for the following
+Android-powered devices:</p>
+ <ul>
+ <li>ADP1 / T-Mobile G1*</li>
+ <li>ADP2 / Google Ion / T-Mobile myTouch 3G*</li>
+ <li>Verizon Droid*</li>
+ <li>Nexus One</li>
+ <li>Nexus S</li>
+ </ul>
+ <p>* <em>Or similar hardware on other carriers</em></p>
+ <p>Any additional devices will require Windows drivers provided by
+the hardware manufacturer. See <a href="{@docRoot}sdk/oem-usb.html">OEM USB Drivers</a>.</p>
+</div>
+</div>
<p class="note"><strong>Note:</strong>
If you're developing on Mac OS X or Linux, then you do not need to install a
@@ -34,6 +55,12 @@
href="{@docRoot}guide/developing/device.html#setting-up">Setting up a
Device</a> to start development with a device.</p>
+<p>The sections below provide instructions on how to download the USB Driver
+for Windows and install it on your development computer. </p>
+
+
+
+
<h2 id="notes">Revisions</h2>
<p>The sections below provide notes about successive revisions of the USB Driver
@@ -132,77 +159,49 @@
</div>
</div>
-<h2 id="WinUsbDriver">Installing the USB Driver for Windows</h2>
-<div class="sidebox-wrapper">
-<div class="sidebox">
- <p>The USB driver for Windows provides support for the following
-Android-powered
-devices:</p>
- <ul>
- <li>ADP1 / T-Mobile G1*</li>
- <li>ADP2 / Google Ion / T-Mobile myTouch 3G*</li>
- <li>Verizon Droid*</li>
- <li>Nexus One</li>
- <li>Nexus S</li>
- </ul>
- <p>* <em>Or similar hardware on other carriers</em></p>
- <p>Any additional devices will require Windows drivers provided by
-the hardware manufacturer.</p>
+<h2 id="WinUsbDriver">Downloading the Google USB Driver</h2>
+
+<div class="figure" style="width:498px;margin:0">
+ <img src="{@docRoot}images/developing/sdk-usb-driver.png" alt="" />
+ <p class="img-caption"><strong>Figure 1.</strong> The SDK and AVD Manager
+ with the Google USB Driver selected.</p>
</div>
-</div>
-
-
-<p>The sections below provide instructions on how to download the USB Driver
-for Windows and install it on your development computer. </p>
-
-<h3>Downloading the USB Driver for Windows</h3>
<p>The USB Driver for Windows is available for download as an optional SDK
component. You need the driver only if you are developing on Windows and
-want to connect an Android-powered device to your development environment
-over USB. </p>
-
-<p>To install the driver or upgrade your existing driver to the latest
-revision, you must first download the driver to your development computer. </p>
+want to connect an Android-powered device (ADP, Nexus One, or Nexus S) to your
+development environment over USB. </p>
<p>To download the driver, use the Android SDK and AVD Manager tool that is
-included with the Android SDK. If you haven't yet installed the Android SDK, as
-described in <a href="installing.html">Installing the Android SDK</a>, please do
-so before continuing with the driver installation. </p>
+included with the <a href="{@docRoot}sdk/index.html">Android SDK</a>:</p>
+<ol>
+ <li>Launch the SDK and AVD Manager by double-clicking <code>SDK Manager.exe</code>,
+ at the root of your SDK directory.</li>
+ <li>Expand the <em>Third party Add-ons</em> and <em>Google Inc. add-ons</em>.</li>
+ <li>Check <strong>Google Usb Driver package</strong> and click <strong>Install selected</strong>.</li>
+ <li>Proceed to install the package. When done, the driver files are
+downloaded into the <code><sdk>\google-usb_driver\</code> directory.</li>
+</ol>
-<p>When you are ready to download the driver, follow the instructions given in
-<a href="adding-components.html">Adding SDK Components</a> to launch the Android
-SDK and AVD Manager. From the <strong>Available Packages</strong> panel, select
-"Usb Driver Package" and download it to your computer. The driver files are
-downloaded into the <code><sdk>\google-usb_driver\</code> directory.</p>
-<p>After the download, follow the instructions below to install or upgrade the
-driver, based on your needs and Windows operating system version. If you are
-connecting an Android-powered device to your computer for the first time, follow
-the below procedure to "Perform a fresh installation." If you have installed one
-of the older USB drivers and would like to upgrade to the latest version, follow
-the procedure to "Upgrade an existing driver."</p>
-<p>Once you've completed the USB driver installation,
-please see <a
+<h2 id="InstallingDriver">Installing the USB Driver</h2>
+
+<p>Once you've downloaded your USB driver, follow the instructions below to install or upgrade the
+driver, based on your version of Windows and whether you're installing for the first time
+or upgrading an existing driver.</p>
+
+<p class="note"><strong>Tip:</strong> When you finish the USB driver installation,
+see <a
href="{@docRoot}guide/developing/device.html">Developing on a Device</a> for
other important information about using an Android-powered device for
development.</p>
<ol class="nolist">
- <li><strong>Windows Vista:</strong>
- <ol class="nolist">
- <li><a href="#VistaFreshInstall">Perform a fresh installation</a></li>
- <li><a href="#VistaUpgrade">Upgrade an existing driver</a></li>
- </ol>
- </li>
- <li><strong>Windows XP:</strong>
- <ol class="nolist">
- <li><a href="#XPFreshInstall">Perform a fresh installation</a></li>
- <li><a href="#XPUpgrade">Upgrade an existing driver</a></li>
- </ol>
- </li>
+ <li><a href="#Win7">Windows 7</a></li>
+ <li><a href="#WinXp">Windows XP</a></li>
+ <li><a href="#WinVista">Windows Vista</a></li>
</ol>
@@ -213,94 +212,140 @@
driver. Making any other changes to the driver files may break the installation
process.</p>
-<h3 id="VistaFreshInstall">Windows Vista: Perform a fresh installation</h3>
-<p>To install the Android USB driver on Windows Vista for the first time:</p>
+<h3 id="Win7">Windows 7</h3>
+
+<p>To install the Android USB driver on Windows 7 for the first time:</p>
<ol>
- <li>Connect your Android-powered device to your computer's USB port. Windows
- will detect the device and launch the Found New Hardware wizard.</li>
- <li>Select "Locate and install driver software."</li>
- <li>Select "Don't search online."</li>
- <li>Select "I don't have the disk. Show me other options."</li>
- <li>Select "Browse my computer for driver software."</li>
- <li>Click "Browse..." and locate the folder where you copied the
- installation package. As long as you specified the exact location of the
- installation package, you may leave "Include subfolders" checked or
- unchecked—it doesn't matter.</li>
- <li>Click "Next." Vista may prompt you to confirm the privilege elevation
- required for driver installation. Confirm it.</li>
- <li>When Vista asks if you'd like to install the Google ADB Interface device,
- click "Install" to install the driver.</li>
+ <li>Connect your Android-powered device to your computer's USB port.</li>
+ <li>Right-click on <em>Computer</em> from your desktop or Windows Explorer,
+ and select <strong>Manage</strong>.</li>
+ <li>Select <strong>Devices</strong> in the left pane.</li>
+ <li>Locate and expand <em>Other device</em> in the right pane.</li>
+ <li>Right-click the device name (such as <em>Nexus S</em>) and select <strong>Update
+ Driver Software</strong>.
+ This will launch the Hardware Update Wizard.</li>
+ <li>Select <strong>Browse my computer for driver software</strong> and click
+ <strong>Next</strong>.</li>
+ <li>Click <strong>Browse</strong> and locate the USB driver folder. (The Google USB
+Driver is located in {@code <sdk>\google-usb_driver\}.)</li>
+ <li>Click <strong>Next</strong> to install the driver.</li>
</ol>
-
-<h3 id="VistaUpgrade">Windows Vista: Upgrade an existing driver</h3>
-
-<p>To upgrade an existing Android USB driver on Windows Vista with the new
+<p>Or, to <em>upgrade</em> an existing Android USB driver on Windows 7 with the new
driver:</p>
<ol>
<li>Connect your Android-powered device to your computer's USB port.</li>
- <li>Right-click on "Computer" from your desktop or Windows Explorer,
- and select "Manage."</li>
- <li>Select "Device Manager" in the left pane of the Computer Management
+ <li>Right-click on <em>Computer</em> from your desktop or Windows Explorer,
+ and select <strong>Manage</strong>.</li>
+ <li>Select <strong>Device Manager</strong> in the left pane of the Computer Management
window.</li>
- <li>Locate and expand "ADB Interface" in the right pane.</li>
- <li>Right-click on "HTC Dream Composite ADB Interface", and select "Update
- Driver Software..."</li>
- <li>When Vista starts updating the driver, a prompt will ask how you want to
- search for the driver
- software. Select "Browse my computer for driver software."</li>
- <li>Click "Browse..." and locate the folder where you copied the
- installation package. As long as you specified the exact location of the
- installation package, you may leave "Include subfolders" checked or
- unchecked—it doesn't matter.</li>
- <li>Click "Next." Vista may prompt you to confirm the privilege elevation
- required for driver installation. Confirm it.</li>
- <li>When Vista asks if you'd like to install the Google ADB Interface device,
- click "Install" to install the driver.</li>
+ <li>Locate and expand <em>Android Phone</em> in the right pane.</li>
+ <li>Right-click <em>Android Composite ADB Interface</em> and select <strong>Update
+ Driver</strong>.
+ This will launch the Hardware Update Wizard.</li>
+ <li>Select <strong>Install from a list or specific location</strong> and click
+ <strong>Next</strong>.</li>
+ <li>Select <strong>Search for the best driver in these locations</strong>; un-check
+<strong>Search removable media</strong>; and check <strong>Include this location in the
+search</strong>.</li>
+ <li>Click <strong>Browse</strong> and locate the USB driver folder. (The Google USB
+Driver is located in {@code <sdk>\google-usb_driver\}.)</li>
+ <li>Click <strong>Next</strong> to upgrade the driver.</li>
</ol>
-<h3 id="XPFreshInstall">Windows XP: Perform a fresh installation</h3>
+
+
+
+<h3 id="WinXp">Windows XP</h3>
<p>To install the Android USB driver on Windows XP for the first time:</p>
<ol>
<li>Connect your Android-powered device to your computer's USB port. Windows
will detect the device and launch the Hardware Update Wizard.</li>
- <li>Select "Install from a list or specific location" and click
- "Next."</li>
- <li>Select "Search for the best driver in these locations"; un-check "Search
- removable media"; and check "Include this location in the search."</li>
- <li>Click "Browse..." and locate the folder where you copied the installation
- package.</li>
- <li>Click "Next" to install the driver.</li>
+ <li>Select <strong>Install from a list or specific location</strong> and click
+ <strong>Next</strong>.</li>
+ <li>Select <strong>Search for the best driver in these locations</strong>; un-check
+<strong>Search
+ removable media</strong>; and check <strong>Include
+this location in the search</strong>.</li>
+ <li>Click <strong>Browse</strong> and locate the USB driver folder. (The Google USB
+Driver is located in {@code <sdk>\google-usb_driver\}.)</li>
+ <li>Click <strong>Next</strong> to install the driver.</li>
</ol>
-
-<h3 id="XPUpgrade">Windows XP: Upgrade an existing driver</h3>
-
-<p>To upgrade an existing Android USB driver on Windows XP with the new
+<p>Or, to <em>upgrade</em> an existing Android USB driver on Windows XP with the new
driver:</p>
<ol>
<li>Connect your Android-powered device to your computer's USB port.</li>
- <li>Right-click on "My Computer" from your desktop or Windows Explorer,
- and select "Manage."</li>
- <li>Select "Device Manager" in the left pane of the Computer Management
- window.</li>
- <li>Locate and expand "Android Phone" in the right pane.</li>
- <li>Right-click "Android Composite ADB Interface" and select "Update
- Driver..."
+ <li>Right-click on <em>My Computer</em> from your desktop or Windows Explorer,
+ and select <strong>Manage</strong>.</li>
+ <li>Select <strong>Device Manager</strong> in the left pane.</li>
+ <li>Locate and expand <em>Android Phone</em> in the right pane.</li>
+ <li>Right-click <em>Android Composite ADB Interface</em> and select <strong>Update
+ Driver</strong>.
This will launch the Hardware Update Wizard.</li>
- <li>Select "Install from a list or specific location" and click
- "Next."</li>
- <li>Select "Search for the best driver in these locations"; un-check "Search
- removable media"; and check "Include this location in the search."</li>
- <li>Click "Browse..." and locate the folder where you copied the installation
- package.</li>
- <li>Click "Next" to install the driver.</li>
+ <li>Select <strong>Install from a list or specific location</strong> and click
+ <strong>Next</strong>.</li>
+ <li>Select <strong>Search for the best driver in these locations</strong>; un-check <strong>Search
+ removable media</strong>; and check <strong>Include
+this location in the search</strong>.</li>
+ <li>Click <strong>Browse</strong> and locate the USB driver folder. (The Google USB
+Driver is located in {@code <sdk>\google-usb_driver\}.)</li>
+ <li>Click <strong>Next</strong> to upgrade the driver.</li>
+</ol>
+
+
+
+<h3 id="WinVista">Windows Vista</h3>
+
+<p>To install the Android USB driver on Windows Vista for the first time:</p>
+
+<ol>
+ <li>Connect your Android-powered device to your computer's USB port. Windows
+ will detect the device and launch the Found New Hardware wizard.</li>
+ <li>Select <strong>Locate and install driver software</strong>.</li>
+ <li>Select <strong>Don't search online</strong>.</li>
+ <li>Select <strong>I don't have the disk. Show me other options</strong>.</li>
+ <li>Select <strong>Browse my computer for driver software</strong>.</li>
+ <li>Click <strong>Browse</strong> and locate the USB driver folder. (The Google USB
+Driver is located in {@code <sdk>\google-usb_driver\}.) As long as you specified the exact
+location of the
+ installation package, you may leave <strong>Include subfolders</strong> checked or
+ unchecked—it doesn't matter.</li>
+ <li>Click <strong>Next</strong>. Vista may prompt you to confirm the privilege elevation
+ required for driver installation. Confirm it.</li>
+ <li>When Vista asks if you'd like to install the Google ADB Interface device,
+ click <strong>Install</strong> to install the driver.</li>
+</ol>
+
+<p>Or, to <em>upgrade</em> an existing Android USB driver on Windows Vista with the new
+driver:</p>
+
+<ol>
+ <li>Connect your Android-powered device to your computer's USB port.</li>
+ <li>Right-click on <em>Computer</em> from your desktop or Windows Explorer,
+ and select <strong>Manage</strong>.</li>
+ <li>Select <strong>Device Manager</strong> in the left pane.</li>
+ <li>Locate and expand <em>ADB Interface</em> in the right pane.</li>
+ <li>Right-click on <em>HTC Dream Composite ADB Interface</em>, and select <strong>Update
+ Driver Software</strong>.</li>
+ <li>When Vista starts updating the driver, a prompt will ask how you want to
+ search for the driver
+ software. Select <strong>Browse my computer for driver software</strong>.</li>
+ <li>Click <strong>Browse</strong> and locate the USB driver folder. (The Google USB
+Driver is located in {@code <sdk>\google-usb_driver\}.) As long as you specified the
+exact location of the
+ installation package, you may leave <strong>Include subfolders</strong> checked or
+ unchecked—it doesn't matter.</li>
+ <li>Click <strong>Next</strong>. Vista might prompt you to confirm the privilege elevation
+ required for driver installation. Confirm it.</li>
+ <li>When Vista asks if you'd like to install the Google ADB Interface device,
+ click <strong>Install</strong> to upgrade the driver.</li>
</ol>
diff --git a/graphics/java/android/graphics/Canvas.java b/graphics/java/android/graphics/Canvas.java
index 184620b..89e725a 100644
--- a/graphics/java/android/graphics/Canvas.java
+++ b/graphics/java/android/graphics/Canvas.java
@@ -1175,8 +1175,11 @@
nativeDrawBitmapMatrix(mNativeCanvas, bitmap.ni(), matrix.ni(),
paint != null ? paint.mNativePaint : 0);
}
-
- private static void checkRange(int length, int offset, int count) {
+
+ /**
+ * @hide
+ */
+ protected static void checkRange(int length, int offset, int count) {
if ((offset | count) < 0 || offset + count > length) {
throw new ArrayIndexOutOfBoundsException();
}
diff --git a/graphics/java/android/renderscript/FieldPacker.java b/graphics/java/android/renderscript/FieldPacker.java
index 2fb3d95..40628bc 100644
--- a/graphics/java/android/renderscript/FieldPacker.java
+++ b/graphics/java/android/renderscript/FieldPacker.java
@@ -233,16 +233,16 @@
addI32(v.w);
}
- public void addU32(Int2 v) {
+ public void addU32(Long2 v) {
addU32(v.x);
addU32(v.y);
}
- public void addU32(Int3 v) {
+ public void addU32(Long3 v) {
addU32(v.x);
addU32(v.y);
addU32(v.z);
}
- public void addU32(Int4 v) {
+ public void addU32(Long4 v) {
addU32(v.x);
addU32(v.y);
addU32(v.z);
diff --git a/include/private/surfaceflinger/SharedBufferStack.h b/include/private/surfaceflinger/SharedBufferStack.h
index 9d589cf..eb599b5 100644
--- a/include/private/surfaceflinger/SharedBufferStack.h
+++ b/include/private/surfaceflinger/SharedBufferStack.h
@@ -105,7 +105,7 @@
volatile int32_t head; // server's current front buffer
volatile int32_t available; // number of dequeue-able buffers
volatile int32_t queued; // number of buffers waiting for post
- volatile int32_t inUse; // buffer currently in use by SF
+ volatile int32_t reserved1;
volatile status_t status; // surface's status code
// not part of the conditions
@@ -275,7 +275,6 @@
int32_t identity);
ssize_t retireAndLock();
- status_t unlock(int buffer);
void setStatus(status_t status);
status_t reallocateAll();
status_t reallocateAllExcept(int buffer);
@@ -356,12 +355,6 @@
inline const char* name() const { return "BuffersAvailableCondition"; }
};
- struct UnlockUpdate : public UpdateBase {
- const int lockedBuffer;
- inline UnlockUpdate(SharedBufferBase* sbb, int lockedBuffer);
- inline ssize_t operator()();
- };
-
struct RetireUpdate : public UpdateBase {
const int numBuffers;
inline RetireUpdate(SharedBufferBase* sbb, int numBuffers);
diff --git a/libs/hwui/Caches.h b/libs/hwui/Caches.h
index c03c347..aa0ceb7 100644
--- a/libs/hwui/Caches.h
+++ b/libs/hwui/Caches.h
@@ -31,8 +31,8 @@
#include "GradientCache.h"
#include "PatchCache.h"
#include "ProgramCache.h"
-#include "PathCache.h"
#include "ShapeCache.h"
+#include "PathCache.h"
#include "TextDropShadowCache.h"
#include "FboCache.h"
#include "ResourceCache.h"
diff --git a/libs/hwui/Debug.h b/libs/hwui/Debug.h
index 014519e..6236684 100644
--- a/libs/hwui/Debug.h
+++ b/libs/hwui/Debug.h
@@ -42,9 +42,6 @@
// This flag requires DEBUG_PATCHES to be turned on
#define DEBUG_PATCHES_EMPTY_VERTICES 0
-// Turn on to display debug info about paths
-#define DEBUG_PATHS 0
-
// Turn on to display debug info about shapes
#define DEBUG_SHAPES 0
diff --git a/libs/hwui/DisplayListRenderer.cpp b/libs/hwui/DisplayListRenderer.cpp
index a74a95f..bdf056c 100644
--- a/libs/hwui/DisplayListRenderer.cpp
+++ b/libs/hwui/DisplayListRenderer.cpp
@@ -100,6 +100,7 @@
"DrawBitmap",
"DrawBitmapMatrix",
"DrawBitmapRect",
+ "DrawBitmapMesh",
"DrawPatch",
"DrawColor",
"DrawRect",
@@ -308,6 +309,19 @@
getFloat(), getFloat(), getFloat(), getFloat(), getPaint());
}
break;
+ case DrawBitmapMesh: {
+ int verticesCount = 0;
+ uint32_t colorsCount = 0;
+
+ SkBitmap* bitmap = getBitmap();
+ uint32_t meshWidth = getInt();
+ uint32_t meshHeight = getInt();
+ float* vertices = getFloats(verticesCount);
+ bool hasColors = getInt();
+ int* colors = hasColors ? getInts(colorsCount) : NULL;
+
+ renderer.drawBitmapMesh(bitmap, meshWidth, meshHeight, vertices, colors, getPaint());
+ }
case DrawPatch: {
int32_t* xDivs = NULL;
int32_t* yDivs = NULL;
@@ -587,6 +601,22 @@
addPaint(paint);
}
+void DisplayListRenderer::drawBitmapMesh(SkBitmap* bitmap, int meshWidth, int meshHeight,
+ float* vertices, int* colors, SkPaint* paint) {
+ addOp(DisplayList::DrawBitmapMesh);
+ addBitmap(bitmap);
+ addInt(meshWidth);
+ addInt(meshHeight);
+ addFloats(vertices, (meshWidth + 1) * (meshHeight + 1) * 2);
+ if (colors) {
+ addInt(1);
+ addInts(colors, (meshWidth + 1) * (meshHeight + 1));
+ } else {
+ addInt(0);
+ }
+ addPaint(paint);
+}
+
void DisplayListRenderer::drawPatch(SkBitmap* bitmap, const int32_t* xDivs, const int32_t* yDivs,
const uint32_t* colors, uint32_t width, uint32_t height, int8_t numColors,
float left, float top, float right, float bottom, SkPaint* paint) {
diff --git a/libs/hwui/DisplayListRenderer.h b/libs/hwui/DisplayListRenderer.h
index 4b727f6..7f9db8a 100644
--- a/libs/hwui/DisplayListRenderer.h
+++ b/libs/hwui/DisplayListRenderer.h
@@ -107,6 +107,7 @@
DrawBitmap,
DrawBitmapMatrix,
DrawBitmapRect,
+ DrawBitmapMesh,
DrawPatch,
DrawColor,
DrawRect,
@@ -267,6 +268,8 @@
void drawBitmap(SkBitmap* bitmap, float srcLeft, float srcTop,
float srcRight, float srcBottom, float dstLeft, float dstTop,
float dstRight, float dstBottom, SkPaint* paint);
+ void drawBitmapMesh(SkBitmap* bitmap, int meshWidth, int meshHeight,
+ float* vertices, int* colors, SkPaint* paint);
void drawPatch(SkBitmap* bitmap, const int32_t* xDivs, const int32_t* yDivs,
const uint32_t* colors, uint32_t width, uint32_t height, int8_t numColors,
float left, float top, float right, float bottom, SkPaint* paint);
diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp
index 9528dbb..b06bbd0 100644
--- a/libs/hwui/OpenGLRenderer.cpp
+++ b/libs/hwui/OpenGLRenderer.cpp
@@ -1077,6 +1077,61 @@
restore();
}
+void OpenGLRenderer::drawBitmapMesh(SkBitmap* bitmap, int meshWidth, int meshHeight,
+ float* vertices, int* colors, SkPaint* paint) {
+ // TODO: Do a quickReject
+ if (!vertices || mSnapshot->isIgnored()) {
+ return;
+ }
+
+ glActiveTexture(gTextureUnits[0]);
+ Texture* texture = mCaches.textureCache.get(bitmap);
+ if (!texture) return;
+ const AutoTexture autoCleanup(texture);
+ setTextureWrapModes(texture, GL_CLAMP_TO_EDGE, GL_CLAMP_TO_EDGE);
+
+ int alpha;
+ SkXfermode::Mode mode;
+ getAlphaAndMode(paint, &alpha, &mode);
+
+ // TODO: Support the colors array
+ const uint32_t count = meshWidth * meshHeight * 6;
+ TextureVertex mesh[count];
+
+ TextureVertex* vertex = mesh;
+ for (int32_t y = 0; y < meshHeight; y++) {
+ for (int32_t x = 0; x < meshWidth; x++) {
+ uint32_t i = (y * (meshWidth + 1) + x) * 2;
+
+ float u1 = float(x) / meshWidth;
+ float u2 = float(x + 1) / meshWidth;
+ float v1 = float(y) / meshHeight;
+ float v2 = float(y + 1) / meshHeight;
+
+ int ax = i + (meshWidth + 1) * 2;
+ int ay = ax + 1;
+ int bx = i;
+ int by = bx + 1;
+ int cx = i + 2;
+ int cy = cx + 1;
+ int dx = i + (meshWidth + 1) * 2 + 2;
+ int dy = dx + 1;
+
+ TextureVertex::set(vertex++, vertices[ax], vertices[ay], u1, v2);
+ TextureVertex::set(vertex++, vertices[bx], vertices[by], u1, v1);
+ TextureVertex::set(vertex++, vertices[cx], vertices[cy], u2, v1);
+
+ TextureVertex::set(vertex++, vertices[ax], vertices[ay], u1, v2);
+ TextureVertex::set(vertex++, vertices[cx], vertices[cy], u2, v1);
+ TextureVertex::set(vertex++, vertices[dx], vertices[dy], u2, v2);
+ }
+ }
+
+ drawTextureMesh(0.0f, 0.0f, 1.0f, 1.0f, texture->id, alpha / 255.0f,
+ mode, texture->blend, &mesh[0].position[0], &mesh[0].texture[0],
+ GL_TRIANGLES, count);
+}
+
void OpenGLRenderer::drawBitmap(SkBitmap* bitmap,
float srcLeft, float srcTop, float srcRight, float srcBottom,
float dstLeft, float dstTop, float dstRight, float dstBottom,
diff --git a/libs/hwui/OpenGLRenderer.h b/libs/hwui/OpenGLRenderer.h
index a43660b..42e93ad 100644
--- a/libs/hwui/OpenGLRenderer.h
+++ b/libs/hwui/OpenGLRenderer.h
@@ -102,6 +102,8 @@
virtual void drawBitmap(SkBitmap* bitmap, float srcLeft, float srcTop,
float srcRight, float srcBottom, float dstLeft, float dstTop,
float dstRight, float dstBottom, SkPaint* paint);
+ virtual void drawBitmapMesh(SkBitmap* bitmap, int meshWidth, int meshHeight,
+ float* vertices, int* colors, SkPaint* paint);
virtual void drawPatch(SkBitmap* bitmap, const int32_t* xDivs, const int32_t* yDivs,
const uint32_t* colors, uint32_t width, uint32_t height, int8_t numColors,
float left, float top, float right, float bottom, SkPaint* paint);
diff --git a/libs/hwui/PathCache.cpp b/libs/hwui/PathCache.cpp
index 3184598..28c302e 100644
--- a/libs/hwui/PathCache.cpp
+++ b/libs/hwui/PathCache.cpp
@@ -16,11 +16,6 @@
#define LOG_TAG "OpenGLRenderer"
-#include <GLES2/gl2.h>
-
-#include <SkCanvas.h>
-#include <SkRect.h>
-
#include <utils/threads.h>
#include "PathCache.h"
@@ -30,87 +25,11 @@
namespace uirenderer {
///////////////////////////////////////////////////////////////////////////////
-// Constructors/destructor
+// Path cache
///////////////////////////////////////////////////////////////////////////////
-PathCache::PathCache():
- mCache(GenerationCache<PathCacheEntry, PathTexture*>::kUnlimitedCapacity),
- mSize(0), mMaxSize(MB(DEFAULT_PATH_CACHE_SIZE)) {
- char property[PROPERTY_VALUE_MAX];
- if (property_get(PROPERTY_PATH_CACHE_SIZE, property, NULL) > 0) {
- LOGD(" Setting path cache size to %sMB", property);
- setMaxSize(MB(atof(property)));
- } else {
- LOGD(" Using default path cache size of %.2fMB", DEFAULT_PATH_CACHE_SIZE);
- }
- init();
-}
-
-PathCache::PathCache(uint32_t maxByteSize):
- mCache(GenerationCache<PathCacheEntry, PathTexture*>::kUnlimitedCapacity),
- mSize(0), mMaxSize(maxByteSize) {
- init();
-}
-
-PathCache::~PathCache() {
- mCache.clear();
-}
-
-void PathCache::init() {
- mCache.setOnEntryRemovedListener(this);
-
- GLint maxTextureSize;
- glGetIntegerv(GL_MAX_TEXTURE_SIZE, &maxTextureSize);
- mMaxTextureSize = maxTextureSize;
-
- mDebugEnabled = readDebugLevel() & kDebugCaches;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-// Size management
-///////////////////////////////////////////////////////////////////////////////
-
-uint32_t PathCache::getSize() {
- return mSize;
-}
-
-uint32_t PathCache::getMaxSize() {
- return mMaxSize;
-}
-
-void PathCache::setMaxSize(uint32_t maxSize) {
- mMaxSize = maxSize;
- while (mSize > mMaxSize) {
- mCache.removeOldest();
- }
-}
-
-///////////////////////////////////////////////////////////////////////////////
-// Callbacks
-///////////////////////////////////////////////////////////////////////////////
-
-void PathCache::operator()(PathCacheEntry& path, PathTexture*& texture) {
- removeTexture(texture);
-}
-
-///////////////////////////////////////////////////////////////////////////////
-// Caching
-///////////////////////////////////////////////////////////////////////////////
-
-void PathCache::removeTexture(PathTexture* texture) {
- if (texture) {
- const uint32_t size = texture->width * texture->height;
- mSize -= size;
-
- PATH_LOGD("PathCache::callback: delete path: name, size, mSize = %d, %d, %d",
- texture->id, size, mSize);
- if (mDebugEnabled) {
- LOGD("Path deleted, size = %d", size);
- }
-
- glDeleteTextures(1, &texture->id);
- delete texture;
- }
+PathCache::PathCache(): ShapeCache<PathCacheEntry>("path",
+ PROPERTY_PATH_CACHE_SIZE, DEFAULT_PATH_CACHE_SIZE) {
}
void PathCache::remove(SkPath* path) {
@@ -159,103 +78,5 @@
return texture;
}
-PathTexture* PathCache::addTexture(const PathCacheEntry& entry,
- const SkPath *path, const SkPaint* paint) {
- const SkRect& bounds = path->getBounds();
-
- const float pathWidth = fmax(bounds.width(), 1.0f);
- const float pathHeight = fmax(bounds.height(), 1.0f);
-
- if (pathWidth > mMaxTextureSize || pathHeight > mMaxTextureSize) {
- LOGW("Path too large to be rendered into a texture");
- return NULL;
- }
-
- const float offset = entry.strokeWidth * 1.5f;
- const uint32_t width = uint32_t(pathWidth + offset * 2.0 + 0.5);
- const uint32_t height = uint32_t(pathHeight + offset * 2.0 + 0.5);
-
- const uint32_t size = width * height;
- // Don't even try to cache a bitmap that's bigger than the cache
- if (size < mMaxSize) {
- while (mSize + size > mMaxSize) {
- mCache.removeOldest();
- }
- }
-
- PathTexture* texture = new PathTexture;
- texture->left = bounds.fLeft;
- texture->top = bounds.fTop;
- texture->offset = offset;
- texture->width = width;
- texture->height = height;
- texture->generation = path->getGenerationID();
-
- SkBitmap bitmap;
- bitmap.setConfig(SkBitmap::kA8_Config, width, height);
- bitmap.allocPixels();
- bitmap.eraseColor(0);
-
- SkPaint pathPaint(*paint);
-
- // Make sure the paint is opaque, color, alpha, filter, etc.
- // will be applied later when compositing the alpha8 texture
- pathPaint.setColor(0xff000000);
- pathPaint.setAlpha(255);
- pathPaint.setColorFilter(NULL);
- pathPaint.setMaskFilter(NULL);
- pathPaint.setShader(NULL);
- SkXfermode* mode = SkXfermode::Create(SkXfermode::kSrc_Mode);
- pathPaint.setXfermode(mode)->safeUnref();
-
- SkCanvas canvas(bitmap);
- canvas.translate(-bounds.fLeft + offset, -bounds.fTop + offset);
- canvas.drawPath(*path, pathPaint);
-
- generateTexture(bitmap, texture);
-
- if (size < mMaxSize) {
- mSize += size;
- PATH_LOGD("PathCache::get: create path: name, size, mSize = %d, %d, %d",
- texture->id, size, mSize);
- if (mDebugEnabled) {
- LOGD("Path created, size = %d", size);
- }
- mCache.put(entry, texture);
- } else {
- texture->cleanup = true;
- }
-
- return texture;
-}
-
-void PathCache::clear() {
- mCache.clear();
-}
-
-void PathCache::generateTexture(SkBitmap& bitmap, Texture* texture) {
- SkAutoLockPixels alp(bitmap);
- if (!bitmap.readyToDraw()) {
- LOGE("Cannot generate texture from bitmap");
- return;
- }
-
- glGenTextures(1, &texture->id);
-
- glBindTexture(GL_TEXTURE_2D, texture->id);
- // Textures are Alpha8
- glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
-
- texture->blend = true;
- glTexImage2D(GL_TEXTURE_2D, 0, GL_ALPHA, texture->width, texture->height, 0,
- GL_ALPHA, GL_UNSIGNED_BYTE, bitmap.getPixels());
-
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
-
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
-}
-
}; // namespace uirenderer
}; // namespace android
diff --git a/libs/hwui/PathCache.h b/libs/hwui/PathCache.h
index ae2e55d..dc67e16 100644
--- a/libs/hwui/PathCache.h
+++ b/libs/hwui/PathCache.h
@@ -17,123 +17,54 @@
#ifndef ANDROID_HWUI_PATH_CACHE_H
#define ANDROID_HWUI_PATH_CACHE_H
-#include <SkBitmap.h>
-#include <SkPaint.h>
-#include <SkPath.h>
-
#include <utils/Vector.h>
#include "Debug.h"
-#include "Texture.h"
+#include "ShapeCache.h"
+
#include "utils/Compare.h"
-#include "utils/GenerationCache.h"
namespace android {
namespace uirenderer {
///////////////////////////////////////////////////////////////////////////////
-// Defines
-///////////////////////////////////////////////////////////////////////////////
-
-// Debug
-#if DEBUG_PATHS
- #define PATH_LOGD(...) LOGD(__VA_ARGS__)
-#else
- #define PATH_LOGD(...)
-#endif
-
-///////////////////////////////////////////////////////////////////////////////
// Classes
///////////////////////////////////////////////////////////////////////////////
-/**
- * Describe a path in the path cache.
- */
-struct PathCacheEntry {
- PathCacheEntry() {
+struct PathCacheEntry: public ShapeCacheEntry {
+ PathCacheEntry(SkPath* path, SkPaint* paint):
+ ShapeCacheEntry(ShapeCacheEntry::kShapePath, paint) {
+ this->path = path;
+ }
+
+ PathCacheEntry(): ShapeCacheEntry() {
path = NULL;
- join = SkPaint::kDefault_Join;
- cap = SkPaint::kDefault_Cap;
- style = SkPaint::kFill_Style;
- miter = 4.0f;
- strokeWidth = 1.0f;
}
PathCacheEntry(const PathCacheEntry& entry):
- path(entry.path), join(entry.join), cap(entry.cap),
- style(entry.style), miter(entry.miter),
- strokeWidth(entry.strokeWidth) {
+ ShapeCacheEntry(entry) {
+ path = entry.path;
}
- PathCacheEntry(SkPath* path, SkPaint* paint) {
- this->path = path;
- join = paint->getStrokeJoin();
- cap = paint->getStrokeCap();
- miter = paint->getStrokeMiter();
- strokeWidth = paint->getStrokeWidth();
- style = paint->getStyle();
- }
-
- SkPath* path;
- SkPaint::Join join;
- SkPaint::Cap cap;
- SkPaint::Style style;
- float miter;
- float strokeWidth;
-
- bool operator<(const PathCacheEntry& rhs) const {
+ bool lessThan(const ShapeCacheEntry& r) const {
+ const PathCacheEntry& rhs = (const PathCacheEntry&) r;
LTE_INT(path) {
- LTE_INT(join) {
- LTE_INT(cap) {
- LTE_INT(style) {
- LTE_FLOAT(miter) {
- LTE_FLOAT(strokeWidth) return false;
- }
- }
- }
- }
+ return false;
}
return false;
}
-}; // struct PathCacheEntry
-/**
- * Alpha texture used to represent a path.
- */
-struct PathTexture: public Texture {
- PathTexture(): Texture() {
- }
-
- /**
- * Left coordinate of the path bounds.
- */
- float left;
- /**
- * Top coordinate of the path bounds.
- */
- float top;
- /**
- * Offset to draw the path at the correct origin.
- */
- float offset;
-}; // struct PathTexture
+ SkPath* path;
+}; // PathCacheEntry
/**
* A simple LRU path cache. The cache has a maximum size expressed in bytes.
* Any texture added to the cache causing the cache to grow beyond the maximum
* allowed size will also cause the oldest texture to be kicked out.
*/
-class PathCache: public OnEntryRemoved<PathCacheEntry, PathTexture*> {
+class PathCache: public ShapeCache<PathCacheEntry> {
public:
PathCache();
- PathCache(uint32_t maxByteSize);
- ~PathCache();
-
- /**
- * Used as a callback when an entry is removed from the cache.
- * Do not invoke directly.
- */
- void operator()(PathCacheEntry& path, PathTexture*& texture);
/**
* Returns the texture associated with the specified path. If the texture
@@ -141,10 +72,6 @@
*/
PathTexture* get(SkPath* path, SkPaint* paint);
/**
- * Clears the cache. This causes all textures to be deleted.
- */
- void clear();
- /**
* Removes an entry.
*/
void remove(SkPath* path);
@@ -158,39 +85,7 @@
*/
void clearGarbage();
- /**
- * Sets the maximum size of the cache in bytes.
- */
- void setMaxSize(uint32_t maxSize);
- /**
- * Returns the maximum size of the cache in bytes.
- */
- uint32_t getMaxSize();
- /**
- * Returns the current size of the cache in bytes.
- */
- uint32_t getSize();
-
private:
- /**
- * Generates the texture from a bitmap into the specified texture structure.
- */
- void generateTexture(SkBitmap& bitmap, Texture* texture);
-
- void removeTexture(PathTexture* texture);
-
- PathTexture* addTexture(const PathCacheEntry& entry, const SkPath *path, const SkPaint* paint);
-
- void init();
-
- GenerationCache<PathCacheEntry, PathTexture*> mCache;
-
- uint32_t mSize;
- uint32_t mMaxSize;
- GLuint mMaxTextureSize;
-
- bool mDebugEnabled;
-
Vector<SkPath*> mGarbage;
mutable Mutex mLock;
}; // class PathCache
diff --git a/libs/hwui/ShapeCache.cpp b/libs/hwui/ShapeCache.cpp
index ffa18e3..b78eecb 100644
--- a/libs/hwui/ShapeCache.cpp
+++ b/libs/hwui/ShapeCache.cpp
@@ -21,7 +21,12 @@
namespace android {
namespace uirenderer {
-RoundRectShapeCache::RoundRectShapeCache(): ShapeCache<RoundRectShapeCacheEntry>() {
+///////////////////////////////////////////////////////////////////////////////
+// Rounded rects
+///////////////////////////////////////////////////////////////////////////////
+
+RoundRectShapeCache::RoundRectShapeCache(): ShapeCache<RoundRectShapeCacheEntry>(
+ "round rect", PROPERTY_SHAPE_CACHE_SIZE, DEFAULT_SHAPE_CACHE_SIZE) {
}
PathTexture* RoundRectShapeCache::getRoundRect(float width, float height,
@@ -41,7 +46,12 @@
return texture;
}
-CircleShapeCache::CircleShapeCache(): ShapeCache<CircleShapeCacheEntry>() {
+///////////////////////////////////////////////////////////////////////////////
+// Circles
+///////////////////////////////////////////////////////////////////////////////
+
+CircleShapeCache::CircleShapeCache(): ShapeCache<CircleShapeCacheEntry>(
+ "circle", PROPERTY_SHAPE_CACHE_SIZE, DEFAULT_SHAPE_CACHE_SIZE) {
}
PathTexture* CircleShapeCache::getCircle(float radius, SkPaint* paint) {
diff --git a/libs/hwui/ShapeCache.h b/libs/hwui/ShapeCache.h
index 910d01d..c8bcfc2 100644
--- a/libs/hwui/ShapeCache.h
+++ b/libs/hwui/ShapeCache.h
@@ -19,11 +19,17 @@
#include <GLES2/gl2.h>
+#include <SkBitmap.h>
#include <SkCanvas.h>
+#include <SkPaint.h>
+#include <SkPath.h>
#include <SkRect.h>
-#include "PathCache.h"
+#include "Debug.h"
#include "Properties.h"
+#include "Texture.h"
+#include "utils/Compare.h"
+#include "utils/GenerationCache.h"
namespace android {
namespace uirenderer {
@@ -44,6 +50,27 @@
///////////////////////////////////////////////////////////////////////////////
/**
+ * Alpha texture used to represent a path.
+ */
+struct PathTexture: public Texture {
+ PathTexture(): Texture() {
+ }
+
+ /**
+ * Left coordinate of the path bounds.
+ */
+ float left;
+ /**
+ * Top coordinate of the path bounds.
+ */
+ float top;
+ /**
+ * Offset to draw the path at the correct origin.
+ */
+ float offset;
+}; // struct PathTexture
+
+/**
* Describe a shape in the shape cache.
*/
struct ShapeCacheEntry {
@@ -52,7 +79,8 @@
kShapeRoundRect,
kShapeCircle,
kShapeOval,
- kShapeArc
+ kShapeArc,
+ kShapePath
};
ShapeCacheEntry() {
@@ -196,8 +224,7 @@
template<typename Entry>
class ShapeCache: public OnEntryRemoved<Entry, PathTexture*> {
public:
- ShapeCache();
- ShapeCache(uint32_t maxByteSize);
+ ShapeCache(const char* name, const char* propertyName, float defaultSize);
~ShapeCache();
/**
@@ -231,22 +258,23 @@
return mCache.get(entry);
}
-private:
- /**
- * Generates the texture from a bitmap into the specified texture structure.
- */
- void generateTexture(SkBitmap& bitmap, Texture* texture);
-
void removeTexture(PathTexture* texture);
- void init();
-
GenerationCache<Entry, PathTexture*> mCache;
uint32_t mSize;
uint32_t mMaxSize;
GLuint mMaxTextureSize;
+ char* mName;
bool mDebugEnabled;
+
+private:
+ /**
+ * Generates the texture from a bitmap into the specified texture structure.
+ */
+ void generateTexture(SkBitmap& bitmap, Texture* texture);
+
+ void init();
}; // class ShapeCache
class RoundRectShapeCache: public ShapeCache<RoundRectShapeCacheEntry> {
@@ -269,29 +297,29 @@
///////////////////////////////////////////////////////////////////////////////
template<class Entry>
-ShapeCache<Entry>::ShapeCache():
+ShapeCache<Entry>::ShapeCache(const char* name, const char* propertyName, float defaultSize):
mCache(GenerationCache<ShapeCacheEntry, PathTexture*>::kUnlimitedCapacity),
- mSize(0), mMaxSize(MB(DEFAULT_SHAPE_CACHE_SIZE)) {
+ mSize(0), mMaxSize(MB(defaultSize)) {
char property[PROPERTY_VALUE_MAX];
- if (property_get(PROPERTY_SHAPE_CACHE_SIZE, property, NULL) > 0) {
- LOGD(" Setting shape cache size to %sMB", property);
+ if (property_get(propertyName, property, NULL) > 0) {
+ LOGD(" Setting %s cache size to %sMB", name, property);
setMaxSize(MB(atof(property)));
} else {
- LOGD(" Using default shape cache size of %.2fMB", DEFAULT_SHAPE_CACHE_SIZE);
+ LOGD(" Using default %s cache size of %.2fMB", name, defaultSize);
}
- init();
-}
-template<class Entry>
-ShapeCache<Entry>::ShapeCache(uint32_t maxByteSize):
- mCache(GenerationCache<ShapeCacheEntry, PathTexture*>::kUnlimitedCapacity),
- mSize(0), mMaxSize(maxByteSize) {
+ size_t len = strlen(name);
+ mName = new char[len + 1];
+ strcpy(mName, name);
+ mName[len] = '\0';
+
init();
}
template<class Entry>
ShapeCache<Entry>::~ShapeCache() {
mCache.clear();
+ delete[] mName;
}
template<class Entry>
@@ -346,10 +374,10 @@
const uint32_t size = texture->width * texture->height;
mSize -= size;
- SHAPE_LOGD("ShapeCache::callback: delete path: name, size, mSize = %d, %d, %d",
- texture->id, size, mSize);
+ SHAPE_LOGD("ShapeCache::callback: delete %s: name, size, mSize = %d, %d, %d",
+ mName, texture->id, size, mSize);
if (mDebugEnabled) {
- LOGD("Path deleted, size = %d", size);
+ LOGD("Shape %s deleted, size = %d", mName, size);
}
glDeleteTextures(1, &texture->id);
@@ -366,7 +394,7 @@
const float pathHeight = fmax(bounds.height(), 1.0f);
if (pathWidth > mMaxTextureSize || pathHeight > mMaxTextureSize) {
- LOGW("Shape too large to be rendered into a texture");
+ LOGW("Shape %s too large to be rendered into a texture", mName);
return NULL;
}
@@ -415,10 +443,10 @@
if (size < mMaxSize) {
mSize += size;
- SHAPE_LOGD("ShapeCache::get: create path: name, size, mSize = %d, %d, %d",
- texture->id, size, mSize);
+ SHAPE_LOGD("ShapeCache::get: create %s: name, size, mSize = %d, %d, %d",
+ mName, texture->id, size, mSize);
if (mDebugEnabled) {
- LOGD("Shape created, size = %d", size);
+ LOGD("Shape %s created, size = %d", mName, size);
}
mCache.put(entry, texture);
} else {
diff --git a/libs/rs/java/tests/src/com/android/rs/test/math.rs b/libs/rs/java/tests/src/com/android/rs/test/math.rs
index 3ff7910..02993fe 100644
--- a/libs/rs/java/tests/src/com/android/rs/test/math.rs
+++ b/libs/rs/java/tests/src/com/android/rs/test/math.rs
@@ -83,7 +83,7 @@
i4 = fnc(f4);
-static bool test_math(uint32_t index) {
+static bool test_fp_math(uint32_t index) {
bool failed = false;
start();
@@ -159,10 +159,10 @@
float time = end(index);
if (failed) {
- rsDebug("test_math FAILED", time);
+ rsDebug("test_fp_math FAILED", time);
}
else {
- rsDebug("test_math PASSED", time);
+ rsDebug("test_fp_math PASSED", time);
}
return failed;
@@ -170,7 +170,7 @@
void math_test(uint32_t index, int test_num) {
bool failed = false;
- failed |= test_math(index);
+ failed |= test_fp_math(index);
if (failed) {
rsSendToClientBlocking(RS_MSG_TEST_FAILED);
diff --git a/libs/rs/rsScriptC_LibCL.cpp b/libs/rs/rsScriptC_LibCL.cpp
index 65b5ff4..02d33b7 100644
--- a/libs/rs/rsScriptC_LibCL.cpp
+++ b/libs/rs/rsScriptC_LibCL.cpp
@@ -24,26 +24,6 @@
using namespace android::renderscript;
-static float SC_acospi(float v) {
- return acosf(v)/ M_PI;
-}
-
-static float SC_asinpi(float v) {
- return asinf(v) / M_PI;
-}
-
-static float SC_atanpi(float v) {
- return atanf(v) / M_PI;
-}
-
-static float SC_atan2pi(float y, float x) {
- return atan2f(y, x) / M_PI;
-}
-
-static float SC_cospi(float v) {
- return cosf(v * M_PI);
-}
-
static float SC_exp10(float v) {
return pow(10.f, v);
}
@@ -83,14 +63,6 @@
return sinf(v);
}
-static float SC_sinpi(float v) {
- return sinf(v * M_PI);
-}
-
-static float SC_tanpi(float v) {
- return tanf(v * M_PI);
-}
-
//////////////////////////////////////////////////////////////////////////////
// Integer
//////////////////////////////////////////////////////////////////////////////
@@ -186,21 +158,16 @@
// OpenCL math
{ "_Z4acosf", (void *)&acosf, true },
{ "_Z5acoshf", (void *)&acoshf, true },
- { "_Z6acospif", (void *)&SC_acospi, true },
{ "_Z4asinf", (void *)&asinf, true },
{ "_Z5asinhf", (void *)&asinhf, true },
- { "_Z6asinpif", (void *)&SC_asinpi, true },
{ "_Z4atanf", (void *)&atanf, true },
{ "_Z5atan2ff", (void *)&atan2f, true },
{ "_Z5atanhf", (void *)&atanhf, true },
- { "_Z6atanpif", (void *)&SC_atanpi, true },
- { "_Z7atan2piff", (void *)&SC_atan2pi, true },
{ "_Z4cbrtf", (void *)&cbrtf, true },
{ "_Z4ceilf", (void *)&ceilf, true },
{ "_Z8copysignff", (void *)©signf, true },
{ "_Z3cosf", (void *)&cosf, true },
{ "_Z4coshf", (void *)&coshf, true },
- { "_Z5cospif", (void *)&SC_cospi, true },
{ "_Z4erfcf", (void *)&erfcf, true },
{ "_Z3erff", (void *)&erff, true },
{ "_Z3expf", (void *)&expf, true },
@@ -240,11 +207,9 @@
{ "_Z3sinf", (void *)&sinf, true },
{ "_Z6sincosfPf", (void *)&SC_sincos, true },
{ "_Z4sinhf", (void *)&sinhf, true },
- { "_Z5sinpif", (void *)&SC_sinpi, true },
{ "_Z4sqrtf", (void *)&sqrtf, true },
{ "_Z3tanf", (void *)&tanf, true },
{ "_Z4tanhf", (void *)&tanhf, true },
- { "_Z5tanpif", (void *)&SC_tanpi, true },
{ "_Z6tgammaf", (void *)&lgammaf, true }, // FIXME!!! NEEDS TO USE tgammaf
{ "_Z5truncf", (void *)&truncf, true },
diff --git a/libs/rs/scriptc/rs_cl.rsh b/libs/rs/scriptc/rs_cl.rsh
index a7e46d8..3c0496d 100644
--- a/libs/rs/scriptc/rs_cl.rsh
+++ b/libs/rs/scriptc/rs_cl.rsh
@@ -8,27 +8,31 @@
#endif
// Conversions
-#define CVT_FUNC_2(typeout, typein) \
-_RS_STATIC typeout##2 __attribute__((overloadable)) convert_##typeout##2(typein##2 v) { \
- typeout##2 r = {(typeout)v.x, (typeout)v.y}; \
- return r; \
-} \
-_RS_STATIC typeout##3 __attribute__((overloadable)) convert_##typeout##3(typein##3 v) { \
- typeout##3 r = {(typeout)v.x, (typeout)v.y, (typeout)v.z}; \
- return r; \
-} \
-_RS_STATIC typeout##4 __attribute__((overloadable)) convert_##typeout##4(typein##4 v) { \
- typeout##4 r = {(typeout)v.x, (typeout)v.y, (typeout)v.z, (typeout)v.w}; \
- return r; \
+#define CVT_FUNC_2(typeout, typein) \
+_RS_STATIC typeout##2 __attribute__((overloadable)) \
+ convert_##typeout##2(typein##2 v) { \
+ typeout##2 r = {(typeout)v.x, (typeout)v.y}; \
+ return r; \
+} \
+_RS_STATIC typeout##3 __attribute__((overloadable)) \
+ convert_##typeout##3(typein##3 v) { \
+ typeout##3 r = {(typeout)v.x, (typeout)v.y, (typeout)v.z}; \
+ return r; \
+} \
+_RS_STATIC typeout##4 __attribute__((overloadable)) \
+ convert_##typeout##4(typein##4 v) { \
+ typeout##4 r = {(typeout)v.x, (typeout)v.y, (typeout)v.z, \
+ (typeout)v.w}; \
+ return r; \
}
-#define CVT_FUNC(type) CVT_FUNC_2(type, uchar) \
- CVT_FUNC_2(type, char) \
- CVT_FUNC_2(type, ushort) \
- CVT_FUNC_2(type, short) \
- CVT_FUNC_2(type, uint) \
- CVT_FUNC_2(type, int) \
- CVT_FUNC_2(type, float)
+#define CVT_FUNC(type) CVT_FUNC_2(type, uchar) \
+ CVT_FUNC_2(type, char) \
+ CVT_FUNC_2(type, ushort) \
+ CVT_FUNC_2(type, short) \
+ CVT_FUNC_2(type, uint) \
+ CVT_FUNC_2(type, int) \
+ CVT_FUNC_2(type, float)
CVT_FUNC(char)
CVT_FUNC(uchar)
@@ -38,278 +42,284 @@
CVT_FUNC(uint)
CVT_FUNC(float)
-
-
// Float ops, 6.11.2
-#define FN_FUNC_FN(fnc) \
+#define FN_FUNC_FN(fnc) \
_RS_STATIC float2 __attribute__((overloadable)) fnc(float2 v) { \
- float2 r; \
- r.x = fnc(v.x); \
- r.y = fnc(v.y); \
- return r; \
-} \
+ float2 r; \
+ r.x = fnc(v.x); \
+ r.y = fnc(v.y); \
+ return r; \
+} \
_RS_STATIC float3 __attribute__((overloadable)) fnc(float3 v) { \
- float3 r; \
- r.x = fnc(v.x); \
- r.y = fnc(v.y); \
- r.z = fnc(v.z); \
- return r; \
-} \
+ float3 r; \
+ r.x = fnc(v.x); \
+ r.y = fnc(v.y); \
+ r.z = fnc(v.z); \
+ return r; \
+} \
_RS_STATIC float4 __attribute__((overloadable)) fnc(float4 v) { \
- float4 r; \
- r.x = fnc(v.x); \
- r.y = fnc(v.y); \
- r.z = fnc(v.z); \
- r.w = fnc(v.w); \
- return r; \
+ float4 r; \
+ r.x = fnc(v.x); \
+ r.y = fnc(v.y); \
+ r.z = fnc(v.z); \
+ r.w = fnc(v.w); \
+ return r; \
}
-#define IN_FUNC_FN(fnc) \
-_RS_STATIC int2 __attribute__((overloadable)) fnc(float2 v) { \
- int2 r; \
- r.x = fnc(v.x); \
- r.y = fnc(v.y); \
- return r; \
-} \
-_RS_STATIC int3 __attribute__((overloadable)) fnc(float3 v) { \
- int3 r; \
- r.x = fnc(v.x); \
- r.y = fnc(v.y); \
- r.z = fnc(v.z); \
- return r; \
-} \
-_RS_STATIC int4 __attribute__((overloadable)) fnc(float4 v) { \
- int4 r; \
- r.x = fnc(v.x); \
- r.y = fnc(v.y); \
- r.z = fnc(v.z); \
- r.w = fnc(v.w); \
- return r; \
+#define IN_FUNC_FN(fnc) \
+_RS_STATIC int2 __attribute__((overloadable)) fnc(float2 v) { \
+ int2 r; \
+ r.x = fnc(v.x); \
+ r.y = fnc(v.y); \
+ return r; \
+} \
+_RS_STATIC int3 __attribute__((overloadable)) fnc(float3 v) { \
+ int3 r; \
+ r.x = fnc(v.x); \
+ r.y = fnc(v.y); \
+ r.z = fnc(v.z); \
+ return r; \
+} \
+_RS_STATIC int4 __attribute__((overloadable)) fnc(float4 v) { \
+ int4 r; \
+ r.x = fnc(v.x); \
+ r.y = fnc(v.y); \
+ r.z = fnc(v.z); \
+ r.w = fnc(v.w); \
+ return r; \
}
-#define FN_FUNC_FN_FN(fnc) \
+#define FN_FUNC_FN_FN(fnc) \
_RS_STATIC float2 __attribute__((overloadable)) fnc(float2 v1, float2 v2) { \
- float2 r; \
- r.x = fnc(v1.x, v2.x); \
- r.y = fnc(v1.y, v2.y); \
- return r; \
-} \
+ float2 r; \
+ r.x = fnc(v1.x, v2.x); \
+ r.y = fnc(v1.y, v2.y); \
+ return r; \
+} \
_RS_STATIC float3 __attribute__((overloadable)) fnc(float3 v1, float3 v2) { \
- float3 r; \
- r.x = fnc(v1.x, v2.x); \
- r.y = fnc(v1.y, v2.y); \
- r.z = fnc(v1.z, v2.z); \
- return r; \
-} \
+ float3 r; \
+ r.x = fnc(v1.x, v2.x); \
+ r.y = fnc(v1.y, v2.y); \
+ r.z = fnc(v1.z, v2.z); \
+ return r; \
+} \
_RS_STATIC float4 __attribute__((overloadable)) fnc(float4 v1, float4 v2) { \
- float4 r; \
- r.x = fnc(v1.x, v2.x); \
- r.y = fnc(v1.y, v2.y); \
- r.z = fnc(v1.z, v2.z); \
- r.w = fnc(v1.w, v2.w); \
- return r; \
+ float4 r; \
+ r.x = fnc(v1.x, v2.x); \
+ r.y = fnc(v1.y, v2.y); \
+ r.z = fnc(v1.z, v2.z); \
+ r.w = fnc(v1.w, v2.w); \
+ return r; \
}
-#define FN_FUNC_FN_F(fnc) \
-_RS_STATIC float2 __attribute__((overloadable)) fnc(float2 v1, float v2) { \
- float2 r; \
- r.x = fnc(v1.x, v2); \
- r.y = fnc(v1.y, v2); \
- return r; \
-} \
-_RS_STATIC float3 __attribute__((overloadable)) fnc(float3 v1, float v2) { \
- float3 r; \
- r.x = fnc(v1.x, v2); \
- r.y = fnc(v1.y, v2); \
- r.z = fnc(v1.z, v2); \
- return r; \
-} \
-_RS_STATIC float4 __attribute__((overloadable)) fnc(float4 v1, float v2) { \
- float4 r; \
- r.x = fnc(v1.x, v2); \
- r.y = fnc(v1.y, v2); \
- r.z = fnc(v1.z, v2); \
- r.w = fnc(v1.w, v2); \
- return r; \
+#define FN_FUNC_FN_F(fnc) \
+_RS_STATIC float2 __attribute__((overloadable)) fnc(float2 v1, float v2) { \
+ float2 r; \
+ r.x = fnc(v1.x, v2); \
+ r.y = fnc(v1.y, v2); \
+ return r; \
+} \
+_RS_STATIC float3 __attribute__((overloadable)) fnc(float3 v1, float v2) { \
+ float3 r; \
+ r.x = fnc(v1.x, v2); \
+ r.y = fnc(v1.y, v2); \
+ r.z = fnc(v1.z, v2); \
+ return r; \
+} \
+_RS_STATIC float4 __attribute__((overloadable)) fnc(float4 v1, float v2) { \
+ float4 r; \
+ r.x = fnc(v1.x, v2); \
+ r.y = fnc(v1.y, v2); \
+ r.z = fnc(v1.z, v2); \
+ r.w = fnc(v1.w, v2); \
+ return r; \
}
-#define FN_FUNC_FN_IN(fnc) \
-_RS_STATIC float2 __attribute__((overloadable)) fnc(float2 v1, int2 v2) { \
- float2 r; \
- r.x = fnc(v1.x, v2.x); \
- r.y = fnc(v1.y, v2.y); \
- return r; \
-} \
-_RS_STATIC float3 __attribute__((overloadable)) fnc(float3 v1, int3 v2) { \
- float3 r; \
- r.x = fnc(v1.x, v2.x); \
- r.y = fnc(v1.y, v2.y); \
- r.z = fnc(v1.z, v2.z); \
- return r; \
-} \
-_RS_STATIC float4 __attribute__((overloadable)) fnc(float4 v1, int4 v2) { \
- float4 r; \
- r.x = fnc(v1.x, v2.x); \
- r.y = fnc(v1.y, v2.y); \
- r.z = fnc(v1.z, v2.z); \
- r.w = fnc(v1.w, v2.w); \
- return r; \
+#define FN_FUNC_FN_IN(fnc) \
+_RS_STATIC float2 __attribute__((overloadable)) fnc(float2 v1, int2 v2) { \
+ float2 r; \
+ r.x = fnc(v1.x, v2.x); \
+ r.y = fnc(v1.y, v2.y); \
+ return r; \
+} \
+_RS_STATIC float3 __attribute__((overloadable)) fnc(float3 v1, int3 v2) { \
+ float3 r; \
+ r.x = fnc(v1.x, v2.x); \
+ r.y = fnc(v1.y, v2.y); \
+ r.z = fnc(v1.z, v2.z); \
+ return r; \
+} \
+_RS_STATIC float4 __attribute__((overloadable)) fnc(float4 v1, int4 v2) { \
+ float4 r; \
+ r.x = fnc(v1.x, v2.x); \
+ r.y = fnc(v1.y, v2.y); \
+ r.z = fnc(v1.z, v2.z); \
+ r.w = fnc(v1.w, v2.w); \
+ return r; \
}
-#define FN_FUNC_FN_I(fnc) \
-_RS_STATIC float2 __attribute__((overloadable)) fnc(float2 v1, int v2) { \
- float2 r; \
- r.x = fnc(v1.x, v2); \
- r.y = fnc(v1.y, v2); \
- return r; \
-} \
-_RS_STATIC float3 __attribute__((overloadable)) fnc(float3 v1, int v2) { \
- float3 r; \
- r.x = fnc(v1.x, v2); \
- r.y = fnc(v1.y, v2); \
- r.z = fnc(v1.z, v2); \
- return r; \
-} \
-_RS_STATIC float4 __attribute__((overloadable)) fnc(float4 v1, int v2) { \
- float4 r; \
- r.x = fnc(v1.x, v2); \
- r.y = fnc(v1.y, v2); \
- r.z = fnc(v1.z, v2); \
- r.w = fnc(v1.w, v2); \
- return r; \
+#define FN_FUNC_FN_I(fnc) \
+_RS_STATIC float2 __attribute__((overloadable)) fnc(float2 v1, int v2) { \
+ float2 r; \
+ r.x = fnc(v1.x, v2); \
+ r.y = fnc(v1.y, v2); \
+ return r; \
+} \
+_RS_STATIC float3 __attribute__((overloadable)) fnc(float3 v1, int v2) { \
+ float3 r; \
+ r.x = fnc(v1.x, v2); \
+ r.y = fnc(v1.y, v2); \
+ r.z = fnc(v1.z, v2); \
+ return r; \
+} \
+_RS_STATIC float4 __attribute__((overloadable)) fnc(float4 v1, int v2) { \
+ float4 r; \
+ r.x = fnc(v1.x, v2); \
+ r.y = fnc(v1.y, v2); \
+ r.z = fnc(v1.z, v2); \
+ r.w = fnc(v1.w, v2); \
+ return r; \
}
-#define FN_FUNC_FN_PFN(fnc) \
-_RS_STATIC float2 __attribute__((overloadable)) fnc(float2 v1, float2 *v2) { \
- float2 r; \
- float q; \
- r.x = fnc(v1.x, &q); \
- v2->x = q; \
- r.y = fnc(v1.y, &q); \
- v2->y = q; \
- return r; \
-} \
-_RS_STATIC float3 __attribute__((overloadable)) fnc(float3 v1, float3 *v2) { \
- float3 r; \
- float q; \
- r.x = fnc(v1.x, &q); \
- v2->x = q; \
- r.y = fnc(v1.y, &q); \
- v2->y = q; \
- r.z = fnc(v1.z, &q); \
- v2->z = q; \
- return r; \
-} \
-_RS_STATIC float4 __attribute__((overloadable)) fnc(float4 v1, float4 *v2) { \
- float4 r; \
- float q; \
- r.x = fnc(v1.x, &q); \
- v2->x = q; \
- r.y = fnc(v1.y, &q); \
- v2->y = q; \
- r.z = fnc(v1.z, &q); \
- v2->z = q; \
- r.w = fnc(v1.w, &q); \
- v2->w = q; \
- return r; \
+#define FN_FUNC_FN_PFN(fnc) \
+_RS_STATIC float2 __attribute__((overloadable)) \
+ fnc(float2 v1, float2 *v2) { \
+ float2 r; \
+ float t[2]; \
+ r.x = fnc(v1.x, &t[0]); \
+ r.y = fnc(v1.y, &t[1]); \
+ v2->x = t[0]; \
+ v2->y = t[1]; \
+ return r; \
+} \
+_RS_STATIC float3 __attribute__((overloadable)) \
+ fnc(float3 v1, float3 *v2) { \
+ float3 r; \
+ float t[3]; \
+ r.x = fnc(v1.x, &t[0]); \
+ r.y = fnc(v1.y, &t[1]); \
+ r.z = fnc(v1.z, &t[2]); \
+ v2->x = t[0]; \
+ v2->y = t[1]; \
+ v2->z = t[2]; \
+ return r; \
+} \
+_RS_STATIC float4 __attribute__((overloadable)) \
+ fnc(float4 v1, float4 *v2) { \
+ float4 r; \
+ float t[4]; \
+ r.x = fnc(v1.x, &t[0]); \
+ r.y = fnc(v1.y, &t[1]); \
+ r.z = fnc(v1.z, &t[2]); \
+ r.w = fnc(v1.w, &t[3]); \
+ v2->x = t[0]; \
+ v2->y = t[1]; \
+ v2->z = t[2]; \
+ v2->w = t[3]; \
+ return r; \
}
-#define FN_FUNC_FN_PIN(fnc) \
-_RS_STATIC float2 __attribute__((overloadable)) fnc(float2 v1, int2 *v2) { \
- float2 r; \
- int q; \
- r.x = fnc(v1.x, &q); \
- v2->x = q; \
- r.y = fnc(v1.y, &q); \
- v2->y = q; \
- return r; \
-} \
-_RS_STATIC float3 __attribute__((overloadable)) fnc(float3 v1, int3 *v2) { \
- float3 r; \
- int q; \
- r.x = fnc(v1.x, &q); \
- v2->x = q; \
- r.y = fnc(v1.y, &q); \
- v2->y = q; \
- r.z = fnc(v1.z, &q); \
- v2->z = q; \
- return r; \
-} \
-_RS_STATIC float4 __attribute__((overloadable)) fnc(float4 v1, int4 *v2) { \
- float4 r; \
- int q; \
- r.x = fnc(v1.x, &q); \
- v2->x = q; \
- r.y = fnc(v1.y, &q); \
- v2->y = q; \
- r.z = fnc(v1.z, &q); \
- v2->z = q; \
- r.w = fnc(v1.w, &q); \
- v2->w = q; \
- return r; \
+#define FN_FUNC_FN_PIN(fnc) \
+_RS_STATIC float2 __attribute__((overloadable)) fnc(float2 v1, int2 *v2) { \
+ float2 r; \
+ int t[2]; \
+ r.x = fnc(v1.x, &t[0]); \
+ r.y = fnc(v1.y, &t[1]); \
+ v2->x = t[0]; \
+ v2->y = t[1]; \
+ return r; \
+} \
+_RS_STATIC float3 __attribute__((overloadable)) fnc(float3 v1, int3 *v2) { \
+ float3 r; \
+ int t[3]; \
+ r.x = fnc(v1.x, &t[0]); \
+ r.y = fnc(v1.y, &t[1]); \
+ r.z = fnc(v1.z, &t[2]); \
+ v2->x = t[0]; \
+ v2->y = t[1]; \
+ v2->z = t[2]; \
+ return r; \
+} \
+_RS_STATIC float4 __attribute__((overloadable)) fnc(float4 v1, int4 *v2) { \
+ float4 r; \
+ int t[4]; \
+ r.x = fnc(v1.x, &t[0]); \
+ r.y = fnc(v1.y, &t[1]); \
+ r.z = fnc(v1.z, &t[2]); \
+ r.w = fnc(v1.w, &t[3]); \
+ v2->x = t[0]; \
+ v2->y = t[1]; \
+ v2->z = t[2]; \
+ v2->w = t[3]; \
+ return r; \
}
-#define FN_FUNC_FN_FN_FN(fnc) \
-_RS_STATIC float2 __attribute__((overloadable)) fnc(float2 v1, float2 v2, float2 v3) { \
- float2 r; \
- r.x = fnc(v1.x, v2.x, v3.x); \
- r.y = fnc(v1.y, v2.y, v3.y); \
- return r; \
-} \
-_RS_STATIC float3 __attribute__((overloadable)) fnc(float3 v1, float3 v2, float3 v3) { \
- float3 r; \
- r.x = fnc(v1.x, v2.x, v3.x); \
- r.y = fnc(v1.y, v2.y, v3.y); \
- r.z = fnc(v1.z, v2.z, v3.z); \
- return r; \
-} \
-_RS_STATIC float4 __attribute__((overloadable)) fnc(float4 v1, float4 v2, float4 v3) { \
- float4 r; \
- r.x = fnc(v1.x, v2.x, v3.x); \
- r.y = fnc(v1.y, v2.y, v3.y); \
- r.z = fnc(v1.z, v2.z, v3.z); \
- r.w = fnc(v1.w, v2.w, v3.w); \
- return r; \
+#define FN_FUNC_FN_FN_FN(fnc) \
+_RS_STATIC float2 __attribute__((overloadable)) \
+ fnc(float2 v1, float2 v2, float2 v3) { \
+ float2 r; \
+ r.x = fnc(v1.x, v2.x, v3.x); \
+ r.y = fnc(v1.y, v2.y, v3.y); \
+ return r; \
+} \
+_RS_STATIC float3 __attribute__((overloadable)) \
+ fnc(float3 v1, float3 v2, float3 v3) { \
+ float3 r; \
+ r.x = fnc(v1.x, v2.x, v3.x); \
+ r.y = fnc(v1.y, v2.y, v3.y); \
+ r.z = fnc(v1.z, v2.z, v3.z); \
+ return r; \
+} \
+_RS_STATIC float4 __attribute__((overloadable)) \
+ fnc(float4 v1, float4 v2, float4 v3) { \
+ float4 r; \
+ r.x = fnc(v1.x, v2.x, v3.x); \
+ r.y = fnc(v1.y, v2.y, v3.y); \
+ r.z = fnc(v1.z, v2.z, v3.z); \
+ r.w = fnc(v1.w, v2.w, v3.w); \
+ return r; \
}
-#define FN_FUNC_FN_FN_PIN(fnc) \
-_RS_STATIC float2 __attribute__((overloadable)) fnc(float2 v1, float2 v2, int2 *v3) { \
- float2 r; \
- int q; \
- r.x = fnc(v1.x, v2.x, &q); \
- v3->x = q; \
- r.y = fnc(v1.y, v2.y, &q); \
- v3->y = q; \
- return r; \
-} \
-_RS_STATIC float3 __attribute__((overloadable)) fnc(float3 v1, float3 v2, int3 *v3) { \
- float3 r; \
- int q; \
- r.x = fnc(v1.x, v2.x, &q); \
- v3->x = q; \
- r.y = fnc(v1.y, v2.y, &q); \
- v3->y = q; \
- r.z = fnc(v1.z, v2.z, &q); \
- v3->z = q; \
- return r; \
-} \
-_RS_STATIC float4 __attribute__((overloadable)) fnc(float4 v1, float4 v2, int4 *v3) { \
- float4 r; \
- int q; \
- r.x = fnc(v1.x, v2.x, &q); \
- v3->x = q; \
- r.y = fnc(v1.y, v2.y, &q); \
- v3->y = q; \
- r.z = fnc(v1.z, v2.z, &q); \
- v3->z = q; \
- r.w = fnc(v1.w, v2.w, &q); \
- v3->w = q; \
- return r; \
+#define FN_FUNC_FN_FN_PIN(fnc) \
+_RS_STATIC float2 __attribute__((overloadable)) \
+ fnc(float2 v1, float2 v2, int2 *v3) { \
+ float2 r; \
+ int t[2]; \
+ r.x = fnc(v1.x, v2.x, &t[0]); \
+ r.y = fnc(v1.y, v2.y, &t[1]); \
+ v3->x = t[0]; \
+ v3->y = t[1]; \
+ return r; \
+} \
+_RS_STATIC float3 __attribute__((overloadable)) \
+ fnc(float3 v1, float3 v2, int3 *v3) { \
+ float3 r; \
+ int t[3]; \
+ r.x = fnc(v1.x, v2.x, &t[0]); \
+ r.y = fnc(v1.y, v2.y, &t[1]); \
+ r.z = fnc(v1.z, v2.z, &t[2]); \
+ v3->x = t[0]; \
+ v3->y = t[1]; \
+ v3->z = t[2]; \
+ return r; \
+} \
+_RS_STATIC float4 __attribute__((overloadable)) \
+ fnc(float4 v1, float4 v2, int4 *v3) { \
+ float4 r; \
+ int t[4]; \
+ r.x = fnc(v1.x, v2.x, &t[0]); \
+ r.y = fnc(v1.y, v2.y, &t[1]); \
+ r.z = fnc(v1.z, v2.z, &t[2]); \
+ r.w = fnc(v1.w, v2.w, &t[3]); \
+ v3->x = t[0]; \
+ v3->y = t[1]; \
+ v3->z = t[2]; \
+ v3->w = t[3]; \
+ return r; \
}
-
extern float __attribute__((overloadable)) acos(float);
FN_FUNC_FN(acos)
@@ -420,39 +430,7 @@
iptr[0] = i;
return fmin(v - i, 0x1.fffffep-1f);
}
-_RS_STATIC float2 __attribute__((overloadable)) fract(float2 v, float2 *iptr) {
- float t[2];
- float2 r;
- r.x = fract(v.x, &t[0]);
- r.y = fract(v.y, &t[1]);
- iptr[0] = t[0];
- iptr[1] = t[1];
- return r;
-}
-_RS_STATIC float3 __attribute__((overloadable)) fract(float3 v, float3 *iptr) {
- float t[3];
- float3 r;
- r.x = fract(v.x, &t[0]);
- r.y = fract(v.y, &t[1]);
- r.z = fract(v.z, &t[2]);
- iptr[0] = t[0];
- iptr[1] = t[1];
- iptr[2] = t[2];
- return r;
-}
-_RS_STATIC float4 __attribute__((overloadable)) fract(float4 v, float4 *iptr) {
- float t[4];
- float4 r;
- r.x = fract(v.x, &t[0]);
- r.y = fract(v.y, &t[1]);
- r.z = fract(v.z, &t[2]);
- r.w = fract(v.w, &t[3]);
- iptr[0] = t[0];
- iptr[1] = t[1];
- iptr[2] = t[2];
- iptr[3] = t[3];
- return r;
-}
+FN_FUNC_FN_PFN(fract)
extern float __attribute__((overloadable)) frexp(float, int *);
FN_FUNC_FN_PIN(frexp)
@@ -612,36 +590,36 @@
// Int ops (partial), 6.11.3
-#define XN_FUNC_YN(typeout, fnc, typein) \
-extern typeout __attribute__((overloadable)) fnc(typein); \
+#define XN_FUNC_YN(typeout, fnc, typein) \
+extern typeout __attribute__((overloadable)) fnc(typein); \
_RS_STATIC typeout##2 __attribute__((overloadable)) fnc(typein##2 v) { \
- typeout##2 r; \
- r.x = fnc(v.x); \
- r.y = fnc(v.y); \
- return r; \
-} \
+ typeout##2 r; \
+ r.x = fnc(v.x); \
+ r.y = fnc(v.y); \
+ return r; \
+} \
_RS_STATIC typeout##3 __attribute__((overloadable)) fnc(typein##3 v) { \
- typeout##3 r; \
- r.x = fnc(v.x); \
- r.y = fnc(v.y); \
- r.z = fnc(v.z); \
- return r; \
-} \
+ typeout##3 r; \
+ r.x = fnc(v.x); \
+ r.y = fnc(v.y); \
+ r.z = fnc(v.z); \
+ return r; \
+} \
_RS_STATIC typeout##4 __attribute__((overloadable)) fnc(typein##4 v) { \
- typeout##4 r; \
- r.x = fnc(v.x); \
- r.y = fnc(v.y); \
- r.z = fnc(v.z); \
- r.w = fnc(v.w); \
- return r; \
+ typeout##4 r; \
+ r.x = fnc(v.x); \
+ r.y = fnc(v.y); \
+ r.z = fnc(v.z); \
+ r.w = fnc(v.w); \
+ return r; \
}
-#define UIN_FUNC_IN(fnc) \
+#define UIN_FUNC_IN(fnc) \
XN_FUNC_YN(uchar, fnc, char) \
XN_FUNC_YN(ushort, fnc, short) \
XN_FUNC_YN(uint, fnc, int)
-#define IN_FUNC_IN(fnc) \
+#define IN_FUNC_IN(fnc) \
XN_FUNC_YN(uchar, fnc, uchar) \
XN_FUNC_YN(char, fnc, char) \
XN_FUNC_YN(ushort, fnc, ushort) \
@@ -649,33 +627,37 @@
XN_FUNC_YN(uint, fnc, uint) \
XN_FUNC_YN(int, fnc, int)
-#define XN_FUNC_XN_XN_BODY(type, fnc, body) \
-_RS_STATIC type __attribute__((overloadable)) fnc(type v1, type v2) { \
- return body; \
-} \
-_RS_STATIC type##2 __attribute__((overloadable)) fnc(type##2 v1, type##2 v2) { \
- type##2 r; \
- r.x = fnc(v1.x, v2.x); \
- r.y = fnc(v1.y, v2.y); \
- return r; \
-} \
-_RS_STATIC type##3 __attribute__((overloadable)) fnc(type##3 v1, type##3 v2) { \
- type##3 r; \
- r.x = fnc(v1.x, v2.x); \
- r.y = fnc(v1.y, v2.y); \
- r.z = fnc(v1.z, v2.z); \
- return r; \
-} \
-_RS_STATIC type##4 __attribute__((overloadable)) fnc(type##4 v1, type##4 v2) { \
- type##4 r; \
- r.x = fnc(v1.x, v2.x); \
- r.y = fnc(v1.y, v2.y); \
- r.z = fnc(v1.z, v2.z); \
- r.w = fnc(v1.w, v2.w); \
- return r; \
-} \
+#define XN_FUNC_XN_XN_BODY(type, fnc, body) \
+_RS_STATIC type __attribute__((overloadable)) \
+ fnc(type v1, type v2) { \
+ return body; \
+} \
+_RS_STATIC type##2 __attribute__((overloadable)) \
+ fnc(type##2 v1, type##2 v2) { \
+ type##2 r; \
+ r.x = fnc(v1.x, v2.x); \
+ r.y = fnc(v1.y, v2.y); \
+ return r; \
+} \
+_RS_STATIC type##3 __attribute__((overloadable)) \
+ fnc(type##3 v1, type##3 v2) { \
+ type##3 r; \
+ r.x = fnc(v1.x, v2.x); \
+ r.y = fnc(v1.y, v2.y); \
+ r.z = fnc(v1.z, v2.z); \
+ return r; \
+} \
+_RS_STATIC type##4 __attribute__((overloadable)) \
+ fnc(type##4 v1, type##4 v2) { \
+ type##4 r; \
+ r.x = fnc(v1.x, v2.x); \
+ r.y = fnc(v1.y, v2.y); \
+ r.z = fnc(v1.z, v2.z); \
+ r.w = fnc(v1.w, v2.w); \
+ return r; \
+}
-#define IN_FUNC_IN_IN_BODY(fnc, body) \
+#define IN_FUNC_IN_IN_BODY(fnc, body) \
XN_FUNC_XN_XN_BODY(uchar, fnc, body) \
XN_FUNC_XN_XN_BODY(char, fnc, body) \
XN_FUNC_XN_XN_BODY(ushort, fnc, body) \
diff --git a/libs/surfaceflinger_client/SharedBufferStack.cpp b/libs/surfaceflinger_client/SharedBufferStack.cpp
index af11f97..7505d53 100644
--- a/libs/surfaceflinger_client/SharedBufferStack.cpp
+++ b/libs/surfaceflinger_client/SharedBufferStack.cpp
@@ -58,7 +58,6 @@
void SharedBufferStack::init(int32_t i)
{
- inUse = -2;
status = NO_ERROR;
identity = i;
}
@@ -199,9 +198,9 @@
SharedBufferStack& stack( *mSharedStack );
snprintf(buffer, SIZE,
"%s[ head=%2d, available=%2d, queued=%2d ] "
- "reallocMask=%08x, inUse=%2d, identity=%d, status=%d",
+ "reallocMask=%08x, identity=%d, status=%d",
prefix, stack.head, stack.available, stack.queued,
- stack.reallocMask, stack.inUse, stack.identity, stack.status);
+ stack.reallocMask, stack.identity, stack.status);
result.append(buffer);
result.append("\n");
return result;
@@ -302,22 +301,6 @@
return NO_ERROR;
}
-SharedBufferServer::UnlockUpdate::UnlockUpdate(
- SharedBufferBase* sbb, int lockedBuffer)
- : UpdateBase(sbb), lockedBuffer(lockedBuffer) {
-}
-ssize_t SharedBufferServer::UnlockUpdate::operator()() {
- if (stack.inUse != lockedBuffer) {
- LOGE("unlocking %d, but currently locked buffer is %d "
- "(identity=%d, token=%d)",
- lockedBuffer, stack.inUse,
- stack.identity, stack.token);
- return BAD_VALUE;
- }
- android_atomic_write(-1, &stack.inUse);
- return NO_ERROR;
-}
-
SharedBufferServer::RetireUpdate::RetireUpdate(
SharedBufferBase* sbb, int numBuffers)
: UpdateBase(sbb), numBuffers(numBuffers) {
@@ -327,9 +310,6 @@
if (uint32_t(head) >= SharedBufferStack::NUM_BUFFER_MAX)
return BAD_VALUE;
- // Preventively lock the current buffer before updating queued.
- android_atomic_write(stack.headBuf, &stack.inUse);
-
// Decrement the number of queued buffers
int32_t queued;
do {
@@ -345,7 +325,6 @@
head = (head + 1) % numBuffers;
const int8_t headBuf = stack.index[head];
stack.headBuf = headBuf;
- android_atomic_write(headBuf, &stack.inUse);
// head is only modified here, so we don't need to use cmpxchg
android_atomic_write(head, &stack.head);
@@ -546,13 +525,6 @@
return buf;
}
-status_t SharedBufferServer::unlock(int buf)
-{
- UnlockUpdate update(this, buf);
- status_t err = updateCondition( update );
- return err;
-}
-
void SharedBufferServer::setStatus(status_t status)
{
if (status < NO_ERROR) {
@@ -694,12 +666,6 @@
stack.head = 0;
stack.headBuf = 0;
- // If one of the buffers is in use it must be the head buffer, which we are
- // renaming to buffer 0.
- if (stack.inUse > 0) {
- stack.inUse = 0;
- }
-
// Free the buffers from the end of the list that are no longer needed.
for (int i = newNumBuffers; i < mNumBuffers; i++) {
mBufferList.remove(i);
diff --git a/media/libmediaplayerservice/StagefrightRecorder.cpp b/media/libmediaplayerservice/StagefrightRecorder.cpp
index 153b2a6..65df68c 100644
--- a/media/libmediaplayerservice/StagefrightRecorder.cpp
+++ b/media/libmediaplayerservice/StagefrightRecorder.cpp
@@ -1295,12 +1295,6 @@
status_t err = OK;
sp<MediaWriter> writer = new MPEG4Writer(outputFd);
- // Add audio source first if it exists
- if (!mCaptureTimeLapse && (mAudioSource != AUDIO_SOURCE_LIST_END)) {
- err = setupAudioEncoder(writer);
- if (err != OK) return err;
- *totalBitRate += mAudioBitRate;
- }
if (mVideoSource == VIDEO_SOURCE_DEFAULT
|| mVideoSource == VIDEO_SOURCE_CAMERA) {
@@ -1332,6 +1326,15 @@
*totalBitRate += videoBitRate;
}
+ // Audio source is added at the end if it exists.
+ // This help make sure that the "recoding" sound is suppressed for
+ // camcorder applications in the recorded files.
+ if (!mCaptureTimeLapse && (mAudioSource != AUDIO_SOURCE_LIST_END)) {
+ err = setupAudioEncoder(writer);
+ if (err != OK) return err;
+ *totalBitRate += mAudioBitRate;
+ }
+
if (mInterleaveDurationUs > 0) {
reinterpret_cast<MPEG4Writer *>(writer.get())->
setInterleaveDuration(mInterleaveDurationUs);
diff --git a/media/libmediaplayerservice/nuplayer/NuPlayer.cpp b/media/libmediaplayerservice/nuplayer/NuPlayer.cpp
index 7f534c0..1fcf92b 100644
--- a/media/libmediaplayerservice/nuplayer/NuPlayer.cpp
+++ b/media/libmediaplayerservice/nuplayer/NuPlayer.cpp
@@ -92,11 +92,11 @@
}
void NuPlayer::pause() {
- // XXX to be implemented
+ (new AMessage(kWhatPause, id()))->post();
}
void NuPlayer::resume() {
- // XXX to be implemented
+ (new AMessage(kWhatResume, id()))->post();
}
void NuPlayer::resetAsync() {
@@ -430,6 +430,20 @@
break;
}
+ case kWhatPause:
+ {
+ CHECK(mRenderer != NULL);
+ mRenderer->pause();
+ break;
+ }
+
+ case kWhatResume:
+ {
+ CHECK(mRenderer != NULL);
+ mRenderer->resume();
+ break;
+ }
+
default:
TRESPASS();
break;
diff --git a/media/libmediaplayerservice/nuplayer/NuPlayer.h b/media/libmediaplayerservice/nuplayer/NuPlayer.h
index 339b628..bb65162 100644
--- a/media/libmediaplayerservice/nuplayer/NuPlayer.h
+++ b/media/libmediaplayerservice/nuplayer/NuPlayer.h
@@ -75,6 +75,8 @@
kWhatRendererNotify,
kWhatReset,
kWhatSeek,
+ kWhatPause,
+ kWhatResume,
};
wp<NuPlayerDriver> mDriver;
diff --git a/media/libmediaplayerservice/nuplayer/NuPlayerRenderer.cpp b/media/libmediaplayerservice/nuplayer/NuPlayerRenderer.cpp
index 5833697..93e5c14 100644
--- a/media/libmediaplayerservice/nuplayer/NuPlayerRenderer.cpp
+++ b/media/libmediaplayerservice/nuplayer/NuPlayerRenderer.cpp
@@ -42,7 +42,8 @@
mFlushingVideo(false),
mHasAudio(mAudioSink != NULL),
mHasVideo(true),
- mSyncQueues(mHasAudio && mHasVideo) {
+ mSyncQueues(mHasAudio && mHasVideo),
+ mPaused(false) {
}
NuPlayer::Renderer::~Renderer() {
@@ -93,6 +94,14 @@
mSyncQueues = mHasAudio && mHasVideo;
}
+void NuPlayer::Renderer::pause() {
+ (new AMessage(kWhatPause, id()))->post();
+}
+
+void NuPlayer::Renderer::resume() {
+ (new AMessage(kWhatResume, id()))->post();
+}
+
void NuPlayer::Renderer::onMessageReceived(const sp<AMessage> &msg) {
switch (msg->what()) {
case kWhatDrainAudioQueue:
@@ -151,6 +160,18 @@
break;
}
+ case kWhatPause:
+ {
+ onPause();
+ break;
+ }
+
+ case kWhatResume:
+ {
+ onResume();
+ break;
+ }
+
default:
TRESPASS();
break;
@@ -158,7 +179,7 @@
}
void NuPlayer::Renderer::postDrainAudioQueue() {
- if (mDrainAudioQueuePending || mSyncQueues) {
+ if (mDrainAudioQueuePending || mSyncQueues || mPaused) {
return;
}
@@ -254,7 +275,7 @@
}
void NuPlayer::Renderer::postDrainVideoQueue() {
- if (mDrainVideoQueuePending || mSyncQueues) {
+ if (mDrainVideoQueuePending || mSyncQueues || mPaused) {
return;
}
@@ -528,5 +549,39 @@
notify->post();
}
+void NuPlayer::Renderer::onPause() {
+ CHECK(!mPaused);
+
+ mDrainAudioQueuePending = false;
+ ++mAudioQueueGeneration;
+
+ mDrainVideoQueuePending = false;
+ ++mVideoQueueGeneration;
+
+ if (mHasAudio) {
+ mAudioSink->pause();
+ }
+
+ mPaused = true;
+}
+
+void NuPlayer::Renderer::onResume() {
+ CHECK(mPaused);
+
+ if (mHasAudio) {
+ mAudioSink->start();
+ }
+
+ mPaused = false;
+
+ if (!mAudioQueue.empty()) {
+ postDrainAudioQueue();
+ }
+
+ if (!mVideoQueue.empty()) {
+ postDrainVideoQueue();
+ }
+}
+
} // namespace android
diff --git a/media/libmediaplayerservice/nuplayer/NuPlayerRenderer.h b/media/libmediaplayerservice/nuplayer/NuPlayerRenderer.h
index dbf3ecff..703e971 100644
--- a/media/libmediaplayerservice/nuplayer/NuPlayerRenderer.h
+++ b/media/libmediaplayerservice/nuplayer/NuPlayerRenderer.h
@@ -41,6 +41,9 @@
void signalAudioSinkChanged();
+ void pause();
+ void resume();
+
enum {
kWhatEOS,
kWhatFlushComplete,
@@ -60,6 +63,8 @@
kWhatQueueEOS,
kWhatFlush,
kWhatAudioSinkChanged,
+ kWhatPause,
+ kWhatResume,
};
struct QueueEntry {
@@ -91,6 +96,8 @@
bool mHasVideo;
bool mSyncQueues;
+ bool mPaused;
+
void onDrainAudioQueue();
void postDrainAudioQueue();
@@ -101,6 +108,8 @@
void onQueueEOS(const sp<AMessage> &msg);
void onFlush(const sp<AMessage> &msg);
void onAudioSinkChanged();
+ void onPause();
+ void onResume();
void notifyEOS(bool audio);
void notifyFlushComplete(bool audio);
diff --git a/packages/SystemUI/res/drawable-hdpi/ic_sysbar_lights_out_dot_large.png b/packages/SystemUI/res/drawable-hdpi/ic_sysbar_lights_out_dot_large.png
new file mode 100644
index 0000000..2249d01
--- /dev/null
+++ b/packages/SystemUI/res/drawable-hdpi/ic_sysbar_lights_out_dot_large.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-hdpi/ic_sysbar_lights_out_dot_small.png b/packages/SystemUI/res/drawable-hdpi/ic_sysbar_lights_out_dot_small.png
new file mode 100644
index 0000000..ca3bb5d
--- /dev/null
+++ b/packages/SystemUI/res/drawable-hdpi/ic_sysbar_lights_out_dot_small.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-mdpi/ic_sysbar_lights_out_dot_large.png b/packages/SystemUI/res/drawable-mdpi/ic_sysbar_lights_out_dot_large.png
index f865e7a..7d381dd 100644
--- a/packages/SystemUI/res/drawable-mdpi/ic_sysbar_lights_out_dot_large.png
+++ b/packages/SystemUI/res/drawable-mdpi/ic_sysbar_lights_out_dot_large.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-mdpi/ic_sysbar_lights_out_dot_small.png b/packages/SystemUI/res/drawable-mdpi/ic_sysbar_lights_out_dot_small.png
index 04588bb..954621b 100644
--- a/packages/SystemUI/res/drawable-mdpi/ic_sysbar_lights_out_dot_small.png
+++ b/packages/SystemUI/res/drawable-mdpi/ic_sysbar_lights_out_dot_small.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-xlarge-hdpi/recents_bg_protect_tile.png b/packages/SystemUI/res/drawable-xlarge-hdpi/recents_bg_protect_tile.png
new file mode 100644
index 0000000..a57c27a
--- /dev/null
+++ b/packages/SystemUI/res/drawable-xlarge-hdpi/recents_bg_protect_tile.png
Binary files differ
diff --git a/packages/SystemUI/res/drawable-xlarge-mdpi/recents_bg_protect_tile.png b/packages/SystemUI/res/drawable-xlarge-mdpi/recents_bg_protect_tile.png
index 55d38d8..87c7be6 100644
--- a/packages/SystemUI/res/drawable-xlarge-mdpi/recents_bg_protect_tile.png
+++ b/packages/SystemUI/res/drawable-xlarge-mdpi/recents_bg_protect_tile.png
Binary files differ
diff --git a/packages/SystemUI/res/layout-xlarge/status_bar_notification_panel.xml b/packages/SystemUI/res/layout-xlarge/status_bar_notification_panel.xml
index 26e045c..4cf28ee 100644
--- a/packages/SystemUI/res/layout-xlarge/status_bar_notification_panel.xml
+++ b/packages/SystemUI/res/layout-xlarge/status_bar_notification_panel.xml
@@ -18,20 +18,13 @@
<com.android.systemui.statusbar.tablet.NotificationPanel
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui"
+ android:id="@+id/panel_root"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:gravity="right"
+ android:background="@drawable/notify_panel_bg_protect_tiled"
>
- <View
- android:id="@+id/scrim"
- android:background="@drawable/notify_panel_bg_protect_tiled"
- android:layout_width="512dp"
- android:layout_height="match_parent"
- android:layout_alignParentTop="true"
- android:layout_alignParentRight="true"
- />
-
<RelativeLayout
android:id="@+id/content_parent"
android:layout_height="wrap_content"
@@ -68,8 +61,6 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal|bottom"
- android:animateLayoutChanges="true"
- android:animationCache="false"
android:orientation="vertical"
android:clickable="true"
android:focusable="true"
@@ -88,7 +79,7 @@
android:layout_alignTop="@id/content_parent"
android:layout_alignLeft="@id/content_parent"
android:layout_marginLeft="100dip"
- android:layout_marginTop="-100dip"
+ android:layout_marginTop="50dip"
/>
</com.android.systemui.statusbar.tablet.NotificationPanel>
diff --git a/packages/SystemUI/res/layout-xlarge/status_bar_settings_view.xml b/packages/SystemUI/res/layout-xlarge/status_bar_settings_view.xml
index 1dbd759..20a992da 100644
--- a/packages/SystemUI/res/layout-xlarge/status_bar_settings_view.xml
+++ b/packages/SystemUI/res/layout-xlarge/status_bar_settings_view.xml
@@ -65,14 +65,6 @@
style="@style/StatusBarPanelSettingsContents"
android:text="@string/status_bar_settings_wifi_button"
/>
- <ImageView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="top"
- android:layout_marginTop="16dp"
- android:layout_marginRight="2dp"
- android:src="@drawable/ic_notification_open"
- />
</LinearLayout>
<View style="@style/StatusBarPanelSettingsPanelSeparator" />
@@ -158,14 +150,6 @@
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="2dp"
- android:src="@drawable/ic_notification_open"
- />
</LinearLayout>
<View style="@style/StatusBarPanelSettingsPanelSeparator" />
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/InputMethodButton.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/InputMethodButton.java
index 7012ddc..28f485c 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/InputMethodButton.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/InputMethodButton.java
@@ -124,9 +124,9 @@
if (subtype != null) {
return pm.getDrawable(imi.getPackageName(), subtype.getIconResId(),
imi.getServiceInfo().applicationInfo);
- } else if (imi.getSubtypes().size() > 0) {
+ } else if (imi.getSubtypeCount() > 0) {
return pm.getDrawable(imi.getPackageName(),
- imi.getSubtypes().get(0).getIconResId(),
+ imi.getSubtypeAt(0).getIconResId(),
imi.getServiceInfo().applicationInfo);
} else {
try {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/InputMethodsPanel.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/InputMethodsPanel.java
index cc200e3..a3ccef9 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/InputMethodsPanel.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/InputMethodsPanel.java
@@ -342,9 +342,9 @@
if (subtype != null) {
return mPackageManager.getDrawable(imi.getPackageName(), subtype.getIconResId(),
imi.getServiceInfo().applicationInfo);
- } else if (imi.getSubtypes().size() > 0) {
+ } else if (imi.getSubtypeCount() > 0) {
return mPackageManager.getDrawable(imi.getPackageName(),
- imi.getSubtypes().get(0).getIconResId(),
+ imi.getSubtypeAt(0).getIconResId(),
imi.getServiceInfo().applicationInfo);
} else {
try {
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 973bff9..9f48b48 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationPanel.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationPanel.java
@@ -17,6 +17,7 @@
package com.android.systemui.statusbar.tablet;
import android.animation.Animator;
+import android.animation.AnimatorListenerAdapter;
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.animation.ValueAnimator;
@@ -32,10 +33,10 @@
import android.view.ViewGroup;
import android.view.animation.AccelerateInterpolator;
import android.widget.FrameLayout;
+import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
-import android.widget.FrameLayout;
import android.widget.TextView;
import com.android.systemui.R;
@@ -54,7 +55,7 @@
ViewGroup mContentFrame;
Rect mContentArea = new Rect();
View mSettingsView;
- View mScrim, mGlow;
+ View mGlow;
ViewGroup mContentParent;
Choreographer mChoreo = new Choreographer();
@@ -79,7 +80,6 @@
mModeToggle = findViewById(R.id.mode_toggle);
mModeToggle.setOnClickListener(this);
- mScrim = findViewById(R.id.scrim);
mGlow = findViewById(R.id.glow);
mSettingsButton = (ImageView)findViewById(R.id.settings_button);
@@ -101,7 +101,6 @@
} else {
mShowing = show;
setVisibility(show ? View.VISIBLE : View.GONE);
- mChoreo.jumpTo(show);
}
}
@@ -118,50 +117,74 @@
super.onVisibilityChanged(v, vis);
// when we hide, put back the notifications
if (!isShown()) {
- switchToNotificationMode();
+ if (mSettingsView != null) removeSettingsView();
+ mNotificationScroller.setVisibility(View.VISIBLE);
+ mNotificationScroller.setAlpha(1f);
mNotificationScroller.scrollTo(0, 0);
+ updatePanelModeButtons();
}
}
- /**
- * We need to be aligned at the bottom. LinearLayout can't do this, so instead,
- * let LinearLayout do all the hard work, and then shift everything down to the bottom.
- */
+ /*
@Override
protected void onLayout(boolean changed, int l, int t, int r, int b) {
super.onLayout(changed, l, t, r, b);
- mChoreo.setPanelHeight(mContentParent.getHeight());
+ if (DEBUG) Slog.d(TAG, String.format("PANEL: onLayout: (%d, %d, %d, %d)", l, t, r, b));
}
@Override
public void onSizeChanged(int w, int h, int oldw, int oldh) {
super.onSizeChanged(w, h, oldw, oldh);
+
+ if (DEBUG) {
+ Slog.d(TAG, String.format("PANEL: onSizeChanged: (%d -> %d, %d -> %d)",
+ oldw, w, oldh, h));
+ }
}
+ */
public void onClick(View v) {
if (v == mModeToggle) {
- if (mSettingsView == null) {
- switchToSettingsMode();
- } else {
- switchToNotificationMode();
- }
+ swapPanels();
}
}
- public void switchToSettingsMode() {
- removeSettingsView();
- addSettingsView();
- mSettingsButton.setVisibility(View.INVISIBLE);
- mNotificationScroller.setVisibility(View.GONE);
- mNotificationButton.setVisibility(View.VISIBLE);
- }
+ final static int PANEL_FADE_DURATION = 150;
- public void switchToNotificationMode() {
- removeSettingsView();
- mSettingsButton.setVisibility(View.VISIBLE);
- mNotificationScroller.setVisibility(View.VISIBLE);
- mNotificationButton.setVisibility(View.INVISIBLE);
+ public void swapPanels() {
+ final View toShow, toHide;
+ if (mSettingsView == null) {
+ addSettingsView();
+ toShow = mSettingsView;
+ toHide = mNotificationScroller;
+ } else {
+ toShow = mNotificationScroller;
+ toHide = mSettingsView;
+ }
+ Animator a = ObjectAnimator.ofFloat(toHide, "alpha", 1f, 0f)
+ .setDuration(PANEL_FADE_DURATION);
+ a.addListener(new AnimatorListenerAdapter() {
+ @Override
+ public void onAnimationEnd(Animator _a) {
+ toHide.setVisibility(View.GONE);
+ toShow.setVisibility(View.VISIBLE);
+ ObjectAnimator.ofFloat(toShow, "alpha", 0f, 1f)
+ .setDuration(PANEL_FADE_DURATION)
+ .start();
+ if (toHide == mSettingsView) {
+ removeSettingsView();
+ }
+ updatePanelModeButtons();
+ }
+ });
+ a.start();
+ }
+
+ public void updatePanelModeButtons() {
+ final boolean settingsVisible = (mSettingsView != null);
+ mSettingsButton.setVisibility(!settingsVisible ? View.VISIBLE : View.INVISIBLE);
+ mNotificationButton.setVisibility(settingsVisible ? View.VISIBLE : View.INVISIBLE);
}
public boolean isInContentArea(int x, int y) {
@@ -180,9 +203,11 @@
}
}
+ // NB: it will be invisible until you show it
void addSettingsView() {
LayoutInflater infl = LayoutInflater.from(getContext());
mSettingsView = infl.inflate(R.layout.status_bar_settings_view, mContentFrame, false);
+ mSettingsView.setVisibility(View.GONE);
mContentFrame.addView(mSettingsView);
}
@@ -192,18 +217,21 @@
AnimatorSet mContentAnim;
// should group this into a multi-property animation
- final int OPEN_DURATION = 136;
- final int CLOSE_DURATION = 250;
+ final static int OPEN_DURATION = 136;
+ final static int CLOSE_DURATION = 250;
// the panel will start to appear this many px from the end
- final int HYPERSPACE_OFFRAMP = 30;
+ final int HYPERSPACE_OFFRAMP = 100;
Choreographer() {
}
void createAnimation(boolean appearing) {
- Animator bgAnim = ObjectAnimator.ofFloat(mScrim,
- "alpha", mScrim.getAlpha(), appearing ? 1 : 0);
+ // mVisible: previous state; appearing: new state
+
+ View root = findViewById(R.id.panel_root);
+ Animator bgAnim = ObjectAnimator.ofInt(root.getBackground(), "alpha",
+ mVisible ? 255 : 0, appearing ? 255 : 0);
float start, end;
@@ -213,34 +241,33 @@
if (appearing) {
// we want to go from near-the-top to the top, unless we're half-open in the right
// general vicinity
- start = (y < HYPERSPACE_OFFRAMP)
- ? y
- : HYPERSPACE_OFFRAMP;
+ start = (y < HYPERSPACE_OFFRAMP) ? y : HYPERSPACE_OFFRAMP;
end = 0;
} else {
start = y;
end = y + HYPERSPACE_OFFRAMP;
}
- Animator posAnim = ObjectAnimator.ofFloat(mContentParent, "translationY", start, end);
+ Animator posAnim = ObjectAnimator.ofFloat(mContentParent, "translationY",
+ start, end);
posAnim.setInterpolator(appearing
- ? new android.view.animation.DecelerateInterpolator(2.0f)
- : new android.view.animation.AccelerateInterpolator(2.0f));
+ ? new android.view.animation.DecelerateInterpolator(1.0f)
+ : new android.view.animation.AccelerateInterpolator(1.0f));
- Animator glowAnim = ObjectAnimator.ofFloat(mGlow, "alpha",
- mGlow.getAlpha(), appearing ? 1.0f : 0.0f);
+ Animator glowAnim = ObjectAnimator.ofInt(mGlow.getBackground(), "alpha",
+ mVisible ? 255 : 0, appearing ? 255 : 0);
glowAnim.setInterpolator(appearing
? new android.view.animation.AccelerateInterpolator(1.0f)
: new android.view.animation.DecelerateInterpolator(1.0f));
mContentAnim = new AnimatorSet();
mContentAnim
- .play(ObjectAnimator.ofFloat(mContentParent, "alpha", mContentParent.getAlpha(),
- appearing ? 1.0f : 0.0f))
- .with(glowAnim)
+ .play(ObjectAnimator.ofFloat(mContentParent, "alpha",
+ mContentParent.getAlpha(), appearing ? 1.0f : 0.0f))
.with(bgAnim)
+ .with(glowAnim)
.with(posAnim)
;
- mContentAnim.setDuration(appearing ? OPEN_DURATION : CLOSE_DURATION);
+ mContentAnim.setDuration((DEBUG?10:1)*(appearing ? OPEN_DURATION : CLOSE_DURATION));
mContentAnim.addListener(this);
}
@@ -250,30 +277,12 @@
createAnimation(appearing);
mContentParent.setLayerType(View.LAYER_TYPE_HARDWARE, null);
+ mGlow.setLayerType(View.LAYER_TYPE_HARDWARE, null);
mContentAnim.start();
mVisible = appearing;
}
- void jumpTo(boolean appearing) {
-// setBgAlpha(appearing ? 255 : 0);
- mContentParent.setTranslationY(appearing ? 0 : mPanelHeight);
- }
-
- public void setPanelHeight(int h) {
- if (DEBUG) Slog.d(TAG, "panelHeight=" + h);
- mPanelHeight = h;
- if (mPanelHeight == 0) {
- // fully closed, no animation necessary
- } else if (mVisible) {
- if (DEBUG) {
- Slog.d(TAG, "panelHeight not zero but trying to open; scheduling an anim"
- + " to open fully");
- }
- startAnimation(true);
- }
- }
-
public void onAnimationCancel(Animator animation) {
if (DEBUG) Slog.d(TAG, "onAnimationCancel");
// force this to zero so we close the window
@@ -286,6 +295,7 @@
setVisibility(View.GONE);
}
mContentParent.setLayerType(View.LAYER_TYPE_NONE, null);
+ mGlow.setLayerType(View.LAYER_TYPE_NONE, null);
mContentAnim = null;
}
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 6db74d1..a3a58ed 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java
@@ -189,7 +189,7 @@
mStatusBarView.setIgnoreChildren(0, mNotificationTrigger, mNotificationPanel);
WindowManager.LayoutParams lp = new WindowManager.LayoutParams(
- 720, // ViewGroup.LayoutParams.MATCH_PARENT,
+ 512, // ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.MATCH_PARENT,
WindowManager.LayoutParams.TYPE_STATUS_BAR_PANEL,
WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN
diff --git a/services/audioflinger/AudioFlinger.cpp b/services/audioflinger/AudioFlinger.cpp
index 16c042d..11ad4e4 100644
--- a/services/audioflinger/AudioFlinger.cpp
+++ b/services/audioflinger/AudioFlinger.cpp
@@ -5443,19 +5443,21 @@
// clear auxiliary effect input buffer for next accumulation
if ((mDescriptor.flags & EFFECT_FLAG_TYPE_MASK) == EFFECT_FLAG_TYPE_AUXILIARY) {
- memset(mConfig.inputCfg.buffer.raw, 0, mConfig.inputCfg.buffer.frameCount*sizeof(int32_t));
+ memset(mConfig.inputCfg.buffer.raw, 0,
+ mConfig.inputCfg.buffer.frameCount*sizeof(int32_t));
}
} else if ((mDescriptor.flags & EFFECT_FLAG_TYPE_MASK) == EFFECT_FLAG_TYPE_INSERT &&
- mConfig.inputCfg.buffer.raw != mConfig.outputCfg.buffer.raw){
- // If an insert effect is idle and input buffer is different from output buffer, copy input to
- // output
+ mConfig.inputCfg.buffer.raw != mConfig.outputCfg.buffer.raw) {
+ // If an insert effect is idle and input buffer is different from output buffer,
+ // accumulate input onto output
sp<EffectChain> chain = mChain.promote();
if (chain != 0 && chain->activeTracks() != 0) {
- size_t size = mConfig.inputCfg.buffer.frameCount * sizeof(int16_t);
- if (mConfig.inputCfg.channels == CHANNEL_STEREO) {
- size *= 2;
+ size_t frameCnt = mConfig.inputCfg.buffer.frameCount * 2; //always stereo here
+ int16_t *in = mConfig.inputCfg.buffer.s16;
+ int16_t *out = mConfig.outputCfg.buffer.s16;
+ for (size_t i = 0; i < frameCnt; i++) {
+ out[i] = clamp16((int32_t)out[i] + (int32_t)in[i]);
}
- memcpy(mConfig.outputCfg.buffer.raw, mConfig.inputCfg.buffer.raw, size);
}
}
}
diff --git a/services/java/com/android/server/InputMethodManagerService.java b/services/java/com/android/server/InputMethodManagerService.java
index 18a6fe0..945e714 100644
--- a/services/java/com/android/server/InputMethodManagerService.java
+++ b/services/java/com/android/server/InputMethodManagerService.java
@@ -118,7 +118,6 @@
private static final int NOT_A_SUBTYPE_ID = -1;
private static final String NOT_A_SUBTYPE_ID_STR = String.valueOf(NOT_A_SUBTYPE_ID);
- private static final String EXTRA_INPUT_METHOD_ID = "input_method_id";
private static final String SUBTYPE_MODE_KEYBOARD = "keyboard";
private static final String SUBTYPE_MODE_VOICE = "voice";
@@ -576,7 +575,7 @@
if (!allowsImplicitlySelectedSubtypes || enabledSubtypes.size() > 0) {
return enabledSubtypes;
} else {
- return getApplicableSubtypesLocked(mRes, imi.getSubtypes());
+ return getApplicableSubtypesLocked(mRes, getSubtypes(imi));
}
}
}
@@ -1015,10 +1014,9 @@
}
if (id.equals(mCurMethodId)) {
- ArrayList<InputMethodSubtype> subtypes = info.getSubtypes();
InputMethodSubtype subtype = null;
- if (subtypeId >= 0 && subtypeId < subtypes.size()) {
- subtype = subtypes.get(subtypeId);
+ if (subtypeId >= 0 && subtypeId < info.getSubtypeCount()) {
+ subtype = info.getSubtypeAt(subtypeId);
}
if (subtype != mCurrentSubtype) {
synchronized (mMethodMap) {
@@ -1150,9 +1148,11 @@
if (!mIWindowManager.inputMethodClientHasFocus(client)) {
if (DEBUG) Slog.w(TAG, "Ignoring hideSoftInput of uid "
+ uid + ": " + client);
+ mStatusBar.setIMEButtonVisible(mCurToken, false);
return false;
}
} catch (RemoteException e) {
+ mStatusBar.setIMEButtonVisible(mCurToken, false);
return false;
}
}
@@ -1544,6 +1544,15 @@
& ApplicationInfo.FLAG_SYSTEM) != 0;
}
+ private static ArrayList<InputMethodSubtype> getSubtypes(InputMethodInfo imi) {
+ ArrayList<InputMethodSubtype> subtypes = new ArrayList<InputMethodSubtype>();
+ final int subtypeCount = imi.getSubtypeCount();
+ for (int i = 0; i < subtypeCount; ++i) {
+ subtypes.add(imi.getSubtypeAt(i));
+ }
+ return subtypes;
+ }
+
private boolean chooseNewDefaultIMELocked() {
List<InputMethodInfo> enabled = mSettings.getEnabledInputMethodListLocked();
if (enabled != null && enabled.size() > 0) {
@@ -1645,7 +1654,7 @@
| Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED
| Intent.FLAG_ACTIVITY_CLEAR_TOP);
if (!TextUtils.isEmpty(inputMethodId)) {
- intent.putExtra(EXTRA_INPUT_METHOD_ID, inputMethodId);
+ intent.putExtra(Settings.EXTRA_INPUT_METHOD_ID, inputMethodId);
}
mContext.startActivity(intent);
}
@@ -1681,7 +1690,7 @@
ArrayList<String> subtypes = immis.get(i).second;
if (subtypes != null && subtypes.size() == 0) {
ArrayList<InputMethodSubtype> applicableSubtypes =
- getApplicableSubtypesLocked(mRes, imi.getSubtypes());
+ getApplicableSubtypesLocked(mRes, getSubtypes(imi));
final int numSubtypes = applicableSubtypes.size();
for (int j = 0; j < numSubtypes; ++j) {
subtypes.add(String.valueOf(applicableSubtypes.get(j).hashCode()));
@@ -1711,11 +1720,11 @@
if (property == null) {
continue;
}
- ArrayList<InputMethodSubtype> subtypes = property.getSubtypes();
CharSequence label = property.loadLabel(pm);
if (showSubtypes && enabledSubtypeSet.size() > 0) {
- for (int j = 0; j < subtypes.size(); ++j) {
- InputMethodSubtype subtype = subtypes.get(j);
+ final int subtypeCount = property.getSubtypeCount();
+ for (int j = 0; j < subtypeCount; ++j) {
+ InputMethodSubtype subtype = property.getSubtypeAt(j);
if (enabledSubtypeSet.contains(String.valueOf(subtype.hashCode()))) {
CharSequence title;
int nameResId = subtype.getNameResId();
@@ -1791,7 +1800,7 @@
hideInputMethodMenu();
if (im != null) {
if ((subtypeId < 0)
- || (subtypeId >= im.getSubtypes().size())) {
+ || (subtypeId >= im.getSubtypeCount())) {
subtypeId = NOT_A_SUBTYPE_ID;
}
setInputMethodLocked(im.getId(), subtypeId);
@@ -1916,10 +1925,10 @@
mSettings.putSelectedSubtype(NOT_A_SUBTYPE_ID);
mCurrentSubtype = null;
} else {
- final ArrayList<InputMethodSubtype> subtypes = imi.getSubtypes();
- if (subtypeId < subtypes.size()) {
- mSettings.putSelectedSubtype(subtypes.get(subtypeId).hashCode());
- mCurrentSubtype = subtypes.get(subtypeId);
+ if (subtypeId < imi.getSubtypeCount()) {
+ InputMethodSubtype subtype = imi.getSubtypeAt(subtypeId);
+ mSettings.putSelectedSubtype(subtype.hashCode());
+ mCurrentSubtype = subtype;
} else {
mSettings.putSelectedSubtype(NOT_A_SUBTYPE_ID);
mCurrentSubtype = null;
@@ -1967,9 +1976,9 @@
private int getSubtypeIdFromHashCode(InputMethodInfo imi, int subtypeHashCode) {
if (imi != null) {
- ArrayList<InputMethodSubtype> subtypes = imi.getSubtypes();
- for (int i = 0; i < subtypes.size(); ++i) {
- InputMethodSubtype ims = subtypes.get(i);
+ final int subtypeCount = imi.getSubtypeCount();
+ for (int i = 0; i < subtypeCount; ++i) {
+ InputMethodSubtype ims = imi.getSubtypeAt(i);
if (subtypeHashCode == ims.hashCode()) {
return i;
}
@@ -2113,13 +2122,13 @@
// 4. Search by the current subtype's locale from all subtypes.
if (subtype == null && mCurrentSubtype != null) {
subtype = findLastResortApplicableSubtypeLocked(
- mRes, imi.getSubtypes(), mode, mCurrentSubtype.getLocale(), false);
+ mRes, getSubtypes(imi), mode, mCurrentSubtype.getLocale(), false);
}
// 5. Search by the system locale from all subtypes.
// 6. Search the first enabled subtype matched with mode from all subtypes.
if (subtype == null) {
subtype = findLastResortApplicableSubtypeLocked(
- mRes, imi.getSubtypes(), mode, null, true);
+ mRes, getSubtypes(imi), mode, null, true);
}
if (subtype != null) {
if (imiId.equals(mCurMethodId)) {
@@ -2197,7 +2206,7 @@
}
} else {
mCurrentSubtype =
- mMethodMap.get(lastInputMethodId).getSubtypes().get(subtypeId);
+ getSubtypes(mMethodMap.get(lastInputMethodId)).get(subtypeId);
}
}
return mCurrentSubtype;
@@ -2320,8 +2329,9 @@
for (Pair<String, ArrayList<String>> imsPair : imsList) {
InputMethodInfo info = mMethodMap.get(imsPair.first);
if (info != null && info.getId().equals(imi.getId())) {
- ArrayList<InputMethodSubtype> subtypes = info.getSubtypes();
- for (InputMethodSubtype ims: subtypes) {
+ final int subtypeCount = info.getSubtypeCount();
+ for (int i = 0; i < subtypeCount; ++i) {
+ InputMethodSubtype ims = info.getSubtypeAt(i);
for (String s: imsPair.second) {
if (String.valueOf(ims.hashCode()).equals(s)) {
enabledSubtypes.add(ims);
@@ -2561,9 +2571,9 @@
InputMethodInfo ime = mMethodMap.get(imeId);
// If IME is enabled and no subtypes are enabled, applicable subtypes
// are enabled implicitly, so needs to treat them to be enabled.
- if (ime != null && ime.getSubtypes().size() > 0) {
+ if (ime != null && ime.getSubtypeCount() > 0) {
List<InputMethodSubtype> implicitlySelectedSubtypes =
- getApplicableSubtypesLocked(mRes, ime.getSubtypes());
+ getApplicableSubtypesLocked(mRes, getSubtypes(ime));
if (implicitlySelectedSubtypes != null) {
final int N = implicitlySelectedSubtypes.size();
for (int i = 0; i < N; ++i) {
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp
index fde68f6..3730739 100644
--- a/services/surfaceflinger/Layer.cpp
+++ b/services/surfaceflinger/Layer.cpp
@@ -691,22 +691,6 @@
}
}
-void Layer::finishPageFlip()
-{
- ClientRef::Access sharedClient(mUserClientRef);
- SharedBufferServer* lcblk(sharedClient.get());
- if (lcblk) {
- int buf = mBufferManager.getActiveBufferIndex();
- if (buf >= 0) {
- status_t err = lcblk->unlock( buf );
- LOGE_IF(err!=NO_ERROR,
- "layer %p, buffer=%d wasn't locked!",
- this, buf);
- }
- }
-}
-
-
void Layer::dump(String8& result, char* buffer, size_t SIZE) const
{
LayerBaseClient::dump(result, buffer, SIZE);
diff --git a/services/surfaceflinger/Layer.h b/services/surfaceflinger/Layer.h
index 5444d2f..2908119 100644
--- a/services/surfaceflinger/Layer.h
+++ b/services/surfaceflinger/Layer.h
@@ -75,7 +75,6 @@
virtual uint32_t doTransaction(uint32_t transactionFlags);
virtual void lockPageFlip(bool& recomputeVisibleRegions);
virtual void unlockPageFlip(const Transform& planeTransform, Region& outDirtyRegion);
- virtual void finishPageFlip();
virtual bool needsBlending() const { return mNeedsBlending; }
virtual bool needsDithering() const { return mNeedsDithering; }
virtual bool needsFiltering() const;
diff --git a/services/surfaceflinger/LayerBase.cpp b/services/surfaceflinger/LayerBase.cpp
index 9ddb05f..464841b 100644
--- a/services/surfaceflinger/LayerBase.cpp
+++ b/services/surfaceflinger/LayerBase.cpp
@@ -273,10 +273,6 @@
}
}
-void LayerBase::finishPageFlip()
-{
-}
-
void LayerBase::invalidate()
{
if ((android_atomic_or(1, &mInvalidate)&1) == 0) {
diff --git a/services/surfaceflinger/LayerBase.h b/services/surfaceflinger/LayerBase.h
index 13af223..1a34f52 100644
--- a/services/surfaceflinger/LayerBase.h
+++ b/services/surfaceflinger/LayerBase.h
@@ -174,11 +174,6 @@
virtual void unlockPageFlip(const Transform& planeTransform, Region& outDirtyRegion);
/**
- * finishPageFlip - called after all surfaces have drawn.
- */
- virtual void finishPageFlip();
-
- /**
* needsBlending - true if this surface needs blending
*/
virtual bool needsBlending() const { return false; }
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index 434e473..694af70 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -394,14 +394,10 @@
logger.log(GraphicLog::SF_SWAP_BUFFERS, index);
postFramebuffer();
- logger.log(GraphicLog::SF_UNLOCK_CLIENTS, index);
- unlockClients();
-
logger.log(GraphicLog::SF_REPAINT_DONE, index);
} else {
// pretend we did the post
hw.compositionComplete();
- unlockClients();
usleep(16667); // 60 fps period
}
return true;
@@ -872,30 +868,36 @@
for (size_t i=0 ; i<count ; i++) {
const sp<LayerBase>& layer(layers[i]);
layer->setPerFrameData(&cur[i]);
- if (cur[i].hints & HWC_HINT_CLEAR_FB) {
- if (!(layer->needsBlending())) {
- transparent.orSelf(layer->visibleRegionScreen);
- }
- }
}
err = hwc.prepare();
LOGE_IF(err, "HWComposer::prepare failed (%s)", strerror(-err));
- }
- /*
- * clear the area of the FB that need to be transparent
- */
- transparent.andSelf(dirty);
- if (!transparent.isEmpty()) {
- glClearColor(0,0,0,0);
- Region::const_iterator it = transparent.begin();
- Region::const_iterator const end = transparent.end();
- const int32_t height = hw.getHeight();
- while (it != end) {
- const Rect& r(*it++);
- const GLint sy = height - (r.top + r.height());
- glScissor(r.left, sy, r.width(), r.height());
- glClear(GL_COLOR_BUFFER_BIT);
+ if (err == NO_ERROR) {
+ for (size_t i=0 ; i<count ; i++) {
+ if (cur[i].hints & HWC_HINT_CLEAR_FB) {
+ const sp<LayerBase>& layer(layers[i]);
+ if (!(layer->needsBlending())) {
+ transparent.orSelf(layer->visibleRegionScreen);
+ }
+ }
+ }
+
+ /*
+ * clear the area of the FB that need to be transparent
+ */
+ transparent.andSelf(dirty);
+ if (!transparent.isEmpty()) {
+ glClearColor(0,0,0,0);
+ Region::const_iterator it = transparent.begin();
+ Region::const_iterator const end = transparent.end();
+ const int32_t height = hw.getHeight();
+ while (it != end) {
+ const Rect& r(*it++);
+ const GLint sy = height - (r.top + r.height());
+ glScissor(r.left, sy, r.width(), r.height());
+ glClear(GL_COLOR_BUFFER_BIT);
+ }
+ }
}
}
@@ -920,17 +922,6 @@
}
}
-void SurfaceFlinger::unlockClients()
-{
- const LayerVector& drawingLayers(mDrawingState.layersSortedByZ);
- const size_t count = drawingLayers.size();
- sp<LayerBase> const* const layers = drawingLayers.array();
- for (size_t i=0 ; i<count ; ++i) {
- const sp<LayerBase>& layer = layers[i];
- layer->finishPageFlip();
- }
-}
-
void SurfaceFlinger::debugFlashRegions()
{
const DisplayHardware& hw(graphicPlane(0).displayHardware());
diff --git a/services/surfaceflinger/SurfaceFlinger.h b/services/surfaceflinger/SurfaceFlinger.h
index eabdc64..6dd91ac 100644
--- a/services/surfaceflinger/SurfaceFlinger.h
+++ b/services/surfaceflinger/SurfaceFlinger.h
@@ -314,7 +314,6 @@
void handleRepaint();
void postFramebuffer();
void composeSurfaces(const Region& dirty);
- void unlockClients();
ssize_t addClientLayer(const sp<Client>& client,
diff --git a/telephony/java/com/android/internal/telephony/DataConnection.java b/telephony/java/com/android/internal/telephony/DataConnection.java
index c143424..a3d3781 100644
--- a/telephony/java/com/android/internal/telephony/DataConnection.java
+++ b/telephony/java/com/android/internal/telephony/DataConnection.java
@@ -30,6 +30,7 @@
import android.util.EventLog;
import java.net.InetAddress;
+import java.net.Inet4Address;
import java.net.InterfaceAddress;
import java.net.NetworkInterface;
import java.net.SocketException;
@@ -448,22 +449,65 @@
NetworkInterface networkInterface = NetworkInterface.getByName(interfaceName);
linkProperties.setInterfaceName(interfaceName);
- // TODO: Get gateway and dns via RIL interface not property?
- String gatewayAddress = SystemProperties.get(prefix + "gw");
- linkProperties.setGateway(InetAddress.getByName(gatewayAddress));
+ if (response.length >= 5) {
+ log("response.length >=5 using response for ip='" + response[2] +
+ "' dns='" + response[3] + "' gateway='" + response[4] + "'");
+ String [] addresses = response[2].split(" ");
+ String [] dnses = response[3].split(" ");
+ String gateway = response[4];
+ for (String addr : addresses) {
+ LinkAddress la;
+ if (!InetAddress.isNumeric(addr)) {
+ throw new RuntimeException(
+ "Vendor ril bug: Non-numeric ip addr=" + addr);
+ }
+ InetAddress ia = InetAddress.getByName(addr);
+ if (ia instanceof Inet4Address) {
+ la = new LinkAddress(ia, 32);
+ } else {
+ la = new LinkAddress(ia, 128);
+ }
+ linkProperties.addLinkAddress(la);
+ }
- for (InterfaceAddress addr : networkInterface.getInterfaceAddresses()) {
- linkProperties.addLinkAddress(new LinkAddress(addr));
- }
- // TODO: Get gateway and dns via RIL interface not property?
- String dnsServers[] = new String[2];
- dnsServers[0] = SystemProperties.get(prefix + "dns1");
- dnsServers[1] = SystemProperties.get(prefix + "dns2");
- if (isDnsOk(dnsServers)) {
- linkProperties.addDns(InetAddress.getByName(dnsServers[0]));
- linkProperties.addDns(InetAddress.getByName(dnsServers[1]));
+ if (dnses.length != 0) {
+ for (String addr : dnses) {
+ if (!InetAddress.isNumeric(addr)) {
+ throw new RuntimeException(
+ "Vendor ril bug: Non-numeric dns addr=" + addr);
+ }
+ InetAddress ia = InetAddress.getByName(addr);
+ linkProperties.addDns(ia);
+ }
+ result = SetupResult.SUCCESS;
+ } else {
+ result = SetupResult.ERR_BadDns;
+ }
+
+ if (!InetAddress.isNumeric(gateway)) {
+ throw new RuntimeException(
+ "Vendor ril bug: Non-numeric gateway addr=" + gateway);
+ }
+ linkProperties.setGateway(InetAddress.getByName(gateway));
+
} else {
- result = SetupResult.ERR_BadDns;
+ log("response.length < 5 using properties for dns and gateway");
+ for (InterfaceAddress addr : networkInterface.getInterfaceAddresses()) {
+ linkProperties.addLinkAddress(new LinkAddress(addr));
+ }
+
+ String gatewayAddress = SystemProperties.get(prefix + "gw");
+ linkProperties.setGateway(InetAddress.getByName(gatewayAddress));
+
+ String dnsServers[] = new String[2];
+ dnsServers[0] = SystemProperties.get(prefix + "dns1");
+ dnsServers[1] = SystemProperties.get(prefix + "dns2");
+ if (isDnsOk(dnsServers)) {
+ linkProperties.addDns(InetAddress.getByName(dnsServers[0]));
+ linkProperties.addDns(InetAddress.getByName(dnsServers[1]));
+ } else {
+ result = SetupResult.ERR_BadDns;
+ }
}
} catch (UnknownHostException e1) {
log("onSetupCompleted: UnknowHostException " + e1);
diff --git a/tests/HwAccelerationTest/AndroidManifest.xml b/tests/HwAccelerationTest/AndroidManifest.xml
index 1d67964..61f8e1a 100644
--- a/tests/HwAccelerationTest/AndroidManifest.xml
+++ b/tests/HwAccelerationTest/AndroidManifest.xml
@@ -25,6 +25,15 @@
android:hardwareAccelerated="true">
<activity
+ android:name="BitmapMeshActivity"
+ android:label="_BitmapMesh">
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN" />
+ <category android:name="android.intent.category.LAUNCHER" />
+ </intent-filter>
+ </activity>
+
+ <activity
android:name="ShapesActivity"
android:label="_Shapes">
<intent-filter>
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/BitmapMeshActivity.java b/tests/HwAccelerationTest/src/com/android/test/hwui/BitmapMeshActivity.java
new file mode 100644
index 0000000..833d559
--- /dev/null
+++ b/tests/HwAccelerationTest/src/com/android/test/hwui/BitmapMeshActivity.java
@@ -0,0 +1,67 @@
+/*
+ * 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.test.hwui;
+
+import android.app.Activity;
+import android.content.Context;
+import android.graphics.Bitmap;
+import android.graphics.BitmapFactory;
+import android.graphics.Canvas;
+import android.graphics.Paint;
+import android.graphics.PorterDuff;
+import android.graphics.PorterDuffXfermode;
+import android.os.Bundle;
+import android.util.Log;
+import android.view.View;
+
+@SuppressWarnings({"UnusedDeclaration"})
+public class BitmapMeshActivity extends Activity {
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ final BitmapMeshView view = new BitmapMeshView(this);
+ view.setDrawingCacheEnabled(true);
+ setContentView(view);
+ }
+
+ static class BitmapMeshView extends View {
+ private Paint mBitmapPaint;
+ private final Bitmap mBitmap1;
+
+ BitmapMeshView(Context c) {
+ super(c);
+
+ mBitmap1 = BitmapFactory.decodeResource(c.getResources(), R.drawable.sunset1);
+ }
+
+ @Override
+ protected void onDraw(Canvas canvas) {
+ super.onDraw(canvas);
+
+ canvas.drawARGB(255, 255, 255, 255);
+ canvas.translate(100, 100);
+ final float width = mBitmap1.getWidth() / 3.0f;
+ final float height = mBitmap1.getHeight() / 3.0f;
+ canvas.drawBitmapMesh(mBitmap1, 3, 3, new float[] {
+ 0.0f, 0.0f, width, 0.0f, width * 2, 0.0f, width * 3, 0.0f,
+ 0.0f, height, width, height, width * 2, height, width * 4, height,
+ 0.0f, height * 2, width, height * 2, width * 2, height * 2, width * 3, height * 2,
+ 0.0f, height * 4, width, height * 4, width * 2, height * 4, width * 4, height * 4,
+ }, 0, null, 0, null);
+ }
+ }
+}