Merge "Honor accessibility timeout for screenshots" into rvc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
ad3149f08b
@@ -67,6 +67,7 @@ import android.view.ViewGroup;
|
|||||||
import android.view.ViewOutlineProvider;
|
import android.view.ViewOutlineProvider;
|
||||||
import android.view.ViewTreeObserver;
|
import android.view.ViewTreeObserver;
|
||||||
import android.view.WindowManager;
|
import android.view.WindowManager;
|
||||||
|
import android.view.accessibility.AccessibilityManager;
|
||||||
import android.view.animation.AccelerateInterpolator;
|
import android.view.animation.AccelerateInterpolator;
|
||||||
import android.view.animation.AnimationUtils;
|
import android.view.animation.AnimationUtils;
|
||||||
import android.view.animation.Interpolator;
|
import android.view.animation.Interpolator;
|
||||||
@@ -169,7 +170,7 @@ public class GlobalScreenshot implements ViewTreeObserver.OnComputeInternalInset
|
|||||||
private static final long SCREENSHOT_DISMISS_ALPHA_OFFSET_MS = 50; // delay before starting fade
|
private static final long SCREENSHOT_DISMISS_ALPHA_OFFSET_MS = 50; // delay before starting fade
|
||||||
private static final float SCREENSHOT_ACTIONS_START_SCALE_X = .7f;
|
private static final float SCREENSHOT_ACTIONS_START_SCALE_X = .7f;
|
||||||
private static final float ROUNDED_CORNER_RADIUS = .05f;
|
private static final float ROUNDED_CORNER_RADIUS = .05f;
|
||||||
private static final long SCREENSHOT_CORNER_TIMEOUT_MILLIS = 6000;
|
private static final int SCREENSHOT_CORNER_DEFAULT_TIMEOUT_MILLIS = 6000;
|
||||||
private static final int MESSAGE_CORNER_TIMEOUT = 2;
|
private static final int MESSAGE_CORNER_TIMEOUT = 2;
|
||||||
|
|
||||||
private final Interpolator mAccelerateInterpolator = new AccelerateInterpolator();
|
private final Interpolator mAccelerateInterpolator = new AccelerateInterpolator();
|
||||||
@@ -588,10 +589,16 @@ public class GlobalScreenshot implements ViewTreeObserver.OnComputeInternalInset
|
|||||||
} else {
|
} else {
|
||||||
createScreenshotActionsShadeAnimation(imageData).start();
|
createScreenshotActionsShadeAnimation(imageData).start();
|
||||||
}
|
}
|
||||||
|
AccessibilityManager accessibilityManager = (AccessibilityManager)
|
||||||
|
mContext.getSystemService(Context.ACCESSIBILITY_SERVICE);
|
||||||
|
long timeoutMs = accessibilityManager.getRecommendedTimeoutMillis(
|
||||||
|
SCREENSHOT_CORNER_DEFAULT_TIMEOUT_MILLIS,
|
||||||
|
AccessibilityManager.FLAG_CONTENT_CONTROLS);
|
||||||
|
|
||||||
mScreenshotHandler.removeMessages(MESSAGE_CORNER_TIMEOUT);
|
mScreenshotHandler.removeMessages(MESSAGE_CORNER_TIMEOUT);
|
||||||
mScreenshotHandler.sendMessageDelayed(
|
mScreenshotHandler.sendMessageDelayed(
|
||||||
mScreenshotHandler.obtainMessage(MESSAGE_CORNER_TIMEOUT),
|
mScreenshotHandler.obtainMessage(MESSAGE_CORNER_TIMEOUT),
|
||||||
SCREENSHOT_CORNER_TIMEOUT_MILLIS);
|
timeoutMs);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user