Druk bluetooth z Androidem przestał działać w 4.1

Mamy aplikację, która drukuje obrazy na drukarce bluetooth. Ta aplikacja działa dobrze na Androidzie 4.0 ICS, ale kiedy zaktualizowaliśmy jeden z nich do Androida 4.1 galaretki fasoli, drukowanie przestało działać z tym w logcat:

W / System.err (19319): java.lang.SecurityException: Odmowa uprawnień: zapisywanie treści uri com.android.bluetooth.opp.BluetoothOppProvider: //com.android.bluetooth.opp/btopp z pid = 19319, uid = 10106 wymaga android.permission.ACCESS_BLUETOOTH_SHARE lub grantUriPermission ()

Problem polega na tym, że deklarujemy to zezwolenie, więc ten błąd nie ma dla nas sensu. Oto linia z naszego manifestu

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.turner.itstrategy.LumenboxClient"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk android:minSdkVersion="11" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />
    <uses-permission android:name="android.permission.ACCESS_BLUETOOTH_SHARE"/>
    <uses-permission android:name="android.permission.BLUETOOTH"/>
    <uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
    <uses-permission android:name="android.permission.VIBRATE" />

     (stuff removed)
</manifest>

Oto kod, którego używamy do drukowania. Ten kod został zaczerpnięty z przykładów na stackoverflow i gdzie indziej.

ContentValues values = new ContentValues();

String path = Environment.getExternalStorageDirectory().toString();
File imageFile = new File(path, "CurrentLumenboxPrint.jpg");

//build the message to send on BT
values.put(BluetoothShare.URI, Uri.fromFile(imageFile).toString());
values.put(BluetoothShare.MIMETYPE, "image/jpeg");
values.put(BluetoothShare.DESTINATION, device.getAddress());
values.put(BluetoothShare.DIRECTION, BluetoothShare.DIRECTION_OUTBOUND);
Long ts = System.currentTimeMillis();
values.put(BluetoothShare.TIMESTAMP, ts);

// Here is where the exception happens      
final Uri contentUri = getApplicationContext().getContentResolver().insert(BluetoothShare.CONTENT_URI, values);

W tej chwili jesteśmy martwi w wodzie.

questionAnswers(1)

yourAnswerToTheQuestion