use of com.stardust.pio.UncheckedIOException in project Auto.js by hyb1996.
the class JavaScriptHighlighter method updateTokens.
public void updateTokens(String sourceString) {
final int id = mRunningHighlighterId.incrementAndGet();
mExecutorService.execute(() -> {
try {
mLogger.reset();
updateTokens(sourceString, id);
mLogger.addSplit("parse tokens");
mLogger.dumpToLog();
} catch (IOException neverHappen) {
throw new UncheckedIOException(neverHappen);
}
});
}
use of com.stardust.pio.UncheckedIOException in project Auto.js by hyb1996.
the class Media method playMusic.
public void playMusic(String path, float volume, boolean looping) {
if (mMediaPlayer == null) {
mMediaPlayer = new MediaPlayerWrapper();
}
mMediaPlayer.stopAndReset();
try {
mMediaPlayer.setDataSource(path);
} catch (IOException e) {
throw new UncheckedIOException(e);
}
mMediaPlayer.setVolume(volume, volume);
mMediaPlayer.setLooping(looping);
mMediaPlayer.start();
}
use of com.stardust.pio.UncheckedIOException in project Auto.js by hyb1996.
the class ProcessShell method init.
@Override
protected void init(String initialCommand) {
try {
mProcess = new ProcessBuilder(initialCommand).redirectErrorStream(true).start();
mCommandOutputStream = new DataOutputStream(mProcess.getOutputStream());
mSucceedReader = new BufferedReader(new InputStreamReader(mProcess.getInputStream()));
mErrorReader = new BufferedReader(new InputStreamReader(mProcess.getErrorStream()));
} catch (IOException e) {
throw new UncheckedIOException(e);
}
}
use of com.stardust.pio.UncheckedIOException in project Auto.js by hyb1996.
the class Shell method init.
@Override
protected void init(final String initialCommand) {
Handler uiHandler = new Handler(mContext.getMainLooper());
uiHandler.post(new Runnable() {
@Override
public void run() {
TermSettings settings = new TermSettings(mContext.getResources(), PreferenceManager.getDefaultSharedPreferences(mContext));
try {
mTermSession = new MyShellTermSession(settings, initialCommand);
mTermSession.initializeEmulator(1024, 40);
} catch (IOException e) {
mInitException = new UncheckedIOException(e);
}
}
});
}
use of com.stardust.pio.UncheckedIOException in project Auto.js by hyb1996.
the class JsBeautifier method compile.
private void compile() {
try {
enterContext();
InputStream is = mContext.getAssets().open(mBeautifyJsPath);
if (mScriptable == null)
mScriptable = mScriptContext.initSafeStandardObjects();
mJsBeautifyFunction = (Function) mScriptContext.evaluateString(mScriptable, PFiles.read(is), "<js_beautify>", 1, null);
} catch (IOException e) {
exitContext();
throw new UncheckedIOException(e);
}
}
Aggregations