summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTyler Gunn <tgunn@google.com>2014-04-18 22:37:32 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-04-18 22:37:32 +0000
commit2dda5cd5850ec1afd4bfb0a9e05a5e641853a545 (patch)
tree548e49dbdf91a4955d2c27b1065ca617493046c6 /src
parent150621605d4d9993e6a9ffae34af171ec4ee06ba (diff)
parent93dcef71c7ea7a99ef4067ab3dea79a263b9613b (diff)
am 93dcef71: Merge "Adding support in the CallLogFragment for filtering calls based on call date/time."
* commit '93dcef71c7ea7a99ef4067ab3dea79a263b9613b': Adding support in the CallLogFragment for filtering calls based on call date/time.
Diffstat (limited to 'src')
-rw-r--r--src/com/android/dialer/calllog/CallLogFragment.java36
1 files changed, 31 insertions, 5 deletions
diff --git a/src/com/android/dialer/calllog/CallLogFragment.java b/src/com/android/dialer/calllog/CallLogFragment.java
index d0350f0ce..84d55d1d6 100644
--- a/src/com/android/dialer/calllog/CallLogFragment.java
+++ b/src/com/android/dialer/calllog/CallLogFragment.java
@@ -108,6 +108,10 @@ public class CallLogFragment extends ListFragment
// will be used.
private int mLogLimit = -1;
+ // Date limit (in millis since epoch) - when non-zero, only calls which occurred on or after
+ // the date filter are included. If zero, no date-based filtering occurs.
+ private long mDateLimit = 0;
+
public CallLogFragment() {
this(CallLogQueryHandler.CALL_TYPE_ALL, -1);
}
@@ -122,6 +126,28 @@ public class CallLogFragment extends ListFragment
mLogLimit = logLimit;
}
+ /**
+ * Creates a call log fragment, filtering to include only calls of the desired type, occurring
+ * after the specified date.
+ * @param filterType type of calls to include.
+ * @param dateLimit limits results to calls occurring on or after the specified date.
+ */
+ public CallLogFragment(int filterType, long dateLimit) {
+ this(filterType, -1, dateLimit);
+ }
+
+ /**
+ * Creates a call log fragment, filtering to include only calls of the desired type, occurring
+ * after the specified date. Also provides a means to limit the number of results returned.
+ * @param filterType type of calls to include.
+ * @param logLimit limits the number of results to return.
+ * @param dateLimit limits results to calls occurring on or after the specified date.
+ */
+ public CallLogFragment(int filterType, int logLimit, long dateLimit) {
+ this(filterType, logLimit);
+ mDateLimit = dateLimit;
+ }
+
@Override
public void onCreate(Bundle state) {
super.onCreate(state);
@@ -141,7 +167,7 @@ public class CallLogFragment extends ListFragment
getActivity().getContentResolver().registerContentObserver(
Status.CONTENT_URI, true, mVoicemailStatusObserver);
setHasOptionsMenu(true);
- updateCallList(mCallTypeFilter);
+ updateCallList(mCallTypeFilter, mDateLimit);
}
/** Called by the CallLogQueryHandler when the list of calls has been fetched or updated. */
@@ -320,20 +346,20 @@ public class CallLogFragment extends ListFragment
@Override
public void fetchCalls() {
- mCallLogQueryHandler.fetchCalls(mCallTypeFilter);
+ mCallLogQueryHandler.fetchCalls(mCallTypeFilter, mDateLimit);
}
public void startCallsQuery() {
mAdapter.setLoading(true);
- mCallLogQueryHandler.fetchCalls(mCallTypeFilter);
+ mCallLogQueryHandler.fetchCalls(mCallTypeFilter, mDateLimit);
}
private void startVoicemailStatusQuery() {
mCallLogQueryHandler.fetchVoicemailStatus();
}
- private void updateCallList(int filterType) {
- mCallLogQueryHandler.fetchCalls(filterType);
+ private void updateCallList(int filterType, long dateLimit) {
+ mCallLogQueryHandler.fetchCalls(filterType, dateLimit);
}
private void updateEmptyMessage(int filterType) {