Hello,

I have implemented a service which must start another service and I
get a permission exception. The implementation of the two services are
in two different projects, i.e. in two different apk.

The first apk contains a package "my.package", the first service
my.package.service1 and an abstract class my.package.abstractservice
which extends the Service class. The second apk contains the
implementation of the second service my.package.service2 which extends
my.package.abstractservice.

When service1 starts service2 with the function startService(), I get
an error telling that the system can't start service2 without private
permissions. So I modify the manifest files: the first apk declares
and uses my own permission, and in the second apk I added
android:permission=... in the declaration of service2 in the manifest
file. But I get a SecurityException telling that service2 can't be
started without the requested permission.

I have checked the application settings and the dumpsys of adb.
Permission is well attributed, but this does not help. One thing I
read in this group is that the order of the installation of packages
declaring permissions and those using them is important. I noticed
that when debugging service2, its apk is first installed in the
emulator, then the first apk (which declares the permission) is
installed. Probably due to the fact that service2 extends the abstract
class of the first apk. Is it this the origin of my permission
problem?

Bye.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" 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-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to