forked from google/talkback
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Push to GitHub 2024-02-26 * Pipeline: Download with cUrl * Pipeline: Download with cUrl into temp dir * Allow build to use local temp directory to prevent gradle re-download and use assemble not assembleDebug * Pipeline fix 1 * Pipeline fix 2: Added build tools logging --------- Co-authored-by: simplexatg <simplexatg>
- Loading branch information
Showing
3,343 changed files
with
690,707 additions
and
57,260 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,32 @@ | ||
.gradle/ | ||
.idea/ | ||
build/ | ||
.cxx/ | ||
braille/translate/src/phone/res/ | ||
gradle/ | ||
gradlew | ||
gradlew.bat | ||
gradle-*/ | ||
|
||
## generated content files | ||
braille/translate/src/phone/res/raw/translationtables.zip | ||
braille/brltty/src/phone/res/raw/keytables.zip | ||
|
||
## special build files | ||
local.properties | ||
gradle-*/ | ||
.gradle/ | ||
|
||
## generated intermediates | ||
braille/brailledisplay/build/ | ||
braille/brailledisplayanalytics/build/ | ||
braille/brailleime/build/ | ||
braille/brailleimeanalytics/build/ | ||
braille/brltty/.cxx/ | ||
braille/brltty/build/ | ||
braille/common/build/ | ||
braille/interfaces/build/ | ||
braille/translate/.cxx/ | ||
braille/translate/build/ | ||
build/ | ||
proguard/build/ | ||
talkback/build/ | ||
utils/build/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 0 additions & 42 deletions
42
...src/main/java/com/google/android/accessibility/braille/brailledisplay/BrailleDisplay.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="com.google.android.accessibility.braille.brailledisplay"> | ||
|
||
<uses-sdk | ||
android:minSdkVersion="26" | ||
android:targetSdkVersion="31" /> | ||
<uses-permission android:name="android.permission.WAKE_LOCK" /> | ||
<!-- If you need access to FINE location, you must request both ACCESS_FINE_LOCATION and ACCESS_COARSE_LOCATION. --> | ||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" android:maxSdkVersion="30" /> | ||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" android:maxSdkVersion="30" /> | ||
<uses-permission android:name="android.permission.BLUETOOTH" android:maxSdkVersion="30" /> | ||
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" android:maxSdkVersion="30" /> | ||
<uses-permission android:name="android.permission.INTERNET" /> | ||
<!-- Bluetooth permissions introduced in API level 31. --> | ||
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" /> | ||
<uses-permission android:name="android.permission.BLUETOOTH_SCAN" android:usesPermissionFlags="neverForLocation" /> | ||
|
||
<uses-feature android:name="android.hardware.usb.host" /> | ||
|
||
<application> | ||
|
||
<activity | ||
android:name="com.google.android.accessibility.braille.brailledisplay.settings.BrailleDisplaySettingsActivity" | ||
android:label="@string/bd_preferences_title" | ||
android:theme="@style/BrailleSettingsTheme" | ||
android:configChanges="orientation|screenSize" | ||
android:exported="true" | ||
android:launchMode="singleTop" > | ||
<intent-filter> | ||
<action android:name=".BrailleDisplayPreferencesActivity" /> | ||
<category android:name="android.intent.category.DEFAULT" /> | ||
</intent-filter> | ||
</activity> | ||
|
||
<activity | ||
android:name="com.google.android.accessibility.braille.brailledisplay.settings.BrailleGradeActivity" | ||
android:label="@string/pref_preferred_braille_grade_title" | ||
android:exported="true" | ||
android:theme="@style/BrailleSettingsTheme" > | ||
<!-- TODO: Currently, braille grade is placed in braille display folder and share with braille keyboard. If we're going separate them into different settings. This intent filter can be removed. --> | ||
<intent-filter> | ||
<action android:name=".BrailleGradeActivity" /> | ||
<category android:name="android.intent.category.DEFAULT" /> | ||
</intent-filter> | ||
</activity> | ||
|
||
<activity | ||
android:name="com.google.android.accessibility.braille.brailledisplay.settings.KeyBindingsActivity" | ||
android:label="@string/bd_preference_key_bindings_title" | ||
android:exported="false" | ||
android:theme="@style/BrailleSettingsTheme" /> | ||
|
||
<activity | ||
android:name="com.google.android.accessibility.braille.brailledisplay.settings.KeyBindingsCommandActivity" | ||
android:exported="true" | ||
android:theme="@style/BrailleSettingsTheme" > | ||
<intent-filter> | ||
<action android:name=".KeyBindingsCommandActivity" /> | ||
<category android:name="android.intent.category.DEFAULT" /> | ||
</intent-filter> | ||
</activity> | ||
|
||
<activity | ||
android:name="com.google.android.accessibility.braille.brailledisplay.settings.BrailleElementsActivity" | ||
android:label="@string/bd_preference_key_braille_elements_title" | ||
android:exported="false" | ||
android:theme="@style/BrailleSettingsTheme" /> | ||
|
||
<activity | ||
android:name="com.google.android.accessibility.braille.brailledisplay.BrailleDisplayImeUnavailableActivity" | ||
android:label="@string/bd_ime_unavailable_activity_name" | ||
android:exported="false" | ||
android:excludeFromRecents="true" | ||
android:theme="@style/Theme.Transparent" /> | ||
|
||
<activity | ||
android:name="com.google.android.accessibility.braille.brailledisplay.settings.AutoScrollActivity" | ||
android:label="@string/bd_preference_key_auto_scroll_title" | ||
android:exported="false" | ||
android:theme="@style/BrailleSettingsTheme" /> | ||
|
||
<activity | ||
android:name="com.google.android.accessibility.braille.brailledisplay.settings.AdvancedSettingsActivity" | ||
android:label="@string/bd_preference_key_advanced_settings_title" | ||
android:exported="false" | ||
android:theme="@style/BrailleSettingsTheme" /> | ||
</application> | ||
|
||
</manifest> |
97 changes: 97 additions & 0 deletions
97
...rc/phone/java/com/google/android/accessibility/braille/brailledisplay/BrailleDisplay.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
package com.google.android.accessibility.braille.brailledisplay; | ||
|
||
import android.accessibilityservice.AccessibilityService; | ||
import android.view.accessibility.AccessibilityEvent; | ||
import com.google.android.accessibility.braille.brailledisplay.controller.BdController; | ||
import com.google.android.accessibility.braille.brailledisplay.platform.BrailleDisplayManager; | ||
import com.google.android.accessibility.braille.brltty.BrlttyEncoder; | ||
import com.google.android.accessibility.braille.brltty.Encoder; | ||
import com.google.android.accessibility.braille.interfaces.BrailleDisplayForBrailleIme; | ||
import com.google.android.accessibility.braille.interfaces.BrailleDisplayForTalkBack; | ||
import com.google.android.accessibility.braille.interfaces.BrailleImeForBrailleDisplay; | ||
import com.google.android.accessibility.braille.interfaces.TalkBackForBrailleDisplay; | ||
|
||
/** Entry point between TalkBack and the braille display feature. */ | ||
public class BrailleDisplay implements BrailleDisplayForTalkBack, BrailleDisplayForBrailleIme { | ||
private static final String TAG = "BrailleDisplay"; | ||
public static final Encoder.Factory ENCODER_FACTORY = new BrlttyEncoder.BrlttyFactory(); | ||
|
||
private boolean isRunning; | ||
private BrailleDisplayManager brailleDisplayManager; | ||
private final BdController controller; | ||
private final AccessibilityService accessibilityService; | ||
|
||
/** Provides BrailleIme callbacks for BrailleDisplay. */ | ||
public interface BrailleImeProvider { | ||
BrailleImeForBrailleDisplay getBrailleImeForBrailleDisplay(); | ||
} | ||
|
||
public BrailleDisplay( | ||
AccessibilityService accessibilityService, | ||
TalkBackForBrailleDisplay talkBackForBrailleDisplay, | ||
BrailleImeProvider brailleImeProvider) { | ||
this.controller = | ||
new BdController(accessibilityService, talkBackForBrailleDisplay, brailleImeProvider); | ||
this.accessibilityService = accessibilityService; | ||
this.brailleDisplayManager = | ||
new BrailleDisplayManager(accessibilityService, controller, ENCODER_FACTORY); | ||
BrailleDisplayTalkBackSpeaker.getInstance().initialize(talkBackForBrailleDisplay); | ||
} | ||
|
||
/** Starts braille display. */ | ||
@Override | ||
public void start() { | ||
BrailleDisplayLog.d(TAG, "start"); | ||
brailleDisplayManager.setAccessibilityServiceContextProvider(() -> accessibilityService); | ||
brailleDisplayManager.onServiceStarted(); | ||
isRunning = true; | ||
} | ||
|
||
/** Stops braille display. */ | ||
@Override | ||
public void stop() { | ||
BrailleDisplayLog.d(TAG, "stop"); | ||
brailleDisplayManager.onServiceStopped(); | ||
brailleDisplayManager.setAccessibilityServiceContextProvider(() -> null); | ||
brailleDisplayManager = null; | ||
isRunning = false; | ||
} | ||
|
||
/** Notifies receiving accessibility event. */ | ||
@Override | ||
public void onAccessibilityEvent(AccessibilityEvent accessibilityEvent) { | ||
if (isRunning) { | ||
brailleDisplayManager.onAccessibilityEvent(accessibilityEvent); | ||
} | ||
} | ||
|
||
@Override | ||
public void onReadingControlChanged(CharSequence readingControlDescription) { | ||
controller.onReadingControlChanged(readingControlDescription); | ||
} | ||
|
||
@Override | ||
public void switchBrailleDisplayOnOrOff() { | ||
controller.switchBrailleDisplayOnOrOff(); | ||
} | ||
|
||
@Override | ||
public void onImeVisibilityChanged(boolean visible) { | ||
controller.getBrailleDisplayForBrailleIme().onImeVisibilityChanged(visible); | ||
} | ||
|
||
@Override | ||
public void showOnDisplay(ResultForDisplay result) { | ||
controller.getBrailleDisplayForBrailleIme().showOnDisplay(result); | ||
} | ||
|
||
@Override | ||
public boolean isBrailleDisplayConnectedAndNotSuspended() { | ||
return controller.getBrailleDisplayForBrailleIme().isBrailleDisplayConnectedAndNotSuspended(); | ||
} | ||
|
||
@Override | ||
public void suspendInFavorOfBrailleKeyboard() { | ||
controller.getBrailleDisplayForBrailleIme().suspendInFavorOfBrailleKeyboard(); | ||
} | ||
} |
Oops, something went wrong.