2015-06-19 87 views
0

我們可以檢查設備admin上的設備強制執行哪些策略。我希望啓用/禁用某些功能並根據設備上強制執行的策略向用戶顯示提示。檢查設備上執行的設備管理策略

對於例如:我想在我的應用停用相機選項時相機 限購政策已被管理員啓用的device.This 將有助於提高可用性。

請注意我的應用程序是不是設備管理員應用程序。

回答

0

發現有UserManager api這將幫助我做到這一點。 refer here

public boolean hasUserRestriction (String restrictionKey) 
Added in API level 21 

Returns whether the current user has been disallowed from performing certain actions or setting certain settings. 
Parameters 
restrictionKey The string key representing the restriction. 
Returns 

    true if the current user has the given restriction, false otherwise. 


    [1]: http://developer.android.com/reference/android/os/UserManager.html#hasUserRestriction%28java.lang.String%29