Android-cts

453 views
Skip to first unread message

muke...@pathpartnertech.com

unread,
Oct 3, 2013, 1:46:12 AM10/3/13
to android-...@googlegroups.com
Hi All,
I am running Android cts on TI's based Panda Board ,using android 4.2_r4. I am getting a error in the package "android.app".The Test case is
"testNfcFeatures" and the error says --junit.framework.AssertionFailedError: PackageManager#hasSystemFeature should NOT return true for android.hardware.nfc at android.app.cts.SystemFeaturesTest.assertNotAvailable(SystemFeaturesTest.java:375).
What is the reason behind this failure.
Can any one help me out.

Thanks in Advance !!!

Best Regards,
Mukesh

shridutt kothari

unread,
Oct 3, 2013, 3:26:52 AM10/3/13
to android-...@googlegroups.com
Hi muke,

If you see, your error and  android_root/cts/tests/tests/app/src/android/app/cts/SystemFeaturesTest.java -> testNfcFeatures() , you can see that :

 NfcAdapter.getDefaultAdapter(mContext) is returning null. // That means your TI's based Panda Board does not support NFC.

While if you see your error and  android_root/cts/tests/tests/app/src/android/app/cts/SystemFeaturesTest.java -> assertNotAvailable() , you can see that:

  mPackageManager.hasSystemFeature(feature)  is returning true for nfc feature.  // Which is contradicting testNfcFeatures()'s statement.

So if your board actually do not support NFC? than  mPackageManager.hasSystemFeature(feature) should return false, and for that you will need to remove NFC permission file from /frameworks/native/data/etc/ ie. android.hardware.nfc.xml, com.android.nfc_extras.xml

Or if your board supports NFC? than see and fix why -> NfcAdapter.getDefaultAdapter(mContext) is returning null???

PS: for more details see 
/frameworks/base/services/java/com/android/server/pm/PackageManagerService.java --> mAvailableFeatures
/frameworks/base/services/java/com/android/server/pm/PackageManagerService.java --> getSystemAvailableFeatures()
/cts/tests/tests/app/src/android/app/cts/SystemFeaturesTest.java --> testNfcFeatures() 
/cts/tests/tests/app/src/android/app/cts/SystemFeaturesTest.java --> assertNotAvailable() 

Hope that solves your problem!
Shridutt Kothari
Impetus Infotech Limited
shridut...@gmail.com

Bill Zhao

unread,
Feb 18, 2014, 7:41:37 AM2/18/14
to android-...@googlegroups.com

  Please remove the file of android.hardware.nfc.xml under the /system/etc/permissions in your board, and then test again
You also need to comment off  the file copying in the .mk file of your source sdk codes

Bill Z
--
You received this message because you are subscribed to the Google Groups "android-platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-platfo...@googlegroups.com.
To post to this group, send email to android-...@googlegroups.com.
Visit this group at http://groups.google.com/group/android-platform.
For more options, visit https://groups.google.com/groups/opt_out.


--
Bill Zhao
Reply all
Reply to author
Forward
0 new messages