Hi JBQ,

Thanks for you reply, and I appologize for the delay in getting back
to you.

The detailed log of the issue is list as following:

01-01 07:06:27.936: ERROR/AndroidRuntime(479): Uncaught handler:
thread Thread-11 exiting due to uncaught exception
01-01 07:06:27.936: ERROR/AndroidRuntime(479):
java.lang.SecurityException: Cannot write secure settings table
01-01 07:06:27.936: ERROR/AndroidRuntime(479):     at
android.os.Parcel.readException(Parcel.java:1234)
01-01 07:06:27.936: ERROR/AndroidRuntime(479):     at
android.os.Parcel.readException(Parcel.java:1222)
01-01 07:06:27.936: ERROR/AndroidRuntime(479):     at
android.bluetooth.IBluetoothDevice$Stub$Proxy.disable
(IBluetoothDevice.java:577)
01-01 07:06:27.936: ERROR/AndroidRuntime(479):     at
android.bluetooth.BluetoothDevice.disable(BluetoothDevice.java:134)

And I searched the built environment, and found out the following code
snippet from the auto-generated file IBluetoothDevice.java:

public boolean enable(android.bluetooth.IBluetoothDeviceCallback
callback) throws android.os.RemoteException
{
    android.os.Parcel _data = android.os.Parcel.obtain();
    android.os.Parcel _reply = android.os.Parcel.obtain();
    boolean _result;
    try {
        _data.writeInterfaceToken(DESCRIPTOR);
        _data.writeStrongBinder((((callback!=null))?(callback.asBinder
()):(null)));
        mRemote.transact(Stub.TRANSACTION_enable, _data, _reply, 0);
        _reply.readException();
        _result = (0!=_reply.readInt());
    }
    finally {
        _reply.recycle();
        _data.recycle();
    }
    return _result;
}
// async

public boolean disable() throws android.os.RemoteException
{
    android.os.Parcel _data = android.os.Parcel.obtain();
    android.os.Parcel _reply = android.os.Parcel.obtain();
    boolean _result;
    try {
        _data.writeInterfaceToken(DESCRIPTOR);
        mRemote.transact(Stub.TRANSACTION_disable, _data, _reply, 0);
        _reply.readException();
        _result = (0!=_reply.readInt());
    }
    finally {
        _reply.recycle();
        _data.recycle();
    }
    return _result;
}

>From the source code, in fact, I could not find the difference between
the two functions disable and enable in their implementation. I also
compared the file IBluetoothDeivceService.java, and still not find
where the permission is needed. The only permission is
BLUETOOTH_ADMIN. Maybe other permission rather than the permission
WRITE_SECURE_SETTING is needed?

Stanley

On Mar 26, 9:35 pm, Jean-Baptiste Queru <[email protected]> wrote:
> As far as I know this permissions won't be available to applications.
> My understanding is that there activities that your application will
> be able start that allow the user to change the settings in question.
>
> JBQ
>
>
>
> On Thu, Mar 26, 2009 at 6:31 AM,Stanley.lei<[email protected]> wrote:
>
> > Does any Android developer give me any explaination?
>
> > I will appreciate any reply.
>
> > Thanks & Best Regards,
>
> > Stanley
>
> > On Mar 25, 6:37 pm, "Stanley.lei" <[email protected]> wrote:
> >> One more thing as the supplement, is that I met this issue when I
> >> tried to call the non-published API BluetoothDevice.disable(), but the
> >> API BluetoothDevice.enable() works well. I am just curious about why
> >> enabling bluetooth is allowed, while disabling bluetooth is not
> >> allowed. I think these two API should have same security level. Of
> >> course, this is just my private opinion. Any mistake, please point it
> >> out.
>
> >> Thanks,
>
> >> Stanley
>
> >> On Mar 25, 6:17 pm, "Stanley.lei" <[email protected]> wrote:
>
> >> > Hi all,
>
> >> > I am developing the application based on the latest cupcake branch. I
> >> > met a security issue, which needs the permission
> >> > WRITE_SECURE_SETTINGS. I have tried to grant it to my application, but
> >> > when the package is installed, an error is reported:
>
> >> > 01-15 06:50:49.780: WARN/PackageManager(160): Not granting permission
> >> > android.permission.WRITE_SECURE_SETTINGS to package com.ourdroid.apks
> >> > (protectionLevel=3 flags=0x44)
>
> >> > I have searched in this group, and found some cases same as mime. My
> >> > question is whether it is possible to get this permission?
>
> >> > Any reply will be appreciated.
>
> >> > Regards,
>
> >> > Stanley
>
> --
> Jean-Baptiste M. "JBQ" Queru
> Android Engineer, Google.
>
> Questions sent directly to me that have no reason for being private
> will likely get ignored or forwarded to a public forum with no further
> warning.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to