Merge "Frameworks: Make MockUtils more robust" into pi-dev
diff --git a/services/tests/servicestests/src/com/android/server/devicepolicy/MockUtils.java b/services/tests/servicestests/src/com/android/server/devicepolicy/MockUtils.java
index 92ea766..17e5832 100644
--- a/services/tests/servicestests/src/com/android/server/devicepolicy/MockUtils.java
+++ b/services/tests/servicestests/src/com/android/server/devicepolicy/MockUtils.java
@@ -22,6 +22,7 @@
import android.content.ComponentName;
import android.content.Intent;
+import android.os.BaseBundle;
import android.os.Bundle;
import android.os.UserHandle;
import android.util.ArraySet;
@@ -92,7 +93,10 @@
public boolean matches(Object item) {
if (item == null) return false;
if (!intent.filterEquals((Intent) item)) return false;
- return intent.getExtras().kindofEquals(((Intent) item).getExtras());
+ BaseBundle extras = intent.getExtras();
+ BaseBundle itemExtras = ((Intent) item).getExtras();
+ return (extras == itemExtras) || (extras != null &&
+ extras.kindofEquals(itemExtras));
}
@Override
public void describeTo(Description description) {