summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Bestas <mikeioannina@gmail.com>2015-01-22 02:25:26 +0200
committerMichael Bestas <mikeioannina@gmail.com>2015-01-22 02:25:26 +0200
commitd8c16b9ba9e25b7d35958116722fac308649df23 (patch)
treeb9d2faa664c437c749ca9129a03bbadc29e32b42
parent757e19f2eca2cb464f40f3fb5dae738b9d67ac72 (diff)
downloadpackages_apps_Contacts-d8c16b9ba9e25b7d35958116722fac308649df23.tar.gz
packages_apps_Contacts-d8c16b9ba9e25b7d35958116722fac308649df23.tar.bz2
packages_apps_Contacts-d8c16b9ba9e25b7d35958116722fac308649df23.zip
Revert "Support adding contacts to blacklist and whitelist"
* We have our own blacklist implementation This reverts commit c24b0a2b5637ec2d24b162c137f14b395583b7db. Change-Id: I9864e4f8e9949480ad7b1a55e070530d367216d0
-rwxr-xr-xAndroidManifest.xml2
-rwxr-xr-xres/drawable-hdpi/number_in_blacklist.pngbin3404 -> 0 bytes
-rwxr-xr-xres/drawable-hdpi/number_in_whitelist.pngbin3452 -> 0 bytes
-rwxr-xr-xres/drawable-mdpi/number_in_blacklist.pngbin3147 -> 0 bytes
-rwxr-xr-xres/drawable-mdpi/number_in_whitelist.pngbin3166 -> 0 bytes
-rwxr-xr-xres/drawable-xhdpi/number_in_blacklist.pngbin3632 -> 0 bytes
-rwxr-xr-xres/drawable-xhdpi/number_in_whitelist.pngbin3815 -> 0 bytes
-rw-r--r--res/layout/expanding_entry_card_item.xml10
-rw-r--r--[-rwxr-xr-x]res/values-zh-rCN/strings.xml2
-rw-r--r--res/values/cm_strings.xml2
-rw-r--r--src/com/android/contacts/quickcontact/ExpandingEntryCardView.java66
-rw-r--r--src/com/android/contacts/quickcontact/QuickContactActivity.java64
12 files changed, 4 insertions, 142 deletions
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 2f4ed31a1..1aec4c09b 100755
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -40,8 +40,6 @@
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.READ_SYNC_SETTINGS" />
<uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT"/>
- <uses-permission android:name="com.android.firewall.READ_GRAVITY"/>
- <uses-permission android:name="com.android.firewall.WRITE_GRAVITY"/>
<!-- Following used for QuickContacts -->
<uses-permission android:name="android.permission.READ_CALL_LOG" />
<uses-permission android:name="android.permission.READ_SMS" />
diff --git a/res/drawable-hdpi/number_in_blacklist.png b/res/drawable-hdpi/number_in_blacklist.png
deleted file mode 100755
index a6d150927..000000000
--- a/res/drawable-hdpi/number_in_blacklist.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/number_in_whitelist.png b/res/drawable-hdpi/number_in_whitelist.png
deleted file mode 100755
index 43e55d1a4..000000000
--- a/res/drawable-hdpi/number_in_whitelist.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/number_in_blacklist.png b/res/drawable-mdpi/number_in_blacklist.png
deleted file mode 100755
index 27eb30dcb..000000000
--- a/res/drawable-mdpi/number_in_blacklist.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/number_in_whitelist.png b/res/drawable-mdpi/number_in_whitelist.png
deleted file mode 100755
index eb2c45d09..000000000
--- a/res/drawable-mdpi/number_in_whitelist.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/number_in_blacklist.png b/res/drawable-xhdpi/number_in_blacklist.png
deleted file mode 100755
index 12d04a644..000000000
--- a/res/drawable-xhdpi/number_in_blacklist.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/number_in_whitelist.png b/res/drawable-xhdpi/number_in_whitelist.png
deleted file mode 100755
index f1b905983..000000000
--- a/res/drawable-xhdpi/number_in_whitelist.png
+++ /dev/null
Binary files differ
diff --git a/res/layout/expanding_entry_card_item.xml b/res/layout/expanding_entry_card_item.xml
index e973660d2..4f0094d9b 100644
--- a/res/layout/expanding_entry_card_item.xml
+++ b/res/layout/expanding_entry_card_item.xml
@@ -42,19 +42,11 @@
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_toEndOf="@+id/icon"
- android:layout_toStartOf="@+id/header"
+ android:layout_toStartOf="@+id/icon_alternate"
android:textColor="@color/quickcontact_entry_header_text_color"
android:textAlignment="viewStart"
android:layout_marginBottom="@dimen/expanding_entry_card_header_margin_bottom" />
- <ImageView
- android:id="@+id/black_white_list_indicator"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_toEndOf="@+id/header"
- android:layout_marginStart="8dp"
- android:layout_marginTop="@dimen/expanding_entry_card_header_margin_bottom" />
-
<TextView
android:id="@+id/sub_header"
android:layout_width="wrap_content"
diff --git a/res/values-zh-rCN/strings.xml b/res/values-zh-rCN/strings.xml
index 9a0dc8a53..c17ed88e4 100755..100644
--- a/res/values-zh-rCN/strings.xml
+++ b/res/values-zh-rCN/strings.xml
@@ -293,8 +293,6 @@
<string name="content_description_recent_call" msgid="6204048362763219585">"近期通话。<xliff:g id="CALL_DETAILS">%s</xliff:g>。点按可回拨"</string>
<string name="menu_copyTo">"复制到"</string>
<string name="no_empty_email_in_usim">"卡上电子邮件空间已满,部分邮件信息将不会复制 "</string>
- <string name="add_to_white">加入白名单</string>
- <string name="add_to_black">加入黑名单</string>
<string name="title_del_call">删除</string>
<string name="delete_call_title">删除通话记录</string>
<string name="delete_call_message">删除通话记录 ...</string>
diff --git a/res/values/cm_strings.xml b/res/values/cm_strings.xml
index a5b95f01c..1c338c0a1 100644
--- a/res/values/cm_strings.xml
+++ b/res/values/cm_strings.xml
@@ -75,8 +75,6 @@
<string name="contact_detail_picture_description">Picture. Select to change</string>
<string name="menu_copyTo">"Copy to "</string>
<string name="no_empty_email_in_usim">"Email is full, some record copy failed "</string>
- <string name="add_to_white">Add to whitelist</string>
- <string name="add_to_black">Add to blacklist</string>
<string name="voicemail">Voicemail</string>
<string name="select_call_title">Select call logs</string>
<string name="delete_call_title">Delete call logs</string>
diff --git a/src/com/android/contacts/quickcontact/ExpandingEntryCardView.java b/src/com/android/contacts/quickcontact/ExpandingEntryCardView.java
index c6abe860d..81d01d58f 100644
--- a/src/com/android/contacts/quickcontact/ExpandingEntryCardView.java
+++ b/src/com/android/contacts/quickcontact/ExpandingEntryCardView.java
@@ -19,12 +19,9 @@ import android.animation.ObjectAnimator;
import android.content.Context;
import android.content.Intent;
import android.content.res.Resources;
-import android.database.Cursor;
import android.graphics.ColorFilter;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
-import android.net.Uri;
-import android.provider.ContactsContract.CommonDataKinds.Phone;
import android.support.v7.widget.CardView;
import android.telecom.PhoneAccountHandle;
import android.text.TextUtils;
@@ -277,11 +274,6 @@ public class ExpandingEntryCardView extends CardView {
*/
private List<View> mSeparators;
private LinearLayout mContainer;
- private boolean mIsFireWallInstalled = false;
- private static final Uri FIREWALL_BLACKLIST_CONTENT_URI = Uri
- .parse("content://com.android.firewall/blacklistitems");
- private static final Uri FIREWALL_WHITELIST_CONTENT_URI = Uri
- .parse("content://com.android.firewall/whitelistitems");
private final OnClickListener mExpandCollapseButtonListener = new OnClickListener() {
@Override
@@ -631,10 +623,6 @@ public class ExpandingEntryCardView extends CardView {
}
}
- public void isFireWallInstalled(boolean isFireWallInstalled) {
- mIsFireWallInstalled = isFireWallInstalled;
- }
-
private View createEntryView(LayoutInflater layoutInflater, final Entry entry,
int iconVisibility) {
final EntryView view = (EntryView) layoutInflater.inflate(
@@ -657,44 +645,6 @@ public class ExpandingEntryCardView extends CardView {
header.setVisibility(View.GONE);
}
- final ImageView blackWhiteListIndicator = (ImageView) view
- .findViewById(R.id.black_white_list_indicator);
-
- if (mIsFireWallInstalled && entry.getIntent() != null) {
- String actionType = entry.getIntent().getAction();
- if (Intent.ACTION_CALL.equals(actionType)) {
- String number = entry.getHeader();
- number = number.replaceAll(" ", "");
- number = number.replaceAll("-", "");
- String selectionString = "number=?";
- String[] selectionArgs = new String[] { number };
- Cursor cursorBlack = getContext().getContentResolver().query(
- FIREWALL_BLACKLIST_CONTENT_URI, null,
- selectionString, selectionArgs, null);
- if (cursorBlack != null && cursorBlack.getCount() > 0) {// in black list
- blackWhiteListIndicator.setVisibility(View.VISIBLE);
- blackWhiteListIndicator.setBackgroundResource(R.drawable.number_in_blacklist);
- }
- if (cursorBlack != null) {
- cursorBlack.close();
- }
- Cursor cursorWhite = getContext().getContentResolver().query(
- FIREWALL_WHITELIST_CONTENT_URI, null,
- selectionString, selectionArgs, null);
- if (cursorWhite != null && cursorWhite.getCount() > 0) {// in white list
- blackWhiteListIndicator.setVisibility(View.VISIBLE);
- blackWhiteListIndicator.setBackgroundResource(R.drawable.number_in_whitelist);
- }
- if (cursorWhite != null) {
- cursorWhite.close();
- }
- } else {
- blackWhiteListIndicator.setVisibility(View.GONE);
- }
- } else {
- blackWhiteListIndicator.setVisibility(View.GONE);
- }
-
final TextView subHeader = (TextView) view.findViewById(R.id.sub_header);
if (!TextUtils.isEmpty(entry.getSubHeader())) {
subHeader.setText(entry.getSubHeader());
@@ -1040,8 +990,6 @@ public class ExpandingEntryCardView extends CardView {
private final long mId;
private final boolean mIsSuperPrimary;
private String mData;
- private Intent mWhiteIntent;
- private Intent mBlackIntent;
public EntryContextMenuInfo(String copyText, String copyLabel, String mimeType, long id,
boolean isSuperPrimary) {
@@ -1052,16 +1000,14 @@ public class ExpandingEntryCardView extends CardView {
mIsSuperPrimary = isSuperPrimary;
}
- public EntryContextMenuInfo(String copyText, String copyLabel, String mimeType, long id,
- boolean isSuperPrimary, String data, Intent whiteIntent, Intent blackIntent) {
+ public EntryContextMenuInfo(String copyText, String copyLabel,String mimeType, long id,
+ boolean isSuperPrimary, String data) {
mCopyText = copyText;
mCopyLabel = copyLabel;
mMimeType = mimeType;
mId = id;
mIsSuperPrimary = isSuperPrimary;
mData = data;
- mWhiteIntent = whiteIntent;
- mBlackIntent = blackIntent;
}
public String getCopyText() {
@@ -1087,14 +1033,6 @@ public class ExpandingEntryCardView extends CardView {
public String getData() {
return mData;
}
-
- public Intent getWhiteIntent() {
- return mWhiteIntent;
- }
-
- public Intent getBlackIntent() {
- return mBlackIntent;
- }
}
static final class EntryTag {
diff --git a/src/com/android/contacts/quickcontact/QuickContactActivity.java b/src/com/android/contacts/quickcontact/QuickContactActivity.java
index 7896a53a2..a59530281 100644
--- a/src/com/android/contacts/quickcontact/QuickContactActivity.java
+++ b/src/com/android/contacts/quickcontact/QuickContactActivity.java
@@ -30,9 +30,7 @@ import android.content.ContentValues;
import android.content.Context;
import android.content.Intent;
import android.content.Loader;
-import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
-import android.content.pm.PackageManager.NameNotFoundException;
import android.content.pm.ResolveInfo;
import android.content.res.Resources;
import android.database.Cursor;
@@ -318,14 +316,6 @@ public class QuickContactActivity extends ContactsActivity {
private static final int MIN_NUM_COLLAPSED_RECENT_ENTRIES_SHOWN = 3;
private static final int CARD_ENTRY_ID_EDIT_CONTACT = -2;
- private boolean isFireWallInstalled = false;
- private static final String FIREWALL_APK_NAME = "com.android.firewall";
- private static final String FIREWALL_BLACK_WHITE_LIST = "com.android.firewall.FirewallListPage";
-
- private static final String NAME_KEY = "name";
- private static final String NUMBER_KEY = "number";
- private static final String PERSON_KEY = "personid";
- private static final String MODE_KEY = "mode";
private static final int MAX_NUM_LENGTH = 3; // add limit length to show IP call item
private static final int[] mRecentLoaderIds = new int[]{
@@ -422,8 +412,6 @@ public class QuickContactActivity extends ContactsActivity {
static final int CLEAR_DEFAULT = 1;
static final int SET_DEFAULT = 2;
static final int EDIT_BEFORE_CALL = 3;
- static final int ADD_TO_BLACKLIST = 4;
- static final int ADD_TO_WHITELIST = 5;
static final int IPCALL1 = 6;
static final int IPCALL2 = 7; // add for new feature: ip call prefix
}
@@ -469,16 +457,6 @@ public class QuickContactActivity extends ContactsActivity {
menu.add(ContextMenu.NONE, ContextMenuIds.EDIT_BEFORE_CALL,
ContextMenu.NONE, getString(R.string.edit_before_call));
- if (isFireWallInstalled) {
- menu.add(ContextMenu.NONE, ContextMenuIds.ADD_TO_BLACKLIST,
- ContextMenu.NONE, getString(R.string.add_to_black)).setIntent(
- info.getBlackIntent());
-
- menu.add(ContextMenu.NONE, ContextMenuIds.ADD_TO_WHITELIST,
- ContextMenu.NONE, getString(R.string.add_to_white)).setIntent(
- info.getWhiteIntent());
- }
-
// add limit length to show IP call item
if (info.getData().length() > MAX_NUM_LENGTH) {
if (MoreContactUtils.isMultiSimEnable(QuickContactActivity.this,
@@ -530,10 +508,6 @@ public class QuickContactActivity extends ContactsActivity {
case ContextMenuIds.EDIT_BEFORE_CALL:
callByEdit(menuInfo.getData());
return true;
- case ContextMenuIds.ADD_TO_BLACKLIST:
- return false;
- case ContextMenuIds.ADD_TO_WHITELIST:
- return false;
case ContextMenuIds.IPCALL1:
ipCallBySlot(menuInfo.getData(), SimContactsConstants.SUB_1);
return true;
@@ -836,19 +810,6 @@ public class QuickContactActivity extends ContactsActivity {
Trace.endSection();
}
- private boolean isFirewalltalled() {
- boolean installed = false;
- try {
- ApplicationInfo info = getApplicationContext().getPackageManager().getApplicationInfo(
- FIREWALL_APK_NAME, PackageManager.GET_PROVIDERS);
- installed = info != null;
- } catch (NameNotFoundException e) {
- installed = false;
- }
- Log.d(TAG,"Is Firewall installed ? " + installed);
- return installed;
- }
-
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == REQUEST_CODE_CONTACT_EDITOR_ACTIVITY &&
@@ -1510,32 +1471,9 @@ public class QuickContactActivity extends ContactsActivity {
primaryContentDescription.append(res.getString(R.string.call_other)).append(" ");
header = sBidiFormatter.unicodeWrap(phone.buildDataString(context, kind),
TextDirectionHeuristics.LTR);
-
- // white and black listintent
- Bundle blackBundle = new Bundle();
- blackBundle.putString(NUMBER_KEY, header);
- blackBundle.putString(MODE_KEY, "blacklist");
-
- Intent blackIntent = new Intent();
- blackBundle.putString(NAME_KEY, contactData.getDisplayName());// optional
- blackIntent.setClassName(FIREWALL_APK_NAME, FIREWALL_BLACK_WHITE_LIST);
- blackIntent.setAction(Intent.ACTION_INSERT);
- blackIntent.putExtras(blackBundle);
-
- Bundle whiteBundle = new Bundle();
- whiteBundle.putString(NUMBER_KEY, header);
- whiteBundle.putInt(PERSON_KEY, 0);// optional
- 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);
-
entryContextMenuInfo = new EntryContextMenuInfo(header,
res.getString(R.string.phoneLabelsGroup), dataItem.getMimeType(),
- dataItem.getId(), dataItem.isSuperPrimary(), header,
- whiteIntent, blackIntent );
+ dataItem.getId(), dataItem.isSuperPrimary(), header);
if (phone.hasKindTypeColumn(kind)) {
text = Phone.getTypeLabel(res, phone.getKindTypeColumn(kind),
phone.getLabel()).toString();