Search in sources :

Example 6 with FilteredNumberAsyncQueryHandler

use of com.android.dialer.blocking.FilteredNumberAsyncQueryHandler in project android_packages_apps_Dialer by LineageOS.

the class VisualVoicemailUpdateTask method scheduleTask.

/**
 * Updates the voicemail notifications displayed.
 */
static void scheduleTask(@NonNull Context context, @NonNull Runnable callback) {
    Assert.isNotNull(context);
    Assert.isNotNull(callback);
    if (!TelecomUtil.isDefaultDialer(context)) {
        LogUtil.i("VisualVoicemailUpdateTask.scheduleTask", "not default dialer, not running");
        callback.run();
        return;
    }
    Input input = new Input(context, CallLogNotificationsQueryHelper.getInstance(context), new FilteredNumberAsyncQueryHandler(context));
    DialerExecutors.createNonUiTaskBuilder(new VisualVoicemailUpdateTask()).onSuccess(output -> {
        LogUtil.i("VisualVoicemailUpdateTask.scheduleTask", "update successful");
        callback.run();
    }).onFailure(throwable -> {
        LogUtil.i("VisualVoicemailUpdateTask.scheduleTask", "update failed: " + throwable);
        callback.run();
    }).build().executeParallel(input);
}
Also used : Assert(com.android.dialer.common.Assert) Context(android.content.Context) LogUtil(com.android.dialer.common.LogUtil) ContactInfo(com.android.dialer.phonenumbercache.ContactInfo) FilteredNumbersUtil(com.android.dialer.blocking.FilteredNumbersUtil) DialerExecutors(com.android.dialer.common.concurrent.DialerExecutors) Worker(com.android.dialer.common.concurrent.DialerExecutor.Worker) R(com.android.dialer.app.R) TextUtils(android.text.TextUtils) NonNull(android.support.annotation.NonNull) WorkerThread(android.support.annotation.WorkerThread) ArrayList(java.util.ArrayList) NewCall(com.android.dialer.app.calllog.CallLogNotificationsQueryHelper.NewCall) List(java.util.List) FilteredNumberAsyncQueryHandler(com.android.dialer.blocking.FilteredNumberAsyncQueryHandler) Map(java.util.Map) Nullable(android.support.annotation.Nullable) ArrayMap(android.util.ArrayMap) TelecomUtil(com.android.dialer.telecom.TelecomUtil) FilteredNumberAsyncQueryHandler(com.android.dialer.blocking.FilteredNumberAsyncQueryHandler)

Example 7 with FilteredNumberAsyncQueryHandler

use of com.android.dialer.blocking.FilteredNumberAsyncQueryHandler in project android_packages_apps_Dialer by LineageOS.

the class BlockedListSearchFragment method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setShowEmptyListForNullQuery(true);
    /*
     * Pass in the empty string here so ContactEntryListFragment#setQueryString interprets it as
     * an empty search query, rather than as an uninitalized value. In the latter case, the
     * adapter returned by #createListAdapter is used, which populates the view with contacts.
     * Passing in the empty string forces ContactEntryListFragment to interpret it as an empty
     * query, which results in showing an empty view
     */
    setQueryString(getQueryString() == null ? "" : getQueryString());
    mFilteredNumberAsyncQueryHandler = new FilteredNumberAsyncQueryHandler(getContext());
}
Also used : FilteredNumberAsyncQueryHandler(com.android.dialer.blocking.FilteredNumberAsyncQueryHandler)

Example 8 with FilteredNumberAsyncQueryHandler

use of com.android.dialer.blocking.FilteredNumberAsyncQueryHandler in project android_packages_apps_Dialer by LineageOS.

the class DialerApplication method onCreate.

@Override
public void onCreate() {
    Trace.beginSection("DialerApplication.onCreate");
    if (BuildType.get() == BuildType.BUGFOOD) {
        enableStrictMode();
    }
    super.onCreate();
    new BlockedNumbersAutoMigrator(this.getApplicationContext(), new FilteredNumberAsyncQueryHandler(this), new DefaultDialerExecutorFactory()).asyncAutoMigrate();
    CallLogComponent.get(this).callLogFramework().registerContentObservers(getApplicationContext());
    PersistentLogger.initialize(this);
    if (BuildCompat.isAtLeastO()) {
        NotificationChannelManager.initChannels(this);
    }
    Trace.endSection();
}
Also used : DefaultDialerExecutorFactory(com.android.dialer.common.concurrent.DefaultDialerExecutorFactory) BlockedNumbersAutoMigrator(com.android.dialer.blocking.BlockedNumbersAutoMigrator) FilteredNumberAsyncQueryHandler(com.android.dialer.blocking.FilteredNumberAsyncQueryHandler)

Aggregations

FilteredNumberAsyncQueryHandler (com.android.dialer.blocking.FilteredNumberAsyncQueryHandler)8 Context (android.content.Context)2 NotificationManager (android.app.NotificationManager)1 NonNull (android.support.annotation.NonNull)1 Nullable (android.support.annotation.Nullable)1 WorkerThread (android.support.annotation.WorkerThread)1 AppCompatActivity (android.support.v7.app.AppCompatActivity)1 TextUtils (android.text.TextUtils)1 ArrayMap (android.util.ArrayMap)1 R (com.android.dialer.app.R)1 NewCall (com.android.dialer.app.calllog.CallLogNotificationsQueryHelper.NewCall)1 CallLogCache (com.android.dialer.app.calllog.calllogcache.CallLogCache)1 ContactInfoCache (com.android.dialer.app.contactinfo.ContactInfoCache)1 BlockedNumbersAutoMigrator (com.android.dialer.blocking.BlockedNumbersAutoMigrator)1 FilteredNumbersUtil (com.android.dialer.blocking.FilteredNumbersUtil)1 Assert (com.android.dialer.common.Assert)1 LogUtil (com.android.dialer.common.LogUtil)1 DefaultDialerExecutorFactory (com.android.dialer.common.concurrent.DefaultDialerExecutorFactory)1 Worker (com.android.dialer.common.concurrent.DialerExecutor.Worker)1 DialerExecutors (com.android.dialer.common.concurrent.DialerExecutors)1