Search code examples
androidandroid-service

How to stop a system service?


I want to know how to stop a system service using my app in android, I'm not talking here about stopping a Service Class that exists inside my app, I'm taking about stopping a System Service like (Bluetooth, Mailing, Alarm, WiFi, .....etc) I tried to make it like the following but nothing stopped:

    stopService(new Intent(Service.BLUETOOTH_SERVICE));

Solution

  • I want to know how to stop a system service using my app in android,

    In the UI of your app, you ask the user to completely power down their phone. If your app is a system app (i.e., installed on the /system partition, such as a pre-installed app), you may be able to power down the device yourself.

    What developers perceive as a "system service" is merely an API to a core OS process. SDK developers do not have control over those processes.