Alex Rivera | Logout

Android Map V2 - Why MAPS_RECEIVE permission

Asked 2013-02-12T12:45:48.687
32

Consider this as a wiki question.

While I setup my project to support Map V2, There has been a step to add MAPS_RECEIVE permission.

<permission
          android:name="com.example.mapdemo.permission.MAPS_RECEIVE"
          android:protectionLevel="signature"/>
<uses-permission android:name="com.example.mapdemo.permission.MAPS_RECEIVE"/>

Why we creating and consuming the permission from the app itself?

Is that google play services app interact using this permission ?

This permission can't takes care of these things?

<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>

I thought the use of custom permission is to allow other apps to launch/use our app's services/resources.

Edit
Report

1 Answer

6

This is the same pattern you see when using Google Cloud Messaging (GCM) with its C2D_MESSAGE permission. The idea is to protect an endpoint in your application (e.g. a broadcast receiver) so that some other component (presumably part of the Maps API) can contact it securely (otherwise, another application could impersonate your application by using the same intent filter).

In this case, then, Maps API internally sets up such an endpoint (transparently to you) and can, with the use of this permission, that this endpoint cannot be impersonated (because to do so would require the permission, which is protected by your application signature).

answered 2013-03-07T07:12:22.217

Your Answer