Why is this permission doesn't grant in niotron ide?

I been trying to make my device restart using my niotron ide Extension.

Here is the block

import android.os.PowerManager;
@SimpleFunction(description = "Restarts the device")
public void RestartDevice() {
    PowerManager pm = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
    if (pm != null) {
        pm.reboot("App initiated restart");
    }
}

And it need this permission

android.permission.REBOOT

But it doesn’t grant, why? It exist but it doesn’t restart due the the permission that hasn’t grant. Is it because it needs the device needed root or the permission needed to be granted?

This permission is reserved for system apps or pre-installed apps that are part of the firmware.

So it means i can’t grant the permission or its because the device need root?

Here is the runtime error when i tested it

Neither user 10513 nor current proccess has android.permission.REBOOT.

If you see 10513, it means this number is the user id of the app. (From mit app inventor)

If this was a system, then how can i grant it?
By just going through androidRuntime.jar and then open the file and chahge the manifest?

The answer remains unchanged from my previous post. The requested permissions are unavailable; they are reserved exclusively for system or firmware applications.

Thank you.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.