[Android General] wlryss:
Control of points of display by Rom Control​

By default in the Expanded menu are left the Power off, Reboot and Emergency Mode points. Display of remaining points (including the new SBike) can be switched (to Show/hide) through Rom Control.

1. We add GearUtils to SystemUI.apk

2. In SystemUI/smali/com/android/systemui/globalactions/presentation/features/GlobalActionFeatures.smali - we make a method to such look:

.method private isBikeModeSupported()Z
.locals 3

const/4 v1, 0x0

const-string v2, "power_sbike_show"

invoke-static {v2, v1}, Lcom/android/wubydax/GearUtils;->getDbIntForKey(Ljava/lang/String;I)I

move-result v2

if-eqz v2, :cond_next

const/4 v0, 0x1

return v0

:cond_next
const/4 v0, 0x0

return v0
.end method

And .method private isDataModeSupported()Z:

.method private isDataModeSupported()Z
.locals 3

const/4 v1, 0x0

const-string v2, "power_datamode_show"

invoke-static {v2, v1}, Lcom/android/wubydax/GearUtils;->getDbIntForKey(Ljava/lang/String;I)I

move-result v2

if-eqz v2, :cond_next

const/4 v0, 0x1

return v0

:cond_next
const/4 v0, 0x0

return v0
.end method

3. In SystemUI/smali_classes2/com/samsung/android/globalactionsdlx/presentation/viewmodel/DefaultActionViewModelFactory.smali:

add .field in # instance fields

........................................
.field private final mContext:Landroid/content/Context;

Last method to change - in attached Guide - Last Method

II. For Rom Control v.2.*:

1. It is necessary to add the following pictures-icons to RomControl/res/drawable-xxhdpi

And put

<PreferenceScreen android:title="Power Menu" android:summary="Display points">
<PreferenceCategory android:title="Power Menu" />
<com.wubydax.romcontrol.v2.prefs.MySwitchPreference android:icon="@drawable/tw_ic_do_data_network_square" android:title="Mobile Data" android:key="power_datamode_show" android:defaultValue="false" android:summaryOn="Show" android:summaryOff="Hide" />
<com.wubydax.romcontrol.v2.prefs.MySwitchPreference android:icon="@drawable/tw_ic_do_fast_reboot" android:title="Quick Reboot" android:key="power_quick_reboot_show" android:defaultValue="false" android:summaryOn="Show" android:summaryOff="Hide" />
<com.wubydax.romcontrol.v2.prefs.MySwitchPreference android:icon="@drawable/tw_ic_do_download" android:title="Reboot to Download" android:key="power_download_show" android:defaultValue="false" android:summaryOn="Show" android:summaryOff="Hide" />
<com.wubydax.romcontrol.v2.prefs.MySwitchPreference android:icon="@drawable/tw_ic_do_recovery" android:title="Reboot to Recovery" android:key="power_recovery_show" android:defaultValue="false" android:summaryOn="Show" android:summaryOff="Hide" />
<com.wubydax.romcontrol.v2.prefs.MySwitchPreference android:icon="@drawable/tw_ic_do_screen_recorder" android:title="ScreenRecord" android:key="power_record_show" android:defaultValue="false" android:summaryOn="Show" android:summaryOff="Hide" />
<com.wubydax.romcontrol.v2.prefs.MySwitchPreference android:icon="@drawable/tw_ic_do_screenshot" android:title="Screenshot" android:key="power_screenshot_show" android:defaultValue="false" android:summaryOn="Show" android:summaryOff="Hide" />
<com.wubydax.romcontrol.v2.prefs.MySwitchPreference android:icon="@drawable/ic_settings" android:title="Settings" android:key="power_settings_show" android:defaultValue="false" android:summaryOn="Show" android:summaryOff="Hide" />
<com.wubydax.romcontrol.v2.prefs.MySwitchPreference android:icon="@drawable/tw_ic_do_torchlight" android:title="Flashlight" android:key="power_torchlight_show" android:defaultValue="false" android:summaryOn="Show" android:summaryOff="Hide" />
<com.wubydax.romcontrol.v2.prefs.MySwitchPreference android:icon="@drawable/tw_ic_do_bikemode_square" android:title="SBike Mode" android:key="power_sbike_show" android:defaultValue="false" android:summaryOn="Show" android:summaryOff="Hide" />
</PreferenceScreen>

Then we need to add all this (including BikeMode_N.apk (system/priv-app/BikeMode_N/BikeMode_N.apk) to phone - better by TWRP

My script for examle for zip (updater-script) TWRP for changing SystemUI

ui_print(" ");
ui_print("***********************************************");
ui_print("* *");
ui_print("* Mod SysUI RC Bike_N - Power Hide Punkts *");
ui_print("* 18.02 by WR *");
ui_print("* *");
ui_print("***********************************************");
ui_print("");
show_progress(1.0,0);
run_program("/sbin/busybox", "mount", "/cache");
run_program("/sbin/busybox", "mount", "/system");
run_program("/sbin/busybox", "mount", "/data");
set_progress(0.33);
ui_print("Delete files...");

delete_recursive("/system/priv-app/SystemUI");
delete("/data/dalvik-cache/arm64/system@priv-app@SystemUI@SystemUI.apk@classes.dex");
delete("/data/dalvik-cache/arm64/system@priv-app@SystemUI@SystemUI.apk@classes.vdex");
delete_recursive("/data/data/com.android.systemui");
delete_recursive("/data/user/0/com.android.systemui");

set_progress(0.33);
ui_print("Extracting files...");
package_extract_dir("system", "/system");
set_progress(0.33);
ui_print("Setting Permission");

set_perm(0, 0, 0755, "/system/priv-app");
ui_print("Unmounting SYSTEM...");
unmount("/system");
unmount("/data");
set_progress(1.00);
ui_print("Done!");

Excuse for my English