当出现一定数量的屏幕密码失败时,我试图让 Android 手机(LP 5.1.1)重新启动。这是我在 Keyguard 中的语言:
if (mLockPatternUtils.isSeparateEncryptionPasswordEnabled() && failedAttempts >= 5) {
final PowerManager powerManager = mContext.getSystemService(PowerManager.class);
powerManager.reboot(null);
我得到一个编译错误:
frameworks/base/packages/Keyguard/src/com/android/keyguard/KeyguardSecurityContainer.java:409:
错误:类 Context 中的方法 getSystemService 不能应用于给定类型;final PowerManager powerManager = mContext.getSystemService(PowerManager.class); ^ 必需:字符串
发现:类
原因:实际参数类不能转换为
字符串按方法调用转换
有任何想法吗?提前致谢