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

Commit aee51f2b authored by Tyler Gunn's avatar Tyler Gunn
Browse files

Support enhanced call blocking function

- Add settings about whether to accept or block an incoming call
from unidentified numbers by configuring the setting for each reason
(unregistered/private/pay phone/unknown).
- Show a notification when making an emergency call.

Bug: 28189985
Test: Manual
Merged-In: I134a60675c512d12fd6c235c9cf95e506fcc7b85
Change-Id: I134a60675c512d12fd6c235c9cf95e506fcc7b85
(cherry picked from commit c18a4320)
parent 5983dc14
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -102,6 +102,15 @@
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>

        <activity android:name=".settings.CallBlockDisabledActivity"
                android:configChanges="keyboardHidden|orientation|screenSize"
                android:excludeFromRecents="true"
                android:launchMode="singleInstance"
                android:theme="@style/Theme.Telecomm.Transparent"
                android:process=":ui">
        </activity>

        <!-- Activity that starts the outgoing call process by listening to CALL intent which
             contain contact information in the intent's data. CallActivity handles any data
             URL with the schemes "tel", "sip", and "voicemail". It also handles URLs linked to
+3 −0
Original line number Diff line number Diff line
-verbose
-keep @com.android.internal.annotations.VisibleForTesting class *
-keep public class * extends android.widget.ListView {
    public *;
}
-keep class com.android.server.telecom.TelecomSystem {
  *;
}
+29 −0
Original line number Diff line number Diff line
@@ -252,8 +252,37 @@
    <string name="notification_channel_incoming_call">Incoming calls</string>
    <!-- Notification channel name for a channel containing missed call notifications. -->
    <string name="notification_channel_missed_call">Missed calls</string>
    <!-- Notification channel name for a channel containing call blocking notifications. -->
    <string name="notification_channel_call_blocking">Call Blocking</string>

    <!-- Alert dialog content used to inform the user that placing a new outgoing call will end the
         ongoing call in the app "other_app". -->
    <string name="alert_outgoing_call">Placing this call will end your <xliff:g id="other_app">%1$s</xliff:g> call.</string>

    <!-- The name of a feature available under the Call settings. -->
    <string name="phone_settings_call_blocking_txt">Call Blocking</string>
    <!-- Call type to be blocked. See the explanatory text "phone_settings_number_not_in_contact_summary_txt". -->
    <string name="phone_settings_number_not_in_contact_txt">Numbers not in Contacts</string>
    <!-- Explanatory text under the call type "phone_settings_number_not_in_contact_txt". -->
    <string name="phone_settings_number_not_in_contact_summary_txt">Block numbers that are not listed in your Contacts</string>
    <!-- Call type to be blocked. See the explanatory text "phone_settings_private_num_summary_txt". This is also called Anonymous or Withheld depending on region. -->
    <string name="phone_settings_private_num_txt">Private</string>
    <!-- Explanatory text under the call type "phone_settings_payphone_summary_txt". -->
    <string name="phone_settings_private_num_summary_txt">Block callers that do not disclose their number</string>
    <!-- Call type to be blocked. See the explanatory text "phone_settings_private_num_summary_txt".  -->
    <string name="phone_settings_payphone_txt">Pay phone</string>
    <!-- Explanatory text under the call type "phone_settings_payphone_txt". -->
    <string name="phone_settings_payphone_summary_txt">Block calls from pay phones</string>
    <!-- Call type to be blocked. See the explanatory text "phone_settings_unknown_summary_txt".  -->
    <string name="phone_settings_unknown_txt">Unknown</string>
    <!-- Explanatory text under the call type "phone_settings_unknown_txt". This occurs when no caller ID information unavailable (e.g., international calls, IP phones that operators cannot identify the caller) -->
    <string name="phone_settings_unknown_summary_txt">Block calls from unidentified callers</string>
    <!-- Notification. Make this translation consistent with "phone_settings_call_blocking_txt". -->
    <string name="phone_strings_call_blocking_turned_off_notification_title_txt">Call Blocking</string>
    <!-- Notification that appears when the feature Call Blocking has been disabled. -->
    <string name="phone_strings_call_blocking_turned_off_notification_text_txt">Call Blocking disabled</string>
    <!-- Title of the dialog "phone_strings_emergency_call_made_dialog_text_txt". -->
    <string name="phone_strings_emergency_call_made_dialog_title_txt">Emergency call made</string>
    <!-- Notification details that appear when the user taps the notification "phone_strings_call_blocking_turned_off_notification_text_txt". -->
    <string name="phone_strings_emergency_call_made_dialog_call_blocking_text_txt">Call Blocking has been disabled to allow emergency responders to contact you.</string>
</resources>
+1 −0
Original line number Diff line number Diff line
@@ -39,6 +39,7 @@
        <item name="android:homeAsUpIndicator">@drawable/ic_back_arrow</item>
        <item name="android:windowContentOverlay">@null</item>
        <item name="android:colorAccent">@color/theme_color</item>
        <item name="android:listDivider">@null</item>
    </style>

    <style name="TelecomDialerSettingsActionBarStyle" parent="android:Widget.Material.ActionBar">
+40 −32
Original line number Diff line number Diff line
@@ -33,9 +33,7 @@

        <FrameLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:paddingLeft="@dimen/blocked_numbers_large_padding"
                android:paddingRight="@dimen/blocked_numbers_large_padding">
                android:layout_height="match_parent">

            <TextView
                    android:id="@+id/non_primary_user"
@@ -43,15 +41,29 @@
                    android:layout_height="wrap_content"
                    android:text="@string/non_primary_user"
                    android:paddingTop="@dimen/blocked_numbers_large_padding"
                    android:paddingLeft="@dimen/blocked_numbers_large_padding"
                    android:paddingRight="@dimen/blocked_numbers_large_padding"
                    style="@style/BlockedNumbersTitleText"
                    android:visibility="gone" />

            <LinearLayout
                    android:id="@+id/manage_blocked_ui"
                    android:orientation="vertical"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content">

                <FrameLayout
                        android:id="@+id/enhanced_call_blocking_container"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content" />

                <LinearLayout
                        android:orientation="vertical"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                    android:paddingTop="@dimen/blocked_numbers_large_padding">
                        android:paddingTop="@dimen/blocked_numbers_large_padding"
                        android:paddingLeft="@dimen/blocked_numbers_large_padding"
                        android:paddingRight="@dimen/blocked_numbers_large_padding">

                    <TextView
                            android:layout_width="wrap_content"
@@ -78,12 +90,8 @@
                            android:layout_marginTop="@dimen/blocked_numbers_progress_bar_padding"
                            style="@android:style/Widget.ProgressBar.Large" />

                <ListView
                        android:id="@android:id/list"
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:nestedScrollingEnabled="true"
                        android:paddingBottom="@dimen/blocked_numbers_extra_large_padding" />
                    <include layout="@xml/layout_customized_listview" />
                </LinearLayout>
            </LinearLayout>
        </FrameLayout>
    </LinearLayout>
Loading