summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--api/current.txt3
-rw-r--r--core/java/android/view/ViewConfiguration.java16
-rw-r--r--core/java/com/android/internal/widget/SwipeDismissLayout.java20
-rw-r--r--core/res/res/values-watch/config.xml2
-rw-r--r--core/res/res/values/config.xml3
-rw-r--r--core/res/res/values/symbols.xml1
-rw-r--r--docs/html/about/dashboards/index.jd46
-rw-r--r--docs/html/tools/device.jd4
-rw-r--r--policy/src/com/android/internal/policy/impl/PhoneWindowManager.java7
9 files changed, 63 insertions, 39 deletions
diff --git a/api/current.txt b/api/current.txt
index 2464e38eae22..2638ee45260f 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -28382,10 +28382,11 @@ package android.view {
public class ViewConfiguration {
ctor public deprecated ViewConfiguration();
method public static android.view.ViewConfiguration get(android.content.Context);
+ method public long getDeviceGlobalActionKeyTimeout();
method public static int getDoubleTapTimeout();
method public static deprecated int getEdgeSlop();
method public static deprecated int getFadingEdgeLength();
- method public static long getGlobalActionKeyTimeout();
+ method public static deprecated long getGlobalActionKeyTimeout();
method public static int getJumpTapTimeout();
method public static int getKeyRepeatDelay();
method public static int getKeyRepeatTimeout();
diff --git a/core/java/android/view/ViewConfiguration.java b/core/java/android/view/ViewConfiguration.java
index 7417abb881f7..4b8541eb710d 100644
--- a/core/java/android/view/ViewConfiguration.java
+++ b/core/java/android/view/ViewConfiguration.java
@@ -234,6 +234,7 @@ public class ViewConfiguration {
private final int mOverscrollDistance;
private final int mOverflingDistance;
private final boolean mFadingMarqueeEnabled;
+ private final long mGlobalActionsKeyTimeout;
private boolean sHasPermanentMenuKey;
private boolean sHasPermanentMenuKeySet;
@@ -261,6 +262,7 @@ public class ViewConfiguration {
mOverscrollDistance = OVERSCROLL_DISTANCE;
mOverflingDistance = OVERFLING_DISTANCE;
mFadingMarqueeEnabled = true;
+ mGlobalActionsKeyTimeout = GLOBAL_ACTIONS_KEY_TIMEOUT;
}
/**
@@ -342,6 +344,8 @@ public class ViewConfiguration {
com.android.internal.R.dimen.config_viewMinFlingVelocity);
mMaximumFlingVelocity = res.getDimensionPixelSize(
com.android.internal.R.dimen.config_viewMaxFlingVelocity);
+ mGlobalActionsKeyTimeout = res.getInteger(
+ com.android.internal.R.integer.config_globalActionsKeyTimeout);
}
/**
@@ -698,12 +702,24 @@ public class ViewConfiguration {
*
* @return how long a user needs to press the relevant key to bring up
* the global actions dialog.
+ * @deprecated use getDeviceGlobalActionKeyTimeout
*/
public static long getGlobalActionKeyTimeout() {
return GLOBAL_ACTIONS_KEY_TIMEOUT;
}
/**
+ * The amount of time a user needs to press the relevant key to bring up
+ * the global actions dialog.
+ *
+ * @return how long a user needs to press the relevant key to bring up
+ * the global actions dialog.
+ */
+ public long getDeviceGlobalActionKeyTimeout() {
+ return mGlobalActionsKeyTimeout;
+ }
+
+ /**
* The amount of friction applied to scrolls and flings.
*
* @return A scalar dimensionless value representing the coefficient of
diff --git a/core/java/com/android/internal/widget/SwipeDismissLayout.java b/core/java/com/android/internal/widget/SwipeDismissLayout.java
index 467d42e1d326..674d084d4928 100644
--- a/core/java/com/android/internal/widget/SwipeDismissLayout.java
+++ b/core/java/com/android/internal/widget/SwipeDismissLayout.java
@@ -35,7 +35,7 @@ import android.widget.FrameLayout;
public class SwipeDismissLayout extends FrameLayout {
private static final String TAG = "SwipeDismissLayout";
- private static final float TRANSLATION_MIN_ALPHA = 0.5f;
+ private static final float DISMISS_MIN_PROGRESS = 0.6f;
public interface OnDismissedListener {
void onDismissed(SwipeDismissLayout layout);
@@ -77,6 +77,8 @@ public class SwipeDismissLayout extends FrameLayout {
private OnDismissedListener mDismissedListener;
private OnSwipeProgressChangedListener mProgressListener;
+ private float mLastX;
+
public SwipeDismissLayout(Context context) {
super(context);
init(context);
@@ -95,7 +97,7 @@ public class SwipeDismissLayout extends FrameLayout {
private void init(Context context) {
ViewConfiguration vc = ViewConfiguration.get(getContext());
mSlop = vc.getScaledTouchSlop();
- mMinFlingVelocity = vc.getScaledMinimumFlingVelocity() * 16;
+ mMinFlingVelocity = vc.getScaledMinimumFlingVelocity();
mMaxFlingVelocity = vc.getScaledMaximumFlingVelocity();
mAnimationTime = getContext().getResources().getInteger(
android.R.integer.config_shortAnimTime);
@@ -193,8 +195,8 @@ public class SwipeDismissLayout extends FrameLayout {
case MotionEvent.ACTION_MOVE:
mVelocityTracker.addMovement(ev);
+ mLastX = ev.getRawX();
updateSwiping(ev);
- updateDismiss(ev);
if (mSwiping) {
setProgress(ev.getRawX() - mDownX);
break;
@@ -256,20 +258,16 @@ public class SwipeDismissLayout extends FrameLayout {
float absVelocityX = Math.abs(velocityX);
float absVelocityY = Math.abs(mVelocityTracker.getYVelocity());
- if (deltaX > getWidth() / 2) {
- mDismissed = true;
- } else if (absVelocityX >= mMinFlingVelocity
- && absVelocityX <= mMaxFlingVelocity
- && absVelocityY < absVelocityX / 2
- && velocityX > 0
- && deltaX > 0) {
+ if (deltaX > (getWidth() * DISMISS_MIN_PROGRESS) &&
+ absVelocityX < mMinFlingVelocity &&
+ ev.getRawX() >= mLastX) {
mDismissed = true;
}
}
// Check if the user tried to undo this.
if (mDismissed && mSwiping) {
// Check if the user's finger is actually back
- if (deltaX < getWidth() / 2) {
+ if (deltaX < (getWidth() * DISMISS_MIN_PROGRESS)) {
mDismissed = false;
}
}
diff --git a/core/res/res/values-watch/config.xml b/core/res/res/values-watch/config.xml
index e71fa4a22966..44e258d84666 100644
--- a/core/res/res/values-watch/config.xml
+++ b/core/res/res/values-watch/config.xml
@@ -32,7 +32,7 @@
<dimen name="config_viewConfigurationTouchSlop">4dp</dimen>
<!-- Minimum velocity to initiate a fling, as measured in dips per second. -->
- <dimen name="config_viewMinFlingVelocity">50dp</dimen>
+ <dimen name="config_viewMinFlingVelocity">500dp</dimen>
<!-- Maximum velocity to initiate a fling, as measured in dips per second. -->
<dimen name="config_viewMaxFlingVelocity">8000dp</dimen>
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index 602c4f6fe1be..9d27164c5563 100644
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -1191,6 +1191,9 @@
<!-- Maximum velocity to initiate a fling, as measured in dips per second. -->
<dimen name="config_viewMaxFlingVelocity">8000dp</dimen>
+ <!-- Amount of time in ms the user needs to press the relevant key to bring up the global actions dialog -->
+ <integer name="config_globalActionsKeyTimeout">500</integer>
+
<!-- Maximum number of grid columns permitted in the ResolverActivity
used for picking activities to handle an intent. -->
<integer name="config_maxResolverActivityColumns">2</integer>
diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml
index f027da0c1a18..e2e7a34a7736 100644
--- a/core/res/res/values/symbols.xml
+++ b/core/res/res/values/symbols.xml
@@ -1637,6 +1637,7 @@
<java-symbol type="id" name="resolver_list" />
<java-symbol type="id" name="button_once" />
<java-symbol type="id" name="button_always" />
+ <java-symbol type="integer" name="config_globalActionsKeyTimeout" />
<java-symbol type="integer" name="config_maxResolverActivityColumns" />
<java-symbol type="array" name="config_notificationScorers" />
diff --git a/docs/html/about/dashboards/index.jd b/docs/html/about/dashboards/index.jd
index 92ecd2410931..bddb8eca57a4 100644
--- a/docs/html/about/dashboards/index.jd
+++ b/docs/html/about/dashboards/index.jd
@@ -61,7 +61,7 @@ Platform Versions</a>.</p>
</div>
-<p style="clear:both"><em>Data collected during a 7-day period ending on April 1, 2014.
+<p style="clear:both"><em>Data collected during a 7-day period ending on May 1, 2014.
<br/>Any versions with less than 0.1% distribution are not shown.</em>
</p>
@@ -92,7 +92,7 @@ Screens</a>.</p>
</div>
-<p style="clear:both"><em>Data collected during a 7-day period ending on April 1, 2014.
+<p style="clear:both"><em>Data collected during a 7-day period ending on May 1, 2014.
<br/>Any screen configurations with less than 0.1% distribution are not shown.</em></p>
@@ -111,7 +111,7 @@ support for any lower version (for example, support for version 2.0 also implies
<img alt="" style="float:right"
-src="//chart.googleapis.com/chart?chl=GL%201.1%20only%7CGL%202.0%7CGL%203.0&chf=bg%2Cs%2C00000000&chd=t%3A0.1%2C93.5%2C6.4&chco=c4df9b%2C6fad0c&chs=400x250&cht=p" />
+src="//chart.googleapis.com/chart?chs=400x250&cht=p&chd=t%3A0.1%2C87.0%2C12.9&chf=bg%2Cs%2C00000000&chl=GL%201.1%20only%7CGL%202.0%7CGL%203.0&chco=c4df9b%2C6fad0c" />
<p>To declare which version of OpenGL ES your application requires, you should use the {@code
android:glEsVersion} attribute of the <a
@@ -133,17 +133,17 @@ uses.</p>
</tr>
<tr>
<td>2.0</th>
-<td>89.4%</td>
+<td>87.0%</td>
</tr>
<tr>
<td>3.0</th>
-<td>10.5%</td>
+<td>12.9%</td>
</tr>
</table>
-<p style="clear:both"><em>Data collected during a 7-day period ending on April 1, 2014</em></p>
+<p style="clear:both"><em>Data collected during a 7-day period ending on May 1, 2014</em></p>
@@ -161,17 +161,17 @@ uses.</p>
var VERSION_DATA =
[
{
- "chart": "//chart.googleapis.com/chart?cht=p&chs=500x250&chco=c4df9b%2C6fad0c&chf=bg%2Cs%2C00000000&chd=t%3A1.1%2C17.8%2C0.1%2C14.3%2C61.4%2C5.3&chl=Froyo%7CGingerbread%7CHoneycomb%7CIce%20Cream%20Sandwich%7CJelly%20Bean%7CKitKat",
+ "chart": "//chart.googleapis.com/chart?chs=500x250&cht=p&chd=t%3A1.0%2C16.2%2C0.1%2C13.4%2C60.8%2C8.5&chf=bg%2Cs%2C00000000&chl=Froyo%7CGingerbread%7CHoneycomb%7CIce%20Cream%20Sandwich%7CJelly%20Bean%7CKitKat&chco=c4df9b%2C6fad0c",
"data": [
{
"api": 8,
"name": "Froyo",
- "perc": "1.1"
+ "perc": "1.0"
},
{
"api": 10,
"name": "Gingerbread",
- "perc": "17.8"
+ "perc": "16.2"
},
{
"api": 13,
@@ -181,27 +181,27 @@ var VERSION_DATA =
{
"api": 15,
"name": "Ice Cream Sandwich",
- "perc": "14.3"
+ "perc": "13.4"
},
{
"api": 16,
"name": "Jelly Bean",
- "perc": "34.4"
+ "perc": "33.5"
},
{
"api": 17,
"name": "Jelly Bean",
- "perc": "18.1"
+ "perc": "18.8"
},
{
"api": 18,
"name": "Jelly Bean",
- "perc": "8.9"
+ "perc": "8.5"
},
{
"api": 19,
"name": "KitKat",
- "perc": "5.3"
+ "perc": "8.5"
}
]
}
@@ -217,19 +217,19 @@ var SCREEN_DATA =
"data": {
"Large": {
"hdpi": "0.6",
- "ldpi": "0.7",
+ "ldpi": "0.6",
"mdpi": "4.4",
- "tvdpi": "1.5",
+ "tvdpi": "1.6",
"xhdpi": "0.6"
},
"Normal": {
- "hdpi": "33.7",
- "mdpi": "13.2",
- "xhdpi": "19.8",
- "xxhdpi": "12.5"
+ "hdpi": "33.9",
+ "mdpi": "12.5",
+ "xhdpi": "19.9",
+ "xxhdpi": "13.5"
},
"Small": {
- "ldpi": "8.1"
+ "ldpi": "7.5"
},
"Xlarge": {
"hdpi": "0.3",
@@ -238,8 +238,8 @@ var SCREEN_DATA =
"xhdpi": "0.3"
}
},
- "densitychart": "//chart.googleapis.com/chart?cht=p&chs=400x250&chco=c4df9b%2C6fad0c&chf=bg%2Cs%2C00000000&chd=t%3A8.9%2C21.8%2C1.5%2C34.6%2C20.7%2C12.6&chl=ldpi%7Cmdpi%7Ctvdpi%7Chdpi%7Cxhdpi%7Cxxhdpi",
- "layoutchart": "//chart.googleapis.com/chart?cht=p&chs=400x250&chco=c4df9b%2C6fad0c&chf=bg%2Cs%2C00000000&chd=t%3A4.9%2C7.8%2C79.3%2C8.1&chl=Xlarge%7CLarge%7CNormal%7CSmall"
+ "densitychart": "//chart.googleapis.com/chart?chs=400x250&cht=p&chd=t%3A8.2%2C21.1%2C1.6%2C34.8%2C20.8%2C13.5&chf=bg%2Cs%2C00000000&chl=ldpi%7Cmdpi%7Ctvdpi%7Chdpi%7Cxhdpi%7Cxxhdpi&chco=c4df9b%2C6fad0c",
+ "layoutchart": "//chart.googleapis.com/chart?chs=400x250&cht=p&chd=t%3A4.9%2C7.8%2C80.0%2C7.5&chf=bg%2Cs%2C00000000&chl=Xlarge%7CLarge%7CNormal%7CSmall&chco=c4df9b%2C6fad0c"
}
];
diff --git a/docs/html/tools/device.jd b/docs/html/tools/device.jd
index ccd590337280..e9caa44ed38b 100644
--- a/docs/html/tools/device.jd
+++ b/docs/html/tools/device.jd
@@ -192,6 +192,10 @@ above.</p>
<td><code>12d1</code></td>
</tr>
<tr>
+ <td>Intel</td>
+ <td><code>8087</code></td>
+ </tr>
+ <tr>
<td>K-Touch</td>
<td><code>24e3</code></td>
</tr>
diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
index 2b7bbd0424f4..dd7abb6eb103 100644
--- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
+++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
@@ -668,7 +668,8 @@ public class PhoneWindowManager implements WindowManagerPolicy {
private void interceptPowerKeyDown(boolean handled) {
mPowerKeyHandled = handled;
if (!handled) {
- mHandler.postDelayed(mPowerLongPress, ViewConfiguration.getGlobalActionKeyTimeout());
+ mHandler.postDelayed(mPowerLongPress,
+ ViewConfiguration.get(mContext).getDeviceGlobalActionKeyTimeout());
}
}
@@ -707,9 +708,9 @@ public class PhoneWindowManager implements WindowManagerPolicy {
if (mKeyguardDelegate.isShowing()) {
// Double the time it takes to take a screenshot from the keyguard
return (long) (KEYGUARD_SCREENSHOT_CHORD_DELAY_MULTIPLIER *
- ViewConfiguration.getGlobalActionKeyTimeout());
+ ViewConfiguration.get(mContext).getDeviceGlobalActionKeyTimeout());
}
- return ViewConfiguration.getGlobalActionKeyTimeout();
+ return ViewConfiguration.get(mContext).getDeviceGlobalActionKeyTimeout();
}
private void cancelPendingScreenshotChordAction() {