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

Commit e6714860 authored by Grace Jia's avatar Grace Jia
Browse files

Use public API Toast#makeText instead of the hidden version.

Bug: b/305742542
Test: make and telecom unit tests
Change-Id: I6bb8c91f3a657a9b7eac8235fe58f32fca4d1a2e
parent 525dc1a7
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);
@@ -344,15 +346,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 =