Skip to content

Commit

Permalink
Update: Talkback 14 (2024) (#12)
Browse files Browse the repository at this point in the history
* 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
qbalsdon authored Mar 2, 2024
1 parent ee887c0 commit 655cc8d
Show file tree
Hide file tree
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.
4 changes: 3 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,14 @@ jobs:
echo "BUILD START"
./build.sh -p
echo "BUILD COMPLETE"
echo "-----------------------------------------------------"
echo "ARTIFACT INFORMATION"
ls -ln ./build/outputs/apk/phone/release/talkback-phone-release-unsigned.apk
ls -ln ./build/outputs/apk/wear/release/talkback-wear-release-unsigned.apk
- name: Sign Phone and Wear Artifacts
run: |
echo "Available build tools"
ls ${ANDROID_SDK_ROOT}/build-tools/
echo "--------------------------------------"
SIGNING_KEY=${{ secrets.SIGNING_KEY }}
SIGNING_PASSWORD=${{ secrets.KEY_STORE_PASSWORD }}
BUILD_TOOLS=33.0.0
Expand Down
26 changes: 24 additions & 2 deletions .gitignore
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/
6 changes: 6 additions & 0 deletions braille/brailledisplay/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,11 @@ apply plugin: 'com.android.library'
apply from: "../../shared.gradle"

dependencies {
implementation project(':proguard')
implementation project(':utils')
implementation project(':braillebrltty')
implementation project(':brailledisplayanalytics')
implementation project(':brailleinterfaces')
implementation project(':brailletranslate')
implementation project(':braillecommon')
}

This file was deleted.

90 changes: 90 additions & 0 deletions braille/brailledisplay/src/phone/AndroidManifest.xml
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>
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();
}
}
Loading

0 comments on commit 655cc8d

Please sign in to comment.