Example usage for android.os UserManager DISALLOW_INSTALL_UNKNOWN_SOURCES

List of usage examples for android.os UserManager DISALLOW_INSTALL_UNKNOWN_SOURCES

Introduction

In this page you can find the example usage for android.os UserManager DISALLOW_INSTALL_UNKNOWN_SOURCES.

Prototype

String DISALLOW_INSTALL_UNKNOWN_SOURCES

To view the source code for android.os UserManager DISALLOW_INSTALL_UNKNOWN_SOURCES.

Click Source Link

Document

Specifies if a user is disallowed from enabling the "Unknown Sources" setting, that allows installation of apps from unknown sources.

Usage

From source file:com.android.packageinstaller.PackageInstallerActivity.java

/**
 * @return whether the device admin restricts installation from unknown sources
 *///w  ww  .j a v  a 2 s . c  o  m
private boolean isUnknownSourcesAllowedByAdmin() {
    return !mUserManager.hasUserRestriction(UserManager.DISALLOW_INSTALL_UNKNOWN_SOURCES);
}