Loading core/java/android/speech/tts/FileSynthesisCallback.java +7 −15 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ */ package android.speech.tts; import android.annotation.NonNull; import android.media.AudioFormat; import android.speech.tts.TextToSpeechService.UtteranceProgressDispatcher; import android.util.Log; Loading Loading @@ -46,7 +47,6 @@ class FileSynthesisCallback extends AbstractSynthesisCallback { private FileChannel mFileChannel; private final UtteranceProgressDispatcher mDispatcher; private final Object mCallerIdentity; private boolean mStarted = false; private boolean mDone = false; Loading @@ -54,12 +54,11 @@ class FileSynthesisCallback extends AbstractSynthesisCallback { /** Status code of synthesis */ protected int mStatusCode; FileSynthesisCallback(FileChannel fileChannel, UtteranceProgressDispatcher dispatcher, Object callerIdentity, boolean clientIsUsingV2) { FileSynthesisCallback(@NonNull FileChannel fileChannel, @NonNull UtteranceProgressDispatcher dispatcher, boolean clientIsUsingV2) { super(clientIsUsingV2); mFileChannel = fileChannel; mDispatcher = dispatcher; mCallerIdentity = callerIdentity; mStatusCode = TextToSpeech.SUCCESS; } Loading @@ -75,11 +74,9 @@ class FileSynthesisCallback extends AbstractSynthesisCallback { mStatusCode = TextToSpeech.STOPPED; cleanUp(); if (mDispatcher != null) { mDispatcher.dispatchOnStop(); } } } /** * Must be called while holding the monitor on {@link #mStateLock}. Loading Loading @@ -134,9 +131,7 @@ class FileSynthesisCallback extends AbstractSynthesisCallback { mAudioFormat = audioFormat; mChannelCount = channelCount; if (mDispatcher != null) { mDispatcher.dispatchOnStart(); } fileChannel = mFileChannel; } Loading Loading @@ -214,8 +209,7 @@ class FileSynthesisCallback extends AbstractSynthesisCallback { if (DBG) Log.d(TAG, "Request has been aborted."); return errorCodeOnStop(); } if (mDispatcher != null && mStatusCode != TextToSpeech.SUCCESS && mStatusCode != TextToSpeech.STOPPED) { if (mStatusCode != TextToSpeech.SUCCESS && mStatusCode != TextToSpeech.STOPPED) { mDispatcher.dispatchOnError(mStatusCode); return TextToSpeech.ERROR; } Loading @@ -239,9 +233,7 @@ class FileSynthesisCallback extends AbstractSynthesisCallback { synchronized (mStateLock) { closeFile(); if (mDispatcher != null) { mDispatcher.dispatchOnSuccess(); } return TextToSpeech.SUCCESS; } } catch (IOException ex) { Loading core/java/android/speech/tts/TextToSpeechService.java +1 −2 Original line number Diff line number Diff line Loading @@ -1032,8 +1032,7 @@ public abstract class TextToSpeechService extends Service { @Override protected AbstractSynthesisCallback createSynthesisCallback() { return new FileSynthesisCallback(mFileOutputStream.getChannel(), this, getCallerIdentity(), false); return new FileSynthesisCallback(mFileOutputStream.getChannel(), this, false); } @Override Loading Loading
core/java/android/speech/tts/FileSynthesisCallback.java +7 −15 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ */ package android.speech.tts; import android.annotation.NonNull; import android.media.AudioFormat; import android.speech.tts.TextToSpeechService.UtteranceProgressDispatcher; import android.util.Log; Loading Loading @@ -46,7 +47,6 @@ class FileSynthesisCallback extends AbstractSynthesisCallback { private FileChannel mFileChannel; private final UtteranceProgressDispatcher mDispatcher; private final Object mCallerIdentity; private boolean mStarted = false; private boolean mDone = false; Loading @@ -54,12 +54,11 @@ class FileSynthesisCallback extends AbstractSynthesisCallback { /** Status code of synthesis */ protected int mStatusCode; FileSynthesisCallback(FileChannel fileChannel, UtteranceProgressDispatcher dispatcher, Object callerIdentity, boolean clientIsUsingV2) { FileSynthesisCallback(@NonNull FileChannel fileChannel, @NonNull UtteranceProgressDispatcher dispatcher, boolean clientIsUsingV2) { super(clientIsUsingV2); mFileChannel = fileChannel; mDispatcher = dispatcher; mCallerIdentity = callerIdentity; mStatusCode = TextToSpeech.SUCCESS; } Loading @@ -75,11 +74,9 @@ class FileSynthesisCallback extends AbstractSynthesisCallback { mStatusCode = TextToSpeech.STOPPED; cleanUp(); if (mDispatcher != null) { mDispatcher.dispatchOnStop(); } } } /** * Must be called while holding the monitor on {@link #mStateLock}. Loading Loading @@ -134,9 +131,7 @@ class FileSynthesisCallback extends AbstractSynthesisCallback { mAudioFormat = audioFormat; mChannelCount = channelCount; if (mDispatcher != null) { mDispatcher.dispatchOnStart(); } fileChannel = mFileChannel; } Loading Loading @@ -214,8 +209,7 @@ class FileSynthesisCallback extends AbstractSynthesisCallback { if (DBG) Log.d(TAG, "Request has been aborted."); return errorCodeOnStop(); } if (mDispatcher != null && mStatusCode != TextToSpeech.SUCCESS && mStatusCode != TextToSpeech.STOPPED) { if (mStatusCode != TextToSpeech.SUCCESS && mStatusCode != TextToSpeech.STOPPED) { mDispatcher.dispatchOnError(mStatusCode); return TextToSpeech.ERROR; } Loading @@ -239,9 +233,7 @@ class FileSynthesisCallback extends AbstractSynthesisCallback { synchronized (mStateLock) { closeFile(); if (mDispatcher != null) { mDispatcher.dispatchOnSuccess(); } return TextToSpeech.SUCCESS; } } catch (IOException ex) { Loading
core/java/android/speech/tts/TextToSpeechService.java +1 −2 Original line number Diff line number Diff line Loading @@ -1032,8 +1032,7 @@ public abstract class TextToSpeechService extends Service { @Override protected AbstractSynthesisCallback createSynthesisCallback() { return new FileSynthesisCallback(mFileOutputStream.getChannel(), this, getCallerIdentity(), false); return new FileSynthesisCallback(mFileOutputStream.getChannel(), this, false); } @Override Loading