Code example for InvalidParameterException

0
 
    public void execute() { 
      Bundle b=cmd.getExtras();
       
      if (!b.containsKey(EXTRA_VCS) || !b.containsKey(EXTRA_DS)) {
        throw new InvalidParameterException("Missing a strategy!");
      } 
 
      WakefulIntentService.sendWakefulWork(ctxt, cmd);
    } 
 
    void setPhase(int phase) {
      cmd.putExtra(EXTRA_PHASE, phase);
    } 
 
    void setUpdateURL(String updateURL) {
      cmd.putExtra(EXTRA_UPDATE_URL, updateURL);
    } 
 
    void setInstallUri(Uri apk) {
      cmd.putExtra(EXTRA_INSTALL_URI, apk.toString());