This code can adapt to samsung i9000/i9100/i897/t959/m110s etc. I will port this in my new rom. The flashflight will display a white and brightest activity when the camera without flashlight, for example i9000/i897/t959/m110s etc.
There are 3 attachments QuickPanelSettings.apk, LidroidSystemUI.apk and lidroid-res.apk.1. Download LidroidSystemUI.apk and decompile it whit apktool, then you get LidroidSystemUI dir.2. Decompile SystemUI.apk, copy LidroidSystemUI/smali/* into SystemUI/smali.3. Modify SystemUI/AndroidManifeset.xml, add this code before </Application>
Code:
<activity android:name="com.lidroid.systemui.quickpanel.FlashlightActivity"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
android:clearTaskOnLaunch="true"
android:configChanges="orientation|keyboardHidden"
android:launchMode="singleTask" />
if your model has flashlight, you can skip this step.4. Open SystemUI/smali/com/android/systemui/status/StatusBarService.smali. Find(Ctrl + F) QuickSettingsView, locate fellow codes
Code:
const v7, 0x7f030002
invoke-static {p1, v7, v9}, Landroid/view/View;->inflate(Landroid/content/Context;ILandroid/view/ViewGroup;)Landroid/view/View;
move-result-object v3
check-cast v3, Lcom/android/systemui/statusbar/quickpanel/QuickSettingsView;
.line 379
.local v3, qsv:Lcom/android/systemui/statusbar/quickpanel/QuickSettingsView;
modify
Code:
const v7, 0x3030003
invoke-static {p1, v7, v9}, Landroid/view/View;->inflate(Landroid/content/Context;ILandroid/view/ViewGroup;)Landroid/view/View;
move-result-object v3
check-cast v3, Lcom/lidroid/systemui/quickpanel/PowerWidget;
.line 394
.local v3, qsv:Lcom/lidroid/systemui/quickpanel/PowerWidget;
invoke-virtual {v3}, Lcom/lidroid/systemui/quickpanel/PowerWidget;->setupWidget()V
5. Compile SystemUI with apktool, Sign it if you have modify AndroidManifest.xml. Push it into /system/app/6. push lidroid-res.apk in /system/framework/, push QuickPanelSettings.apk in /system/app, reboot.
Simplicity, no need to modify layout, id and Strings which is painful. If you know how to do it, you will know how simple it is. Any android/rom developer can download this code and add more buttons.Enjoy!