Permalink
Browse files

Longpress power lockscreen torch [2/2]

Change-Id: I0de67f556056939c51d3b05173da24465c6d27b7
  • Loading branch information...
beanstown106 authored and xlxfoxxlx committed Jan 17, 2016
1 parent 5d13810 commit 10ad51d5ad281f97e8092a47f2e10b2abe6912fc
View
@@ -593,6 +593,10 @@
<string name="volbtn_wake_device_title">Volume button wake</string>
<string name="button_wake_summary">May not wake device if music control is active and music is playing</string>
<!-- Lockscreen Torch toggle -->
<string name="keyguard_torch_title">Lockscreen torch</string>
<string name="keyguard_torch_summary">Longpress power button with screen off turns on torch</string>
<!-- powermenu fragment -->
<string name="power_menu_title">Advanced power menu</string>
<string name="powermenu_settings_summary">Customize APM actions</string>
@@ -26,5 +26,11 @@
android:title="@string/power_menu_title"
android:summary="@string/powermenu_settings_summary"
android:fragment="com.aosip.owlsnest.buttons.PowerMenuFragment" />
<com.aosip.owlsnest.preference.SystemSettingSwitchPreference
android:key="keyguard_toggle_torch"
android:title="@string/keyguard_torch_title"
android:summary="@string/keyguard_torch_summary"
android:defaultValue="false" />
</PreferenceScreen>
View
@@ -24,14 +24,14 @@
android:fragment="com.aosip.owlsnest.statusbar.StatusbarHolder"
android:title="@string/statusbar_bar_title"
android:summary="@string/statusbar_bar_summary"
android:icon="@drawable/ic_owlsnest_status" />
android:icon="@drawable/ic_owlsnest_status"/>
<PreferenceScreen
android:key="quicksettings"
android:fragment="com.aosip.owlsnest.qssettings.QsSettingsHolder"
android:title="@string/quicksettings_title"
android:summary="@string/quicksettings_summary"
android:icon="@drawable/ic_owlsnest_qs" />
android:icon="@drawable/ic_owlsnest_qs"/>
<PreferenceScreen
android:key="notification"
@@ -45,42 +45,42 @@
android:fragment="com.aosip.owlsnest.navigation.NavigationHolder"
android:title="@string/navigation_title"
android:summary="@string/navigation_summary"
android:icon="@drawable/ic_owlsnest_nav" />
android:icon="@drawable/ic_owlsnest_nav"/>
<PreferenceScreen
android:key="buttons"
android:fragment="com.aosip.owlsnest.buttons.ButtonsHolder"
android:title="@string/buttons_title"
android:summary="@string/buttons_summary"
android:icon="@drawable/ic_owlsnest_buttons" />
android:icon="@drawable/ic_owlsnest_buttons"/>
<PreferenceScreen
android:key="recent"
android:fragment="com.aosip.owlsnest.recent.RecentHolder"
android:title="@string/recent_title"
android:summary="@string/recent_summary"
android:icon="@drawable/ic_owlsnest_recents" />
android:icon="@drawable/ic_owlsnest_recents"/>
<PreferenceScreen
android:key="lockscreen"
android:fragment="com.aosip.owlsnest.lockscreen.LockscreenHolder"
android:title="@string/lockscreen_title"
android:summary="@string/lockscreen_summary"
android:icon="@drawable/ic_owlsnest_lockscreen" />
android:icon="@drawable/ic_owlsnest_lockscreen"/>
<PreferenceScreen
android:key="gesture"
android:fragment="com.aosip.owlsnest.gesture.GestureHolder"
android:title="@string/gesture_category"
android:summary="@string/gesture_summary"
android:icon="@drawable/ic_owlsnest_gesture" />
android:icon="@drawable/ic_owlsnest_gesture"/>
<PreferenceScreen
android:key="advanced"
android:fragment="com.aosip.owlsnest.advanced.AdvancedHolder"
android:title="@string/advanced_title"
android:summary="@string/advanced_summary"
android:icon="@drawable/ic_owlsnest_advanced" />
android:icon="@drawable/ic_owlsnest_advanced"/>
<PreferenceScreen
android:key="ota"
@@ -18,16 +18,22 @@
import android.os.Bundle;
import android.provider.Settings;
import android.preference.Preference;
import android.preference.Preference.OnPreferenceChangeListener;
import android.support.v7.preference.Preference;
import android.support.v7.preference.PreferenceScreen;
import com.android.internal.util.aosip.aosipUtils;
import com.android.internal.logging.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.SettingsPreferenceFragment;
import com.aosip.owlsnest.preference.SystemSettingSwitchPreference;
public class PowermenuCategory extends SettingsPreferenceFragment implements
Preference.OnPreferenceChangeListener {
private static final String KEYGUARD_TORCH = "keyguard_toggle_torch";
private SystemSettingSwitchPreference mLsTorch;
@Override
protected int getMetricsCategory() {
return MetricsEvent.OWLSNEST;
@@ -38,7 +44,12 @@ public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
addPreferencesFromResource(R.xml.aosip_powermenu);
PreferenceScreen prefScreen = getPreferenceScreen();
mLsTorch = (SystemSettingSwitchPreference) findPreference(KEYGUARD_TORCH);
if (!aosipUtils.deviceSupportsFlashLight(getActivity())) {
prefScreen.removePreference(mLsTorch);
}
}
@Override

0 comments on commit 10ad51d

Please sign in to comment.