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

Commit fbb4f137 authored by Michael Bestas's avatar Michael Bestas
Browse files

Revert "Dialer: support "add to black/white list" in call detail"

* We have our own blacklist implementation

This reverts commit 1d8c0c9a

Change-Id: I764d3b565d9d0f2d11b1aa0722dbc21f79241b0b
parent c57eee11
Loading
Loading
Loading
Loading
+0 −12
Original line number Diff line number Diff line
@@ -20,18 +20,6 @@
        android:title="@string/video_call"
        android:onClick="onMenuVideoCall"
    />
    <item
        android:id="@+id/menu_add_to_black_list"
        android:showAsAction="withText"
        android:title="@string/add_to_black_list"
        android:onClick="onMenuAddToBlackList"
    />
    <item
        android:id="@+id/menu_add_to_white_list"
        android:showAsAction="withText"
        android:title="@string/add_to_white_list"
        android:onClick="onMenuAddToWhiteList"
    />
    <item
        android:id="@+id/menu_trash"
        android:icon="@drawable/ic_calllog_delete"
+0 −2
Original line number Diff line number Diff line
@@ -115,8 +115,6 @@
    <string name="call_log_show_all_slots">All SIMs</string>
    <string name="call_log_all_calls_header">All calls</string>
    <string name="calllog_search_hint">Search call log</string>
    <string name="add_to_white_list">Add to white list</string>
    <string name="add_to_black_list">Add to black list</string>

    <string name="msim_ime_dialog_title">Device identifier</string>

+0 −51
Original line number Diff line number Diff line
@@ -22,9 +22,6 @@ import android.content.ContentUris;
import android.content.ContentValues;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.content.res.Resources;
import android.database.Cursor;
import android.net.Uri;
@@ -142,13 +139,6 @@ public class CallDetailActivity extends AnalyticsActivity implements ProximitySe
    /** Whether we should show "remove from call log" in the options menu. */
    private boolean mHasRemoveFromCallLogOption;

    /** Add for black/white list. */
    private boolean mHasInstallFireWallOption = false;
    private static final String NUMBER_KEY = "number";
    private static final String MODE_KEY = "mode";
    private static final String FIREWALL_APK_NAME = "com.android.firewall";
    private static final String FIREWALL_BLACK_WHITE_LIST = "com.android.firewall.FirewallListPage";

    private ProximitySensorManager mProximitySensorManager;
    private final ProximitySensorListener mProximitySensorListener = new ProximitySensorListener();

@@ -266,20 +256,6 @@ public class CallDetailActivity extends AnalyticsActivity implements ProximitySe
    public void onResume() {
        super.onResume();
        updateData(getCallLogEntryUris());

        mHasInstallFireWallOption = isFireWallInstalled();
    }

    private boolean isFireWallInstalled() {
        boolean installed = false;
        try {
            ApplicationInfo info = getPackageManager().getApplicationInfo(
                    FIREWALL_APK_NAME, PackageManager.GET_PROVIDERS);
            installed = (info != null);
        } catch (NameNotFoundException e) {
        }
        Log.d(TAG, "Is Firewall installed ? " + installed);
        return installed;
    }

    /**
@@ -616,9 +592,6 @@ public class CallDetailActivity extends AnalyticsActivity implements ProximitySe

        menu.findItem(R.id.menu_video_call).setVisible(CallUtil.isCSVTEnabled());

        menu.findItem(R.id.menu_add_to_black_list).setVisible(mHasInstallFireWallOption);
        menu.findItem(R.id.menu_add_to_white_list).setVisible(mHasInstallFireWallOption);

        return super.onPrepareOptionsMenu(menu);
    }

@@ -630,30 +603,6 @@ public class CallDetailActivity extends AnalyticsActivity implements ProximitySe
        }
    }

    public void onMenuAddToBlackList(MenuItem menuItem) {
        Bundle blackBundle = new Bundle();
        blackBundle.putString(NUMBER_KEY, mNumber);
        blackBundle.putString(MODE_KEY, "blacklist");

        Intent blackIntent = new Intent();
        blackIntent.setClassName(FIREWALL_APK_NAME, FIREWALL_BLACK_WHITE_LIST);
        blackIntent.setAction(Intent.ACTION_INSERT);
        blackIntent.putExtras(blackBundle);
        startActivity(blackIntent);
    }

    public void onMenuAddToWhiteList(MenuItem menuItem) {
        Bundle whiteBundle = new Bundle();
        whiteBundle.putString(NUMBER_KEY, mNumber);
        whiteBundle.putString(MODE_KEY, "whitelist");

        Intent whiteIntent = new Intent();
        whiteIntent.setClassName(FIREWALL_APK_NAME, FIREWALL_BLACK_WHITE_LIST);
        whiteIntent.setAction(Intent.ACTION_INSERT);
        whiteIntent.putExtras(whiteBundle);
        startActivity(whiteIntent);
    }

    public void onMenuRemoveFromCallLog(MenuItem menuItem) {
        final StringBuilder callIds = new StringBuilder();
        for (Uri callUri : getCallLogEntryUris()) {