mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-11-06 15:12:24 +00:00
Remove the Android 2.x/3.x support code.
The Android 4.x+ code has changed a lot since the initial import
of the eyes-free codebase. A lot of bug fixes and improvements
have been made to it.
The eyes-free codebase had two different code paths:
* one for ICS (4.0) or later, using the Java-based TTS APIs
provided by the Android platform;
* one for pre-ICS using an internal C++-based TTS API.
Thus, any bug fixes or improvements would have to be done to both
code bases if Android 2.x/3.x support is required. This is not
maintainable.
If pre-ICS support is to be re-added in the future, the plan will
be to:
* forward the C++-based APIs to the Java-based APIs via a
compatibility layer;
* use a compatibility layer (Android Support Library?) for using
the ICS settings API on pre-ICS.
This commit is contained in:
@@ -1,43 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2011 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.reecedunn.espeak;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.os.Bundle;
|
||||
|
||||
/*
|
||||
* The Java portion of this TTS plugin engine app does nothing.
|
||||
* This activity is only here so that the native code can be
|
||||
* wrapped up inside an apk file.
|
||||
*
|
||||
* The file path structure convention is that the native library
|
||||
* implementing TTS must be a file placed here:
|
||||
* /data/data/<PACKAGE_NAME>/lib/libtts<ACTIVITY_NAME_LOWERCASED>.so
|
||||
* Example:
|
||||
* /data/data/com.reecedunn.espeak/lib/libttsespeak.so
|
||||
*/
|
||||
|
||||
public class eSpeak extends Activity {
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
// The Java portion of this does nothing.
|
||||
// This activity is only here so that everything
|
||||
// can be wrapped up inside an apk file.
|
||||
finish();
|
||||
}
|
||||
}
|
||||
@@ -1,94 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2011 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.reecedunn.espeak.providers;
|
||||
|
||||
import com.reecedunn.espeak.CheckVoiceData;
|
||||
|
||||
import android.content.ContentProvider;
|
||||
import android.content.ContentValues;
|
||||
import android.database.Cursor;
|
||||
import android.database.MatrixCursor;
|
||||
import android.net.Uri;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
/**
|
||||
* Provides the "engineConfig" parameter for the legacy (pre-ICS) TTS API.
|
||||
*
|
||||
* @author alanv@google.com (Alan Viverette)
|
||||
*/
|
||||
public class SettingsProvider extends ContentProvider {
|
||||
private class SettingsCursor extends MatrixCursor {
|
||||
private String settings;
|
||||
|
||||
public SettingsCursor(String[] columnNames) {
|
||||
super(columnNames);
|
||||
}
|
||||
|
||||
public void putSettings(String settings) {
|
||||
this.settings = settings;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCount() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getString(int column) {
|
||||
return settings;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int delete(Uri uri, String selection, String[] selectionArgs) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getType(Uri uri) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Uri insert(Uri uri, ContentValues values) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCreate() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs,
|
||||
String sortOrder) {
|
||||
final File dataPath = CheckVoiceData.getDataPath(getContext());
|
||||
final String[] dummyColumns = {
|
||||
"", ""
|
||||
};
|
||||
final SettingsCursor cursor = new SettingsCursor(dummyColumns);
|
||||
cursor.putSettings(dataPath.getParent());
|
||||
return cursor;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int update(Uri uri, ContentValues values, String selection, String[] selectionArgs) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user