Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2e2e479e authored by Yanchao Su's avatar Yanchao Su Committed by Android (Google) Code Review
Browse files

Merge "fix bug 184901520." into sc-dev

parents b0ea1529 d952496f
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ import android.app.PendingIntent;
import android.content.Context;
import android.os.Handler;
import android.os.Looper;
import android.os.Parcelable;
import android.os.RemoteException;
import android.os.SynchronousResultReceiver;
import android.util.ArrayMap;
@@ -200,8 +201,14 @@ public final class TranslationManager {
            if (result.resultCode != STATUS_SYNC_CALL_SUCCESS) {
                return Collections.emptySet();
            }
            return new ArraySet<>(
                    (TranslationCapability[]) result.bundle.getParcelableArray(EXTRA_CAPABILITIES));
            Parcelable[] parcelables = 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) {
            throw e.rethrowFromSystemServer();
        } catch (TimeoutException e) {