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

Commit 2b7cadac authored by Stanley Wang's avatar Stanley Wang
Browse files

Fix the problem that apps can read SIM card information through

screenshots.

Fix: 217377618
Test: manually test and review the UI
Change-Id: I645c4acc9943a17430889dfeee064a42178870ec
parent 426f8a58
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ import android.os.Bundle;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.WindowManager;
import android.widget.TextView;

import androidx.appcompat.app.AlertDialog;
@@ -75,7 +76,12 @@ public class SimStatusDialogFragment extends InstrumentedDialogFragment {
        mRootView = LayoutInflater.from(builder.getContext())
                .inflate(R.layout.dialog_sim_status, null /* parent */);
        mController.initialize();
        return builder.setView(mRootView).create();

        Dialog dlg = builder.setView(mRootView).create();
        dlg.getWindow().setFlags(WindowManager.LayoutParams.FLAG_SECURE,
                WindowManager.LayoutParams.FLAG_SECURE);

        return dlg;
    }

    @Override
@@ -107,8 +113,7 @@ public class SimStatusDialogFragment extends InstrumentedDialogFragment {
        }
        if (TextUtils.isEmpty(text)) {
            text = getResources().getString(R.string.device_info_default);
        }
        else if (Arrays.binarySearch(sViewIdsInDigitFormat, viewId) >= 0) {
        } else if (Arrays.binarySearch(sViewIdsInDigitFormat, viewId) >= 0) {
            text = PhoneNumberUtil.expandByTts(text);
        }
        textView.setText(text);