summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/java/android/app/MediaRouteButton.java13
-rw-r--r--core/java/android/app/StatusBarManager.java33
-rw-r--r--core/java/android/content/Intent.java8
-rw-r--r--core/java/android/content/pm/VerificationParams.java71
-rwxr-xr-xcore/java/android/provider/ContactsContract.java86
-rw-r--r--core/java/android/provider/Settings.java13
-rw-r--r--core/java/android/view/ScaleGestureDetector.java22
-rw-r--r--core/java/android/view/View.java138
-rw-r--r--core/java/android/view/ViewDebug.java12
-rw-r--r--core/java/android/view/ViewGroup.java64
-rw-r--r--core/java/android/widget/Gallery.java18
-rw-r--r--core/java/android/widget/NumberPicker.java8
-rw-r--r--core/java/com/android/internal/app/MediaRouteChooserDialogFragment.java22
-rw-r--r--core/java/com/android/internal/statusbar/IStatusBar.aidl7
-rw-r--r--core/java/com/android/internal/statusbar/IStatusBarService.aidl7
-rw-r--r--core/jni/android/graphics/TextLayoutCache.cpp29
-rw-r--r--core/res/AndroidManifest.xml6
-rw-r--r--core/res/res/drawable-hdpi/magnified_region_frame.9.pngbin0 -> 190 bytes
-rw-r--r--core/res/res/drawable-mdpi/magnified_region_frame.9.pngbin0 -> 172 bytes
-rw-r--r--core/res/res/drawable-nodpi/magnified_region_frame.9.pngbin741 -> 0 bytes
-rw-r--r--core/res/res/drawable-xhdpi/magnified_region_frame.9.pngbin0 -> 205 bytes
-rw-r--r--core/res/res/layout/media_route_list_item.xml15
-rw-r--r--core/res/res/values-sw600dp/bools.xml2
-rwxr-xr-xcore/res/res/values/strings.xml16
-rw-r--r--core/res/res/values/symbols.xml7
-rw-r--r--core/res/res/xml/sms_short_codes.xml189
-rw-r--r--core/tests/coretests/src/android/content/pm/VerificationParamsTest.java80
27 files changed, 440 insertions, 426 deletions
diff --git a/core/java/android/app/MediaRouteButton.java b/core/java/android/app/MediaRouteButton.java
index cfc8bbd..a9ccef0 100644
--- a/core/java/android/app/MediaRouteButton.java
+++ b/core/java/android/app/MediaRouteButton.java
@@ -221,21 +221,28 @@ public class MediaRouteButton extends View {
void updateRouteCount() {
final int N = mRouter.getRouteCount();
int count = 0;
+ boolean hasVideoRoutes = false;
for (int i = 0; i < N; i++) {
final RouteInfo route = mRouter.getRouteAt(i);
- if ((route.getSupportedTypes() & mRouteTypes) != 0) {
+ final int routeTypes = route.getSupportedTypes();
+ if ((routeTypes & mRouteTypes) != 0) {
if (route instanceof RouteGroup) {
count += ((RouteGroup) route).getRouteCount();
} else {
count++;
}
+ if ((routeTypes & MediaRouter.ROUTE_TYPE_LIVE_VIDEO) != 0) {
+ hasVideoRoutes = true;
+ }
}
}
setEnabled(count != 0);
- // Only allow toggling if we have more than just user routes
- mToggleMode = count == 2 && (mRouteTypes & MediaRouter.ROUTE_TYPE_LIVE_AUDIO) != 0;
+ // Only allow toggling if we have more than just user routes.
+ // Don't toggle if we support video routes, we may have to let the dialog scan.
+ mToggleMode = count == 2 && (mRouteTypes & MediaRouter.ROUTE_TYPE_LIVE_AUDIO) != 0 &&
+ !hasVideoRoutes;
}
@Override
diff --git a/core/java/android/app/StatusBarManager.java b/core/java/android/app/StatusBarManager.java
index 1e61e10..3d656c7 100644
--- a/core/java/android/app/StatusBarManager.java
+++ b/core/java/android/app/StatusBarManager.java
@@ -97,13 +97,13 @@ public class StatusBarManager {
}
/**
- * Expand the notifications.
+ * Expand the notifications panel.
*/
- public void expandNotifications() {
+ public void expandNotificationsPanel() {
try {
final IStatusBarService svc = getService();
if (svc != null) {
- svc.expandNotifications();
+ svc.expandNotificationsPanel();
}
} catch (RemoteException ex) {
// system process is dead anyway.
@@ -112,13 +112,13 @@ public class StatusBarManager {
}
/**
- * Collapse the notifications.
+ * Collapse the notifications and settings panels.
*/
- public void collapseNotifications() {
+ public void collapsePanels() {
try {
final IStatusBarService svc = getService();
if (svc != null) {
- svc.collapseNotifications();
+ svc.collapsePanels();
}
} catch (RemoteException ex) {
// system process is dead anyway.
@@ -127,28 +127,13 @@ public class StatusBarManager {
}
/**
- * Expand the quick settings.
+ * Expand the settings panel.
*/
- public void expandQuickSettings() {
+ public void expandSettingsPanel() {
try {
final IStatusBarService svc = getService();
if (svc != null) {
- svc.expandQuickSettings();
- }
- } catch (RemoteException ex) {
- // system process is dead anyway.
- throw new RuntimeException(ex);
- }
- }
-
- /**
- * Collapse the quick settings.
- */
- public void collapseQuickSettings() {
- try {
- final IStatusBarService svc = getService();
- if (svc != null) {
- svc.collapseQuickSettings();
+ svc.expandSettingsPanel();
}
} catch (RemoteException ex) {
// system process is dead anyway.
diff --git a/core/java/android/content/Intent.java b/core/java/android/content/Intent.java
index b9518b8..c301c5c 100644
--- a/core/java/android/content/Intent.java
+++ b/core/java/android/content/Intent.java
@@ -1305,6 +1305,14 @@ public class Intent implements Parcelable, Cloneable {
= "android.intent.extra.REFERRER";
/**
+ * Used as an int extra field with {@link #ACTION_INSTALL_PACKAGE} and
+ * {@link} #ACTION_VIEW} to indicate the uid of the package that initiated the install
+ * @hide
+ */
+ public static final String EXTRA_ORIGINATING_UID
+ = "android.intent.extra.ORIGINATING_UID";
+
+ /**
* Used as a boolean extra field with {@link #ACTION_INSTALL_PACKAGE} to install a
* package. Tells the installer UI to skip the confirmation with the user
* if the .apk is replacing an existing one.
diff --git a/core/java/android/content/pm/VerificationParams.java b/core/java/android/content/pm/VerificationParams.java
index 6454de0..22e1a85 100644
--- a/core/java/android/content/pm/VerificationParams.java
+++ b/core/java/android/content/pm/VerificationParams.java
@@ -27,6 +27,9 @@ import android.os.Parcelable;
* @hide
*/
public class VerificationParams implements Parcelable {
+ /** A constant used to indicate that a uid value is not present. */
+ public static final int NO_UID = -1;
+
/** What we print out first when toString() is called. */
private static final String TO_STRING_PREFIX = "VerificationParams{";
@@ -39,6 +42,9 @@ public class VerificationParams implements Parcelable {
/** HTTP referrer URI associated with the originatingURI. */
private final Uri mReferrer;
+ /** UID of the application that the install request originated from. */
+ private final int mOriginatingUid;
+
/** UID of application requesting the install */
private int mInstallerUid;
@@ -57,16 +63,19 @@ public class VerificationParams implements Parcelable {
* from. May be {@code null}.
* @param referrer HTTP referrer URI associated with the originatingURI.
* May be {@code null}.
+ * @param originatingUid UID of the application that the install request originated
+ * from, or NO_UID if not present
* @param manifestDigest an object that holds the digest of the package
* which can be used to verify ownership. May be {@code null}.
*/
public VerificationParams(Uri verificationURI, Uri originatingURI, Uri referrer,
- ManifestDigest manifestDigest) {
+ int originatingUid, ManifestDigest manifestDigest) {
mVerificationURI = verificationURI;
mOriginatingURI = originatingURI;
mReferrer = referrer;
+ mOriginatingUid = originatingUid;
mManifestDigest = manifestDigest;
- mInstallerUid = -1;
+ mInstallerUid = NO_UID;
}
public Uri getVerificationURI() {
@@ -81,11 +90,16 @@ public class VerificationParams implements Parcelable {
return mReferrer;
}
+ /** return NO_UID if not available */
+ public int getOriginatingUid() {
+ return mOriginatingUid;
+ }
+
public ManifestDigest getManifestDigest() {
return mManifestDigest;
}
- /** @return -1 when not set */
+ /** @return NO_UID when not set */
public int getInstallerUid() {
return mInstallerUid;
}
@@ -111,31 +125,39 @@ public class VerificationParams implements Parcelable {
final VerificationParams other = (VerificationParams) o;
- if (mVerificationURI == null && other.mVerificationURI != null) {
- return false;
- }
- if (!mVerificationURI.equals(other.mVerificationURI)) {
+ if (mVerificationURI == null) {
+ if (other.mVerificationURI != null) {
+ return false;
+ }
+ } else if (!mVerificationURI.equals(other.mVerificationURI)) {
return false;
}
- if (mOriginatingURI == null && other.mOriginatingURI != null) {
- return false;
- }
- if (!mOriginatingURI.equals(other.mOriginatingURI)) {
+ if (mOriginatingURI == null) {
+ if (other.mOriginatingURI != null) {
+ return false;
+ }
+ } else if (!mOriginatingURI.equals(other.mOriginatingURI)) {
return false;
}
- if (mReferrer == null && other.mReferrer != null) {
- return false;
- }
- if (!mReferrer.equals(other.mReferrer)) {
+ if (mReferrer == null) {
+ if (other.mReferrer != null) {
+ return false;
+ }
+ } else if (!mReferrer.equals(other.mReferrer)) {
return false;
}
- if (mManifestDigest == null && other.mManifestDigest != null) {
+ if (mOriginatingUid != other.mOriginatingUid) {
return false;
}
- if (mManifestDigest != null && !mManifestDigest.equals(other.mManifestDigest)) {
+
+ if (mManifestDigest == null) {
+ if (other.mManifestDigest != null) {
+ return false;
+ }
+ } else if (!mManifestDigest.equals(other.mManifestDigest)) {
return false;
}
@@ -150,11 +172,12 @@ public class VerificationParams implements Parcelable {
public int hashCode() {
int hash = 3;
- hash += 5 * (mVerificationURI==null?1:mVerificationURI.hashCode());
- hash += 7 * (mOriginatingURI==null?1:mOriginatingURI.hashCode());
- hash += 11 * (mReferrer==null?1:mReferrer.hashCode());
- hash += 13 * (mManifestDigest==null?1:mManifestDigest.hashCode());
- hash += 17 * mInstallerUid;
+ hash += 5 * (mVerificationURI == null ? 1 : mVerificationURI.hashCode());
+ hash += 7 * (mOriginatingURI == null ? 1 : mOriginatingURI.hashCode());
+ hash += 11 * (mReferrer == null ? 1 : mReferrer.hashCode());
+ hash += 13 * mOriginatingUid;
+ hash += 17 * (mManifestDigest == null ? 1 : mManifestDigest.hashCode());
+ hash += 19 * mInstallerUid;
return hash;
}
@@ -169,6 +192,8 @@ public class VerificationParams implements Parcelable {
sb.append(mOriginatingURI.toString());
sb.append(",mReferrer=");
sb.append(mReferrer.toString());
+ sb.append(",mOriginatingUid=");
+ sb.append(mOriginatingUid);
sb.append(",mManifestDigest=");
sb.append(mManifestDigest.toString());
sb.append(",mInstallerUid=");
@@ -183,6 +208,7 @@ public class VerificationParams implements Parcelable {
dest.writeParcelable(mVerificationURI, 0);
dest.writeParcelable(mOriginatingURI, 0);
dest.writeParcelable(mReferrer, 0);
+ dest.writeInt(mOriginatingUid);
dest.writeParcelable(mManifestDigest, 0);
dest.writeInt(mInstallerUid);
}
@@ -192,6 +218,7 @@ public class VerificationParams implements Parcelable {
mVerificationURI = source.readParcelable(Uri.class.getClassLoader());
mOriginatingURI = source.readParcelable(Uri.class.getClassLoader());
mReferrer = source.readParcelable(Uri.class.getClassLoader());
+ mOriginatingUid = source.readInt();
mManifestDigest = source.readParcelable(ManifestDigest.class.getClassLoader());
mInstallerUid = source.readInt();
}
diff --git a/core/java/android/provider/ContactsContract.java b/core/java/android/provider/ContactsContract.java
index b3ab385..5b49ba3 100755
--- a/core/java/android/provider/ContactsContract.java
+++ b/core/java/android/provider/ContactsContract.java
@@ -7659,6 +7659,54 @@ public final class ContactsContract {
public static final int MODE_LARGE = 3;
/**
+ * Constructs the QuickContacts intent with a view's rect.
+ * @hide
+ */
+ public static Intent composeQuickContactsIntent(Context context, View target, Uri lookupUri,
+ int mode, String[] excludeMimes) {
+ // Find location and bounds of target view, adjusting based on the
+ // assumed local density.
+ final float appScale = context.getResources().getCompatibilityInfo().applicationScale;
+ final int[] pos = new int[2];
+ target.getLocationOnScreen(pos);
+
+ final Rect rect = new Rect();
+ rect.left = (int) (pos[0] * appScale + 0.5f);
+ rect.top = (int) (pos[1] * appScale + 0.5f);
+ rect.right = (int) ((pos[0] + target.getWidth()) * appScale + 0.5f);
+ rect.bottom = (int) ((pos[1] + target.getHeight()) * appScale + 0.5f);
+
+ return composeQuickContactsIntent(context, rect, lookupUri, mode, excludeMimes);
+ }
+
+ /**
+ * Constructs the QuickContacts intent.
+ * @hide
+ */
+ public static Intent composeQuickContactsIntent(Context context, Rect target,
+ Uri lookupUri, int mode, String[] excludeMimes) {
+ // When launching from an Activiy, we don't want to start a new task, but otherwise
+ // we *must* start a new task. (Otherwise startActivity() would crash.)
+ Context actualContext = context;
+ while ((actualContext instanceof ContextWrapper)
+ && !(actualContext instanceof Activity)) {
+ actualContext = ((ContextWrapper) actualContext).getBaseContext();
+ }
+ final int intentFlags = (actualContext instanceof Activity)
+ ? Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET
+ : Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK;
+
+ // Launch pivot dialog through intent for now
+ final Intent intent = new Intent(ACTION_QUICK_CONTACT).addFlags(intentFlags);
+
+ intent.setData(lookupUri);
+ intent.setSourceBounds(target);
+ intent.putExtra(EXTRA_MODE, mode);
+ intent.putExtra(EXTRA_EXCLUDE_MIMES, excludeMimes);
+ return intent;
+ }
+
+ /**
* Trigger a dialog that lists the various methods of interacting with
* the requested {@link Contacts} entry. This may be based on available
* {@link ContactsContract.Data} rows under that contact, and may also
@@ -7683,20 +7731,10 @@ public final class ContactsContract {
*/
public static void showQuickContact(Context context, View target, Uri lookupUri, int mode,
String[] excludeMimes) {
- // Find location and bounds of target view, adjusting based on the
- // assumed local density.
- final float appScale = context.getResources().getCompatibilityInfo().applicationScale;
- final int[] pos = new int[2];
- target.getLocationOnScreen(pos);
-
- final Rect rect = new Rect();
- rect.left = (int) (pos[0] * appScale + 0.5f);
- rect.top = (int) (pos[1] * appScale + 0.5f);
- rect.right = (int) ((pos[0] + target.getWidth()) * appScale + 0.5f);
- rect.bottom = (int) ((pos[1] + target.getHeight()) * appScale + 0.5f);
-
// Trigger with obtained rectangle
- showQuickContact(context, rect, lookupUri, mode, excludeMimes);
+ Intent intent = composeQuickContactsIntent(context, target, lookupUri, mode,
+ excludeMimes);
+ context.startActivity(intent);
}
/**
@@ -7727,25 +7765,9 @@ public final class ContactsContract {
*/
public static void showQuickContact(Context context, Rect target, Uri lookupUri, int mode,
String[] excludeMimes) {
- // When launching from an Activiy, we don't want to start a new task, but otherwise
- // we *must* start a new task. (Otherwise startActivity() would crash.)
- Context actualContext = context;
- while ((actualContext instanceof ContextWrapper)
- && !(actualContext instanceof Activity)) {
- actualContext = ((ContextWrapper) actualContext).getBaseContext();
- }
- final int intentFlags = (actualContext instanceof Activity)
- ? Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET
- : Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK;
-
- // Launch pivot dialog through intent for now
- final Intent intent = new Intent(ACTION_QUICK_CONTACT).addFlags(intentFlags);
-
- intent.setData(lookupUri);
- intent.setSourceBounds(target);
- intent.putExtra(EXTRA_MODE, mode);
- intent.putExtra(EXTRA_EXCLUDE_MIMES, excludeMimes);
- context.startActivityAsUser(intent, new UserHandle(UserHandle.USER_CURRENT));
+ Intent intent = composeQuickContactsIntent(context, target, lookupUri, mode,
+ excludeMimes);
+ context.startActivity(intent);
}
}
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
index 550713d..8825f58 100644
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -3141,6 +3141,12 @@ public final class Settings {
public static final String DEVICE_PROVISIONED = Global.DEVICE_PROVISIONED;
/**
+ * Whether the current user has been set up via setup wizard (0 = false, 1 = true)
+ * @hide
+ */
+ public static final String USER_SETUP_COMPLETE = "user_setup_complete";
+
+ /**
* List of input methods that are currently enabled. This is a string
* containing the IDs of all enabled input methods, each ID separated
* by ':'.
@@ -4619,13 +4625,6 @@ public final class Settings {
public static final String SMS_SHORT_CODE_RULE = "sms_short_code_rule";
/**
- * Prefix for SMS short code regex patterns (country code is appended).
- * @see com.android.internal.telephony.SmsUsageMonitor
- * @hide
- */
- public static final String SMS_SHORT_CODES_PREFIX = "sms_short_codes_";
-
- /**
* Used to disable Tethering on a device - defaults to true
* @hide
*/
diff --git a/core/java/android/view/ScaleGestureDetector.java b/core/java/android/view/ScaleGestureDetector.java
index b0a2711..4873860 100644
--- a/core/java/android/view/ScaleGestureDetector.java
+++ b/core/java/android/view/ScaleGestureDetector.java
@@ -19,6 +19,7 @@ package android.view;
import android.content.Context;
import android.os.SystemClock;
import android.util.FloatMath;
+import android.util.Log;
import java.util.Arrays;
@@ -223,10 +224,14 @@ public class ScaleGestureDetector {
* @param id pointer id to clear
* @see #addTouchHistory(MotionEvent)
*/
- private void removeTouchHistoryForId(int id) {
+ private boolean removeTouchHistoryForId(int id) {
+ if (id >= mTouchHistoryLastAccepted.length) {
+ return false;
+ }
mTouchHistoryLastAccepted[id] = Float.NaN;
mTouchHistoryDirection[id] = 0;
mTouchHistoryLastAcceptedTime[id] = 0;
+ return true;
}
/**
@@ -236,6 +241,11 @@ public class ScaleGestureDetector {
* @see #addTouchHistory(MotionEvent)
*/
private float getAdjustedTouchHistory(int id) {
+ if (id >= mTouchHistoryLastAccepted.length) {
+ Log.e(TAG, "Error retrieving adjusted touch history for id=" + id +
+ " - incomplete event stream?");
+ return 0;
+ }
return mTouchHistoryLastAccepted[id];
}
@@ -244,6 +254,10 @@ public class ScaleGestureDetector {
* @see #addTouchHistory(MotionEvent)
*/
private void clearTouchHistory() {
+ if (mTouchHistoryLastAccepted == null) {
+ // All three arrays will be null if this is the case; nothing to do.
+ return;
+ }
Arrays.fill(mTouchHistoryLastAccepted, Float.NaN);
Arrays.fill(mTouchHistoryDirection, 0);
Arrays.fill(mTouchHistoryLastAcceptedTime, 0);
@@ -333,7 +347,11 @@ public class ScaleGestureDetector {
final float focusY = sumY / div;
if (pointerUp) {
- removeTouchHistoryForId(event.getPointerId(event.getActionIndex()));
+ final int id = event.getPointerId(event.getActionIndex());
+ if (!removeTouchHistoryForId(id)) {
+ Log.e(TAG, "Got ACTION_POINTER_UP for previously unknown id=" + id +
+ " - incomplete event stream?");
+ }
} else {
addTouchHistory(event);
}
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index 111f959..f9ff865 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -5887,6 +5887,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
* layout attribute and/or the inherited value from the parent
*
* @return true if the layout is right-to-left.
+ *
+ * @hide
*/
@ViewDebug.ExportedProperty(category = "layout")
public boolean isLayoutRtl() {
@@ -11628,9 +11630,11 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
* Resolve and cache the layout direction. LTR is set initially. This is implicitly supposing
* that the parent directionality can and will be resolved before its children.
*
+ * @return true if resolution has been done, false otherwise.
+ *
* @hide
*/
- public void resolveLayoutDirection() {
+ public boolean resolveLayoutDirection() {
// Clear any previous layout direction resolution
mPrivateFlags2 &= ~PFLAG2_LAYOUT_DIRECTION_RESOLVED_MASK;
@@ -11641,15 +11645,13 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
case LAYOUT_DIRECTION_INHERIT:
// We cannot resolve yet. LTR is by default and let the resolution happen again
// later to get the correct resolved value
- if (!canResolveLayoutDirection()) return;
-
- ViewGroup viewGroup = ((ViewGroup) mParent);
+ if (!canResolveLayoutDirection()) return false;
- // We cannot resolve yet on the parent too. LTR is by default and let the
- // resolution happen again later
- if (!viewGroup.canResolveLayoutDirection()) return;
+ View parent = ((View) mParent);
+ // Parent has not yet resolved, LTR is still the default
+ if (!parent.isLayoutDirectionResolved()) return false;
- if (viewGroup.getLayoutDirection() == LAYOUT_DIRECTION_RTL) {
+ if (parent.getLayoutDirection() == LAYOUT_DIRECTION_RTL) {
mPrivateFlags2 |= PFLAG2_LAYOUT_DIRECTION_RESOLVED_RTL;
}
break;
@@ -11669,6 +11671,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
// Set to resolved
mPrivateFlags2 |= PFLAG2_LAYOUT_DIRECTION_RESOLVED;
+ return true;
}
/**
@@ -11679,10 +11682,10 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
* @hide
*/
public boolean canResolveLayoutDirection() {
- switch ((mPrivateFlags2 & PFLAG2_LAYOUT_DIRECTION_MASK) >>
- PFLAG2_LAYOUT_DIRECTION_MASK_SHIFT) {
+ switch (getRawLayoutDirection()) {
case LAYOUT_DIRECTION_INHERIT:
- return (mParent != null) && (mParent instanceof ViewGroup);
+ return (mParent != null) && (mParent instanceof ViewGroup) &&
+ ((ViewGroup) mParent).canResolveLayoutDirection();
default:
return true;
}
@@ -16640,9 +16643,11 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
/**
* Resolve the text direction.
*
+ * @return true if resolution has been done, false otherwise.
+ *
* @hide
*/
- public void resolveTextDirection() {
+ public boolean resolveTextDirection() {
// Reset any previous text direction resolution
mPrivateFlags2 &= ~(PFLAG2_TEXT_DIRECTION_RESOLVED | PFLAG2_TEXT_DIRECTION_RESOLVED_MASK);
@@ -16651,29 +16656,35 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
final int textDirection = getRawTextDirection();
switch(textDirection) {
case TEXT_DIRECTION_INHERIT:
- if (canResolveTextDirection()) {
- ViewGroup viewGroup = ((ViewGroup) mParent);
-
- // Set current resolved direction to the same value as the parent's one
- final int parentResolvedDirection = viewGroup.getTextDirection();
- switch (parentResolvedDirection) {
- case TEXT_DIRECTION_FIRST_STRONG:
- case TEXT_DIRECTION_ANY_RTL:
- case TEXT_DIRECTION_LTR:
- case TEXT_DIRECTION_RTL:
- case TEXT_DIRECTION_LOCALE:
- mPrivateFlags2 |=
- (parentResolvedDirection << PFLAG2_TEXT_DIRECTION_RESOLVED_MASK_SHIFT);
- break;
- default:
- // Default resolved direction is "first strong" heuristic
- mPrivateFlags2 |= PFLAG2_TEXT_DIRECTION_RESOLVED_DEFAULT;
- }
- } else {
+ if (!canResolveTextDirection()) {
// We cannot do the resolution if there is no parent, so use the default one
mPrivateFlags2 |= PFLAG2_TEXT_DIRECTION_RESOLVED_DEFAULT;
// Resolution will need to happen again later
- return;
+ return false;
+ }
+
+ View parent = ((View) mParent);
+ // Parent has not yet resolved, so we still return the default
+ if (!parent.isTextDirectionResolved()) {
+ mPrivateFlags2 |= PFLAG2_TEXT_DIRECTION_RESOLVED_DEFAULT;
+ // Resolution will need to happen again later
+ return false;
+ }
+
+ // Set current resolved direction to the same value as the parent's one
+ final int parentResolvedDirection = parent.getTextDirection();
+ switch (parentResolvedDirection) {
+ case TEXT_DIRECTION_FIRST_STRONG:
+ case TEXT_DIRECTION_ANY_RTL:
+ case TEXT_DIRECTION_LTR:
+ case TEXT_DIRECTION_RTL:
+ case TEXT_DIRECTION_LOCALE:
+ mPrivateFlags2 |=
+ (parentResolvedDirection << PFLAG2_TEXT_DIRECTION_RESOLVED_MASK_SHIFT);
+ break;
+ default:
+ // Default resolved direction is "first strong" heuristic
+ mPrivateFlags2 |= PFLAG2_TEXT_DIRECTION_RESOLVED_DEFAULT;
}
break;
case TEXT_DIRECTION_FIRST_STRONG:
@@ -16695,6 +16706,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
// Set to resolved
mPrivateFlags2 |= PFLAG2_TEXT_DIRECTION_RESOLVED;
+ return true;
}
/**
@@ -16705,7 +16717,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
private boolean canResolveTextDirection() {
switch (getRawTextDirection()) {
case TEXT_DIRECTION_INHERIT:
- return (mParent != null) && (mParent instanceof ViewGroup);
+ return (mParent != null) && (mParent instanceof View) &&
+ ((View) mParent).canResolveTextDirection();
default:
return true;
}
@@ -16835,9 +16848,11 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
/**
* Resolve the text alignment.
*
+ * @return true if resolution has been done, false otherwise.
+ *
* @hide
*/
- public void resolveTextAlignment() {
+ public boolean resolveTextAlignment() {
// Reset any previous text alignment resolution
mPrivateFlags2 &= ~(PFLAG2_TEXT_ALIGNMENT_RESOLVED | PFLAG2_TEXT_ALIGNMENT_RESOLVED_MASK);
@@ -16847,32 +16862,37 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
switch (textAlignment) {
case TEXT_ALIGNMENT_INHERIT:
// Check if we can resolve the text alignment
- if (canResolveTextAlignment() && mParent instanceof View) {
- View view = (View) mParent;
-
- final int parentResolvedTextAlignment = view.getTextAlignment();
- switch (parentResolvedTextAlignment) {
- case TEXT_ALIGNMENT_GRAVITY:
- case TEXT_ALIGNMENT_TEXT_START:
- case TEXT_ALIGNMENT_TEXT_END:
- case TEXT_ALIGNMENT_CENTER:
- case TEXT_ALIGNMENT_VIEW_START:
- case TEXT_ALIGNMENT_VIEW_END:
- // Resolved text alignment is the same as the parent resolved
- // text alignment
- mPrivateFlags2 |=
- (parentResolvedTextAlignment << PFLAG2_TEXT_ALIGNMENT_RESOLVED_MASK_SHIFT);
- break;
- default:
- // Use default resolved text alignment
- mPrivateFlags2 |= PFLAG2_TEXT_ALIGNMENT_RESOLVED_DEFAULT;
- }
- }
- else {
+ if (!canResolveTextAlignment()) {
// We cannot do the resolution if there is no parent so use the default
mPrivateFlags2 |= PFLAG2_TEXT_ALIGNMENT_RESOLVED_DEFAULT;
// Resolution will need to happen again later
- return;
+ return false;
+ }
+ View parent = (View) mParent;
+
+ // Parent has not yet resolved, so we still return the default
+ if (!parent.isTextAlignmentResolved()) {
+ mPrivateFlags2 |= PFLAG2_TEXT_ALIGNMENT_RESOLVED_DEFAULT;
+ // Resolution will need to happen again later
+ return false;
+ }
+
+ final int parentResolvedTextAlignment = parent.getTextAlignment();
+ switch (parentResolvedTextAlignment) {
+ case TEXT_ALIGNMENT_GRAVITY:
+ case TEXT_ALIGNMENT_TEXT_START:
+ case TEXT_ALIGNMENT_TEXT_END:
+ case TEXT_ALIGNMENT_CENTER:
+ case TEXT_ALIGNMENT_VIEW_START:
+ case TEXT_ALIGNMENT_VIEW_END:
+ // Resolved text alignment is the same as the parent resolved
+ // text alignment
+ mPrivateFlags2 |=
+ (parentResolvedTextAlignment << PFLAG2_TEXT_ALIGNMENT_RESOLVED_MASK_SHIFT);
+ break;
+ default:
+ // Use default resolved text alignment
+ mPrivateFlags2 |= PFLAG2_TEXT_ALIGNMENT_RESOLVED_DEFAULT;
}
break;
case TEXT_ALIGNMENT_GRAVITY:
@@ -16895,6 +16915,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
// Set the resolved
mPrivateFlags2 |= PFLAG2_TEXT_ALIGNMENT_RESOLVED;
+ return true;
}
/**
@@ -16905,7 +16926,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
private boolean canResolveTextAlignment() {
switch (getRawTextAlignment()) {
case TEXT_DIRECTION_INHERIT:
- return (mParent != null);
+ return (mParent != null) && (mParent instanceof View) &&
+ ((View) mParent).canResolveTextAlignment();
default:
return true;
}
diff --git a/core/java/android/view/ViewDebug.java b/core/java/android/view/ViewDebug.java
index 1286eb9..c013d85 100644
--- a/core/java/android/view/ViewDebug.java
+++ b/core/java/android/view/ViewDebug.java
@@ -1178,10 +1178,14 @@ public class ViewDebug {
private static void writeValue(BufferedWriter out, Object value) throws IOException {
if (value != null) {
- String output = value.toString().replace("\n", "\\n");
- out.write(String.valueOf(output.length()));
- out.write(",");
- out.write(output);
+ String output = "[EXCEPTION]";
+ try {
+ output = value.toString().replace("\n", "\\n");
+ } finally {
+ out.write(String.valueOf(output.length()));
+ out.write(",");
+ out.write(output);
+ }
} else {
out.write("4,null");
}
diff --git a/core/java/android/view/ViewGroup.java b/core/java/android/view/ViewGroup.java
index 41890d6..db1c00a 100644
--- a/core/java/android/view/ViewGroup.java
+++ b/core/java/android/view/ViewGroup.java
@@ -3382,6 +3382,11 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
ai.mKeepScreenOn = lastKeepOn;
}
+ if (child.isLayoutDirectionInherited()) {
+ child.resetResolvedLayoutDirection();
+ child.resolveRtlPropertiesIfNeeded();
+ }
+
onViewAdded(child);
if ((child.mViewFlags & DUPLICATE_PARENT_STATE) == DUPLICATE_PARENT_STATE) {
@@ -5256,48 +5261,54 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
* @hide
*/
@Override
- public void resolveLayoutDirection() {
- super.resolveLayoutDirection();
-
- int count = getChildCount();
- for (int i = 0; i < count; i++) {
- final View child = getChildAt(i);
- if (child.isLayoutDirectionInherited()) {
- child.resolveLayoutDirection();
+ public boolean resolveLayoutDirection() {
+ final boolean result = super.resolveLayoutDirection();
+ if (result) {
+ int count = getChildCount();
+ for (int i = 0; i < count; i++) {
+ final View child = getChildAt(i);
+ if (child.isLayoutDirectionInherited()) {
+ child.resolveLayoutDirection();
+ }
}
}
+ return result;
}
/**
* @hide
*/
@Override
- public void resolveTextDirection() {
- super.resolveTextDirection();
-
- int count = getChildCount();
- for (int i = 0; i < count; i++) {
- final View child = getChildAt(i);
- if (child.isTextDirectionInherited()) {
- child.resolveTextDirection();
+ public boolean resolveTextDirection() {
+ final boolean result = super.resolveTextDirection();
+ if (result) {
+ int count = getChildCount();
+ for (int i = 0; i < count; i++) {
+ final View child = getChildAt(i);
+ if (child.isTextDirectionInherited()) {
+ child.resolveTextDirection();
+ }
}
}
+ return result;
}
/**
* @hide
*/
@Override
- public void resolveTextAlignment() {
- super.resolveTextAlignment();
-
- int count = getChildCount();
- for (int i = 0; i < count; i++) {
- final View child = getChildAt(i);
- if (child.isTextAlignmentInherited()) {
- child.resolveTextAlignment();
+ public boolean resolveTextAlignment() {
+ final boolean result = super.resolveTextAlignment();
+ if (result) {
+ int count = getChildCount();
+ for (int i = 0; i < count; i++) {
+ final View child = getChildAt(i);
+ if (child.isTextAlignmentInherited()) {
+ child.resolveTextAlignment();
+ }
}
}
+ return result;
}
/**
@@ -5893,7 +5904,10 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
}
}
- protected boolean isLayoutRtl() {
+ /**
+ * @hide
+ */
+ public boolean isLayoutRtl() {
return (layoutDirection == View.LAYOUT_DIRECTION_RTL);
}
diff --git a/core/java/android/widget/Gallery.java b/core/java/android/widget/Gallery.java
index b72b8cb..e0c5bbd 100644
--- a/core/java/android/widget/Gallery.java
+++ b/core/java/android/widget/Gallery.java
@@ -182,6 +182,12 @@ public class Gallery extends AbsSpinner implements GestureDetector.OnGestureList
*/
private boolean mIsRtl = true;
+ /**
+ * Offset between the center of the selected child view and the center of the Gallery.
+ * Used to reset position correctly during layout.
+ */
+ private int mSelectedCenterOffset;
+
public Gallery(Context context) {
this(context, null);
}
@@ -395,6 +401,14 @@ public class Gallery extends AbsSpinner implements GestureDetector.OnGestureList
setSelectionToCenterChild();
+ final View selChild = mSelectedChild;
+ if (selChild != null) {
+ final int childLeft = selChild.getLeft();
+ final int childCenter = selChild.getWidth() / 2;
+ final int galleryCenter = getWidth() / 2;
+ mSelectedCenterOffset = childLeft + childCenter - galleryCenter;
+ }
+
onScrollChanged(0, 0, 0, 0); // dummy values, View's implementation does not use these.
invalidate();
@@ -537,6 +551,7 @@ public class Gallery extends AbsSpinner implements GestureDetector.OnGestureList
// We haven't been callbacking during the fling, so do it now
super.selectionChanged();
}
+ mSelectedCenterOffset = 0;
invalidate();
}
@@ -650,7 +665,8 @@ public class Gallery extends AbsSpinner implements GestureDetector.OnGestureList
View sel = makeAndAddView(mSelectedPosition, 0, 0, true);
// Put the selected child in the center
- int selectedOffset = childrenLeft + (childrenWidth / 2) - (sel.getWidth() / 2);
+ int selectedOffset = childrenLeft + (childrenWidth / 2) - (sel.getWidth() / 2) +
+ mSelectedCenterOffset;
sel.offsetLeftAndRight(selectedOffset);
fillToGalleryRight();
diff --git a/core/java/android/widget/NumberPicker.java b/core/java/android/widget/NumberPicker.java
index 704f6b6..4918e48 100644
--- a/core/java/android/widget/NumberPicker.java
+++ b/core/java/android/widget/NumberPicker.java
@@ -1361,6 +1361,14 @@ public class NumberPicker extends LinearLayout {
// Allow text entry rather than strictly numeric entry.
mInputText.setRawInputType(InputType.TYPE_CLASS_TEXT
| InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);
+ // Make sure the min, max, respect the size of the displayed
+ // values. This will take care of the current value as well.
+ if (getMinValue() >= displayedValues.length) {
+ setMinValue(0);
+ }
+ if (getMaxValue() >= displayedValues.length) {
+ setMaxValue(displayedValues.length - 1);
+ }
} else {
mInputText.setRawInputType(InputType.TYPE_CLASS_NUMBER);
}
diff --git a/core/java/com/android/internal/app/MediaRouteChooserDialogFragment.java b/core/java/com/android/internal/app/MediaRouteChooserDialogFragment.java
index f010d7b..386f387 100644
--- a/core/java/com/android/internal/app/MediaRouteChooserDialogFragment.java
+++ b/core/java/com/android/internal/app/MediaRouteChooserDialogFragment.java
@@ -25,7 +25,7 @@ import android.app.MediaRouteActionProvider;
import android.app.MediaRouteButton;
import android.content.Context;
import android.graphics.drawable.Drawable;
-import android.media.AudioManager;
+import android.hardware.display.DisplayManager;
import android.media.MediaRouter;
import android.media.MediaRouter.RouteCategory;
import android.media.MediaRouter.RouteGroup;
@@ -70,6 +70,7 @@ public class MediaRouteChooserDialogFragment extends DialogFragment {
};
MediaRouter mRouter;
+ DisplayManager mDisplayService;
private int mRouteTypes;
private LayoutInflater mInflater;
@@ -97,6 +98,7 @@ public class MediaRouteChooserDialogFragment extends DialogFragment {
public void onAttach(Activity activity) {
super.onAttach(activity);
mRouter = (MediaRouter) activity.getSystemService(Context.MEDIA_ROUTER_SERVICE);
+ mDisplayService = (DisplayManager) activity.getSystemService(Context.DISPLAY_SERVICE);
}
@Override
@@ -119,6 +121,15 @@ public class MediaRouteChooserDialogFragment extends DialogFragment {
public void setRouteTypes(int types) {
mRouteTypes = types;
+ if ((mRouteTypes & MediaRouter.ROUTE_TYPE_LIVE_VIDEO) != 0 && mDisplayService == null) {
+ final Context activity = getActivity();
+ if (activity != null) {
+ mDisplayService = (DisplayManager) activity.getSystemService(
+ Context.DISPLAY_SERVICE);
+ }
+ } else {
+ mDisplayService = null;
+ }
}
void updateVolume() {
@@ -194,6 +205,9 @@ public class MediaRouteChooserDialogFragment extends DialogFragment {
@Override
public void onResume() {
super.onResume();
+ if (mDisplayService != null) {
+ mDisplayService.scanWifiDisplays();
+ }
}
private static class ViewHolder {
@@ -253,7 +267,9 @@ public class MediaRouteChooserDialogFragment extends DialogFragment {
final RouteCategory cat = mRouter.getCategoryAt(i);
routes = cat.getRoutes(mCatRouteList);
- mItems.add(cat);
+ if (!cat.isSystem()) {
+ mItems.add(cat);
+ }
if (cat == mCategoryEditingGroups) {
addGroupEditingCategoryRoutes(routes);
@@ -370,6 +386,7 @@ public class MediaRouteChooserDialogFragment extends DialogFragment {
public boolean isEnabled(int position) {
switch (getItemViewType(position)) {
case VIEW_ROUTE:
+ return ((RouteInfo) mItems.get(position)).isEnabled();
case VIEW_GROUPING_ROUTE:
case VIEW_GROUPING_DONE:
return true;
@@ -434,6 +451,7 @@ public class MediaRouteChooserDialogFragment extends DialogFragment {
}
convertView.setActivated(position == mSelectedItemPosition);
+ convertView.setEnabled(isEnabled(position));
return convertView;
}
diff --git a/core/java/com/android/internal/statusbar/IStatusBar.aidl b/core/java/com/android/internal/statusbar/IStatusBar.aidl
index 0737b52..780f5b3 100644
--- a/core/java/com/android/internal/statusbar/IStatusBar.aidl
+++ b/core/java/com/android/internal/statusbar/IStatusBar.aidl
@@ -28,10 +28,9 @@ oneway interface IStatusBar
void updateNotification(IBinder key, in StatusBarNotification notification);
void removeNotification(IBinder key);
void disable(int state);
- void animateExpandNotifications();
- void animateCollapseNotifications();
- void animateExpandQuickSettings();
- void animateCollapseQuickSettings();
+ void animateExpandNotificationsPanel();
+ void animateExpandSettingsPanel();
+ void animateCollapsePanels();
void setSystemUiVisibility(int vis, int mask);
void topAppWindowChanged(boolean menuVisible);
void setImeWindowStatus(in IBinder token, int vis, int backDisposition);
diff --git a/core/java/com/android/internal/statusbar/IStatusBarService.aidl b/core/java/com/android/internal/statusbar/IStatusBarService.aidl
index 60e2b34..600c27a 100644
--- a/core/java/com/android/internal/statusbar/IStatusBarService.aidl
+++ b/core/java/com/android/internal/statusbar/IStatusBarService.aidl
@@ -24,16 +24,15 @@ import com.android.internal.statusbar.StatusBarNotification;
/** @hide */
interface IStatusBarService
{
- void expandNotifications();
- void collapseNotifications();
- void expandQuickSettings();
- void collapseQuickSettings();
+ void expandNotificationsPanel();
+ void collapsePanels();
void disable(int what, IBinder token, String pkg);
void setIcon(String slot, String iconPackage, int iconId, int iconLevel, String contentDescription);
void setIconVisibility(String slot, boolean visible);
void removeIcon(String slot);
void topAppWindowChanged(boolean menuVisible);
void setImeWindowStatus(in IBinder token, int vis, int backDisposition);
+ void expandSettingsPanel();
// ---- Methods below are for use by the status bar policy services ----
// You need the STATUS_BAR_SERVICE permission
diff --git a/core/jni/android/graphics/TextLayoutCache.cpp b/core/jni/android/graphics/TextLayoutCache.cpp
index 8032ed8..ba8cea4 100644
--- a/core/jni/android/graphics/TextLayoutCache.cpp
+++ b/core/jni/android/graphics/TextLayoutCache.cpp
@@ -686,23 +686,24 @@ void TextLayoutShaper::computeRunValues(const SkPaint* paint, const UChar* chars
i, HBFixedToFloat(mShaperItem.advances[i]));
}
#endif
- // Get Advances and their total
- jfloat currentAdvance = HBFixedToFloat(mShaperItem.advances[mShaperItem.log_clusters[0]]);
- jfloat totalFontRunAdvance = currentAdvance;
- outAdvances->replaceAt(currentAdvance, startScriptRun);
- for (size_t i = 1; i < countScriptRun; i++) {
- size_t clusterPrevious = mShaperItem.log_clusters[i - 1];
+ jfloat totalFontRunAdvance = 0;
+ size_t clusterStart = 0;
+ for (size_t i = 0; i < countScriptRun; i++) {
size_t cluster = mShaperItem.log_clusters[i];
- if (cluster != clusterPrevious) {
- currentAdvance = HBFixedToFloat(mShaperItem.advances[mShaperItem.log_clusters[i]]);
- outAdvances->replaceAt(currentAdvance, startScriptRun + i);
+ size_t clusterNext = i == countScriptRun - 1 ? mShaperItem.num_glyphs :
+ mShaperItem.log_clusters[i + 1];
+ if (cluster != clusterNext) {
+ jfloat advance = 0;
+ // The advance for the cluster is the sum of the advances of all glyphs within
+ // the cluster.
+ for (size_t j = cluster; j < clusterNext; j++) {
+ advance += HBFixedToFloat(mShaperItem.advances[j]);
+ }
+ totalFontRunAdvance += advance;
+ outAdvances->replaceAt(advance, startScriptRun + clusterStart);
+ clusterStart = i + 1;
}
}
- // TODO: can be removed and go back in the previous loop when Harfbuzz log clusters are fixed
- for (size_t i = 1; i < mShaperItem.num_glyphs; i++) {
- currentAdvance = HBFixedToFloat(mShaperItem.advances[i]);
- totalFontRunAdvance += currentAdvance;
- }
#if DEBUG_ADVANCES
ALOGD("Returned advances");
diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml
index 08cafb8..9801d98 100644
--- a/core/res/AndroidManifest.xml
+++ b/core/res/AndroidManifest.xml
@@ -2153,6 +2153,12 @@
</intent-filter>
</receiver>
+ <receiver android:name="com.android.server.updates.SmsShortCodesInstallReceiver" >
+ <intent-filter>
+ <action android:name="android.intent.action.UPDATE_SMS_SHORT_CODES" />
+ </intent-filter>
+ </receiver>
+
<receiver android:name="com.android.server.MasterClearReceiver"
android:permission="android.permission.MASTER_CLEAR"
android:priority="100" >
diff --git a/core/res/res/drawable-hdpi/magnified_region_frame.9.png b/core/res/res/drawable-hdpi/magnified_region_frame.9.png
new file mode 100644
index 0000000..29bdc42
--- /dev/null
+++ b/core/res/res/drawable-hdpi/magnified_region_frame.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/magnified_region_frame.9.png b/core/res/res/drawable-mdpi/magnified_region_frame.9.png
new file mode 100644
index 0000000..a61cbea
--- /dev/null
+++ b/core/res/res/drawable-mdpi/magnified_region_frame.9.png
Binary files differ
diff --git a/core/res/res/drawable-nodpi/magnified_region_frame.9.png b/core/res/res/drawable-nodpi/magnified_region_frame.9.png
deleted file mode 100644
index 4cadefb..0000000
--- a/core/res/res/drawable-nodpi/magnified_region_frame.9.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/magnified_region_frame.9.png b/core/res/res/drawable-xhdpi/magnified_region_frame.9.png
new file mode 100644
index 0000000..424b3d9
--- /dev/null
+++ b/core/res/res/drawable-xhdpi/magnified_region_frame.9.png
Binary files differ
diff --git a/core/res/res/layout/media_route_list_item.xml b/core/res/res/layout/media_route_list_item.xml
index 53d813e..423d544 100644
--- a/core/res/res/layout/media_route_list_item.xml
+++ b/core/res/res/layout/media_route_list_item.xml
@@ -24,7 +24,8 @@
android:layout_height="56dp"
android:scaleType="center"
android:id="@+id/icon"
- android:visibility="gone" />
+ android:visibility="gone"
+ android:duplicateParentState="true" />
<LinearLayout android:layout_width="0dp"
android:layout_height="match_parent"
@@ -32,21 +33,24 @@
android:orientation="vertical"
android:gravity="start|center_vertical"
android:paddingStart="?android:attr/listPreferredItemPaddingStart"
- android:paddingEnd="?android:attr/listPreferredItemPaddingEnd">
+ android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
+ android:duplicateParentState="true">
<TextView android:id="@android:id/text1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:ellipsize="marquee"
- android:textAppearance="?android:attr/textAppearanceMedium" />
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:duplicateParentState="true" />
<TextView android:id="@android:id/text2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:ellipsize="marquee"
- android:textAppearance="?android:attr/textAppearanceSmall" />
+ android:textAppearance="?android:attr/textAppearanceSmall"
+ android:duplicateParentState="true" />
</LinearLayout>
<ImageButton
@@ -56,6 +60,7 @@
android:background="?android:attr/selectableItemBackground"
android:src="@drawable/ic_media_group_expand"
android:scaleType="center"
- android:visibility="gone" />
+ android:visibility="gone"
+ android:duplicateParentState="true" />
</LinearLayout>
diff --git a/core/res/res/values-sw600dp/bools.xml b/core/res/res/values-sw600dp/bools.xml
index 751b997..2f65eab 100644
--- a/core/res/res/values-sw600dp/bools.xml
+++ b/core/res/res/values-sw600dp/bools.xml
@@ -16,5 +16,5 @@
<resources>
<bool name="target_honeycomb_needs_options_menu">false</bool>
- <bool name="show_ongoing_ime_switcher">false</bool>
+ <bool name="show_ongoing_ime_switcher">true</bool>
</resources>
diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml
index 02aa537..1b56c29 100755
--- a/core/res/res/values/strings.xml
+++ b/core/res/res/values/strings.xml
@@ -3768,8 +3768,8 @@
<!-- Name of the default audio route when an audio dock is connected. [CHAR LIMIT=50] -->
<string name="default_audio_route_name_dock_speakers">Dock speakers</string>
- <!-- Name of the default audio route when HDMI is connected. [CHAR LIMIT=50] -->
- <string name="default_audio_route_name_hdmi">HDMI audio</string>
+ <!-- Name of the default media route when HDMI is connected. [CHAR LIMIT=50] -->
+ <string name="default_media_route_name_hdmi">HDMI</string>
<!-- Name of the default audio route category. [CHAR LIMIT=50] -->
<string name="default_audio_route_category_name">System</string>
@@ -3783,6 +3783,18 @@
<!-- Content description of a MediaRouteButton for accessibility support -->
<string name="media_route_button_content_description">Media output</string>
+ <!-- Status message for remote routes attempting to scan/determine availability -->
+ <string name="media_route_status_scanning">Scanning...</string>
+
+ <!-- Status message for a remote route attempting to connect -->
+ <string name="media_route_status_connecting">Connecting...</string>
+
+ <!-- Status message for a remote route that is confirmed to be available for connection -->
+ <string name="media_route_status_available">Available</string>
+
+ <!-- Status message for remote routes that are not available for connection right now -->
+ <string name="media_route_status_not_available">Not available</string>
+
<!-- Display manager service -->
<!-- Name of the built-in display. [CHAR LIMIT=50] -->
diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml
index 9a4136b..966e457 100644
--- a/core/res/res/values/symbols.xml
+++ b/core/res/res/values/symbols.xml
@@ -823,9 +823,13 @@
<java-symbol type="string" name="default_audio_route_name" />
<java-symbol type="string" name="default_audio_route_name_headphones" />
<java-symbol type="string" name="default_audio_route_name_dock_speakers" />
- <java-symbol type="string" name="default_audio_route_name_hdmi" />
+ <java-symbol type="string" name="default_media_route_name_hdmi" />
<java-symbol type="string" name="default_audio_route_category_name" />
<java-symbol type="string" name="safe_media_volume_warning" />
+ <java-symbol type="string" name="media_route_status_scanning" />
+ <java-symbol type="string" name="media_route_status_connecting" />
+ <java-symbol type="string" name="media_route_status_available" />
+ <java-symbol type="string" name="media_route_status_not_available" />
<java-symbol type="plurals" name="abbrev_in_num_days" />
<java-symbol type="plurals" name="abbrev_in_num_hours" />
@@ -1088,7 +1092,6 @@
<java-symbol type="xml" name="kg_password_kbd_numeric" />
<java-symbol type="xml" name="power_profile" />
<java-symbol type="xml" name="time_zones_by_country" />
- <java-symbol type="xml" name="sms_short_codes" />
<java-symbol type="raw" name="accessibility_gestures" />
<java-symbol type="raw" name="incognito_mode_start_page" />
diff --git a/core/res/res/xml/sms_short_codes.xml b/core/res/res/xml/sms_short_codes.xml
deleted file mode 100644
index 8b395af..0000000
--- a/core/res/res/xml/sms_short_codes.xml
+++ /dev/null
@@ -1,189 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
-** Copyright 2012, 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.
-*/
--->
-
-<!-- Regex patterns for SMS short codes by country. -->
-<shortcodes>
-
- <!-- The country attribute is the ISO country code of the user's account (from SIM card or NV).
- The pattern attribute is a regex that matches all SMS short codes for the country.
- The premium attribute is a regex that matches premium rate SMS short codes.
- The free attribute matches short codes that we know will not cost the user, such as
- emergency numbers. The standard attribute matches short codes that are billed at the
- standard SMS rate. The user is warned when the destination phone number matches the
- "pattern" or "premium" regexes, and does not match the "free" or "standard" regexes. -->
-
- <!-- Harmonised European Short Codes are 6 digit numbers starting with 116 (free helplines).
- Premium patterns include short codes from: http://aonebill.com/coverage&tariffs
- and http://mobilcent.com/info-worldwide.asp and extracted from:
- http://smscoin.net/software/engine/WordPress/Paid+SMS-registration/ -->
-
- <!-- Albania: 5 digits, known short codes listed -->
- <shortcode country="al" pattern="\\d{5}" premium="15191|55[56]00" />
-
- <!-- Armenia: 3-4 digits, emergency numbers 10[123] -->
- <shortcode country="am" pattern="\\d{3,4}" premium="11[2456]1|3024" free="10[123]" />
-
- <!-- Austria: 10 digits, premium prefix 09xx, plus EU -->
- <shortcode country="at" pattern="11\\d{4}" premium="09.*" free="116\\d{3}" />
-
- <!-- Australia: 6 or 8 digits starting with "19" -->
- <shortcode country="au" pattern="19(?:\\d{4}|\\d{6})" premium="19998882" />
-
- <!-- Azerbaijan: 4-5 digits, known premium codes listed -->
- <shortcode country="az" pattern="\\d{4,5}" premium="330[12]|87744|901[234]|93(?:94|101)|9426|9525" />
-
- <!-- Belgium: 4 digits, plus EU: http://www.mobileweb.be/en/mobileweb/sms-numberplan.asp -->
- <shortcode country="be" premium="\\d{4}" free="8\\d{3}|116\\d{3}" />
-
- <!-- Bulgaria: 4-5 digits, plus EU -->
- <shortcode country="bg" pattern="\\d{4,5}" premium="18(?:16|423)|19(?:1[56]|35)" free="116\\d{3}" />
-
- <!-- Belarus: 4 digits -->
- <shortcode country="by" pattern="\\d{4}" premium="3336|4161|444[4689]|501[34]|7781" />
-
- <!-- Canada: 5-6 digits -->
- <shortcode country="ca" pattern="\\d{5,6}" premium="60999|88188" />
-
- <!-- Switzerland: 3-5 digits: http://www.swisscom.ch/fxres/kmu/thirdpartybusiness_code_of_conduct_en.pdf -->
- <shortcode country="ch" pattern="[2-9]\\d{2,4}" premium="543|83111" />
-
- <!-- China: premium shortcodes start with "1066", free shortcodes start with "1065":
- http://clients.txtnation.com/entries/197192-china-premium-sms-short-code-requirements -->
- <shortcode country="cn" premium="1066.*" free="1065.*" />
-
- <!-- Cyprus: 4-6 digits (not confirmed), known premium codes listed, plus EU -->
- <shortcode country="cy" pattern="\\d{4,6}" premium="7510" free="116\\d{3}" />
-
- <!-- Czech Republic: 7-8 digits, starting with 9, plus EU:
- http://www.o2.cz/osobni/en/services-by-alphabet/91670-premium_sms.html -->
- <shortcode country="cz" premium="9\\d{6,7}" free="116\\d{3}" />
-
- <!-- Germany: 4-5 digits plus 1232xxx (premium codes from http://www.vodafone.de/infofaxe/537.pdf and http://premiumdienste.eplus.de/pdf/kodex.pdf), plus EU. To keep the premium regex from being too large, it only includes payment processors that have been used by SMS malware, with the regular pattern matching the other premium short codes. -->
- <shortcode country="de" pattern="\\d{4,5}|1232\\d{3}" premium="11(?:111|833)|1232(?:013|021|060|075|286|358)|118(?:44|80|86)|20[25]00|220(?:21|22|88|99)|221(?:14|21)|223(?:44|53|77)|224[13]0|225(?:20|59|90)|226(?:06|10|20|26|30|40|56|70)|227(?:07|33|39|66|76|78|79|88|99)|228(?:08|11|66|77)|23300|30030|3[12347]000|330(?:33|55|66)|33(?:233|331|366|533)|34(?:34|567)|37000|40(?:040|123|444|[3568]00)|41(?:010|414)|44(?:000|044|344|44[24]|544)|50005|50100|50123|50555|51000|52(?:255|783)|54(?:100|2542)|55(?:077|[24]00|222|333|55|[12369]55)|56(?:789|886)|60800|6[13]000|66(?:[12348]66|566|766|777|88|999)|68888|70(?:07|123|777)|76766|77(?:007|070|222|444|[567]77)|80(?:008|123|888)|82(?:002|[378]00|323|444|472|474|488|727)|83(?:005|[169]00|333|830)|84(?:141|300|32[34]|343|488|499|777|888)|85888|86(?:188|566|640|644|650|677|868|888)|870[24]9|871(?:23|[49]9)|872(?:1[0-8]|49|99)|87499|875(?:49|55|99)|876(?:0[1367]|1[1245678]|54|99)|877(?:00|99)|878(?:15|25|3[567]|8[12])|87999|880(?:08|44|55|77|99)|88688|888(?:03|10|8|89)|8899|90(?:009|999)|99999" free="116\\d{3}" />
-
- <!-- Denmark: see http://iprs.webspacecommerce.com/Denmark-Premium-Rate-Numbers -->
- <shortcode country="dk" pattern="\\d{4,5}" premium="1\\d{3}" free="116\\d{3}" />
-
- <!-- Estonia: short codes 3-5 digits starting with 1, plus premium 7 digit numbers starting with 90, plus EU.
- http://www.tja.ee/public/documents/Elektrooniline_side/Oigusaktid/ENG/Estonian_Numbering_Plan_annex_06_09_2010.mht -->
- <shortcode country="ee" pattern="1\\d{2,4}" premium="90\\d{5}|15330|1701[0-3]" free="116\\d{3}" />
-
- <!-- Spain: 5-6 digits: 25xxx, 27xxx, 280xx, 35xxx, 37xxx, 795xxx, 797xxx, 995xxx, 997xxx, plus EU.
- http://www.legallink.es/?q=en/content/which-current-regulatory-status-premium-rate-services-spain -->
- <shortcode country="es" premium="[23][57]\\d{3}|280\\d{2}|[79]9[57]\\d{3}" free="116\\d{3}" />
-
- <!-- Finland: 5-6 digits, premium 0600, 0700: http://en.wikipedia.org/wiki/Telephone_numbers_in_Finland -->
- <shortcode country="fi" pattern="\\d{5,6}" premium="0600.*|0700.*|171(?:59|63)" free="116\\d{3}" />
-
- <!-- France: 5 digits, free: 3xxxx, premium [4-8]xxxx, plus EU:
- http://clients.txtnation.com/entries/161972-france-premium-sms-short-code-requirements -->
- <shortcode country="fr" premium="[4-8]\\d{4}" free="3\\d{4}|116\\d{3}" />
-
- <!-- United Kingdom (Great Britain): 4-6 digits, common codes [5-8]xxxx, plus EU:
- http://www.short-codes.com/media/Co-regulatoryCodeofPracticeforcommonshortcodes170206.pdf -->
- <shortcode country="gb" pattern="\\d{4,6}" premium="[5-8]\\d{4}" free="116\\d{3}" />
-
- <!-- Georgia: 4 digits, known premium codes listed -->
- <shortcode country="ge" pattern="\\d{4}" premium="801[234]|888[239]" />
-
- <!-- Greece: 5 digits (54xxx, 19yxx, x=0-9, y=0-5): http://www.cmtelecom.com/premium-sms/greece -->
- <shortcode country="gr" pattern="\\d{5}" premium="54\\d{3}|19[0-5]\\d{2}" free="116\\d{3}" />
-
- <!-- Hungary: 4 or 10 digits starting with 1 or 0, plus EU:
- http://clients.txtnation.com/entries/209633-hungary-premium-sms-short-code-regulations -->
- <shortcode country="hu" pattern="[01](?:\\d{3}|\\d{9})" premium="0691227910|1784" free="116\\d{3}" />
-
- <!-- Ireland: 5 digits, 5xxxx (50xxx=free, 5[12]xxx=standard), plus EU:
- http://www.comreg.ie/_fileupload/publications/ComReg1117.pdf -->
- <shortcode country="ie" pattern="\\d{5}" premium="5[3-9]\\d{3}" free="50\\d{3}|116\\d{3}" standard="5[12]\\d{3}" />
-
- <!-- Israel: 4 digits, known premium codes listed -->
- <shortcode country="il" pattern="\\d{4}" premium="4422|4545" />
-
- <!-- Italy: 5 digits (premium=4xxxx), plus EU:
- http://clients.txtnation.com/attachments/token/di5kfblvubttvlw/?name=Italy_CASP_EN.pdf -->
- <shortcode country="it" pattern="\\d{5}" premium="4\\d{4}" free="116\\d{3}" />
-
- <!-- Kyrgyzstan: 4 digits, known premium codes listed -->
- <shortcode country="kg" pattern="\\d{4}" premium="415[2367]|444[69]" />
-
- <!-- Kazakhstan: 4 digits, known premium codes listed: http://smscoin.net/info/pricing-kazakhstan/ -->
- <shortcode country="kz" pattern="\\d{4}" premium="335[02]|4161|444[469]|77[2359]0|8444|919[3-5]|968[2-5]" />
-
- <!-- Lithuania: 3-5 digits, known premium codes listed, plus EU -->
- <shortcode country="lt" pattern="\\d{3,5}" premium="13[89]1|1394|16[34]5" free="116\\d{3}" />
-
- <!-- Luxembourg: 5 digits, 6xxxx, plus EU:
- http://www.luxgsm.lu/assets/files/filepage/file_1253803400.pdf -->
- <shortcode country="lu" premium="6\\d{4}" free="116\\d{3}" />
-
- <!-- Latvia: 4 digits, known premium codes listed, plus EU -->
- <shortcode country="lv" pattern="\\d{4}" premium="18(?:19|63|7[1-4])" free="116\\d{3}" />
-
- <!-- Mexico: 4-5 digits (not confirmed), known premium codes listed -->
- <shortcode country="mx" pattern="\\d{4,5}" premium="53035|7766" />
-
- <!-- Malaysia: 5 digits: http://www.skmm.gov.my/attachment/Consumer_Regulation/Mobile_Content_Services_FAQs.pdf -->
- <shortcode country="my" pattern="\\d{5}" premium="32298|33776" />
-
- <!-- The Netherlands, 4 digits, known premium codes listed, plus EU -->
- <shortcode country="nl" pattern="\\d{4}" premium="4466|5040" free="116\\d{3}" />
-
- <!-- Norway: 4-5 digits (not confirmed), known premium codes listed -->
- <shortcode country="no" pattern="\\d{4,5}" premium="2201|222[67]" />
-
- <!-- New Zealand: 3-4 digits, known premium codes listed -->
- <shortcode country="nz" pattern="\\d{3,4}" premium="3903|8995" />
-
- <!-- Poland: 4-5 digits (not confirmed), known premium codes listed, plus EU -->
- <shortcode country="pl" pattern="\\d{4,5}" premium="74240|79(?:10|866)|92525" free="116\\d{3}" />
-
- <!-- Portugal: 5 digits, plus EU:
- http://clients.txtnation.com/entries/158326-portugal-premium-sms-short-code-regulations -->
- <shortcode country="pt" premium="6[1289]\\d{3}" free="116\\d{3}" />
-
- <!-- Romania: 4 digits, plus EU: http://www.simplus.ro/en/resources/glossary-of-terms/ -->
- <shortcode country="ro" pattern="\\d{4}" premium="12(?:63|66|88)|13(?:14|80)" free="116\\d{3}" />
-
- <!-- Russia: 4 digits, known premium codes listed: http://smscoin.net/info/pricing-russia/ -->
- <shortcode country="ru" pattern="\\d{4}" premium="1(?:1[56]1|899)|2(?:09[57]|322|47[46]|880|990)|3[589]33|4161|44(?:4[3-9]|81)|77(?:33|81)" />
-
- <!-- Sweden: 5 digits (72xxx), plus EU: http://www.viatel.se/en/premium-sms/ -->
- <shortcode country="se" premium="72\\d{3}" free="116\\d{3}" />
-
- <!-- Singapore: 5 digits: http://clients.txtnation.com/entries/306442-singapore-premium-sms-short-code-requirements
- Free government directory info at 74688: http://app.sgdi.gov.sg/sms_help.asp -->
- <shortcode country="sg" pattern="7\\d{4}" premium="73800" standard="74688" />
-
- <!-- Slovenia: 4 digits (premium=3xxx, 6xxx, 8xxx), plus EU: http://www.cmtelecom.com/premium-sms/slovenia -->
- <shortcode country="si" pattern="\\d{4}" premium="[368]\\d{3}" free="116\\d{3}" />
-
- <!-- Slovakia: 4 digits (premium), plus EU: http://www.cmtelecom.com/premium-sms/slovakia -->
- <shortcode country="sk" premium="\\d{4}" free="116\\d{3}" />
-
- <!-- Tajikistan: 4 digits, known premium codes listed -->
- <shortcode country="tj" pattern="\\d{4}" premium="11[3-7]1|4161|4333|444[689]" />
-
- <!-- Ukraine: 4 digits, known premium codes listed -->
- <shortcode country="ua" pattern="\\d{4}" premium="444[3-9]|70[579]4|7540" />
-
- <!-- USA: 5-6 digits (premium codes from https://www.premiumsmsrefunds.com/ShortCodes.htm) -->
- <shortcode country="us" pattern="\\d{5,6}" premium="20433|21(?:344|472)|22715|23(?:333|847)|24(?:15|28)0|25209|27(?:449|606|663)|28498|305(?:00|83)|32(?:340|941)|33(?:166|786|849)|34746|35(?:182|564)|37975|38(?:135|146|254)|41(?:366|463)|42335|43(?:355|500)|44(?:578|711|811)|45814|46(?:157|173|327)|46666|47553|48(?:221|277|669)|50(?:844|920)|51(?:062|368)|52944|54(?:723|892)|55928|56483|57370|59(?:182|187|252|342)|60339|61(?:266|982)|62478|64(?:219|898)|65(?:108|500)|69(?:208|388)|70877|71851|72(?:078|087|465)|73(?:288|588|882|909|997)|74(?:034|332|815)|76426|79213|81946|83177|84(?:103|685)|85797|86(?:234|236|666)|89616|90(?:715|842|938)|91(?:362|958)|94719|95297|96(?:040|666|835|969)|97(?:142|294|688)|99(?:689|796|807)" />
-
-</shortcodes>
diff --git a/core/tests/coretests/src/android/content/pm/VerificationParamsTest.java b/core/tests/coretests/src/android/content/pm/VerificationParamsTest.java
index 105bcba..9b216cb 100644
--- a/core/tests/coretests/src/android/content/pm/VerificationParamsTest.java
+++ b/core/tests/coretests/src/android/content/pm/VerificationParamsTest.java
@@ -40,11 +40,13 @@ public class VerificationParamsTest extends AndroidTestCase {
private final static Uri ORIGINATING_URI = Uri.parse(ORIGINATING_URI_STRING);
private final static Uri REFERRER = Uri.parse(REFERRER_STRING);
+ private final static int ORIGINATING_UID = 10042;
+
private final static ManifestDigest MANIFEST_DIGEST = new ManifestDigest(DIGEST_BYTES);
public void testParcel() throws Exception {
VerificationParams expected = new VerificationParams(VERIFICATION_URI, ORIGINATING_URI,
- REFERRER, MANIFEST_DIGEST);
+ REFERRER, ORIGINATING_UID, MANIFEST_DIGEST);
Parcel parcel = Parcel.obtain();
expected.writeToParcel(parcel, 0);
@@ -58,71 +60,86 @@ public class VerificationParamsTest extends AndroidTestCase {
assertEquals(REFERRER, actual.getReferrer());
+ assertEquals(ORIGINATING_UID, actual.getOriginatingUid());
+
assertEquals(MANIFEST_DIGEST, actual.getManifestDigest());
}
public void testEquals_Success() throws Exception {
VerificationParams params1 = new VerificationParams(VERIFICATION_URI, ORIGINATING_URI,
- REFERRER, MANIFEST_DIGEST);
+ REFERRER, ORIGINATING_UID, MANIFEST_DIGEST);
VerificationParams params2 = new VerificationParams(
Uri.parse(VERIFICATION_URI_STRING), Uri.parse(ORIGINATING_URI_STRING),
- Uri.parse(REFERRER_STRING), new ManifestDigest(DIGEST_BYTES));
+ Uri.parse(REFERRER_STRING), ORIGINATING_UID, new ManifestDigest(DIGEST_BYTES));
assertEquals(params1, params2);
}
public void testEquals_VerificationUri_Failure() throws Exception {
VerificationParams params1 = new VerificationParams(VERIFICATION_URI, ORIGINATING_URI,
- REFERRER, MANIFEST_DIGEST);
+ REFERRER, ORIGINATING_UID, MANIFEST_DIGEST);
VerificationParams params2 = new VerificationParams(
Uri.parse("http://a.different.uri/"), Uri.parse(ORIGINATING_URI_STRING),
- Uri.parse(REFERRER_STRING), new ManifestDigest(DIGEST_BYTES));
+ Uri.parse(REFERRER_STRING), ORIGINATING_UID, new ManifestDigest(DIGEST_BYTES));
assertFalse(params1.equals(params2));
}
public void testEquals_OriginatingUri_Failure() throws Exception {
VerificationParams params1 = new VerificationParams(VERIFICATION_URI, ORIGINATING_URI,
- REFERRER, MANIFEST_DIGEST);
+ REFERRER, ORIGINATING_UID, MANIFEST_DIGEST);
VerificationParams params2 = new VerificationParams(
Uri.parse(VERIFICATION_URI_STRING), Uri.parse("http://a.different.uri/"),
- Uri.parse(REFERRER_STRING), new ManifestDigest(DIGEST_BYTES));
+ Uri.parse(REFERRER_STRING), ORIGINATING_UID, new ManifestDigest(DIGEST_BYTES));
assertFalse(params1.equals(params2));
}
public void testEquals_Referrer_Failure() throws Exception {
VerificationParams params1 = new VerificationParams(VERIFICATION_URI, ORIGINATING_URI,
- REFERRER, MANIFEST_DIGEST);
+ REFERRER, ORIGINATING_UID, MANIFEST_DIGEST);
+
+ VerificationParams params2 = new VerificationParams(
+ Uri.parse(VERIFICATION_URI_STRING), Uri.parse(ORIGINATING_URI_STRING),
+ Uri.parse("http://a.different.uri/"), ORIGINATING_UID,
+ new ManifestDigest(DIGEST_BYTES));
+
+ assertFalse(params1.equals(params2));
+ }
+
+ public void testEquals_Originating_Uid_Failure() throws Exception {
+ VerificationParams params1 = new VerificationParams(VERIFICATION_URI, ORIGINATING_URI,
+ REFERRER, ORIGINATING_UID, MANIFEST_DIGEST);
VerificationParams params2 = new VerificationParams(
Uri.parse(VERIFICATION_URI_STRING), Uri.parse(ORIGINATING_URI_STRING),
- Uri.parse("http://a.different.uri/"), new ManifestDigest(DIGEST_BYTES));
+ Uri.parse(REFERRER_STRING), 12345, new ManifestDigest(DIGEST_BYTES));
assertFalse(params1.equals(params2));
}
public void testEquals_ManifestDigest_Failure() throws Exception {
VerificationParams params1 = new VerificationParams(VERIFICATION_URI, ORIGINATING_URI,
- REFERRER, MANIFEST_DIGEST);
+ REFERRER, ORIGINATING_UID, MANIFEST_DIGEST);
VerificationParams params2 = new VerificationParams(
Uri.parse(VERIFICATION_URI_STRING), Uri.parse(ORIGINATING_URI_STRING),
- Uri.parse(REFERRER_STRING), new ManifestDigest("a different digest".getBytes()));
+ Uri.parse(REFERRER_STRING), ORIGINATING_UID,
+ new ManifestDigest("a different digest".getBytes()));
assertFalse(params1.equals(params2));
}
public void testEquals_InstallerUid_Failure() throws Exception {
VerificationParams params1 = new VerificationParams(VERIFICATION_URI, ORIGINATING_URI,
- REFERRER, MANIFEST_DIGEST);
+ REFERRER, ORIGINATING_UID, MANIFEST_DIGEST);
VerificationParams params2 = new VerificationParams(
Uri.parse(VERIFICATION_URI_STRING), Uri.parse(ORIGINATING_URI_STRING),
- Uri.parse(REFERRER_STRING), new ManifestDigest(DIGEST_BYTES));
+ Uri.parse(REFERRER_STRING), ORIGINATING_UID, new ManifestDigest(DIGEST_BYTES));
params2.setInstallerUid(INSTALLER_UID);
assertFalse(params1.equals(params2));
@@ -130,65 +147,78 @@ public class VerificationParamsTest extends AndroidTestCase {
public void testHashCode_Success() throws Exception {
VerificationParams params1 = new VerificationParams(VERIFICATION_URI, ORIGINATING_URI,
- REFERRER, MANIFEST_DIGEST);
+ REFERRER, ORIGINATING_UID, MANIFEST_DIGEST);
VerificationParams params2 = new VerificationParams(
Uri.parse(VERIFICATION_URI_STRING), Uri.parse(ORIGINATING_URI_STRING),
- Uri.parse(REFERRER_STRING), new ManifestDigest(DIGEST_BYTES));
+ Uri.parse(REFERRER_STRING), ORIGINATING_UID, new ManifestDigest(DIGEST_BYTES));
assertEquals(params1.hashCode(), params2.hashCode());
}
public void testHashCode_VerificationUri_Failure() throws Exception {
VerificationParams params1 = new VerificationParams(VERIFICATION_URI, ORIGINATING_URI,
- REFERRER, MANIFEST_DIGEST);
+ REFERRER, ORIGINATING_UID, MANIFEST_DIGEST);
VerificationParams params2 = new VerificationParams(null, Uri.parse(ORIGINATING_URI_STRING),
- Uri.parse(REFERRER_STRING), new ManifestDigest(DIGEST_BYTES));
+ Uri.parse(REFERRER_STRING), ORIGINATING_UID, new ManifestDigest(DIGEST_BYTES));
assertFalse(params1.hashCode() == params2.hashCode());
}
public void testHashCode_OriginatingUri_Failure() throws Exception {
VerificationParams params1 = new VerificationParams(VERIFICATION_URI, ORIGINATING_URI,
- REFERRER, MANIFEST_DIGEST);
+ REFERRER, ORIGINATING_UID, MANIFEST_DIGEST);
VerificationParams params2 = new VerificationParams(
Uri.parse(VERIFICATION_URI_STRING), Uri.parse("http://a.different.uri/"),
- Uri.parse(REFERRER_STRING), new ManifestDigest(DIGEST_BYTES));
+ Uri.parse(REFERRER_STRING), ORIGINATING_UID, new ManifestDigest(DIGEST_BYTES));
assertFalse(params1.hashCode() == params2.hashCode());
}
public void testHashCode_Referrer_Failure() throws Exception {
VerificationParams params1 = new VerificationParams(VERIFICATION_URI, ORIGINATING_URI,
- REFERRER, MANIFEST_DIGEST);
+ REFERRER, ORIGINATING_UID, MANIFEST_DIGEST);
VerificationParams params2 = new VerificationParams(
Uri.parse(VERIFICATION_URI_STRING), Uri.parse(ORIGINATING_URI_STRING), null,
- new ManifestDigest(DIGEST_BYTES));
+ ORIGINATING_UID, new ManifestDigest(DIGEST_BYTES));
+
+ assertFalse(params1.hashCode() == params2.hashCode());
+ }
+
+ public void testHashCode_Originating_Uid_Failure() throws Exception {
+ VerificationParams params1 = new VerificationParams(VERIFICATION_URI, ORIGINATING_URI,
+ REFERRER, ORIGINATING_UID, MANIFEST_DIGEST);
+
+ VerificationParams params2 = new VerificationParams(
+ Uri.parse(VERIFICATION_URI_STRING), Uri.parse(ORIGINATING_URI_STRING),
+ Uri.parse(REFERRER_STRING), 12345, new ManifestDigest(DIGEST_BYTES));
assertFalse(params1.hashCode() == params2.hashCode());
}
public void testHashCode_ManifestDigest_Failure() throws Exception {
VerificationParams params1 = new VerificationParams(VERIFICATION_URI, ORIGINATING_URI,
- REFERRER, MANIFEST_DIGEST);
+ REFERRER, ORIGINATING_UID, MANIFEST_DIGEST);
VerificationParams params2 = new VerificationParams(
Uri.parse(VERIFICATION_URI_STRING), Uri.parse(ORIGINATING_URI_STRING),
- Uri.parse(REFERRER_STRING), new ManifestDigest("a different digest".getBytes()));
+ Uri.parse(REFERRER_STRING), ORIGINATING_UID,
+ new ManifestDigest("a different digest".getBytes()));
assertFalse(params1.hashCode() == params2.hashCode());
}
public void testHashCode_InstallerUid_Failure() throws Exception {
VerificationParams params1 = new VerificationParams(VERIFICATION_URI, ORIGINATING_URI,
- REFERRER, MANIFEST_DIGEST);
+ REFERRER, ORIGINATING_UID, MANIFEST_DIGEST);
VerificationParams params2 = new VerificationParams(
Uri.parse(VERIFICATION_URI_STRING), Uri.parse(ORIGINATING_URI_STRING),
- Uri.parse(REFERRER_STRING), new ManifestDigest("a different digest".getBytes()));
+ Uri.parse(REFERRER_STRING), ORIGINATING_UID,
+ new ManifestDigest("a different digest".getBytes()));
params2.setInstallerUid(INSTALLER_UID);
assertFalse(params1.hashCode() == params2.hashCode());