title: DevicePolicyManager resetPassword not working some times
body: <p>All, 
  I am having a very strange issue.
  I have the following code that enables and disables the PIN based on certain conditions</p>
  
  <pre><code>DevicePolicyManager mDPM;
  ComponentName mDeviceAdminSample;
  mDPM = (DevicePolicyManager)context.getSystemService(Context.DEVICE_POLICY_SERVICE);
  mDeviceAdminSample = new ComponentName(context, DeviceAdminSampleReceiver.class);
  
  public void disablePINLock(DBHelper myDBHelper, Context context) {
  
      mDPM.setPasswordQuality(mDeviceAdminSample,
              DevicePolicyManager.PASSWORD_QUALITY_UNSPECIFIED);
      mDPM.setPasswordMinimumLength(mDeviceAdminSample, 0);
      boolean result = false;
      result = mDPM.resetPassword("", DevicePolicyManager.RESET_PASSWORD_REQUIRE_ENTRY);
  
      if (result) {
          // Toast: "Successfully Disabled PIN lock"
      }
      else {
          // Toast: "Could not disable PIN lock"
      }
  }
  
  public void enablePINLock(DBHelper myDBHelper, Context context) {
      mDPM.setPasswordQuality(mDeviceAdminSample,
              DevicePolicyManager.PASSWORD_QUALITY_NUMERIC);
      mDPM.setPasswordMinimumLength(mDeviceAdminSample, 4);
  
      Cursor c = myDBHelper.getSetting("'random'");
      if (c != null) {
          boolean result = mDPM.resetPassword("1234",
                  DevicePolicyManager.RESET_PASSWORD_REQUIRE_ENTRY);
          if (result) {
              // Toast: "Successfully Enabled PIN lock"
          }
          else {
              // Toast: "Could not enable PIN lock"
          }
      }
      else {
          // Toast: "Could not enable PIN lock"
          c.close();
      }
  }
  </code></pre>
  
  <p>The code was working fine until a few days ago. I restarted the phone to finish updating and since then the <code>disablePINLock</code> function is not working correctly. When the function executes all I get is 
  "result" is false and toast message "Could not disable PIN". The <code>enablePINLock</code> method is working just fine and has always worked fine.</p>
  
  <p>Since the restart <code>result = mDPM.resetPassword("", DevicePolicyManager.RESET_PASSWORD_REQUIRE_ENTRY);</code> has failed to execute. I tried to catch an exception but it didn't help.</p>
  
  <p>At this point I am clueless as to why the method stopped working after the restart. I checked the device administrators, enabled/disabled the app few times without any success.</p>
  
  <p>Also I am not sure if this is related, but let me say this. The device administrator screen has my app always checked, even after I uncheck the app and deactivate it, the app name has the box checked.</p>
  
  <p>Thank you in advance for any response.</p>