Merge changes I49263df9,Ie733ad38,I84908fd3,Ia4e869b8,I8240e763,Id5704cc5
* changes:
fix the build
Don't re-show the ticker for a notification if they have set FLAG_ONLY_SHOW_ONCE.
Notification.Builder.setAutoCancel() was setting the wrong flag.
Allow taps on the ticker to pass through to the notification target view so the notification panel still opens.
The whole title area of the notification panel should toggle the settings view.
When the number field on a notifications is >100, just say "100+" instead of listing the number.
diff --git a/core/java/android/nfc/technology/IsoDep.java b/core/java/android/nfc/technology/IsoDep.java
index 52a453fa..32a7542 100644
--- a/core/java/android/nfc/technology/IsoDep.java
+++ b/core/java/android/nfc/technology/IsoDep.java
@@ -39,18 +39,18 @@
*/
public final class IsoDep extends BasicTagTechnology {
/** @hide */
- public static final String EXTRA_ATTRIB = "attrib";
+ public static final String EXTRA_HI_LAYER_RESP = "hiresp";
/** @hide */
public static final String EXTRA_HIST_BYTES = "histbytes";
- private byte[] mAttrib = null;
+ private byte[] mHiLayerResponse = null;
private byte[] mHistBytes = null;
public IsoDep(NfcAdapter adapter, Tag tag, Bundle extras)
throws RemoteException {
super(adapter, tag, TagTechnology.ISO_DEP);
if (extras != null) {
- mAttrib = extras.getByteArray(EXTRA_ATTRIB);
+ mHiLayerResponse = extras.getByteArray(EXTRA_HI_LAYER_RESP);
mHistBytes = extras.getByteArray(EXTRA_HIST_BYTES);
}
}
@@ -63,5 +63,5 @@
/**
* 3B only
*/
- public byte[] getAttrib() { return mAttrib; }
+ public byte[] getHiLayerResponse() { return mHiLayerResponse; }
}
diff --git a/core/java/android/nfc/technology/NfcB.java b/core/java/android/nfc/technology/NfcB.java
index de528f8..267c94d 100644
--- a/core/java/android/nfc/technology/NfcB.java
+++ b/core/java/android/nfc/technology/NfcB.java
@@ -37,20 +37,34 @@
*/
public final class NfcB extends BasicTagTechnology {
/** @hide */
- public static final String EXTRA_ATQB = "atqb";
+ public static final String EXTRA_APPDATA = "appdata";
+ /** @hide */
+ public static final String EXTRA_PROTINFO = "protinfo";
- private byte[] mAtqb;
+ private byte[] mAppData;
+ private byte[] mProtInfo;
public NfcB(NfcAdapter adapter, Tag tag, Bundle extras)
throws RemoteException {
super(adapter, tag, TagTechnology.NFC_B);
- mAtqb = extras.getByteArray(EXTRA_ATQB);
+ mAppData = extras.getByteArray(EXTRA_APPDATA);
+ mProtInfo = extras.getByteArray(EXTRA_PROTINFO);
}
/**
- * Returns the ATQB/SENSB_RES bytes discovered at tag discovery.
+ * Returns the Application Data bytes from the ATQB/SENSB_RES
+ * bytes discovered at tag discovery.
*/
- public byte[] getAtqb() {
- return mAtqb;
+ public byte[] getApplicationData() {
+ return mAppData;
}
+
+ /**
+ * Returns the Protocol Info bytes from the ATQB/SENSB_RES
+ * bytes discovered at tag discovery.
+ */
+ public byte[] getProtocolInfo() {
+ return mProtInfo;
+ }
+
}
diff --git a/media/java/android/media/MediaMetadataRetriever.java b/media/java/android/media/MediaMetadataRetriever.java
index a3c3f09..6209dc0 100644
--- a/media/java/android/media/MediaMetadataRetriever.java
+++ b/media/java/android/media/MediaMetadataRetriever.java
@@ -42,6 +42,8 @@
@SuppressWarnings("unused")
private int mNativeContext;
+ private static final int EMBEDDED_PICTURE_TYPE_ANY = 0xFFFF;
+
public MediaMetadataRetriever() {
native_setup();
}
@@ -272,7 +274,11 @@
*
* @return null if no such graphic is found.
*/
- public native byte[] extractAlbumArt();
+ public byte[] getEmbeddedPicture() {
+ return getEmbeddedPicture(EMBEDDED_PICTURE_TYPE_ANY);
+ }
+
+ private native byte[] getEmbeddedPicture(int pictureType);
/**
* Call it when one is done with the object. This method releases the memory
diff --git a/media/jni/android_media_MediaMetadataRetriever.cpp b/media/jni/android_media_MediaMetadataRetriever.cpp
index 4ccdd9a..05623ec 100644
--- a/media/jni/android_media_MediaMetadataRetriever.cpp
+++ b/media/jni/android_media_MediaMetadataRetriever.cpp
@@ -289,21 +289,26 @@
return jBitmap;
}
-static jbyteArray android_media_MediaMetadataRetriever_extractAlbumArt(JNIEnv *env, jobject thiz)
+static jbyteArray android_media_MediaMetadataRetriever_getEmbeddedPicture(
+ JNIEnv *env, jobject thiz, jint pictureType)
{
- LOGV("extractAlbumArt");
+ LOGV("getEmbeddedPicture: %d", pictureType);
MediaMetadataRetriever* retriever = getRetriever(env, thiz);
if (retriever == 0) {
jniThrowException(env, "java/lang/IllegalStateException", "No retriever available");
return NULL;
}
MediaAlbumArt* mediaAlbumArt = NULL;
+
+ // FIXME:
+ // Use pictureType to retrieve the intended embedded picture and also change
+ // the method name to getEmbeddedPicture().
sp<IMemory> albumArtMemory = retriever->extractAlbumArt();
if (albumArtMemory != 0) { // cast the shared structure to a MediaAlbumArt object
mediaAlbumArt = static_cast<MediaAlbumArt *>(albumArtMemory->pointer());
}
if (mediaAlbumArt == NULL) {
- LOGE("extractAlbumArt: Call to extractAlbumArt failed.");
+ LOGE("getEmbeddedPicture: Call to getEmbeddedPicture failed.");
return NULL;
}
@@ -311,7 +316,7 @@
char* data = (char*) mediaAlbumArt + sizeof(MediaAlbumArt);
jbyteArray array = env->NewByteArray(len);
if (!array) { // OutOfMemoryError exception has already been thrown.
- LOGE("extractAlbumArt: OutOfMemoryError is thrown.");
+ LOGE("getEmbeddedPicture: OutOfMemoryError is thrown.");
} else {
jbyte* bytes = env->GetByteArrayElements(array, NULL);
if (bytes != NULL) {
@@ -445,7 +450,7 @@
{"setMode", "(I)V", (void *)android_media_MediaMetadataRetriever_setMode},
{"_getFrameAtTime", "(JI)Landroid/graphics/Bitmap;", (void *)android_media_MediaMetadataRetriever_getFrameAtTime},
{"extractMetadata", "(I)Ljava/lang/String;", (void *)android_media_MediaMetadataRetriever_extractMetadata},
- {"extractAlbumArt", "()[B", (void *)android_media_MediaMetadataRetriever_extractAlbumArt},
+ {"getEmbeddedPicture", "(I)[B", (void *)android_media_MediaMetadataRetriever_getEmbeddedPicture},
{"release", "()V", (void *)android_media_MediaMetadataRetriever_release},
{"native_finalize", "()V", (void *)android_media_MediaMetadataRetriever_native_finalize},
{"native_setup", "()V", (void *)android_media_MediaMetadataRetriever_native_setup},
diff --git a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/unit/MediaMetadataRetrieverTest.java b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/unit/MediaMetadataRetrieverTest.java
index a0c72e6..0870522 100644
--- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/unit/MediaMetadataRetrieverTest.java
+++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/unit/MediaMetadataRetrieverTest.java
@@ -31,8 +31,8 @@
// Test album art extraction.
@MediumTest
- public static void testAlbumArt() throws Exception {
- Log.v(TAG, "testAlbumArt starts.");
+ public static void testGetEmbeddedPicture() throws Exception {
+ Log.v(TAG, "testGetEmbeddedPicture starts.");
MediaMetadataRetriever retriever = new MediaMetadataRetriever();
boolean supportWMA = MediaProfileReader.getWMAEnable();
boolean hasFailed = false;
@@ -48,13 +48,13 @@
continue;
}
retriever.setDataSource(MediaNames.ALBUMART_TEST_FILES[i]);
- byte[] albumArt = retriever.extractAlbumArt();
+ byte[] albumArt = retriever.getEmbeddedPicture();
// TODO:
// A better test would be to compare the retrieved album art with the
// known result.
if (albumArt == null) { // Do we have expect in JUnit?
- Log.e(TAG, "Fails to extract album art for " + MediaNames.ALBUMART_TEST_FILES[i]);
+ Log.e(TAG, "Fails to get embedded picture for " + MediaNames.ALBUMART_TEST_FILES[i]);
hasFailed = true;
}
} catch(Exception e) {
@@ -64,7 +64,7 @@
Thread.yield(); // Don't be evil
}
retriever.release();
- Log.v(TAG, "testAlbumArt completes.");
+ Log.v(TAG, "testGetEmbeddedPicture completes.");
assertTrue(!hasFailed);
}