Merge "Allow translation should also work on non-resume state" into sc-v2-dev am: fb894242ba am: d9cc1370f2
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15786469 Change-Id: I7dbebe2a073cc891d71d646de15fc1801828a807
This commit is contained in:
@@ -112,11 +112,10 @@ public class UiTranslationController {
|
||||
public void updateUiTranslationState(@UiTranslationState int state, TranslationSpec sourceSpec,
|
||||
TranslationSpec targetSpec, List<AutofillId> views,
|
||||
UiTranslationSpec uiTranslationSpec) {
|
||||
if (!mActivity.isResumed() && (state == STATE_UI_TRANSLATION_STARTED
|
||||
|| state == STATE_UI_TRANSLATION_RESUMED)) {
|
||||
if (mActivity.isDestroyed()) {
|
||||
Log.i(TAG, "Cannot update " + stateToString(state) + " for destroyed " + mActivity);
|
||||
return;
|
||||
}
|
||||
|
||||
Log.i(TAG, "updateUiTranslationState state: " + stateToString(state)
|
||||
+ (DEBUG ? (", views: " + views + ", spec: " + uiTranslationSpec) : ""));
|
||||
synchronized (mLock) {
|
||||
@@ -344,10 +343,8 @@ public class UiTranslationController {
|
||||
*/
|
||||
private void onVirtualViewTranslationCompleted(
|
||||
SparseArray<LongSparseArray<ViewTranslationResponse>> translatedResult) {
|
||||
if (!mActivity.isResumed()) {
|
||||
if (DEBUG) {
|
||||
Log.v(TAG, "onTranslationCompleted: Activity is not resumed.");
|
||||
}
|
||||
if (mActivity.isDestroyed()) {
|
||||
Log.v(TAG, "onTranslationCompleted:" + mActivity + "is destroyed.");
|
||||
return;
|
||||
}
|
||||
synchronized (mLock) {
|
||||
@@ -395,10 +392,8 @@ public class UiTranslationController {
|
||||
* The method is used to handle the translation result for non-vertual views.
|
||||
*/
|
||||
private void onTranslationCompleted(SparseArray<ViewTranslationResponse> translatedResult) {
|
||||
if (!mActivity.isResumed()) {
|
||||
if (DEBUG) {
|
||||
Log.v(TAG, "onTranslationCompleted: Activity is not resumed.");
|
||||
}
|
||||
if (mActivity.isDestroyed()) {
|
||||
Log.v(TAG, "onTranslationCompleted:" + mActivity + "is destroyed.");
|
||||
return;
|
||||
}
|
||||
final int resultCount = translatedResult.size();
|
||||
|
||||
Reference in New Issue
Block a user