I'd like to apply a correction:
When I sign both the regular and the service apps with the same
signature, only the regular app shows up as a device administrator. As
it should be.

On Jan 19, 1:57 pm, kl4232 <klavin4...@yahoo.com> wrote:
> Hi
> I have 2 apps. One is a regular app with a UI. I've made it a device
> administrator which has been granted the wipeData permission.
> The other is a service, with no UI. I want to call wipeData() from my
> service.
>
> If I simply call
>
> DevicePolicyManager dpm =
> (DevicePolicyManager)context.getSystemService(Context.DEVICE_POLICY_SERVICE­);
> dpm.wipeData(0);
>
> from my service app I get a security exception....
>
> java.lang.SecurityException: No active admin owned by uid 10033 for
> policy #4
>
> If I sign both the regular app and the service app with the same
> signature and have the same sharedUserId in both of their manifests...
> android:sharedUserId="com.myapps.shared"
> Then they both appear as device administrators in the Settings app. I
> can present the device administrator screen easily to the user for the
> regular app but for the service it ends up having to be as a
> notification and users may miss it.
>
> Q: Is there any way to have my regular app be a device administrator
> and for the service app to leverage off that and call wipeData(),
> without the user having to specifically grant permissions for the
> service app.
>
> Thanks.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to