I'd like to get an "official" response to this as well as I'm having
the same problem.  However, according the compatibility doc, when you
are missing hardware, you need to make whatever code changes to the
system code so that values returned by the API are correct according
to the SDK.  In this case, I forced a "null" service to be registered
for Bluetooth in frameworks/base/services/java/com/android/server/
SystemServer.java (same thing is done for the emulator).  I get the
following errors:


android.bluetooth.cts.BasicAdapterTest
-- test_getDefaultAdapter
fail

junit.framework.AssertionFailedError at
android.bluetooth.cts.BasicAdapterTest.test_getDefaultAdapter(BasicAdapterTest.java:
45)
-- test_enableDisable
fail

java.lang.NullPointerException at
android.bluetooth.cts.BasicAdapterTest.disable(BasicAdapterTest.java:
178)
-- test_getAddress
fail

java.lang.NullPointerException at
android.bluetooth.cts.BasicAdapterTest.enable(BasicAdapterTest.java:
206)
-- test_getName
fail

java.lang.NullPointerException at
android.bluetooth.cts.BasicAdapterTest.enable(BasicAdapterTest.java:
206)
-- test_getBondedDevices
fail

java.lang.NullPointerException at
android.bluetooth.cts.BasicAdapterTest.enable(BasicAdapterTest.java:
206)
-- test_getRemoteDevice
fail

java.lang.NullPointerException at
android.bluetooth.cts.BasicAdapterTest.disable(BasicAdapterTest.java:
178)
-- test_listenUsingRfcommWithServiceRecord
fail

java.lang.NullPointerException at
android.bluetooth.cts.BasicAdapterTest.enable(BasicAdapterTest.java:
206)


But if you look at the doc for BluetoothAdapter.getDefaultAdapter():
http://developer.android.com/reference/android/bluetooth/BluetoothAdapter.html#getDefaultAdapter%28%29,
it says

Returns

    * the default local adapter, or null if Bluetooth is not supported
on this hardware platform

So, AFAIK, my code is running correctly but these tests will fail.
>From what I can tell from looking at the test source code, these tests
are incomplete.  They really need to check if Bluetooth is an
available feature (as the android.app.cts.SystemFeaturesTest
testBluetoothFeature does) then check the default adapter before
accessing the adapter.


On Jul 6, 2:52 am, Will Newton <will.new...@gmail.com> wrote:
> The CDD says that devices SHOULD implement Bluetooth, but I have a
> device that doesn't. Running theCTSon that device reports failures
> due to some of the bluetooth tests, listed below.
>
> The comment at the top of BasicAdapterTest.java suggests that this
> test should not be run on devices that do not provide Bluetoothhardware, but 
> it is part of theCTS. Is it possible to pass theCTS
> without Bluetoothhardware? Is there a suggested way of modifying theCTSthat 
> can allow a non-Bluetooth device to pass theCTS?
>
> Thanks,
>
> android.bluetooth.cts.BasicAdapterTest
> -- test_enableDisable
> fail
>
> junit.framework.AssertionFailedError: expected:<11> but was:<10> at
> android.bluetooth.cts.BasicAdapterTest.enable(BasicAdapterTest.java:
> 220)
> -- test_getAddress
> fail
>
> junit.framework.AssertionFailedError: expected:<11> but was:<10> at
> android.bluetooth.cts.BasicAdapterTest.enable(BasicAdapterTest.java:
> 220)
> -- test_getName
> fail
>
> junit.framework.AssertionFailedError: expected:<11> but was:<10> at
> android.bluetooth.cts.BasicAdapterTest.enable(BasicAdapterTest.java:
> 220)
> -- test_getBondedDevices
> fail
>
> junit.framework.AssertionFailedError: expected:<11> but was:<10> at
> android.bluetooth.cts.BasicAdapterTest.enable(BasicAdapterTest.java:
> 220)
> -- test_listenUsingRfcommWithServiceRecord
> fail
>
> junit.framework.AssertionFailedError: expected:<11> but was:<10> at
> android.bluetooth.cts.BasicAdapterTest.enable(BasicAdapterTest.java:
> 220)

-- 
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: http://groups.google.com/group/android-porting

Reply via email to