sanders: MotoActions: Nuke PiP action

* Useless
This commit is contained in:
jhenrique09
2018-01-21 23:32:18 -02:00
committed by Keertesh
parent 7c88aadccc
commit 8b78736022
6 changed files with 92 additions and 37 deletions

View File

@@ -68,7 +68,6 @@
<string name="action_dialer">Abrir discador</string>
<string name="action_email">Abrir app de mail</string>
<string name="action_messages">Abrir app de mensagens</string>
<string name="action_pip">Modo picture-in-picture</string>
<!-- Screen off gestures -->
<string name="screen_off_gestures_title">Gestos com a tela desligada</string>
@@ -90,6 +89,4 @@
<string name="haptic_feedback">Retorno tátil</string>
<string name="haptic_feedback_summary">Vibrar quando um gesto for detectado</string>
<!-- Pip -->
<string name="app_does_not_support_pip">O aplicativo não tem suporte ao modo picture-in-picture.</string>
</resources>

View File

@@ -31,7 +31,6 @@
<item>@string/action_flashlight</item>
<item>@string/action_camera</item>
<item>@string/action_screenshot</item>
<item>@string/action_pip</item>
</string-array>
<string-array name="fp_keys_listValues">
<item>0</item>
@@ -49,7 +48,6 @@
<item>110</item> <!-- flashlight -->
<item>111</item> <!-- camera -->
<item>112</item> <!-- screenshot -->
<item>120</item> <!-- pip -->
</string-array>
<string-array name="fp_keys_screen_off_listArray">

View File

@@ -0,0 +1,92 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2013-2016 The CyanogenMod Project
(C) 2017 The LineageOS Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<!-- Title and summary -->
<string name="moto_actions_title">Moto Actions</string>
<!-- Device gestures -->
<string name="device_gestures_title">Device gestures</string>
<string name="device_gestures_summary">Manage device gestures</string>
<!-- Ambient display gestures -->
<string name="ambient_display_manage_summary">Manage ambient display gestures</string>
<!-- Fingerprint gestures -->
<string name="fingerprint_gestures_title">Fingerprint gestures</string>
<string name="fingerprint_gestures_summary">Use fingerprint gestures</string>
<string name="fingerprint_gestures_manage_summary">Manage fingerprint gestures</string>
<string name="fingerprint_actions_screenon">Actions with screen on</string>
<string name="fingerprint_tap_title">Single tap</string>
<string name="fingerprint_tap_dlg_title">Select action for single tap</string>
<string name="fingerprint_double_tap_title">Double tap</string>
<string name="fingerprint_double_tap_dlg_title">Select action for double tap</string>
<string name="fingerprint_long_tap_title">Long tap</string>
<string name="fingerprint_long_tap_dlg_title">Select action for long tap</string>
<string name="fingerprint_swipe_left_title">Swipe left</string>
<string name="fingerprint_swipe_left_dlg_title">Select action for swipe left</string>
<string name="fingerprint_swipe_right_title">Swipe right</string>
<string name="fingerprint_swipe_right_dlg_title">Select action for swipe right</string>
<!-- Fingerprint gestures screen off -->
<string name="fingerprint_gestures_screenoff_title">Fingerprint gestures when screen off</string>
<string name="fingerprint_gestures_screenoff_summary">Use fingerprint gestures when screen off.\n\nFingerprint unlocking must be disabled to use this feature.</string>
<string name="fingerprint_actions_screenoff">Actions with screen off</string>
<!-- Actions -->
<string name="action_none">None</string>
<string name="action_home">Home</string>
<string name="action_power">Screen on/off</string>
<string name="action_wake">Wake</string>
<string name="action_back">Back</string>
<string name="action_recents">Recents</string>
<string name="action_last_app">Last app</string>
<string name="action_volume_up">Volume up</string>
<string name="action_volume_down">Volume down</string>
<string name="action_voice_assistant">Voice assistant</string>
<string name="action_play_pause">Play/pause</string>
<string name="action_previous_track">Previous track</string>
<string name="action_next_track">Next track</string>
<string name="action_flashlight">Flashlight on/off</string>
<string name="action_camera">Open camera</string>
<string name="action_screenshot">Take screenshot</string>
<string name="action_browser">Open browser</string>
<string name="action_dialer">Open dialer</string>
<string name="action_email">Open email app</string>
<string name="action_messages">Open messages app</string>
<!-- Screen off gestures -->
<string name="screen_off_gestures_title">Screen off gestures</string>
<string name="screen_off_gestures_manage_summary">Manage gestures when screen is off</string>
<string name="screen_off_gestures_swipe_left_title">Swipe left</string>
<string name="screen_off_gestures_swipe_left_dlg_title">Select action for swipe left</string>
<string name="screen_off_gestures_swipe_right_title">Swipe right</string>
<string name="screen_off_gestures_swipe_right_dlg_title">Select action for swipe right</string>
<string name="screen_off_gestures_swipe_up_title">Swipe up</string>
<string name="screen_off_gestures_swipe_up_dlg_title">Select action for swipe up</string>
<string name="screen_off_gestures_swipe_down_title">Swipe down</string>
<string name="screen_off_gestures_swipe_down_dlg_title">Select action for swipe down</string>
<!-- Double tap to wake -->
<string name="tap_to_wake">Tap to wake</string>
<string name="tap_to_wake_summary">Double-tap anywhere on the screen to wake device</string>
<!-- Screen off gestures haptic feedback -->
<string name="haptic_feedback">Haptic feedback</string>
<string name="haptic_feedback_summary">Vibrate when a touchscreen gesture is detected</string>
</resources>

View File

@@ -1,4 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<java-symbol type="string" name="app_does_not_support_pip" />
</resources>

View File

@@ -59,7 +59,6 @@ import android.view.InputDevice;
import android.view.KeyCharacterMap;
import android.view.KeyEvent;
import android.view.ViewConfiguration;
import android.widget.Toast;
import com.android.internal.os.DeviceKeyHandler;
import com.android.internal.util.ArrayUtils;
@@ -582,11 +581,6 @@ public class KeyHandler implements DeviceKeyHandler {
case ACTION_SCREENSHOT:
triggerVirtualKeypress(mHandler, KeyEvent.KEYCODE_SYSRQ);
break;
case ACTION_PIP:
if (!mKeyguardManager.inKeyguardRestrictedInputMode()) {
goToPipMode();
}
break;
case ACTION_LAST_APP:
if (!mKeyguardManager.inKeyguardRestrictedInputMode()) {
switchToLastApp(mContext);
@@ -602,26 +596,6 @@ public class KeyHandler implements DeviceKeyHandler {
mVibrator.vibrate(intensity);
}
private void goToPipMode() {
ActivityInfo ai = getRunningActivityInfo(mContext);
if (ai != null && !ai.supportsPictureInPicture()) {
try {
PackageManager pm = mContext.getPackageManager();
Resources resources = pm.getResourcesForApplication("com.moto.actions");
int resId = resources.getIdentifier("app_does_not_support_pip", "string", "com.moto.actions");
final String text = resources.getString(resId);
mHandler.post(new Runnable() {
public void run() {
Toast.makeText(mContext, text, Toast.LENGTH_SHORT).show();
}
});
} catch (Exception e) {
}
return;
}
triggerVirtualKeypress(mHandler, 171);
}
private void toggleScreenState() {
if (mPowerManager.isScreenOn()) {
mPowerManager.goToSleep(SystemClock.uptimeMillis());

View File

@@ -63,7 +63,6 @@ public class Constants {
public static final int ACTION_DIALER = 117;
public static final int ACTION_EMAIL = 118;
public static final int ACTION_MESSAGES = 119;
public static final int ACTION_PIP = 120;
public static final int ACTION_LAST_APP = 121;
public static final int[] sFPSupportedActions = new int[]{
ACTION_HOME,
@@ -79,7 +78,6 @@ public class Constants {
ACTION_FLASHLIGHT,
ACTION_CAMERA,
ACTION_SCREENSHOT,
ACTION_PIP,
ACTION_LAST_APP
};
public static final int[] sFPSupportedActionsScreenOff = new int[]{