зеркало из https://github.com/mozilla/gecko-dev.git
Bug 699243 - Add method to GeckoAppShell to check for a11y and bridge it [r=blassey]
This commit is contained in:
Родитель
4efe487534
Коммит
6180f2fde8
|
@ -63,6 +63,7 @@ import android.webkit.MimeTypeMap;
|
|||
import android.media.MediaScannerConnection;
|
||||
import android.media.MediaScannerConnection.MediaScannerConnectionClient;
|
||||
import android.provider.Settings;
|
||||
import android.view.accessibility.AccessibilityManager;
|
||||
|
||||
import android.util.*;
|
||||
import android.net.Uri;
|
||||
|
@ -1316,6 +1317,13 @@ public class GeckoAppShell
|
|||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean getAccessibilityEnabled() {
|
||||
AccessibilityManager accessibilityManager =
|
||||
(AccessibilityManager) GeckoApp.mAppContext.getSystemService(Context.ACCESSIBILITY_SERVICE);
|
||||
return accessibilityManager.isEnabled();
|
||||
}
|
||||
|
||||
public static void addPluginView(View view,
|
||||
double x, double y,
|
||||
double w, double h)
|
||||
|
|
|
@ -150,6 +150,7 @@ AndroidBridge::Init(JNIEnv *jEnv,
|
|||
jFireAndWaitForTracerEvent = (jmethodID) jEnv->GetStaticMethodID(jGeckoAppShellClass, "fireAndWaitForTracerEvent", "()V");
|
||||
jCreateShortcut = (jmethodID) jEnv->GetStaticMethodID(jGeckoAppShellClass, "createShortcut", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V");
|
||||
jGetShowPasswordSetting = (jmethodID) jEnv->GetStaticMethodID(jGeckoAppShellClass, "getShowPasswordSetting", "()Z");
|
||||
jGetAccessibilityEnabled = (jmethodID) jEnv->GetStaticMethodID(jGeckoAppShellClass, "getAccessibilityEnabled", "()Z");
|
||||
jPostToJavaThread = (jmethodID) jEnv->GetStaticMethodID(jGeckoAppShellClass, "postToJavaThread", "(Z)V");
|
||||
jInitCamera = (jmethodID) jEnv->GetStaticMethodID(jGeckoAppShellClass, "initCamera", "(Ljava/lang/String;III)[I");
|
||||
jCloseCamera = (jmethodID) jEnv->GetStaticMethodID(jGeckoAppShellClass, "closeCamera", "()V");
|
||||
|
@ -763,6 +764,13 @@ AndroidBridge::GetShowPasswordSetting()
|
|||
return mJNIEnv->CallStaticBooleanMethod(mGeckoAppShellClass, jGetShowPasswordSetting);
|
||||
}
|
||||
|
||||
bool
|
||||
AndroidBridge::GetAccessibilityEnabled()
|
||||
{
|
||||
ALOG_BRIDGE("AndroidBridge::GetAccessibilityEnabled");
|
||||
return mJNIEnv->CallStaticBooleanMethod(mGeckoAppShellClass, jGetAccessibilityEnabled);
|
||||
}
|
||||
|
||||
void
|
||||
AndroidBridge::SetSurfaceView(jobject obj)
|
||||
{
|
||||
|
|
|
@ -219,6 +219,8 @@ public:
|
|||
|
||||
void FireAndWaitForTracerEvent();
|
||||
|
||||
bool GetAccessibilityEnabled();
|
||||
|
||||
struct AutoLocalJNIFrame {
|
||||
AutoLocalJNIFrame(int nEntries = 128) : mEntries(nEntries) {
|
||||
// Make sure there is enough space to store a local ref to the
|
||||
|
@ -367,6 +369,7 @@ protected:
|
|||
jmethodID jFireAndWaitForTracerEvent;
|
||||
jmethodID jCreateShortcut;
|
||||
jmethodID jGetShowPasswordSetting;
|
||||
jmethodID jGetAccessibilityEnabled;
|
||||
jmethodID jPostToJavaThread;
|
||||
jmethodID jInitCamera;
|
||||
jmethodID jCloseCamera;
|
||||
|
|
Загрузка…
Ссылка в новой задаче