Skip to content

Commit

Permalink
Push to GitHub 2022-01-08
Browse files Browse the repository at this point in the history
  • Loading branch information
simplexatg committed Jan 9, 2022
1 parent 9db811a commit 6c0b475
Show file tree
Hide file tree
Showing 1,081 changed files with 17,474 additions and 6,488 deletions.
13 changes: 11 additions & 2 deletions braille/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,21 @@ apply from: "../shared.gradle"
android {
externalNativeBuild {
ndkBuild {
path file('src/main/jni/Android.mk')
path file('src/phone/jni/Android.mk')
}
}
}

dependencies {
implementation project(':proguard') // Only exists in open source repo.
implementation project(':proguard')
implementation project(':utils')
}

task createTranslationTablesZip(type: Zip){
archiveName="translationtables.zip"
destinationDir = file('src/phone/res/raw/')
from fileTree('./src/phone/tables/')
into('liblouis/tables')
}

preBuild.dependsOn createTranslationTablesZip
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,10 @@ JNIEXPORT jobject JNICALL JNI_METHOD(translateNative)(
std::vector<int> output_pos(in_len); // Maps char -> cell pos.

int cursor_out_pos = -1;
if (cursorPosition < in_len && cursorPosition > 0) {
int* cursor_pos_pointer = nullptr;
if (cursorPosition < in_len && cursorPosition >= 0) {
cursor_out_pos = cursorPosition;
cursor_pos_pointer = &cursor_out_pos;
}

// See <https://crrev.com/243251> for equivalent ChromeVox implementation.
Expand Down Expand Up @@ -77,7 +79,7 @@ JNIEXPORT jobject JNICALL JNI_METHOD(translateNative)(
int result = lou_translate(
table_name_utf8, text_utf16, &in_used, out_buf.data(), &out_used,
/* typeform= */ nullptr, /* spacing= */ nullptr, output_pos.data(),
input_pos.data(), &cursor_out_pos,
input_pos.data(), cursor_pos_pointer,
computerBrailleAtCursor ? compbrlAtCursor | dotsIO : dotsIO);
if (result == 0) {
LOGE("Translation failed.");
Expand Down Expand Up @@ -120,7 +122,7 @@ JNIEXPORT jobject JNICALL JNI_METHOD(translateNative)(
return nullptr;
}
env->SetIntArrayRegion(input_pos_array, 0, out_used, input_pos.data());
if (cursorPosition < in_len && cursorPosition > 0) {
if (cursor_pos_pointer == nullptr && cursorPosition >= 0) {
// The cursor position was past-the-end of the input, normalize to
// past-the-end of the output.
cursor_out_pos = out_used;
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
51 changes: 1 addition & 50 deletions brailleime/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,53 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.google.android.accessibility.brailleime">

<uses-sdk
android:minSdkVersion="23"
android:targetSdkVersion="30" />

<!-- Required for haptic feedback. -->
<uses-permission android:name="android.permission.VIBRATE" />

<application>
<service
android:name="com.google.android.accessibility.brailleime.BrailleIme"
android:label="@string/braille_ime_service_name"
android:enabled="false"
android:directBootAware="true"
android:permission="android.permission.BIND_INPUT_METHOD">
<intent-filter>
<action android:name="android.view.InputMethod" />
</intent-filter>
<meta-data
android:name="android.view.im"
android:resource="@xml/braille_ime" />
</service>
<activity
android:name="com.google.android.accessibility.brailleime.settings.BrailleImePreferencesActivity"
android:configChanges="orientation|screenSize"
android:exported="true"
android:label="@string/braille_keyboard"
android:launchMode="singleTop"
android:taskAffinity="com.google.android.accessibility.talkback.SettingsAffinity"
android:theme="@style/SettingsTheme"
tools:ignore="ExportedActivity"
>
<intent-filter>
<action android:name=".BrailleImePreferencesActivity" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>

<receiver android:name=".MyPackageReplacedReceiver"
android:enabled="true"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MY_PACKAGE_REPLACED" />
</intent-filter>
</receiver>

</application>

</manifest>
package="com.google.android.accessibility.brailleime" />

This file was deleted.

Binary file not shown.
111 changes: 0 additions & 111 deletions brailleime/src/main/res/drawable/braille_keyboard.xml

This file was deleted.

120 changes: 0 additions & 120 deletions brailleime/src/main/res/drawable/braille_keyboard_letter_a.xml

This file was deleted.

Binary file not shown.
Loading

0 comments on commit 6c0b475

Please sign in to comment.