Merge "fix bug 184901520." into sc-dev
This commit is contained in:
@@ -24,6 +24,7 @@ import android.app.PendingIntent;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.os.Looper;
|
import android.os.Looper;
|
||||||
|
import android.os.Parcelable;
|
||||||
import android.os.RemoteException;
|
import android.os.RemoteException;
|
||||||
import android.os.SynchronousResultReceiver;
|
import android.os.SynchronousResultReceiver;
|
||||||
import android.util.ArrayMap;
|
import android.util.ArrayMap;
|
||||||
@@ -200,8 +201,14 @@ public final class TranslationManager {
|
|||||||
if (result.resultCode != STATUS_SYNC_CALL_SUCCESS) {
|
if (result.resultCode != STATUS_SYNC_CALL_SUCCESS) {
|
||||||
return Collections.emptySet();
|
return Collections.emptySet();
|
||||||
}
|
}
|
||||||
return new ArraySet<>(
|
Parcelable[] parcelables = result.bundle.getParcelableArray(EXTRA_CAPABILITIES);
|
||||||
(TranslationCapability[]) result.bundle.getParcelableArray(EXTRA_CAPABILITIES));
|
ArraySet<TranslationCapability> capabilities = new ArraySet();
|
||||||
|
for (Parcelable obj : parcelables) {
|
||||||
|
if (obj instanceof TranslationCapability) {
|
||||||
|
capabilities.add((TranslationCapability) obj);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return capabilities;
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
throw e.rethrowFromSystemServer();
|
throw e.rethrowFromSystemServer();
|
||||||
} catch (TimeoutException e) {
|
} catch (TimeoutException e) {
|
||||||
|
|||||||
Reference in New Issue
Block a user