yasuhal / mytracks

Automatically exported from code.google.com/p/mytracks
0 stars 1 forks source link

Can't bind to ITrackRecordingService #11

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. copy and paste code from repository to your project
2. create activity to bind service
3. in onCreate(), call:

this.bindService(new Intent(ITrackRecordingService.class.getName()), 
mConnection, 
Context.BIND_AUTO_CREATE)

What is the expected output? What do you see instead?

I expect that the onServiceConnected function in the mConnection object should 
get called and 
the ITrackRecordingService member variable should be set to the IBinder 
variable passed to 
onServiceConnected.

What actually happens is bindService throws a security exception, and 
onServiceConnected 
never gets called.

What version of MyTracks are you using? On what version of Android? On what
phone?

We are using MyTracks version X, with Android 2.0.1 (API Level 7) on the HTC 
Incredible and the 
HTC Nexus One.

Please provide any additional information here:

An example of using the service in a third-party application would benefit us 
greatly.  Also, if 
the wiki were filled out on how to use the service and content provided, that 
would also be a 
tremendous help.

Thanks!
-Eric

Original issue reported on code.google.com by erozel...@gmail.com on 17 May 2010 at 8:38

GoogleCodeExporter commented 8 years ago
Can you please paste the full exception stack trace? We do mean for it to be 
usable
by other apps, so this will be fixed ASAP.

Thanks!

Original comment by rdama...@google.com on 18 May 2010 at 2:29

GoogleCodeExporter commented 8 years ago

Original comment by rdama...@google.com on 18 May 2010 at 2:30

GoogleCodeExporter commented 8 years ago
I think that the problem is in the declaration of the TrackRecordingService in 
the manifest. An exported service should be marked with android:exported="true" 
otherwise any attempt to access the service form a different application will 
throw "java.lang.SecurityException: Not allowed to start service Intent { 
cmp=com.google.android.maps.mytracks/com.google.android.apps.mytracks.services.T
rackRecordingService } without permission private to package". I just verified 
that after this change it is possible to access the service form another app.

Original comment by libor.sy...@gmail.com on 22 Jun 2010 at 11:29

GoogleCodeExporter commented 8 years ago
Nice! Do you have this in a hg clone that we can just pull from? Is it just the 
xml change?

Original comment by rdama...@google.com on 22 Jun 2010 at 11:34

GoogleCodeExporter commented 8 years ago
It is just a simple change in the xml. I've made a hg clone with it 
(liborsykora-external-support).

Original comment by libor.sy...@gmail.com on 25 Jun 2010 at 2:03

GoogleCodeExporter commented 8 years ago

Original comment by sandordo...@google.com on 27 Jul 2010 at 11:44