thanks Chris,
getting to the point
I was trying to write a program which uses the framework library
libharware_legacy.so used for
vibration.

this library tries to open a the vibrator device file -"/sys/class/
timed_output/vibrator/enable"  and write to the file when api -
vibrator_on is called.

the vibrator_on API returns 0 if sucess else returns the ERROR NUMBER.

when we try to call this API from our feedback plugin library  this
API fails and returns an error number 13 which indicates that the we
dont have the PERMISSION to open the file although we have have set
the permissions in the manifest file of the java feedback
adapter(android.permission.VIBRATE)

we solved it by changing the permission of enable
(adb shell chmod 777 /sys/class/timed_output/vibrator/enable) since
the phone was rooted

we cant do the same on a different phone which has no root
permissions.

we have already ported QTfeedback module using JNI and it works well
without any modifications.

so please help us.

Thanks and Regards,
Ajay


On 15 January 2011 21:09, Chris Stratton <[email protected]> wrote:

> I think you mean not possible to chmod the file on a phone which is
> not rooted.
>
> And the answer is that you cannot solve this problem on a secured
> device.
>
> Nor can you load custom kernel drivers on a secured device to begin
> with.
>
> If you are building this into a release which user's won't have root
> within, you could change the bits in the permissions field that
> accompanies the name field in the attribute structure used to create
> the sysfs "file"  - see Documentation/filesystems/sysfs.txt
>
> Unfortunately, this method won't let you use android-style permissions
> to control access.  To do that, you'd have to be able to assign the
> group ID of the sysfs entry to a hard coded linux group matching an
> android group that is assigned to applications with the appropriate
> permission.
>
> On Jan 11, 10:21 pm, ajay <[email protected]> wrote:
> > hi,
> >
> >    I have written a pseudo  driver which creates a file(sample) in sys/
> > class/sampledriver in the phone.when i try to open the file i get an
> > error no 13.
> >
> > but i have observed that we can remove this error by chmod 777 sys/
> > class/sampledriver/sample
> >
> > but this type of hack is not possible on a phone which is rooted.
> >
> > pls reply how to solve this issue.
> >
> > Thanks and regards,
> > Ajay
>
> --
> unsubscribe: 
> [email protected]<android-kernel%[email protected]>
> website: http://groups.google.com/group/android-kernel
>



-- 
ajay

-- 
unsubscribe: [email protected]
website: http://groups.google.com/group/android-kernel

Reply via email to