Code example for DevicePolicyManager

Methods: isActivePasswordSufficient, isAdminActive

0
     * Indicates whether the device administrator is currently active. 
     * 
     * @return 
     */ 
    public boolean isAdminActive() { 
        return mDPM.isAdminActive(mPolicyAdmin);
    } 
 
    public boolean isActivePasswordSufficient() { 
        return mDPM.isActivePasswordSufficient();
    } 
 
    public boolean isDeviceSecured() { 
        return isAdminActive() && isActivePasswordSufficient(); 
    } 
 
    /** 
     * Configure policy defined in the object. 
     */ 
    public void configurePolicy() { 
        mDPM.setPasswordQuality(mPolicyAdmin, PASSWORD_QUALITY_VALUES[mPasswordQuality]);