Skip to content

Commit ab3bb63

Browse files
committed
PowerMenu: reboot adjusted for some custom ROMs
Closes #1814
1 parent 9187e43 commit ab3bb63

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/com/ceco/oreo/gravitybox/ModPowerMenu.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,13 @@ protected void beforeHookedMethod(final MethodHookParam param) throws Throwable
356356
private static void reboot() {
357357
try {
358358
Object wmf = XposedHelpers.getObjectField(mGlobalActionsDialog, "mWindowManagerFuncs");
359-
XposedHelpers.callMethod(wmf, "reboot", false);
359+
Method m = XposedHelpers.findMethodExactIfExists(wmf.getClass(), "reboot",
360+
boolean.class, String.class);
361+
if (m != null) {
362+
m.invoke(wmf, false, "reboot");
363+
} else {
364+
XposedHelpers.callMethod(wmf, "reboot", false);
365+
}
360366
} catch (Throwable t) {
361367
GravityBox.log(TAG, t);
362368
}

0 commit comments

Comments
 (0)