@Thunk static CharSequence ensureValidName(Context context,Intent intent,CharSequence name){
  if (name == null) {
    try {
      PackageManager pm=context.getPackageManager();
      ActivityInfo info=pm.getActivityInfo(intent.getComponent(),0);
      name=info.loadLabel(pm);
    }
 catch (    PackageManager.NameNotFoundException nnfe) {
      return "";
    }
  }
  return name;
}

@ Thunk static CharSequence ensureValidName ( Context context , Intent intent , CharSequence name ) { if ( name == null ) { try { PackageManager pm = context . getPackageManager ( ) ; ActivityInfo info = pm . getActivityInfo ( intent . getComponent ( ) , 0 ) ; name = info . loadLabel ( pm ) ; } catch ( PackageManager . NameNotFoundException nnfe ) { return "" ; } } return name ; }
ensures that we have a valid , non - null name . if the provided name is null , we will return the application name instead .
