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

Commit 516b5d99 authored by Grace Jia's avatar Grace Jia
Browse files

Changed text of add block number and the dialog to sentence case.

Test: AsyncBlockCheckFilterTest
Bug: 111533879
Change-Id: If8b505334ca9076e4a5534f490e192cb3984aaa7
parent 112599dd
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -68,7 +68,6 @@

    <style name="BlockedNumbersButton" parent="BlockedNumbersTextPrimary2">
        <item name="android:textColor">@color/theme_color</item>
        <item name="android:textAllCaps">true</item>
    </style>

    <style name="BlockedNumbersTextHead1"
@@ -83,6 +82,7 @@
        <item name="android:textSize">@dimen/blocked_numbers_primary2_font_size</item>
        <item name="android:fontFamily">sans-serif-regular</item>
        <item name="android:lineSpacingExtra">@dimen/blocked_numbers_line_spacing</item>
        <item name="android:capitalize">sentences</item>
    </style>

    <style name="BlockedNumbersTextSecondary">
@@ -90,5 +90,6 @@
        <item name="android:textSize">@dimen/blocked_numbers_secondary_font_size</item>
        <item name="android:fontFamily">sans-serif-regular</item>
        <item name="android:lineSpacingExtra">@dimen/blocked_numbers_secondary_line_spacing</item>
        <item name="android:capitalize">sentences</item>
    </style>
</resources>
+9 −0
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package com.android.server.telecom.settings;
import android.annotation.Nullable;
import android.app.ActionBar;
import android.app.AlertDialog;
import android.app.Dialog;
import android.app.Fragment;
import android.app.FragmentManager;
import android.app.FragmentTransaction;
@@ -34,10 +35,12 @@ import android.content.Loader;
import android.database.Cursor;
import android.os.Bundle;
import android.provider.BlockedNumberContract;
import android.provider.ContactsContract;
import android.telephony.PhoneNumberFormattingTextWatcher;
import android.telephony.PhoneNumberUtils;
import android.telephony.TelephonyManager;
import android.text.Editable;
import android.text.InputType;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.view.LayoutInflater;
@@ -55,6 +58,7 @@ import android.widget.Toast;

import com.android.server.telecom.R;


/**
 * Activity to manage blocked numbers using {@link BlockedNumberContract}.
 */
@@ -80,6 +84,7 @@ public class BlockedNumbersActivity extends ListActivity
    private ProgressBar mProgressBar;
    private RelativeLayout mButterBar;
    @Nullable private Button mBlockButton;
    @Nullable private Button mBlockButtonNegative;
    private TextView mReEnableButton;

    private BroadcastReceiver mBlockingStatusReceiver;
@@ -261,6 +266,10 @@ public class BlockedNumbersActivity extends ListActivity
                    public void onShow(DialogInterface dialog) {
                        mBlockButton = ((AlertDialog) dialog)
                                .getButton(AlertDialog.BUTTON_POSITIVE);
                        mBlockButtonNegative = ((AlertDialog) dialog)
                                .getButton(AlertDialog.BUTTON_NEGATIVE);
                        mBlockButton.setAllCaps(false);
                        mBlockButtonNegative.setAllCaps(false);
                        mBlockButton.setEnabled(false);
                        // show keyboard
                        InputMethodManager inputMethodManager =
+11 −3
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@ import android.text.SpannableString;
import android.view.View;
import android.widget.SimpleCursorAdapter;
import android.widget.TextView;

import com.android.server.telecom.R;

public class BlockedNumbersAdapter extends SimpleCursorAdapter {
@@ -63,7 +64,7 @@ public class BlockedNumbersAdapter extends SimpleCursorAdapter {
        Spannable messageSpannable = new SpannableString(message);
        PhoneNumberUtils.addTtsSpan(messageSpannable, startingPosition,
                startingPosition + formattedNumber.length());
        new AlertDialog.Builder(context)
        AlertDialog dialog = new AlertDialog.Builder(context)
                .setMessage(messageSpannable)
                .setPositiveButton(R.string.unblock_button,
                        new DialogInterface.OnClickListener() {
@@ -79,8 +80,15 @@ public class BlockedNumbersAdapter extends SimpleCursorAdapter {
                            }
                        }
                )
                .create()
                .show();
                .create();
        dialog.setOnShowListener(new AlertDialog.OnShowListener() {
            @Override
            public void onShow(DialogInterface dialog) {
                ((AlertDialog) dialog).getButton(AlertDialog.BUTTON_POSITIVE).setAllCaps(false);
                ((AlertDialog) dialog).getButton(AlertDialog.BUTTON_NEGATIVE).setAllCaps(false);
            }
        });
        dialog.show();
    }

    private void deleteBlockedNumber(Context context, String number) {