private void maybeSwapSearchIcon() {
   Intent intent = SearchManager.getAssistIntent(mContext);
   if (intent != null) {
     ComponentName component = intent.getComponent();
     if (component == null
         || !mGlowPadView.replaceTargetDrawablesIfPresent(
             component,
             ASSIST_ICON_METADATA_NAME,
             com.android.internal.R.drawable.ic_action_assist_generic)) {
       if (DEBUG) Slog.v(TAG, "Couldn't grab icon for component " + component);
     }
   }
 }
 private void startAssistActivity() {
   // Close Recent Apps if needed
   mBar.animateCollapse(CommandQueue.FLAG_EXCLUDE_SEARCH_PANEL);
   // Launch Assist
   Intent intent = SearchManager.getAssistIntent(mContext);
   if (intent == null) return;
   try {
     ActivityOptions opts =
         ActivityOptions.makeCustomAnimation(
             mContext, R.anim.search_launch_enter, R.anim.search_launch_exit, getHandler(), this);
     intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
     mContext.startActivity(intent, opts.toBundle());
   } catch (ActivityNotFoundException e) {
     Slog.w(TAG, "Activity not found for " + intent.getAction());
     onAnimationStarted();
   }
 }
 public boolean isAssistantAvailable() {
   return SearchManager.getAssistIntent(mContext) != null;
 }