Muhammed Refaat
Muhammed Refaat

Reputation: 9103

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));

Upvotes: 1

Views: 2930

Answers (2)

Ikjn
Ikjn

Reputation: 31

with root shell,

adb shell am stop-service your-service

To disable the service permanently, you should remount and change the system files to modify related .rc file.

Upvotes: 0

CommonsWare
CommonsWare

Reputation: 1007554

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.

Upvotes: 1

Related Questions