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

Commit d7f64cdd authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Use public API Toast#makeText instead of the hidden version." into main

parents cc9922d8 e6714860
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -172,10 +172,15 @@ public class CallIntentProcessor {
            // Show the toast to warn user that it is a personal call though initiated in work
            // profile.
            if (fixedInitiatingUser) {
                if (featureFlags.telecomResolveHiddenDependencies()) {
                    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),
                            Toast.LENGTH_LONG).show();
                }
            }
        } else {
            Log.i(CallIntentProcessor.class,
                    "processOutgoingCallIntent: skip initiating user check");
+14 −4
Original line number Diff line number Diff line
@@ -141,6 +141,7 @@ public class TelecomSystem {
    private final TelecomServiceImpl mTelecomServiceImpl;
    private final ContactsAsyncHelper mContactsAsyncHelper;
    private final DialerCodeReceiver mDialerCodeReceiver;
    private final FeatureFlags mFeatureFlags;

    private boolean mIsBootComplete = false;

@@ -231,6 +232,7 @@ public class TelecomSystem {
            BlockedNumbersAdapter blockedNumbersAdapter,
            FeatureFlags featureFlags) {
        mContext = context.getApplicationContext();
        mFeatureFlags = featureFlags;
        LogUtils.initLogging(mContext);
        android.telecom.Log.setLock(mLock);
        AnomalyReporter.initialize(mContext);
@@ -347,15 +349,23 @@ public class TelecomSystem {
            ToastFactory toastFactory = new ToastFactory() {
                @Override
                public Toast makeText(Context context, int resId, int duration) {
                    if (mFeatureFlags.telecomResolveHiddenDependencies()) {
                        return Toast.makeText(context, resId, duration);
                    } else {
                        return Toast.makeText(context, context.getMainLooper(),
                                context.getString(resId),
                                duration);
                    }
                }

                @Override
                public Toast makeText(Context context, CharSequence text, int duration) {
                    if (mFeatureFlags.telecomResolveHiddenDependencies()) {
                        return Toast.makeText(context, text, duration);
                    } else {
                        return Toast.makeText(context, context.getMainLooper(), text, duration);
                    }
                }
            };

            EmergencyCallDiagnosticLogger emergencyCallDiagnosticLogger =