summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSai Cheemalapati <saicheems@google.com>2014-07-16 17:02:37 +0000
committerSai Cheemalapati <saicheems@google.com>2014-07-16 17:02:37 +0000
commitc44a26cd4de71485047ab3b6c68c9250c02bb27a (patch)
treebc805cf5061d1f2326f3eba25d41614dc3dde78a /src
parentcee1e65f0c411e35c4521922c3e9def13e01fe64 (diff)
Revert "Added a dialog to confirm caller id reporting."
This reverts commit cee1e65f0c411e35c4521922c3e9def13e01fe64. Change-Id: Ic50fd443856ea7e22714423939ac782cd4e89276
Diffstat (limited to 'src')
-rw-r--r--src/com/android/dialer/calllog/CallLogActivity.java2
-rw-r--r--src/com/android/dialer/calllog/CallLogAdapter.java31
-rw-r--r--src/com/android/dialer/calllog/CallLogFragment.java21
-rw-r--r--src/com/android/dialer/list/ListsFragment.java2
-rw-r--r--src/com/android/dialerbind/ObjectFactory.java17
5 files changed, 20 insertions, 53 deletions
diff --git a/src/com/android/dialer/calllog/CallLogActivity.java b/src/com/android/dialer/calllog/CallLogActivity.java
index f743f7ab5..13d5f0356 100644
--- a/src/com/android/dialer/calllog/CallLogActivity.java
+++ b/src/com/android/dialer/calllog/CallLogActivity.java
@@ -179,4 +179,4 @@ public class CallLogActivity extends Activity implements CallLogQueryHandler.Lis
public void onCallsFetched(Cursor statusCursor) {
// Do nothing. Implemented to satisfy CallLogQueryHandler.Listener.
}
-}
+} \ No newline at end of file
diff --git a/src/com/android/dialer/calllog/CallLogAdapter.java b/src/com/android/dialer/calllog/CallLogAdapter.java
index 199b0b03a..f4b9f3a94 100644
--- a/src/com/android/dialer/calllog/CallLogAdapter.java
+++ b/src/com/android/dialer/calllog/CallLogAdapter.java
@@ -89,11 +89,6 @@ public class CallLogAdapter extends GroupingListAdapter
public void fetchCalls();
}
- /** Implements onClickListener for the report button. */
- public interface OnReportButtonClickListener {
- public void onReportButtonClick(String number);
- }
-
/**
* Stores a phone number of a call with the country code where it originally occurred.
* <p>
@@ -138,7 +133,6 @@ public class CallLogAdapter extends GroupingListAdapter
private final ContactInfoHelper mContactInfoHelper;
private final CallFetcher mCallFetcher;
private final Toast mReportedToast;
- private final OnReportButtonClickListener mOnReportButtonClickListener;
private ViewTreeObserver mViewTreeObserver = null;
/**
@@ -350,7 +344,7 @@ public class CallLogAdapter extends GroupingListAdapter
public CallLogAdapter(Context context, CallFetcher callFetcher,
ContactInfoHelper contactInfoHelper, CallItemExpandedListener callItemExpandedListener,
- OnReportButtonClickListener onReportButtonClickListener, boolean isCallLog) {
+ boolean isCallLog) {
super(context);
mContext = context;
@@ -359,7 +353,6 @@ public class CallLogAdapter extends GroupingListAdapter
mIsCallLog = isCallLog;
mCallItemExpandedListener = callItemExpandedListener;
- mOnReportButtonClickListener = onReportButtonClickListener;
mReportedToast = Toast.makeText(mContext, R.string.toast_caller_id_reported,
Toast.LENGTH_SHORT);
@@ -704,6 +697,10 @@ public class CallLogAdapter extends GroupingListAdapter
// when the user expands the actions ViewStub.
}
+ // Restore expansion state of the row on rebind. Inflate the actions ViewStub if required,
+ // and set its visibility state accordingly.
+ expandOrCollapseActions(callLogItemView, isExpanded(rowId));
+
// Lookup contacts with this number
NumberWithCountryIso numberCountryIso = new NumberWithCountryIso(number, countryIso);
ExpirableCache.CachedValue<ContactInfo> cachedInfo =
@@ -762,10 +759,6 @@ public class CallLogAdapter extends GroupingListAdapter
views.reported = info.isBadData;
views.isExternal = mContactInfoHelper.isExternal(info.sourceType);
- // Restore expansion state of the row on rebind. Inflate the actions ViewStub if required,
- // and set its visibility state accordingly.
- expandOrCollapseActions(callLogItemView, isExpanded(rowId));
-
if (TextUtils.isEmpty(name)) {
details = new PhoneCallDetails(number, numberPresentation,
formattedNumber, countryIso, geocode, callTypes, date,
@@ -950,9 +943,10 @@ public class CallLogAdapter extends GroupingListAdapter
views.reportButtonView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
- if (mOnReportButtonClickListener != null) {
- mOnReportButtonClickListener.onReportButtonClick(views.number);
- }
+ mReportedToast.show();
+ ((CallLogListItemViews) callLogItem.getTag()).reported = true;
+ v.setVisibility(View.GONE);
+ // TODO: Set the entry as reported in the database.
}
});
}
@@ -999,8 +993,6 @@ public class CallLogAdapter extends GroupingListAdapter
);
if (views.isExternal && !views.reported) {
views.reportButtonView.setVisibility(View.VISIBLE);
- } else {
- views.reportButtonView.setVisibility(View.GONE);
}
}
@@ -1400,9 +1392,4 @@ public class CallLogAdapter extends GroupingListAdapter
return mContext.getResources().getString(R.string.call_log_header_other);
}
}
-
- public void onBadDataReported(String number) {
- mContactInfoCache.expireAll();
- mReportedToast.show();
- }
}
diff --git a/src/com/android/dialer/calllog/CallLogFragment.java b/src/com/android/dialer/calllog/CallLogFragment.java
index 852370566..1668895ef 100644
--- a/src/com/android/dialer/calllog/CallLogFragment.java
+++ b/src/com/android/dialer/calllog/CallLogFragment.java
@@ -20,7 +20,6 @@ import android.animation.Animator;
import android.animation.ValueAnimator;
import android.animation.Animator.AnimatorListener;
import android.app.Activity;
-import android.app.DialogFragment;
import android.app.KeyguardManager;
import android.app.ListFragment;
import android.content.Context;
@@ -66,7 +65,7 @@ import java.util.List;
* (all, missed or voicemails), specify it in the constructor.
*/
public class CallLogFragment extends ListFragment
- implements CallLogQueryHandler.Listener, CallLogAdapter.OnReportButtonClickListener,
+ implements CallLogQueryHandler.Listener,
CallLogAdapter.CallFetcher,
CallLogAdapter.CallItemExpandedListener {
private static final String TAG = "CallLogFragment";
@@ -179,6 +178,7 @@ public class CallLogFragment extends ListFragment
@Override
public void onCreate(Bundle state) {
super.onCreate(state);
+
if (state != null) {
mCallTypeFilter = state.getInt(KEY_FILTER_TYPE, mCallTypeFilter);
mLogLimit = state.getInt(KEY_LOG_LIMIT, mLogLimit);
@@ -187,8 +187,8 @@ public class CallLogFragment extends ListFragment
}
String currentCountryIso = GeoUtil.getCurrentCountryIso(getActivity());
- mAdapter = ObjectFactory.newCallLogAdapter(getActivity(), this,
- new ContactInfoHelper(getActivity(), currentCountryIso), this, this, true);
+ mAdapter = ObjectFactory.newCallLogAdapter(getActivity(), this, new ContactInfoHelper(
+ getActivity(), currentCountryIso), this, true);
setListAdapter(mAdapter);
mCallLogQueryHandler = new CallLogQueryHandler(getActivity().getContentResolver(),
this, mLogLimit);
@@ -666,17 +666,4 @@ public class CallLogFragment extends ListFragment
return null;
}
-
- public void onBadDataReported(String number) {
- mAdapter.onBadDataReported(number);
- mAdapter.notifyDataSetChanged();
- }
-
- public void onReportButtonClick(String number) {
- DialogFragment df = ObjectFactory.getReportDialogFragment(number);
- if (df != null) {
- df.setTargetFragment(this, 0);
- df.show(getActivity().getFragmentManager(), "report_dialog");
- }
- }
}
diff --git a/src/com/android/dialer/list/ListsFragment.java b/src/com/android/dialer/list/ListsFragment.java
index 103eef780..e94555e2f 100644
--- a/src/com/android/dialer/list/ListsFragment.java
+++ b/src/com/android/dialer/list/ListsFragment.java
@@ -220,7 +220,7 @@ public class ListsFragment extends Fragment implements CallLogQueryHandler.Liste
this, 1);
final String currentCountryIso = GeoUtil.getCurrentCountryIso(getActivity());
mCallLogAdapter = ObjectFactory.newCallLogAdapter(getActivity(), this,
- new ContactInfoHelper(getActivity(), currentCountryIso), null, null, false);
+ new ContactInfoHelper(getActivity(), currentCountryIso), null, false);
mMergedAdapter = new ShortcutCardsAdapter(getActivity(), this, mCallLogAdapter);
}
diff --git a/src/com/android/dialerbind/ObjectFactory.java b/src/com/android/dialerbind/ObjectFactory.java
index 54a5821df..97863116b 100644
--- a/src/com/android/dialerbind/ObjectFactory.java
+++ b/src/com/android/dialerbind/ObjectFactory.java
@@ -18,12 +18,10 @@ package com.android.dialerbind;
import static com.android.dialer.calllog.CallLogAdapter.CallFetcher;
-import android.app.DialogFragment;
import android.content.Context;
import com.android.dialer.calllog.CallLogAdapter;
import com.android.dialer.calllog.CallLogAdapter.CallItemExpandedListener;
-import com.android.dialer.calllog.CallLogAdapter.OnReportButtonClickListener;
import com.android.dialer.calllog.ContactInfoHelper;
import com.android.dialer.service.CachedNumberLookupService;
@@ -45,15 +43,10 @@ public class ObjectFactory {
* @param isCallLog Is this call log adapter being used on the call log?
* @return Instance of CallLogAdapter.
*/
- public static CallLogAdapter newCallLogAdapter(Context context,
- CallFetcher callFetcher, ContactInfoHelper contactInfoHelper,
- CallItemExpandedListener callItemExpandedListener,
- OnReportButtonClickListener onReportButtonClickListener, boolean isCallLog) {
- return new CallLogAdapter(context, callFetcher, contactInfoHelper,
- callItemExpandedListener, onReportButtonClickListener, isCallLog);
- }
-
- public static DialogFragment getReportDialogFragment(String number) {
- return null;
+ public static CallLogAdapter newCallLogAdapter(Context context, CallFetcher callFetcher,
+ ContactInfoHelper contactInfoHelper, CallItemExpandedListener callItemExpandedListener,
+ boolean isCallLog) {
+ return new CallLogAdapter(context, callFetcher, contactInfoHelper, callItemExpandedListener,
+ isCallLog);
}
}