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

Commit 104c22a1 authored by Pranav Madapurmath's avatar Pranav Madapurmath Committed by Android (Google) Code Review
Browse files

Merge "Create toast on main thread executor." into main

parents aa30be61 dd0dd5dc
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -3473,7 +3473,7 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable,
            Log.w(this, "pullExternalCall = pullExternalCall - call %s is external but can not be"
                    + " pulled while an emergency call is in progress.", mId);
            mToastFactory.makeText(mContext, R.string.toast_emergency_can_not_pull_call,
                    Toast.LENGTH_LONG).show();
                    Toast.LENGTH_LONG);
            return;
        }

+3 −2
Original line number Diff line number Diff line
@@ -174,8 +174,9 @@ public class CallIntentProcessor {
            // profile.
            if (fixedInitiatingUser) {
                if (featureFlags.telecomResolveHiddenDependencies()) {
                    Toast.makeText(context, context.getString(R.string.toast_personal_call_msg),
                            Toast.LENGTH_LONG).show();
                    context.getMainExecutor().execute(() ->
                            Toast.makeText(context, context.getString(
                                    R.string.toast_personal_call_msg), Toast.LENGTH_LONG).show());
                } else {
                    Toast.makeText(context, Looper.getMainLooper(),
                            context.getString(R.string.toast_personal_call_msg),
+0 −1
Original line number Diff line number Diff line
@@ -2696,7 +2696,6 @@ public class TelecomServiceImpl {
    private final FeatureFlags mFeatureFlags;
    private final com.android.internal.telephony.flags.FeatureFlags mTelephonyFeatureFlags;


    public TelecomServiceImpl(
            Context context,
            CallsManager callsManager,
+9 −8
Original line number Diff line number Diff line
@@ -346,22 +346,23 @@ public class TelecomSystem {

            ToastFactory toastFactory = new ToastFactory() {
                @Override
                public Toast makeText(Context context, int resId, int duration) {
                public void makeText(Context context, int resId, int duration) {
                    if (mFeatureFlags.telecomResolveHiddenDependencies()) {
                        return Toast.makeText(context, resId, duration);
                        context.getMainExecutor().execute(() ->
                                Toast.makeText(context, resId, duration).show());
                    } else {
                        return Toast.makeText(context, context.getMainLooper(),
                                context.getString(resId),
                                duration);
                        Toast.makeText(context, context.getMainLooper(),
                                context.getString(resId), duration).show();
                    }
                }

                @Override
                public Toast makeText(Context context, CharSequence text, int duration) {
                public void makeText(Context context, CharSequence text, int duration) {
                    if (mFeatureFlags.telecomResolveHiddenDependencies()) {
                        return Toast.makeText(context, text, duration);
                        context.getMainExecutor().execute(() ->
                                Toast.makeText(context, text, duration).show());
                    } else {
                        return Toast.makeText(context, context.getMainLooper(), text, duration);
                        Toast.makeText(context, context.getMainLooper(), text, duration).show();
                    }
                }
            };
+2 −2
Original line number Diff line number Diff line
@@ -21,6 +21,6 @@ import android.content.Context;
import android.widget.Toast;

public interface ToastFactory {
    Toast makeText(Context context, @StringRes int resId, int duration);
    Toast makeText(Context context, CharSequence text, int duration);
    void makeText(Context context, @StringRes int resId, int duration);
    void makeText(Context context, CharSequence text, int duration);
}
Loading