Search in sources :

Example 1 with P13nRefreshCompleteListener

use of com.android.dialer.p13n.inference.protocol.P13nRanker.P13nRefreshCompleteListener in project android_packages_apps_Dialer by LineageOS.

the class DialtactsActivity method onResume.

@Override
protected void onResume() {
    LogUtil.d("DialtactsActivity.onResume", "");
    Trace.beginSection(TAG + " onResume");
    super.onResume();
    // Some calls may not be recorded (eg. from quick contact),
    // so we should restart recording after these calls. (Recorded call is stopped)
    PostCall.restartPerformanceRecordingIfARecentCallExist(this);
    if (!PerformanceReport.isRecording()) {
        PerformanceReport.startRecording();
    }
    mStateSaved = false;
    if (mFirstLaunch) {
        displayFragment(getIntent());
    } else if (!phoneIsInUse() && mInCallDialpadUp) {
        hideDialpadFragment(false, true);
        mInCallDialpadUp = false;
    } else if (mShowDialpadOnResume) {
        showDialpadFragment(false);
        mShowDialpadOnResume = false;
    } else {
        PostCall.promptUserForMessageIfNecessary(this, mParentLayout);
    }
    // shown until onResume has completed.  Active the search UI and set the search term now.
    if (!TextUtils.isEmpty(mVoiceSearchQuery)) {
        mActionBarController.onSearchBoxTapped();
        mSearchView.setText(mVoiceSearchQuery);
        mVoiceSearchQuery = null;
    }
    if (mIsRestarting) {
        // will not cause an extra view to be sent out on rotation
        if (mIsDialpadShown) {
            Logger.get(this).logScreenView(ScreenEvent.Type.DIALPAD, this);
        }
        mIsRestarting = false;
    }
    prepareVoiceSearchButton();
    if (!mWasConfigurationChange) {
        mDialerDatabaseHelper.startSmartDialUpdateThread();
    }
    mFloatingActionButtonController.align(getFabAlignment(), false);
    if (mFirstLaunch) {
        // Only process the Intent the first time onResume() is called after receiving it
        if (Calls.CONTENT_TYPE.equals(getIntent().getType())) {
            // Externally specified extras take precedence to EXTRA_SHOW_TAB, which is only
            // used internally.
            final Bundle extras = getIntent().getExtras();
            if (extras != null && extras.getInt(Calls.EXTRA_CALL_TYPE_FILTER) == Calls.VOICEMAIL_TYPE) {
                mListsFragment.showTab(DialtactsPagerAdapter.TAB_INDEX_VOICEMAIL);
                Logger.get(this).logImpression(DialerImpression.Type.VVM_NOTIFICATION_CLICKED);
            } else {
                mListsFragment.showTab(DialtactsPagerAdapter.TAB_INDEX_HISTORY);
            }
        } else if (getIntent().hasExtra(EXTRA_SHOW_TAB)) {
            int index = getIntent().getIntExtra(EXTRA_SHOW_TAB, DialtactsPagerAdapter.TAB_INDEX_SPEED_DIAL);
            if (index < mListsFragment.getTabCount()) {
                // Hide dialpad since this is an explicit intent to show a specific tab, which is coming
                // from missed call or voicemail notification.
                hideDialpadFragment(false, false);
                exitSearchUi();
                mListsFragment.showTab(index);
            }
        }
        if (getIntent().getBooleanExtra(EXTRA_CLEAR_NEW_VOICEMAILS, false)) {
            LogUtil.i("DialtactsActivity.onResume", "clearing all new voicemails");
            CallLogNotificationsService.markAllNewVoicemailsAsOld(this);
        }
    }
    mFirstLaunch = false;
    setSearchBoxHint();
    timeTabSelected = SystemClock.elapsedRealtime();
    mP13nLogger.reset();
    mP13nRanker.refresh(new P13nRefreshCompleteListener() {

        @Override
        public void onP13nRefreshComplete() {
        // TODO: make zero-query search results visible
        }
    });
    Trace.endSection();
}
Also used : Bundle(android.os.Bundle) P13nRefreshCompleteListener(com.android.dialer.p13n.inference.protocol.P13nRanker.P13nRefreshCompleteListener)

Aggregations

Bundle (android.os.Bundle)1 P13nRefreshCompleteListener (com.android.dialer.p13n.inference.protocol.P13nRanker.P13nRefreshCompleteListener)1