• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java RestrictionsManager类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中android.content.RestrictionsManager的典型用法代码示例。如果您正苦于以下问题:Java RestrictionsManager类的具体用法?Java RestrictionsManager怎么用?Java RestrictionsManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



RestrictionsManager类属于android.content包,在下文中一共展示了RestrictionsManager类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: checkManagedConfiguration

import android.content.RestrictionsManager; //导入依赖的package包/类
public void checkManagedConfiguration() {
    Log.d(TAG, "Checking managed configuration");
    if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {
        // Check for managed configuration
        RestrictionsManager restrictionsManager =
                (RestrictionsManager) getSystemService(Context.RESTRICTIONS_SERVICE);
        Bundle appRestrictions = restrictionsManager.getApplicationRestrictions();
        if (appRestrictions != null && appRestrictions.containsKey("profileUrl")) {
            Log.d(TAG, "Found managed configuration install URL "
                    + appRestrictions.getString("profileUrl"));
            incomingRef = appRestrictions.getString("profileUrl");
            lastInstallMode = INSTALL_MODE_MANAGED_CONFIGURATION;
            uiState = UiState.READY_TO_INSTALL;
            uiStateScreenTransition();
            startResourceInstall();
        }
    }
}
 
开发者ID:dimagi,项目名称:commcare-android,代码行数:19,代码来源:CommCareSetupActivity.java


示例2: checkManagedConfiguration

import android.content.RestrictionsManager; //导入依赖的package包/类
private void checkManagedConfiguration() {
    if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {
        // Check for managed configuration
        RestrictionsManager restrictionsManager =
                (RestrictionsManager) getSystemService(Context.RESTRICTIONS_SERVICE);
        if (restrictionsManager == null) {
            return;
        }
        Bundle appRestrictions = restrictionsManager.getApplicationRestrictions();
        if (appRestrictions.containsKey("username") &&
                appRestrictions.containsKey("password")) {
            uiController.setUsername(appRestrictions.getString("username"));
            uiController.setPasswordOrPin(appRestrictions.getString("password"));
            initiateLoginAttempt(false);
        }
    }
}
 
开发者ID:dimagi,项目名称:commcare-android,代码行数:18,代码来源:LoginActivity.java


示例3: getAppRestrictions

import android.content.RestrictionsManager; //导入依赖的package包/类
private void getAppRestrictions(){
  RestrictionsManager restrictionsManager =
          (RestrictionsManager) this
                  .getSystemService(Context.RESTRICTIONS_SERVICE);

  Bundle appRestrictions = restrictionsManager.getApplicationRestrictions();

  // Block user if KEY_RESTRICTIONS_PENDING is true, and save login hint if available
  if(!appRestrictions.isEmpty()){
    if(appRestrictions.getBoolean(UserManager.
            KEY_RESTRICTIONS_PENDING)!=true){
      mLoginHint = appRestrictions.getString(LOGIN_HINT);
    }
    else {
      Toast.makeText(this,R.string.restrictions_pending_block_user,
              Toast.LENGTH_LONG).show();
      finish();
    }
  }
}
 
开发者ID:googlecodelabs,项目名称:appauth-android-codelab,代码行数:21,代码来源:MainActivity.java


示例4: getIntentForChallengeUIIfRequired

import android.content.RestrictionsManager; //导入依赖的package包/类
@TargetApi(21)
public static Intent getIntentForChallengeUIIfRequired(Activity paramActivity)
{
  if (sUserPinValid) {
    return null;
  }
  Intent localIntent = ((RestrictionsManager)paramActivity.getSystemService("restrictions")).createLocalApprovalIntent();
  PersistableBundle localPersistableBundle = new PersistableBundle();
  localPersistableBundle.putString("android.request.mesg", paramActivity.getString(2131362662));
  localIntent.putExtra("android.content.extra.REQUEST_BUNDLE", localPersistableBundle);
  return localIntent;
}
 
开发者ID:ChiangC,项目名称:FMTech,代码行数:13,代码来源:RestrictedDeviceHelper.java


示例5: onCreate

import android.content.RestrictionsManager; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setRetainInstance(true);
    mDevicePolicyManager = (DevicePolicyManager) getActivity().getSystemService(
            Context.DEVICE_POLICY_SERVICE);
    mRestrictionsManager = (RestrictionsManager) getActivity().getSystemService(
            Context.RESTRICTIONS_SERVICE);
}
 
开发者ID:googlesamples,项目名称:android-testdpc,代码行数:10,代码来源:ManageAppRestrictionsFragment.java


示例6: getRestrictionsManager

import android.content.RestrictionsManager; //导入依赖的package包/类
/**
 * 返回 {@link RestrictionsManager}
 */
public static RestrictionsManager getRestrictionsManager()
{
    return (RestrictionsManager) get(RESTRICTIONS_SERVICE);
}
 
开发者ID:Ayvytr,项目名称:EasyAndroid,代码行数:8,代码来源:Managers.java


示例7: getRestrictionsManager

import android.content.RestrictionsManager; //导入依赖的package包/类
@TargetApi(21)
public static RestrictionsManager getRestrictionsManager() {
    return (RestrictionsManager) getSystemService(Context.RESTRICTIONS_SERVICE);
}
 
开发者ID:simplesoft-duongdt3,项目名称:Android-App-Template,代码行数:5,代码来源:ServiceUtil.java


示例8: restrictions

import android.content.RestrictionsManager; //导入依赖的package包/类
/**
 * @since 4.0.0
 */
public static RestrictionsManager restrictions(Context context) {
    return (RestrictionsManager) context.getSystemService(RESTRICTIONS_SERVICE);
}
 
开发者ID:pushbit,项目名称:sprockets-android,代码行数:7,代码来源:Managers.java


示例9: restrictionsManager

import android.content.RestrictionsManager; //导入依赖的package包/类
@TargetApi(AndroidHelper.API_21)
public static RestrictionsManager restrictionsManager() {
    return (RestrictionsManager) get(Context.RESTRICTIONS_SERVICE);
}
 
开发者ID:shkschneider,项目名称:android_Skeleton,代码行数:5,代码来源:SystemServices.java


示例10: getRestrictionsManager

import android.content.RestrictionsManager; //导入依赖的package包/类
/**
 * Obtain a {@link RestrictionsManager} instance associated with specified {@link Context}
 *
 * @param context Context
 * @return {@link RestrictionsManager} associated with specified {@link Context}
 * @throws InvalidContextException if {@link RestrictionsManager} can't be obtained
 *                                 from specified {@link Context}
 */
@NonNull
@RequiresApi(Build.VERSION_CODES.LOLLIPOP)
public static RestrictionsManager getRestrictionsManager(@NonNull Context context) {
    return validate(context.getSystemService(Context.RESTRICTIONS_SERVICE));
}
 
开发者ID:yuriy-budiyev,项目名称:android-wheels,代码行数:14,代码来源:ContextUtils.java



注:本文中的android.content.RestrictionsManager类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java StructureItem类代码示例发布时间:2022-05-22
下一篇:
Java PointerCoderDescriptor类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap