Remove lifecycle-extensions from Settings
Bug: 259352947 Test: Make Settings Change-Id: Ide9749494ae89ca401120eb5ffee9c0d87043c48
This commit is contained in:
@@ -38,7 +38,7 @@ import android.util.Log;
|
||||
import android.util.Pair;
|
||||
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.lifecycle.ViewModelProviders;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
import androidx.preference.ListPreference;
|
||||
import androidx.preference.Preference;
|
||||
|
||||
@@ -208,7 +208,7 @@ public class TextToSpeechSettings extends SettingsPreferenceFragment
|
||||
}
|
||||
|
||||
final TextToSpeechViewModel ttsViewModel =
|
||||
ViewModelProviders.of(this).get(TextToSpeechViewModel.class);
|
||||
new ViewModelProvider(this).get(TextToSpeechViewModel.class);
|
||||
Pair<TextToSpeech, Boolean> ttsAndNew = ttsViewModel.getTtsAndWhetherNew(mInitListener);
|
||||
mTts = ttsAndNew.first;
|
||||
// If the TTS object is not newly created, we need to run the setup on the settings side to
|
||||
@@ -237,7 +237,7 @@ public class TextToSpeechSettings extends SettingsPreferenceFragment
|
||||
}
|
||||
if (!mTts.getDefaultEngine().equals(mTts.getCurrentEngine())) {
|
||||
final TextToSpeechViewModel ttsViewModel =
|
||||
ViewModelProviders.of(this).get(TextToSpeechViewModel.class);
|
||||
new ViewModelProvider(this).get(TextToSpeechViewModel.class);
|
||||
try {
|
||||
// If the current engine isn't the default engine shut down the current engine in
|
||||
// preparation for creating the new engine.
|
||||
|
Reference in New Issue
Block a user