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

Commit 1fc3ef4f authored by Wenyi Wang's avatar Wenyi Wang
Browse files

Copy "Blocked Numbers Activity" from Dialer to Contacts

1. Classes are copied and modified so that they will work in Contacts.
2. BlockedNumbersActivity.java is the main activity.
3. Most copied classes are put in the newly-created "callblocking" package.
4. What's not copied: CachedNumberLookupService, visual voicemail, and
   emergency call. The corresponding features will be implemented based on
   framework change, which is not ready yet.
5. In Dialer, BlockedListSearchFragment extends RegularSearchFragment,
   which extends SearchFragment. These three classes are combined into
   SearchFragment in Contacts.
6. In Dialer, BlockedListSearchAdapter extends RegularSearchListAdapter,
   which extends DialerPhoneNumberListAdapter. These three classes are
   combined into SearchAdapter in Contacts.
7. An intent is specified in AndroidManifest.xml to open
   BlockedNumbersActivity.java

Bug: 26453530
Change-Id: Iec07725fd9aa5a174bb6b306792fa446dcaa4e65
parent f7e02069
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -21,7 +21,8 @@ src_dirs += src-N $(contacts_common_dir)/src-N $(phone_common_dir)/src-N
LOCAL_SRC_FILES := $(call all-java-files-under, $(src_dirs))
LOCAL_RESOURCE_DIR := $(addprefix $(LOCAL_PATH)/, $(res_dirs)) \
    $(support_library_root_dir)/v7/appcompat/res \
    $(support_library_root_dir)/v7/cardview/res
    $(support_library_root_dir)/v7/cardview/res \
    $(support_library_root_dir)/design/res
LOCAL_ASSET_DIR := $(addprefix $(LOCAL_PATH)/, $(asset_dirs))

LOCAL_AAPT_FLAGS := \
@@ -29,6 +30,7 @@ LOCAL_AAPT_FLAGS := \
    --extra-packages com.android.contacts.common \
    --extra-packages com.android.phone.common \
    --extra-packages android.support.v7.appcompat \
    --extra-packages android.support.design \
    --extra-packages android.support.v7.cardview

LOCAL_STATIC_JAVA_LIBRARIES := \
@@ -40,6 +42,7 @@ LOCAL_STATIC_JAVA_LIBRARIES := \
    android-support-v7-cardview \
    android-support-v7-palette \
    android-support-v4 \
    android-support-design \
    libphonenumber

LOCAL_PACKAGE_NAME := Contacts
+11 −0
Original line number Diff line number Diff line
@@ -418,6 +418,17 @@
            </intent-filter>
        </activity>

        <!-- Blocked numbers activity -->
        <activity android:name=".activities.BlockedNumbersActivity"
                  android:label="@string/blocked_numbers_title"
                  android:theme="@style/BlockedNumbersStyle">
            <intent-filter>
                <action android:name="android.intent.action.EDIT" />
                <data android:mimeType="blocked_numbers/*" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>

        <!-- vCard related -->
        <activity android:name=".common.vcard.ImportVCardActivity"
            android:label="@string/launcherActivityLabel"
+2.4 KiB
Loading image diff...
+565 B
Loading image diff...
+884 B
Loading image diff...
Loading