title: Prevent some users from closing Android service
body: <p>I'm making a service on Android where it will be installed on a phone/tablet. Many people can use that tablet but only selected ones should have right to close the service. How can I achieve this? I googled &amp; found some options:</p>
  <ul>
  <li>Making user accounts: There are lots of apps for this but they do not specify whether service running in one account will run for other accounts also.</li>
  <li>Prompt for password before closing service : There are Many stackoverflow Q.for this but looks impossible.</li>
  <li>Restart service when user closes it : Restarting may lead to loss of data as my service is continuously communicating with other devices to collect data.</li>
  </ul>
  <p><strong>NEW OPTION:</strong></p>
  <p>I have another idea to make it work : I'm will make it system app so that it will warn user when he tries to stop it. For system apps, when user presses the &quot;stop&quot; button from settings, a warning message pops up :&quot; Closing this app may lead to..(blah blah)....&quot;. Do you know which intent is thrown to pop up this message? I think I can use that intent here and disable the &quot;OK&quot; option in this message</p>
  <p><img src="https://i.stack.imgur.com/YlMiM.png" alt="I want to disable this &quot;OK&quot;" />.</p>