public void testWritingTaskWithExtras() throws Exception {
    JobInfo.Builder b =
        new Builder(8, mComponent)
            .setRequiresDeviceIdle(true)
            .setPeriodic(10000L)
            .setRequiresCharging(true)
            .setPersisted(true);

    PersistableBundle extras = new PersistableBundle();
    extras.putDouble("hello", 3.2);
    extras.putString("hi", "there");
    extras.putInt("into", 3);
    b.setExtras(extras);
    final JobInfo task = b.build();
    JobStatus taskStatus = JobStatus.createFromJobInfo(task, SOME_UID, null, -1, null);

    mTaskStoreUnderTest.add(taskStatus);
    Thread.sleep(IO_WAIT);

    final JobSet jobStatusSet = new JobSet();
    mTaskStoreUnderTest.readJobMapFromDisk(jobStatusSet);
    assertEquals("Incorrect # of persisted tasks.", 1, jobStatusSet.size());
    JobStatus loaded = jobStatusSet.getAllJobs().iterator().next();
    assertTasksEqual(task, loaded.getJob());
  }
  public String getVvmType() {
    if (mCarrierConfig == null) {
      return null;
    }

    return mCarrierConfig.getString(CarrierConfigManager.KEY_VVM_TYPE_STRING, null);
  }
  public String getCarrierVvmPackageName() {
    if (mCarrierConfig == null) {
      return null;
    }

    return mCarrierConfig.getString(CarrierConfigManager.KEY_CARRIER_VVM_PACKAGE_NAME_STRING, null);
  }
 /**
  * For checking upon sim insertion whether visual voicemail should be enabled. This method does so
  * by checking if the carrier's voicemail app is installed.
  */
 public boolean isEnabledByDefault() {
   String packageName =
       mCarrierConfig.getString(CarrierConfigManager.KEY_CARRIER_VVM_PACKAGE_NAME_STRING);
   if (packageName == null) {
     return true;
   }
   try {
     mContext.getPackageManager().getPackageInfo(packageName, 0);
     return false;
   } catch (NameNotFoundException e) {
     return true;
   }
 }
  private OmtpMessageSender getMessageSender() {
    if (mCarrierConfig == null) {
      Log.w(TAG, "Empty carrier config.");
      return null;
    }

    int applicationPort = mCarrierConfig.getInt(CarrierConfigManager.KEY_VVM_PORT_NUMBER_INT, 0);
    String destinationNumber =
        mCarrierConfig.getString(CarrierConfigManager.KEY_VVM_DESTINATION_NUMBER_STRING);
    if (TextUtils.isEmpty(destinationNumber)) {
      Log.w(TAG, "No destination number for this carrier.");
      return null;
    }

    OmtpMessageSender messageSender = null;
    SmsManager smsManager = SmsManager.getSmsManagerForSubscriptionId(mSubId);
    switch (mVvmType) {
      case TelephonyManager.VVM_TYPE_OMTP:
        messageSender =
            new OmtpStandardMessageSender(
                smsManager,
                (short) applicationPort,
                destinationNumber,
                null,
                OmtpConstants.PROTOCOL_VERSION1_1,
                null);
        break;
      case TelephonyManager.VVM_TYPE_CVVM:
        messageSender =
            new OmtpCvvmMessageSender(smsManager, (short) applicationPort, destinationNumber);
        break;
      default:
        Log.w(TAG, "Unexpected visual voicemail type: " + mVvmType);
    }

    return messageSender;
  }