title: Few questions about custom permissions in Android
body: <p>I am learning Android programming and I have kind of understood the concept of custom permission.</p>
  
  <p>Based on my understanding this is how custom permissions works:</p>
  
  <p><code>'Base app'</code>can protect some of its components (e.g., activity and services) by declaring  custom permissions (i.e., using <code>&lt;permission&gt;</code> tags in the manifest file) and the<code>'client app'</code> that calls the activities and services protected by custom permissions need to acquire necessary permissions (i.e., using <code>&lt;uses-permission&gt;</code> tags in the manifest file) to call those components in the <code>base app</code>. </p>
  
  <p>However, I have these questions regarding custom permissions:</p>
  
  <ol>
  <li>If the custom permission is declared as dangerous (i.e., <code>android:protectionLevel="dangerous"</code>), does the <code>client app</code> needs to get the approval from the user during installation time? If so, how does the user aware of these custom permissions because there won't be any documentation for the custom permissions. </li>
  <li>During installation time how does the <code>client app</code> knows that <code>base app</code> is already installed in the user's phone? Is there anyway for the <code>client app</code> to know this information?</li>
  <li>Once the <code>client app</code> is installed, what will happen if the user decides to remove the <code>base app</code>? In this case, if the user tries to use <code>client app</code> will it cause any security exception?</li>
  </ol>
  
  <p>I don't know whether these questions make sense but it makes me wonder how custom permissions actually work in real scenario.</p>
  
  <p>Thank you. </p>