Can you show a code diff?
Does ic_flash_on_black exist? I did not find it in the base/core/res/res so I guess you added it yourself...(did you make update-api to reflect it in current.txt & system-current.txt?)
I looked at the code and I would:
Create a new class in GlobalActions:
private final class MyPowerAction extends SinglePressAction implements LongPressAction {
private MyPowerAction() {
super(com.android.internal.R.drawable.ic_flash_on_black,
R.string.global_action_mypower_off);
}
@Override
public boolean onLongPress() {
// Do your thing here....you could also extend WindowManagerFuncs to add your function and do it from there...
return true;
}
@Override
public boolean showDuringKeyguard() {
return true;
}
@Override
public boolean showBeforeProvisioning() {
return true;
}
@Override
public void onPress() {
}
}
in GlobalActionsDialog createDialog() ..... add your new class :
if (GLOBAL_ACTION_KEY_POWER.equals(actionKey)) {
mItems.add(new PowerAction());
mItems.add(new MyPowerAction());
}
.....
I could be wrong....but I hope it helps....
Daniel.