1

我正在使用 Test DPC 应用程序更改其代码以进行一些实验。我编写了一个非常简单的方法来设置应用程序限制,它不会抛出任何异常,但不会设置限制的值。我正在尝试设置 gmail 应用程序的限制“default_signature”(包名= com.google.android.gm)。按照代码:

Log.d(TAG, "restriction="+restriction);
mDevicePolicyManager.setApplicationRestrictions(
            DeviceAdminReceiver.getComponentName(context),
            (String) message.getExtra("packageName"),
            restriction);
Log.d(TAG, "restriction updated");

我可以看到的日志是:

SetRestrictionAction﹕restriction=Bundle[{default_signature=test}]

SetRestrictionAction﹕限制已更新

无论如何,这段代码似乎不会影响 gmail 应用程序。谁能解释一下问题出在哪里?我有一台更新到 Android 7.0 的 LG G5 H850 设备

提前致谢

4

0 回答 0