Search in sources :

Example 6 with FilteredNumberAsyncQueryHandler

use of com.android.dialer.database.FilteredNumberAsyncQueryHandler in project android_packages_apps_Dialer by MoKee.

the class CallStatsDetailActivity method onCreate.

@Override
protected void onCreate(Bundle icicle) {
    super.onCreate(icicle);
    setContentView(R.layout.call_stats_detail);
    mResources = getResources();
    mContactInfoHelper = new ContactInfoHelper(this, GeoUtil.getCurrentCountryIso(this));
    mFilteredNumberAsyncQueryHandler = new FilteredNumberAsyncQueryHandler(getContentResolver());
    mQuickContactBadge = (QuickContactBadge) findViewById(R.id.quick_contact_photo);
    mQuickContactBadge.setOverlay(null);
    mQuickContactBadge.setPrioritizedMimeType(Phone.CONTENT_ITEM_TYPE);
    mCallerName = (TextView) findViewById(R.id.caller_name);
    mCallerNumber = (TextView) findViewById(R.id.caller_number);
    mCallButton = (View) findViewById(R.id.call_back_button);
    mCallButton.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View view) {
            startActivity(CallUtil.getCallIntent(mNumber));
        }
    });
    mDurationBar = (LinearColorBar) findViewById(R.id.duration_number_percent_bar);
    mTotalDurationBar = (LinearColorBar) findViewById(R.id.duration_total_percent_bar);
    mTotalDuration = (TextView) findViewById(R.id.total_duration_number);
    mTotalTotalDuration = (TextView) findViewById(R.id.total_duration_total);
    mInDuration = new DetailLine(R.id.in_duration, R.string.call_stats_incoming, Calls.INCOMING_TYPE);
    mOutDuration = new DetailLine(R.id.out_duration, R.string.call_stats_outgoing, Calls.OUTGOING_TYPE);
    mCountBar = (LinearColorBar) findViewById(R.id.count_number_percent_bar);
    mTotalCountBar = (LinearColorBar) findViewById(R.id.count_total_percent_bar);
    mTotalCount = (TextView) findViewById(R.id.total_count_number);
    mTotalTotalCount = (TextView) findViewById(R.id.total_count_total);
    mInCount = new DetailLine(R.id.in_count, R.string.call_stats_incoming, Calls.INCOMING_TYPE);
    mOutCount = new DetailLine(R.id.out_count, R.string.call_stats_outgoing, Calls.OUTGOING_TYPE);
    mMissedCount = new DetailLine(R.id.missed_count, R.string.call_stats_missed, Calls.MISSED_TYPE);
    mBlockedCount = new DetailLine(R.id.blocked_count, R.string.call_stats_blocked, Calls.BLOCKED_TYPE);
    mInAverage = new DetailLine(R.id.in_average, R.string.call_stats_incoming, Calls.INCOMING_TYPE);
    mOutAverage = new DetailLine(R.id.out_average, R.string.call_stats_outgoing, Calls.OUTGOING_TYPE);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    Intent launchIntent = getIntent();
    mData = (CallStatsDetails) launchIntent.getParcelableExtra(EXTRA_DETAILS);
    mTotalData = (CallStatsDetails) launchIntent.getParcelableExtra(EXTRA_TOTAL);
    updateData();
    updateFilteredNumberChanges();
    TextView dateFilterView = (TextView) findViewById(R.id.date_filter);
    long filterFrom = launchIntent.getLongExtra(EXTRA_FROM, -1);
    if (filterFrom == -1) {
        dateFilterView.setVisibility(View.GONE);
    } else {
        long filterTo = launchIntent.getLongExtra(EXTRA_TO, -1);
        dateFilterView.setText(DateUtils.formatDateRange(this, filterFrom, filterTo, 0));
    }
}
Also used : ContactInfoHelper(com.android.dialer.calllog.ContactInfoHelper) FilteredNumberAsyncQueryHandler(com.android.dialer.database.FilteredNumberAsyncQueryHandler) Intent(android.content.Intent) TextView(android.widget.TextView) View(android.view.View) TextView(android.widget.TextView) CallTypeIconsView(com.android.dialer.calllog.CallTypeIconsView)

Example 7 with FilteredNumberAsyncQueryHandler

use of com.android.dialer.database.FilteredNumberAsyncQueryHandler in project android_packages_apps_Dialer by MoKee.

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(), false);
    mFilteredNumberAsyncQueryHandler = new FilteredNumberAsyncQueryHandler(getContext().getContentResolver());
}
Also used : FilteredNumberAsyncQueryHandler(com.android.dialer.database.FilteredNumberAsyncQueryHandler)

Example 8 with FilteredNumberAsyncQueryHandler

use of com.android.dialer.database.FilteredNumberAsyncQueryHandler in project android_packages_apps_Dialer by MoKee.

the class DialerApplication method onCreate.

@Override
public void onCreate() {
    sContext = this;
    Trace.beginSection(TAG + " onCreate");
    super.onCreate();
    Trace.beginSection(TAG + " ExtensionsFactory initialization");
    ExtensionsFactory.init(getApplicationContext());
    Trace.endSection();
    new BlockedNumbersAutoMigrator(PreferenceManager.getDefaultSharedPreferences(this), new FilteredNumberAsyncQueryHandler(getContentResolver())).autoMigrate();
    Trace.endSection();
}
Also used : BlockedNumbersAutoMigrator(com.android.dialer.filterednumber.BlockedNumbersAutoMigrator) FilteredNumberAsyncQueryHandler(com.android.dialer.database.FilteredNumberAsyncQueryHandler)

Example 9 with FilteredNumberAsyncQueryHandler

use of com.android.dialer.database.FilteredNumberAsyncQueryHandler in project android_packages_apps_Dialer by MoKee.

the class InCallPresenter method setUp.

public void setUp(Context context, CallList callList, ExternalCallList externalCallList, AudioModeProvider audioModeProvider, StatusBarNotifier statusBarNotifier, ExternalCallNotifier externalCallNotifier, ContactInfoCache contactInfoCache, ProximitySensor proximitySensor) {
    if (mServiceConnected) {
        Log.i(this, "New service connection replacing existing one.");
        // retain the current resources, no need to create new ones.
        Preconditions.checkState(context == mContext);
        Preconditions.checkState(callList == mCallList);
        Preconditions.checkState(audioModeProvider == mAudioModeProvider);
        return;
    }
    Preconditions.checkNotNull(context);
    mContext = context;
    mContactInfoCache = contactInfoCache;
    mStatusBarNotifier = statusBarNotifier;
    mExternalCallNotifier = externalCallNotifier;
    addListener(mStatusBarNotifier);
    mInCallVibrationHandler = new InCallVibrationHandler(context);
    addListener(mInCallVibrationHandler);
    mAudioModeProvider = audioModeProvider;
    mProximitySensor = proximitySensor;
    addListener(mProximitySensor);
    // are no longer relevant now.
    if (isActivityStarted()) {
        mInCallActivity.dismissPendingDialogs();
    }
    addIncomingCallListener(mAnswerPresenter);
    addInCallUiListener(mAnswerPresenter);
    mPowerManager = (PowerManager) mContext.getSystemService(Context.POWER_SERVICE);
    mWakeLock = mPowerManager.newWakeLock(PowerManager.SCREEN_BRIGHT_WAKE_LOCK | PowerManager.ACQUIRE_CAUSES_WAKEUP, "InCallPresenter");
    mCallList = callList;
    mExternalCallList = externalCallList;
    externalCallList.addExternalCallListener(mExternalCallNotifier);
    // This only gets called by the service so this is okay.
    mServiceConnected = true;
    // The final thing we do in this set up is add ourselves as a listener to CallList.  This
    // will kick off an update and the whole process can start.
    mCallList.addListener(this);
    InCallCsRedialHandler.getInstance().setUp(mContext);
    InCallUiStateNotifier.getInstance().setUp(mContext);
    VideoPauseController.getInstance().setUp(this);
    InCallLowBatteryListener.getInstance().setUp(mContext);
    InCallVideoCallCallbackNotifier.getInstance().addSessionModificationListener(this);
    mFilteredQueryHandler = new FilteredNumberAsyncQueryHandler(context.getContentResolver());
    mTelephonyManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
    mTelephonyManager.listen(mPhoneStateListener, PhoneStateListener.LISTEN_CALL_STATE);
    mCallList.setFilteredNumberQueryHandler(mFilteredQueryHandler);
    InCallMessageController.getInstance().setUp(mContext);
    OrientationModeHandler.getInstance().setUp();
    addDetailsListener(CallSubstateNotifier.getInstance());
    addDetailsListener(SessionModificationCauseNotifier.getInstance());
    CallList.getInstance().addListener(CallSubstateNotifier.getInstance());
    CallList.getInstance().addListener(SessionModificationCauseNotifier.getInstance());
    InCallZoomController.getInstance().setUp(mContext);
    Log.d(this, "Finished InCallPresenter.setUp");
}
Also used : FilteredNumberAsyncQueryHandler(com.android.dialer.database.FilteredNumberAsyncQueryHandler)

Aggregations

FilteredNumberAsyncQueryHandler (com.android.dialer.database.FilteredNumberAsyncQueryHandler)9 Intent (android.content.Intent)3 View (android.view.View)2 TextView (android.widget.TextView)2 ContactInfoHelper (com.android.dialer.calllog.ContactInfoHelper)2 AlertDialog (android.app.AlertDialog)1 Notification (android.app.Notification)1 NotificationManager (android.app.NotificationManager)1 PendingIntent (android.app.PendingIntent)1 ContentValues (android.content.ContentValues)1 DialogInterface (android.content.DialogInterface)1 Cursor (android.database.Cursor)1 AsyncTask (android.os.AsyncTask)1 ListView (android.widget.ListView)1 ContactsPreferences (com.android.contacts.common.preference.ContactsPreferences)1 CallTypeHelper (com.android.dialer.calllog.CallTypeHelper)1 CallTypeIconsView (com.android.dialer.calllog.CallTypeIconsView)1 OnCheckBlockedListener (com.android.dialer.database.FilteredNumberAsyncQueryHandler.OnCheckBlockedListener)1 OnHasBlockedNumbersListener (com.android.dialer.database.FilteredNumberAsyncQueryHandler.OnHasBlockedNumbersListener)1 BlockedNumbersAutoMigrator (com.android.dialer.filterednumber.BlockedNumbersAutoMigrator)1