Browse Source

Remove cleanup of the legacy directory as this port does not have a legacy directory; removes the need for the WRITE_EXTERNAL_STORAGE permission.

master
Reece H. Dunn 12 years ago
parent
commit
8f2ea37c7a

+ 1
- 3
android/AndroidManifest.xml View File

android:versionCode="7" android:versionCode="7"
android:versionName="1.46.02_r7" > android:versionName="1.46.02_r7" >


<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

<uses-feature <uses-feature
android:name="android.hardware.touchscreen" android:name="android.hardware.touchscreen"
android:required="false" /> android:required="false" />
android:authorities="com.googlecode.eyesfree.espeak.providers.SettingsProvider" /> android:authorities="com.googlecode.eyesfree.espeak.providers.SettingsProvider" />
</application> </application>


</manifest>
</manifest>

+ 0
- 16
android/src/com/googlecode/eyesfree/espeak/DownloadVoiceData.java View File

import android.content.Intent; import android.content.Intent;
import android.os.AsyncTask; import android.os.AsyncTask;
import android.os.Bundle; import android.os.Bundle;
import android.os.Environment;
import android.view.accessibility.AccessibilityEvent; import android.view.accessibility.AccessibilityEvent;


import java.io.BufferedInputStream; import java.io.BufferedInputStream;
public class DownloadVoiceData extends Activity { public class DownloadVoiceData extends Activity {
public static final String BROADCAST_LANGUAGES_UPDATED = "com.googlecode.eyesfree.espeak.LANGUAGES_UPDATED"; public static final String BROADCAST_LANGUAGES_UPDATED = "com.googlecode.eyesfree.espeak.LANGUAGES_UPDATED";


private static final File LEGACY_DATA = new File(
Environment.getExternalStorageDirectory(), "espeak-data");

private AsyncExtract mAsyncExtract; private AsyncExtract mAsyncExtract;


@Override @Override
case RESULT_OK: case RESULT_OK:
final Intent intent = new Intent(BROADCAST_LANGUAGES_UPDATED); final Intent intent = new Intent(BROADCAST_LANGUAGES_UPDATED);
sendBroadcast(intent); sendBroadcast(intent);
new AsyncCleanup().execute(LEGACY_DATA);
break; break;
case RESULT_CANCELED: case RESULT_CANCELED:
// Do nothing? // Do nothing?
} }
} }


private static class AsyncCleanup extends AsyncTask<File, Void, Void> {
@Override
protected Void doInBackground(File... params) {
for (File directory : params) {
clearContents(directory);
}

return null;
}
}

private static class AsyncExtract extends AsyncTask<Void, Void, Integer> { private static class AsyncExtract extends AsyncTask<Void, Void, Integer> {
private final LinkedList<File> mExtractedFiles = new LinkedList<File>(); private final LinkedList<File> mExtractedFiles = new LinkedList<File>();



Loading…
Cancel
Save