title: Request custom permission with protection level=signature with a mismatch signature?
body: <p>Let's say I have a server app that declares a custom permission called <strong>com.testpackage.mypermission</strong>, which is needed to start <strong>ServerActivity</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.testpackage.myserver"
      android:versionCode="1"
      android:versionName="1.0" &gt;
  
      &lt;uses-sdk android:minSdkVersion="10" /&gt;
      &lt;permission android:name="com.testpackage.mypermission" android:label="my_permission" android:protectionLevel="signature"&gt;&lt;/permission&gt;
  
      &lt;application
          android:icon="@drawable/ic_launcher"
          android:label="@string/app_name" &gt;
          &lt;activity
              android:permission="com.testpackage.mypermission"
              android:name=".ServerActivity"
              android:label="@string/app_name" &gt;
          &lt;/activity&gt;
      &lt;/application&gt;
  
  &lt;/manifest&gt;
  </code></pre>
  
  <p>Then I have a client app that request <strong>com.testpackage.mypermission</strong> in its Manifest:</p>
  
  <pre><code>&lt;uses-permission android:name="com.testpackage.mypermission" /&gt;
  </code></pre>
  
  <p>I know that if the 2 apps are signed with different certificates, client app won't be able to start <strong>com.testpackage.myserver.ServerActivity</strong> because of protectionLevel=signature. </p>
  
  <p>My question is:</p>
  
  <ol>
  <li>If server app is already installed, and then I want to install
  client app, are their signatures checked at that moment? Or is it only checked at run time when you do <strong>startActivity(ServerActivity)</strong> in client app?</li>
  <li>From my experience the answer to Q.1 seems to be runtime only. This confuses me, because standard system permissions (eg. <strong>android.permission.CAMERA</strong>) are checked at install time. So are custom permission and standard permission treated differently?</li>
  </ol>
  
  <p>Thanks</p>