Trying to start a Service in another application with this code:

startService((new Intent()).setComponent(new ComponentName(
 
"com.foobar.memtest","com.foobar.memtest.RunningService")));

and get this exception:

java.lang.SecurityException: Not allowed to start service Intent
{ comp={com
.foobar.memtest/com.foobar.memtest.RunningService} } without
permission private
to package

The manifest for com.foobar.memtest does not have any permissions set
for the Service or the Application.  The manifest docs for <service>
android:permission say -

"If this attribute is not set, the permission set by the <application>
element's permission attribute applies to the service. If neither
attribute is set, the service is not protected by a permission."

So if the service is not protected by a permission why does the
exception say a permission is required?

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