locked
[UWP]Accessing device settings? RRS feed

  • Question

  • Soo maybe im not seeing something here but i cant seem to figure out how to access the device settings in uwp. 

    what i need is to determine wether the device encryption on a phone is enabled or not and if not notify the user to do so.

    as always any help is greatly appreciated. thanks


    Thursday, July 28, 2016 7:35 AM

Answers

  • Hi cluelessgenius,

    As I known, there is no API to get the info of device encryption on a phone.

    When we enabled the device encryption, it need the PIN for it. As a workaround, we can use KeyCredentialManager.IsSupportedAsync method to determine if the current device and user is capable of provisioning a key credential.
    For example:

    var keyCredentialAvailable = await KeyCredentialManager.IsSupportedAsync();
    if (keyCredentialAvailable)
    {
        MyText.Text = keyCredentialAvailable.ToString();
    }
    else
    {
        MyText.Text = keyCredentialAvailable.ToString();
    }
    

    Best Regards,

    Jayden Gu

    • Proposed as answer by Jayden Gu Friday, August 5, 2016 8:22 AM
    • Marked as answer by Barry Wang Monday, August 8, 2016 1:37 AM
    Friday, July 29, 2016 6:49 AM

All replies

  • Hi cluelessgenius,

    As I known, there is no API to get the info of device encryption on a phone.

    When we enabled the device encryption, it need the PIN for it. As a workaround, we can use KeyCredentialManager.IsSupportedAsync method to determine if the current device and user is capable of provisioning a key credential.
    For example:

    var keyCredentialAvailable = await KeyCredentialManager.IsSupportedAsync();
    if (keyCredentialAvailable)
    {
        MyText.Text = keyCredentialAvailable.ToString();
    }
    else
    {
        MyText.Text = keyCredentialAvailable.ToString();
    }
    

    Best Regards,

    Jayden Gu

    • Proposed as answer by Jayden Gu Friday, August 5, 2016 8:22 AM
    • Marked as answer by Barry Wang Monday, August 8, 2016 1:37 AM
    Friday, July 29, 2016 6:49 AM
  • Hi jayden,

    thanks for the workaround unfortunately "issupportedasync()" really only return wether or not a pin is set. so if i set a pin and then disable encryption. the method still returns true.

    is there really no other way of making sure device encryption is activated?

    Thursday, August 25, 2016 1:59 PM