Search in sources :

Example 1 with CallLogQueryHandler

use of com.android.dialer.database.CallLogQueryHandler in project android_packages_apps_Dialer by LineageOS.

the class VisualVoicemailEnabledChecker method asyncUpdate.

/**
 * Perform an async query into the system to check the status of visual voicemail. If the status
 * has changed, Callback.onVisualVoicemailEnabledStatusChanged() will be called.
 */
public void asyncUpdate() {
    mCallLogQueryHandler = new CallLogQueryHandler(mContext, mContext.getContentResolver(), this);
    mCallLogQueryHandler.fetchVoicemailStatus();
}
Also used : CallLogQueryHandler(com.android.dialer.database.CallLogQueryHandler)

Example 2 with CallLogQueryHandler

use of com.android.dialer.database.CallLogQueryHandler in project android_packages_apps_Dialer by LineageOS.

the class CallLogFragment method onCreate.

@Override
public void onCreate(Bundle state) {
    LogUtil.d("CallLogFragment.onCreate", toString());
    super.onCreate(state);
    mRefreshDataRequired = true;
    if (state != null) {
        mCallTypeFilter = state.getInt(KEY_FILTER_TYPE, mCallTypeFilter);
        mLogLimit = state.getInt(KEY_LOG_LIMIT, mLogLimit);
        mDateLimit = state.getLong(KEY_DATE_LIMIT, mDateLimit);
        mIsCallLogActivity = state.getBoolean(KEY_IS_CALL_LOG_ACTIVITY, mIsCallLogActivity);
        mHasReadCallLogPermission = state.getBoolean(KEY_HAS_READ_CALL_LOG_PERMISSION, false);
        mRefreshDataRequired = state.getBoolean(KEY_REFRESH_DATA_REQUIRED, mRefreshDataRequired);
        selectAllMode = state.getBoolean(KEY_SELECT_ALL_MODE, false);
    }
    final Activity activity = getActivity();
    final ContentResolver resolver = activity.getContentResolver();
    mCallLogQueryHandler = new CallLogQueryHandler(activity, resolver, this, mLogLimit);
    if (PermissionsUtil.hasCallLogReadPermissions(getContext())) {
        resolver.registerContentObserver(CallLog.CONTENT_URI, true, mCallLogObserver);
    } else {
        LogUtil.w("CallLogFragment.onCreate", "call log permission not available");
    }
    if (PermissionsUtil.hasContactsReadPermissions(getContext())) {
        resolver.registerContentObserver(ContactsContract.Contacts.CONTENT_URI, true, mContactsObserver);
    } else {
        LogUtil.w("CallLogFragment.onCreate", "contacts permission not available.");
    }
    setHasOptionsMenu(true);
}
Also used : AppCompatActivity(android.support.v7.app.AppCompatActivity) Activity(android.app.Activity) ContentResolver(android.content.ContentResolver) CallLogQueryHandler(com.android.dialer.database.CallLogQueryHandler)

Example 3 with CallLogQueryHandler

use of com.android.dialer.database.CallLogQueryHandler in project android_packages_apps_Dialer by LineageOS.

the class ListsFragment method onResume.

@Override
public void onResume() {
    LogUtil.d("ListsFragment.onResume", null);
    Trace.beginSection(TAG + " onResume");
    super.onResume();
    mPaused = false;
    if (getUserVisibleHint()) {
        sendScreenViewForCurrentPosition();
    }
    // Fetch voicemail status to determine if we should show the voicemail tab.
    mCallLogQueryHandler = new CallLogQueryHandler(getActivity(), getActivity().getContentResolver(), this);
    mCallLogQueryHandler.fetchVoicemailStatus();
    mCallLogQueryHandler.fetchMissedCallsUnreadCount();
    Trace.endSection();
    mCurrentPage = mAdapter.getItem(mViewPager.getCurrentItem());
    if (mCurrentPage instanceof CallLogFragment) {
        ((CallLogFragment) mCurrentPage).onVisible();
    }
}
Also used : CallLogFragment(com.android.dialer.app.calllog.CallLogFragment) CallLogQueryHandler(com.android.dialer.database.CallLogQueryHandler)

Aggregations

CallLogQueryHandler (com.android.dialer.database.CallLogQueryHandler)3 Activity (android.app.Activity)1 ContentResolver (android.content.ContentResolver)1 AppCompatActivity (android.support.v7.app.AppCompatActivity)1 CallLogFragment (com.android.dialer.app.calllog.CallLogFragment)1