@Override
    public void onClick(View v) {
        String url = mEditText.getText().toString();
        int viewId = v.getId();

        if (viewId == R.id.connect_button) {
            bindCustomTabsService();
        } else if (viewId == R.id.warmup_button) {
            boolean success = false;
            if (mClient != null) success = mClient.warmup(0);
            if (!success) mWarmupButton.setEnabled(false);
        } else if (viewId == R.id.may_launch_button) {
            CustomTabsSession session = getSession();
            boolean success = false;
            if (mClient != null) success = session.mayLaunchUrl(Uri.parse(url), null, null);
            if (!success) mMayLaunchButton.setEnabled(false);
        } else if (viewId == R.id.launch_button) {
            CustomTabsSession session = getSession();
            CustomTabsIntent.Builder builder = new CustomTabsIntent.Builder(session);
            builder.setToolbarColor(Color.parseColor(TOOLBAR_COLOR)).setShowTitle(true);
            prepareMenuItems(builder);
            prepareActionButton(builder);
            if (session != null) prepareBottombar(builder);
            builder.setStartAnimations(this, R.anim.slide_in_right, R.anim.slide_out_left);
            builder.setExitAnimations(this, R.anim.slide_in_left, R.anim.slide_out_right);
            builder.setCloseButtonIcon(
                    BitmapFactory.decodeResource(getResources(), R.drawable.ic_arrow_back));
            CustomTabsIntent customTabsIntent = builder.build();
            if (session != null) {
                CustomTabsHelper.addKeepAliveExtra(this, customTabsIntent.intent);
            } else {
                if (!TextUtils.isEmpty(mPackageNameToBind)) {
                    customTabsIntent.intent.setPackage(mPackageNameToBind);
                }
            }
            customTabsIntent.launchUrl(this, Uri.parse(url));
        } else if (viewId == R.id.launch_browser_actions_button) {
            Intent openLinkIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
            PendingIntent openLinkPendingIntent = PendingIntent.getActivity(this, 0, openLinkIntent, 0);
            Bitmap bitmap = BitmapFactory.decodeResource(getResources(), R.drawable.ic_launcher);
            Uri uri = BrowserServiceFileProvider.generateUri(this, bitmap, "ic_launcher", 1);

            BrowserActionItem item1 = new BrowserActionItem(
                    "Open the link (without icon)", openLinkPendingIntent, 0);
            BrowserActionItem item2 =
                    new BrowserActionItem("Open the link (with icon from resouce)",
                            openLinkPendingIntent, R.drawable.ic_launcher);
            BrowserActionItem item3 = new BrowserActionItem(
                    "Open the link (with icon from file provider)", openLinkPendingIntent, uri);
            ArrayList<BrowserActionItem> items = new ArrayList<>();
            items.add(item1);
            items.add(item2);
            items.add(item3);
            Intent defaultIntent = new Intent();
            defaultIntent.setClass(getApplicationContext(), BrowserActionsReceiver.class);
            PendingIntent defaultAction = PendingIntent.getBroadcast(this, 0, defaultIntent, 0);
            BrowserActionsIntent.openBrowserAction(
                    this, Uri.parse(url), BrowserActionsIntent.URL_TYPE_NONE, items, defaultAction);
        } else if (viewId == R.id.register_twa_service) {
            if (mPackageNameToBind != null) {
                TrustedWebActivityService.setVerifiedProvider(this, mPackageNameToBind);
            }
        }
    }
Once per second, asks the framework for the process importance, and logs any change.
Application/src/main/java/org/chromium/customtabsclient/MainActivity.java