Temporarily enable touch exploration in Accessibility tutorial
Change-Id: I630f037f909a8941b9547fea95aecc2a1b374451
This commit is contained in:
@@ -17,6 +17,7 @@
|
|||||||
package com.android.settings;
|
package com.android.settings;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
|
import android.content.ContentResolver;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
@@ -25,6 +26,7 @@ import android.graphics.drawable.Drawable;
|
|||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.os.Message;
|
import android.os.Message;
|
||||||
|
import android.provider.Settings;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.MotionEvent;
|
import android.view.MotionEvent;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
@@ -52,9 +54,6 @@ import java.util.List;
|
|||||||
* available in Touch Exploration.
|
* available in Touch Exploration.
|
||||||
*/
|
*/
|
||||||
public class AccessibilityTutorialActivity extends Activity {
|
public class AccessibilityTutorialActivity extends Activity {
|
||||||
/** Intent action for launching this activity. */
|
|
||||||
public static final String ACTION = "com.android.settings.touchtutorial.LAUNCH_TUTORIAL";
|
|
||||||
|
|
||||||
/** Instance state saving constant for the active module. */
|
/** Instance state saving constant for the active module. */
|
||||||
private static final String KEY_ACTIVE_MODULE = "active_module";
|
private static final String KEY_ACTIVE_MODULE = "active_module";
|
||||||
|
|
||||||
@@ -66,6 +65,9 @@ public class AccessibilityTutorialActivity extends Activity {
|
|||||||
|
|
||||||
private AccessibilityManager mAccessibilityManager;
|
private AccessibilityManager mAccessibilityManager;
|
||||||
|
|
||||||
|
/** Should touch exploration be disabled when this activity is paused? */
|
||||||
|
private boolean mDisableOnPause;
|
||||||
|
|
||||||
private final AnimationListener mInAnimationListener = new AnimationListener() {
|
private final AnimationListener mInAnimationListener = new AnimationListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onAnimationEnd(Animation animation) {
|
public void onAnimationEnd(Animation animation) {
|
||||||
@@ -114,6 +116,30 @@ public class AccessibilityTutorialActivity extends Activity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onResume() {
|
||||||
|
super.onResume();
|
||||||
|
|
||||||
|
final ContentResolver cr = getContentResolver();
|
||||||
|
|
||||||
|
if (Settings.Secure.getInt(cr, Settings.Secure.TOUCH_EXPLORATION_ENABLED, 0) == 0) {
|
||||||
|
Settings.Secure.putInt(cr, Settings.Secure.TOUCH_EXPLORATION_ENABLED, 1);
|
||||||
|
mDisableOnPause = true;
|
||||||
|
} else {
|
||||||
|
mDisableOnPause = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onPause() {
|
||||||
|
super.onPause();
|
||||||
|
|
||||||
|
if (mDisableOnPause) {
|
||||||
|
final ContentResolver cr = getContentResolver();
|
||||||
|
Settings.Secure.putInt(cr, Settings.Secure.TOUCH_EXPLORATION_ENABLED, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onSaveInstanceState(Bundle outState) {
|
protected void onSaveInstanceState(Bundle outState) {
|
||||||
super.onSaveInstanceState(outState);
|
super.onSaveInstanceState(outState);
|
||||||
|
Reference in New Issue
Block a user