I'm trying to implement a custom permission to be used between two of
my apps.
In AppA I declare:

    <uses-permission android:name="com.teslacoilsw.TEST_PERMISSION" />

And in AppB I declare:
    <permission android:name="com.teslacoilsw.TEST_PERMISSION"
        android:label="TeslaCoil Test"
        android:protectionLevel="normal" />
...
        <service android:name=".TestService"
            android:exported="true"
            android:permission="com.teslacoilsw.TEST_PERMISSION"
        />

If I install AppB and then install AppA, it work as expected (AppA can
bind to AppB's service). However if I install AppA and then install
AppB, I get a SecurityException when trying to bind to the service as
the permission is not granted. (Tested on Android 4.0.3)

I've investigated adding the <permission> declaration to both
manifests and this does seem to work, I assume because the permission
now always exists at install time. However this feels wrong to me.

Is there a correct way for an app to declare a permission in an
environment like the Market where installation order is not
guaranteed?

Thanks,
-Kevin

-- 
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