解决方案 »

  1.   

    应该是其它权限问题,看看完整的log
      

  2.   

    Add more logs.BtOppRfcommListener: Error create RfcommServerSocket java.io.IOException: Error: -1
    01-02 09:23:46.450 23680  2691 E SQLiteLog: (14) cannot open file at line 30191 of [00bb9c9ce4]
    01-02 09:23:46.450 23680  2691 E SQLiteLog: (14) os_unix.c:30191: (24) open(/data/data/com.android.bluetooth/databases/btopp.db-journal) - 
    01-02 09:23:46.450 23680  2691 E SQLiteLog: (14) cannot open file at line 30191 of [00bb9c9ce4]
    01-02 09:23:46.450 23680  2691 E SQLiteLog: (14) os_unix.c:30191: (24) open(/data/data/com.android.bluetooth/databases/btopp.db-journal) - 
    01-02 09:23:46.450 23680  2691 E SQLiteLog: (14) statement aborts at 23: [SELECT * FROM btopp ORDER BY _id] unable to open database file
    01-02 09:23:46.450 23680 23680 W BluetoothAdapter: getBluetoothService() called with no BluetoothManagerCallback
    01-02 09:23:46.450 23680  2691 E SQLiteQuery: exception: unable to open database file (code 14); query: SELECT * FROM btopp ORDER BY _id
    01-02 09:23:46.450 23680 23680 E BluetoothServiceJni: SOCK FLAG = 0 ***********************
    01-02 09:23:46.450 23680 23680 E bt-btif : socketpair failed, errno:24
    01-02 09:23:46.450 23680 23680 E BluetoothServiceJni: Socket listen failed: 1
    01-02 09:23:46.450 23680 23680 E BluetoothAdapterService(1101198288): Failed to create socket channel
    01-02 09:23:46.450 23680 23680 E BluetoothFtpService: Error create RfcommServerSocket java.io.IOException: Error: -1
    01-02 09:23:46.450 23680 23680 V BluetoothFtpService: wait 300 ms
    01-02 09:23:46.450 23680  2691 W dalvikvm: threadid=32: thread exiting with uncaught exception (group=0x416feba8)
    01-02 09:23:46.450 23680  2674 D bluedroid-mrvl: bt_vnd_mrvl_if_op(L102): opcode = 7
    01-02 09:23:46.450 23680  2691 E AndroidRuntime: FATAL EXCEPTION: Bluetooth Share Service
    01-02 09:23:46.450 23680  2691 E AndroidRuntime: Process: com.android.bluetooth, PID: 23680
    01-02 09:23:46.450 23680  2691 E AndroidRuntime: android.database.sqlite.SQLiteCantOpenDatabaseException: unable to open database file (code 14)
    01-02 09:23:46.450 23680  2691 E AndroidRuntime:  at android.database.sqlite.SQLiteConnection.nativeExecuteForCursorWindow(Native Method)
    01-02 09:23:46.450 23680  2691 E AndroidRuntime:  at android.database.sqlite.SQLiteConnection.executeForCursorWindow(SQLiteConnection.java:878)
    01-02 09:23:46.450 23680  2691 E AndroidRuntime:  at android.database.sqlite.SQLiteSession.executeForCursorWindow(SQLiteSession.java:836)
    01-02 09:23:46.450 23680  2691 E AndroidRuntime:  at android.database.sqlite.SQLiteQuery.fillWindow(SQLiteQuery.java:62)
    01-02 09:23:46.450 23680  2691 E AndroidRuntime:  at android.database.sqlite.SQLiteCursor.fillWindow(SQLiteCursor.java:144)
    01-02 09:23:46.450 23680  2691 E AndroidRuntime:  at android.database.sqlite.SQLiteCursor.getCount(SQLiteCursor.java:133)
    01-02 09:23:46.450 23680  2691 E AndroidRuntime:  at android.content.ContentResolver.query(ContentResolver.java:480)
    01-02 09:23:46.450 23680  2691 E AndroidRuntime:  at android.content.ContentResolver.query(ContentResolver.java:404)
    01-02 09:23:46.450 23680  2691 E AndroidRuntime:  at com.android.bluetooth.opp.BluetoothOppService$UpdateThread.run(BluetoothOppService.java:426)
    01-02 09:23:46.480 23680  2674 D bluedroid-mrvl: bt_vnd_mrvl_if_op(L102): opcode = 7
    01-02 09:23:46.480 23680  2674 D bluedroid-mrvl: bt_vnd_mrvl_if_op(L102): opcode = 7
    01-02 09:23:46.480 23680  2674 D bluedroid-mrvl: bt_vnd_mrvl_if_op(L102): opcode = 7
    01-02 09:23:46.480 23680  2674 D bluedroid-mrvl: bt_vnd_mrvl_if_op(L102): opcode = 7
    01-02 09:23:46.490 23680  2674 D bluedroid-mrvl: bt_vnd_mrvl_if_op(L102): opcode = 7
    01-02 09:23:46.490 23680  2674 D bluedroid-mrvl: bt_vnd_mrvl_if_op(L102): opcode = 7
    01-02 09:23:46.490 23680  2674 D bluedroid-mrvl: bt_vnd_mrvl_if_op(L102): opcode = 7
    01-02 09:23:46.490 23680  2674 D bluedroid-mrvl: bt_vnd_mrvl_if_op(L102): opcode = 7
    01-02 09:23:46.490 23680  2674 D bluedroid-mrvl: bt_vnd_mrvl_if_op(L102): opcode = 7
    01-02 09:23:46.490 23680  2674 D bluedroid-mrvl: bt_vnd_mrvl_if_op(L102): opcode = 7
    01-02 09:23:46.490 23680  2674 D bluedroid-mrvl: bt_vnd_mrvl_if_op(L102): opcode = 7
    01-02 09:23:46.490 23680  2674 D bluedroid-mrvl: bt_vnd_mrvl_if_op(L102): opcode = 7
    01-02 09:23:46.550   569   588 D dalvikvm: GC_FOR_ALLOC freed 371K, 18% free 7200K/8716K, paused 62ms, total 63ms
    01-02 09:23:46.560   569   588 I dalvikvm-heap: Grow heap (frag case) to 8.028MB for 951344-byte allocation
    01-02 09:23:46.630   569   592 D dalvikvm: GC_FOR_ALLOC freed 16K, 16% free 8112K/9648K, paused 68ms, total 68ms
    01-02 09:23:46.750   569   746 D BluetoothManagerService: checkIfCallerIsForegroundUser: valid=true callingUser=0 foregroundUser=0
    01-02 09:23:46.750   569 10346 D BluetoothManagerService: checkIfCallerIsForegroundUser: valid=true callingUser=0 foregroundUser=0
    01-02 09:23:46.760 23680  2693 W BluetoothAdapter: getBluetoothService() called with no BluetoothManagerCallback
    01-02 09:23:46.760 23680 23680 W BluetoothAdapter: getBluetoothService() called with no BluetoothManagerCallback
    01-02 09:23:46.760 23680  2693 E BluetoothServiceJni: SOCK FLAG = 0 ***********************
    01-02 09:23:46.760 23680  2674 D bluedroid-mrvl: bt_vnd_mrvl_if_op(L102): opcode = 7
    01-02 09:23:46.760 23680 23680 E BluetoothServiceJni: SOCK FLAG = 0 ***********************
    01-02 09:23:46.760 23680 23680 E bt-btif : socketpair failed, errno:24
    01-02 09:23:46.760 23680 23680 E BluetoothServiceJni: Socket listen failed: 1
    01-02 09:23:46.760 23680 23680 E BluetoothAdapterService(1101198288): Failed to create socket channel
    01-02 09:23:46.760 23680 23680 E BluetoothFtpService: Error create RfcommServerSocket java.io.IOException: Error: -1
    01-02 09:23:46.760 23680 23680 V BluetoothFtpService: wait 300 ms
    01-02 09:23:47.060   569 12566 D BluetoothManagerService: checkIfCallerIsForegroundUser: valid=true callingUser=0 foregroundUser=0
    01-02 09:23:47.060   569 12565 D BluetoothManagerService: checkIfCallerIsForegroundUser: valid=true callingUser=0 foregroundUser=0
    01-02 09:23:47.070 23680 23680 W BluetoothAdapter: getBluetoothService() called with no BluetoothManagerCallback
      

  3.   

    这些操作都是android中sqlite的公共函数,应该没有错误,不知道还有什么可能。
    刚才看了下sqlite中出现该exception的地方如下int fillWindow(CursorWindow window, int startPos, int requiredPos, boolean countAllRows) {
            acquireReference();
            try {
                window.acquireReference();
                try {
                    int numRows = getSession().executeForCursorWindow(getSql(), getBindArgs(),
                            window, startPos, requiredPos, countAllRows, getConnectionFlags(),
                            mCancellationSignal);
                    return numRows;
                } catch (SQLiteDatabaseCorruptException ex) {
                    onCorruption();
                    throw ex;
                } catch (SQLiteException ex) {
                    Log.e(TAG, "exception: " + ex.getMessage() + "; query: " + getSql());
                    throw ex;
                } finally {
                    window.releaseReference();
                }
            } finally {
                releaseReference();
            }
        }不知道这个low Memroy有什么关系,难道是内存用尽的原因吗?
      

  4.   

    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />这个权限也加上试试。
      

  5.   

    你是在自己的应用下打开com.android.bluetooth下的数据库文件?
      

  6.   

    谢谢您的热情帮助。不过。
    在JellyBean中,Android添加了一个新的权限”android.permission.READ_EXTERNAL_STORAGE”,顾名思义该权限说明该程序可以读取设备外部存储空间(内置SDcard和外置SDCard)的文件,如果您的App已经添加了“WRITE_EXTERNAL_STORAGE ”权限 ,则就没必要添加读的权限了,写权限已经包含了读权限了。Read more: http://blog.chengyunfeng.com/?p=427#ixzz3EIx69sko
      

  7.   

    我是在跑一个蓝牙开关stress的时候出现的。
      

  8.   

    我是在跑一个蓝牙开关stress的时候出现的。stress?没用过,如果是第三方的应用的话,是没有权限读取/data/data/com.android.bluetooth下的文件的,只能访问data里自己目录下的文件
      

  9.   

    应该不是权限问题,重点分析下数据库cursor或者file操作完成后,是否及时回收释放?
    文件或者cursor打开句柄太多也会造成这种现象。