code: public Program getProgramRightNow(Channel channel) {
          ApplicationInfo app = null;
          try {
              app = getApplicationContext().getPackageManager().getApplicationInfo(getApplicationContext().getPackageName(), PackageManager.GET_META_DATA);
              Bundle bundle = app.metaData;
              final String service = bundle.getString("TvInputService");
              String channels = TvContract.buildInputId(new ComponentName(getPackageName(), service.substring(getPackageName().length())));
              Log.d(TAG, new ComponentName(getPackageName(), service.substring(getPackageName().length())).flattenToString());
  
              List<Program> programs = getPrograms(getApplicationContext(),
                      TvContract.buildChannelUri(channel.getChannelId()));
              Log.d(TAG, "Program from channel "+TvContract.buildChannelUri(channel.getChannelId()));
              Log.d(TAG, "Program from chanel "+channel.getChannelId());
              Program currentProgram = null;
              for(Program p: programs) {
                  if(p.getStartTimeUtcMillis() < new Date().getTime()) {
                      currentProgram = p;
                  }
              }
              return currentProgram;
  
          } catch (PackageManager.NameNotFoundException e) {
              e.printStackTrace();
          }
          return null;
      }
docs: Queries the channel list to find the given channel and then queries the EPG (electronic
  programming guide) to find the program that is playing right now.
  @param channel The channel you are tuned to
  @return The current program on provided channel