Add gestures as inline actions for Phone Buddy
Add the following gestures as inline: - Assist gesture - Double tap power - Double tap screen - Pickup - Swipe for notification Bug:62022517 Test: make RunSettingsRoboTests Change-Id: Ib246b97a0b924bf18f464d3548b7e4c393fc1931
This commit is contained in:
@@ -17,15 +17,23 @@
|
||||
package com.android.settings.gestures;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.provider.Settings;
|
||||
import android.support.v7.preference.Preference;
|
||||
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.overlay.FeatureFactory;
|
||||
import com.android.settings.search.DatabaseIndexingUtils;
|
||||
import com.android.settings.search.InlineSwitchPayload;
|
||||
import com.android.settings.search.ResultPayload;
|
||||
import com.android.settingslib.core.lifecycle.Lifecycle;
|
||||
|
||||
public class SwipeToNotificationPreferenceController extends GesturePreferenceController {
|
||||
|
||||
private final int ON = 1;
|
||||
private final int OFF = 0;
|
||||
|
||||
private static final String PREF_KEY_VIDEO = "gesture_swipe_down_fingerprint_video";
|
||||
private final String mSwipeDownFingerPrefKey;
|
||||
|
||||
@@ -64,7 +72,7 @@ public class SwipeToNotificationPreferenceController extends GesturePreferenceCo
|
||||
@Override
|
||||
public boolean onPreferenceChange(Preference preference, Object newValue) {
|
||||
Settings.Secure.putInt(mContext.getContentResolver(),
|
||||
Settings.Secure.SYSTEM_NAVIGATION_KEYS_ENABLED, (boolean) newValue ? 1 : 0);
|
||||
Settings.Secure.SYSTEM_NAVIGATION_KEYS_ENABLED, (boolean) newValue ? ON : OFF);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -74,4 +82,14 @@ public class SwipeToNotificationPreferenceController extends GesturePreferenceCo
|
||||
Settings.Secure.SYSTEM_NAVIGATION_KEYS_ENABLED, 1)
|
||||
== 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultPayload getResultPayload() {
|
||||
final Intent intent = DatabaseIndexingUtils.buildSubsettingIntent(mContext,
|
||||
SwipeToNotificationSettings.class.getName(), mSwipeDownFingerPrefKey,
|
||||
mContext.getString(R.string.display_settings));
|
||||
|
||||
return new InlineSwitchPayload(Settings.Secure.SYSTEM_NAVIGATION_KEYS_ENABLED,
|
||||
ResultPayload.SettingsSource.SECURE, ON, intent, isAvailable());
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user