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

@@ -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());