summaryrefslogtreecommitdiffstats
path: root/core/java/android
diff options
context:
space:
mode:
Diffstat (limited to 'core/java/android')
-rw-r--r--core/java/android/provider/ContactsContract.java41
-rw-r--r--core/java/android/view/View.java4
-rw-r--r--core/java/android/view/ViewGroup.java4
-rw-r--r--core/java/android/webkit/HTML5Audio.java9
-rw-r--r--core/java/android/widget/AppSecurityPermissions.java6
-rw-r--r--core/java/android/widget/ListView.java2
-rw-r--r--core/java/android/widget/RelativeLayout.java30
7 files changed, 42 insertions, 54 deletions
diff --git a/core/java/android/provider/ContactsContract.java b/core/java/android/provider/ContactsContract.java
index 66083c8..367d576 100644
--- a/core/java/android/provider/ContactsContract.java
+++ b/core/java/android/provider/ContactsContract.java
@@ -3796,50 +3796,11 @@ public final class ContactsContract {
* Columns in the Data_Usage_Stat table
*/
protected interface DataUsageStatColumns {
- /** What the referenced {@link Data} was used for.
- * @see DataUsageStatColumns#USAGE_TYPE_CALL
- * @see DataUsageStatColumns#USAGE_TYPE_LONG_TEXT
- * @see DataUsageStatColumns#USAGE_TYPE_SHORT_TEXT
- */
- public static final String USAGE_TYPE = "usage_type";
-
/** The last time (in milliseconds) this {@link Data} was used. */
public static final String LAST_TIME_USED = "last_time_used";
- /** The number of times the referenced {@link Data} has been used for the purpose described
- * in {@link DataUsageStatColumns#USAGE_TYPE}.
- */
+ /** The number of times the referenced {@link Data} has been used. */
public static final String TIMES_USED = "times_used";
-
- /**
- * Integer value for USAGE_TYPE.
- * This type of usage refers to voice interaction, which includes phone calls, voice chat,
- * and video chat.
- *
- * @see DataUsageFeedback#USAGE_TYPE
- * @see DataUsageStatColumns#USAGE_TYPE
- */
- public static final int USAGE_TYPE_CALL = 0;
-
- /**
- * Integer value for USAGE_TYPE.
- * This type of usage refers to text interaction involving longer messages, which includes
- * email.
- *
- * @see DataUsageFeedback#USAGE_TYPE
- * @see DataUsageStatColumns#USAGE_TYPE
- */
- public static final int USAGE_TYPE_LONG_TEXT = 1;
-
- /**
- * Integer value for USAGE_TYPE.
- * This type of usage for text interaction involving shorter messages, which includes SMS
- * and text chat with email addresses.
- *
- * @see DataUsageFeedback#USAGE_TYPE
- * @see DataUsageStatColumns#USAGE_TYPE
- */
- public static final int USAGE_TYPE_SHORT_TEXT = 2;
}
/**
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index a520e17..7c82f7e 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -14060,6 +14060,10 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
* managed: remove them when they should not be displayed anymore. The
* overlay will always have the same size as its host view.
*
+ * <p>Note: Overlays do not currently work correctly with {@link
+ * SurfaceView} or {@link TextureView}; contents in overlays for these
+ * types of views may not display correctly.</p>
+ *
* @return The ViewOverlay object for this view.
* @see ViewOverlay
*/
diff --git a/core/java/android/view/ViewGroup.java b/core/java/android/view/ViewGroup.java
index c07191a..311d1d0 100644
--- a/core/java/android/view/ViewGroup.java
+++ b/core/java/android/view/ViewGroup.java
@@ -2975,6 +2975,10 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
* representation of a view in a parent container, such as might be used
* by an animation effect.
*
+ * <p>Note: Overlays do not currently work correctly with {@link
+ * SurfaceView} or {@link TextureView}; contents in overlays for these
+ * types of views may not display correctly.</p>
+ *
* @return The ViewGroupOverlay object for this view.
* @see ViewGroupOverlay
*/
diff --git a/core/java/android/webkit/HTML5Audio.java b/core/java/android/webkit/HTML5Audio.java
index 684ec07..17eb2df 100644
--- a/core/java/android/webkit/HTML5Audio.java
+++ b/core/java/android/webkit/HTML5Audio.java
@@ -19,6 +19,7 @@ package android.webkit;
import android.content.Context;
import android.media.AudioManager;
import android.media.MediaPlayer;
+import android.net.Uri;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
@@ -84,6 +85,7 @@ class HTML5Audio extends Handler
// See http://www.whatwg.org/specs/web-apps/current-work/#event-media-timeupdate
private Timer mTimer;
private final class TimeupdateTask extends TimerTask {
+ @Override
public void run() {
HTML5Audio.this.obtainMessage(TIMEUPDATE).sendToTarget();
}
@@ -139,11 +141,13 @@ class HTML5Audio extends Handler
// (i.e. the webviewcore thread here)
// MediaPlayer.OnBufferingUpdateListener
+ @Override
public void onBufferingUpdate(MediaPlayer mp, int percent) {
nativeOnBuffering(percent, mNativePointer);
}
// MediaPlayer.OnCompletionListener;
+ @Override
public void onCompletion(MediaPlayer mp) {
mState = COMPLETE;
mProcessingOnEnd = true;
@@ -156,6 +160,7 @@ class HTML5Audio extends Handler
}
// MediaPlayer.OnErrorListener
+ @Override
public boolean onError(MediaPlayer mp, int what, int extra) {
mState = ERROR;
resetMediaPlayer();
@@ -164,6 +169,7 @@ class HTML5Audio extends Handler
}
// MediaPlayer.OnPreparedListener
+ @Override
public void onPrepared(MediaPlayer mp) {
mState = PREPARED;
if (mTimer != null) {
@@ -178,6 +184,7 @@ class HTML5Audio extends Handler
}
// MediaPlayer.OnSeekCompleteListener
+ @Override
public void onSeekComplete(MediaPlayer mp) {
nativeOnTimeupdate(mp.getCurrentPosition(), mNativePointer);
}
@@ -231,7 +238,7 @@ class HTML5Audio extends Handler
headers.put(HIDE_URL_LOGS, "true");
}
- mMediaPlayer.setDataSource(url, headers);
+ mMediaPlayer.setDataSource(mContext, Uri.parse(url), headers);
mState = INITIALIZED;
mMediaPlayer.prepareAsync();
} catch (IOException e) {
diff --git a/core/java/android/widget/AppSecurityPermissions.java b/core/java/android/widget/AppSecurityPermissions.java
index 589a358..34cfea5 100644
--- a/core/java/android/widget/AppSecurityPermissions.java
+++ b/core/java/android/widget/AppSecurityPermissions.java
@@ -244,11 +244,11 @@ public class AppSecurityPermissions {
public void onClick(DialogInterface dialog, int which) {
PackageManager pm = getContext().getPackageManager();
pm.revokePermission(mPackageName, mPerm.name);
- PermissionItemView.this.setVisibility(View.INVISIBLE);
+ PermissionItemView.this.setVisibility(View.GONE);
}
};
- builder.setNegativeButton(R.string.cancel, null);
- builder.setPositiveButton(R.string.revoke, ocl);
+ builder.setNegativeButton(R.string.revoke, ocl);
+ builder.setPositiveButton(R.string.ok, null);
}
}
diff --git a/core/java/android/widget/ListView.java b/core/java/android/widget/ListView.java
index 4b62c2d..c7914f3 100644
--- a/core/java/android/widget/ListView.java
+++ b/core/java/android/widget/ListView.java
@@ -2433,7 +2433,7 @@ public class ListView extends AbsListView {
mFirstPosition;
} else {
final int lastPos = mFirstPosition + getChildCount() - 1;
- nextSelected = selectedPos != INVALID_POSITION && selectedPos < lastPos?
+ nextSelected = selectedPos != INVALID_POSITION && selectedPos <= lastPos ?
selectedPos - 1 :
lastPos;
}
diff --git a/core/java/android/widget/RelativeLayout.java b/core/java/android/widget/RelativeLayout.java
index 529de2e..3df7258 100644
--- a/core/java/android/widget/RelativeLayout.java
+++ b/core/java/android/widget/RelativeLayout.java
@@ -220,28 +220,29 @@ public class RelativeLayout extends ViewGroup {
// with MeasureSpec value overflow and RelativeLayout was one source of them.
// Some apps came to rely on them. :(
private boolean mAllowBrokenMeasureSpecs = false;
+ // Compatibility hack. Old versions of the platform would not take
+ // margins and padding into account when generating the height measure spec
+ // for children during the horizontal measure pass.
+ private boolean mMeasureVerticalWithPaddingMargin = false;
// A default width used for RTL measure pass
- private static int DEFAULT_WIDTH = Integer.MAX_VALUE / 2;
+ private static final int DEFAULT_WIDTH = Integer.MAX_VALUE / 2;
public RelativeLayout(Context context) {
super(context);
- mAllowBrokenMeasureSpecs = context.getApplicationInfo().targetSdkVersion <=
- Build.VERSION_CODES.JELLY_BEAN_MR1;
+ queryCompatibilityModes(context);
}
public RelativeLayout(Context context, AttributeSet attrs) {
super(context, attrs);
initFromAttributes(context, attrs);
- mAllowBrokenMeasureSpecs = context.getApplicationInfo().targetSdkVersion <=
- Build.VERSION_CODES.JELLY_BEAN_MR1;
+ queryCompatibilityModes(context);
}
public RelativeLayout(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
initFromAttributes(context, attrs);
- mAllowBrokenMeasureSpecs = context.getApplicationInfo().targetSdkVersion <=
- Build.VERSION_CODES.JELLY_BEAN_MR1;
+ queryCompatibilityModes(context);
}
private void initFromAttributes(Context context, AttributeSet attrs) {
@@ -251,6 +252,12 @@ public class RelativeLayout extends ViewGroup {
a.recycle();
}
+ private void queryCompatibilityModes(Context context) {
+ int version = context.getApplicationInfo().targetSdkVersion;
+ mAllowBrokenMeasureSpecs = version <= Build.VERSION_CODES.JELLY_BEAN_MR1;
+ mMeasureVerticalWithPaddingMargin = version >= Build.VERSION_CODES.JELLY_BEAN_MR2;
+ }
+
@Override
public boolean shouldDelayChildPressedState() {
return false;
@@ -692,6 +699,11 @@ public class RelativeLayout extends ViewGroup {
params.leftMargin, params.rightMargin,
mPaddingLeft, mPaddingRight,
myWidth);
+ int maxHeight = myHeight;
+ if (mMeasureVerticalWithPaddingMargin) {
+ maxHeight = Math.max(0, myHeight - mPaddingTop - mPaddingBottom -
+ params.topMargin - params.bottomMargin);
+ }
int childHeightMeasureSpec;
if (myHeight < 0 && !mAllowBrokenMeasureSpecs) {
if (params.height >= 0) {
@@ -704,9 +716,9 @@ public class RelativeLayout extends ViewGroup {
childHeightMeasureSpec = MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED);
}
} else if (params.width == LayoutParams.MATCH_PARENT) {
- childHeightMeasureSpec = MeasureSpec.makeMeasureSpec(myHeight, MeasureSpec.EXACTLY);
+ childHeightMeasureSpec = MeasureSpec.makeMeasureSpec(maxHeight, MeasureSpec.EXACTLY);
} else {
- childHeightMeasureSpec = MeasureSpec.makeMeasureSpec(myHeight, MeasureSpec.AT_MOST);
+ childHeightMeasureSpec = MeasureSpec.makeMeasureSpec(maxHeight, MeasureSpec.AT_MOST);
}
child.measure(childWidthMeasureSpec, childHeightMeasureSpec);
}