锁屏Demo:
配置广播接收者 权限android.permission.BIND_DEVICE_ADMIN;
错误“No active admin owned by uid 10077 for policy #3”,是因为接收者没有<meta-data *** android:resource="@xml/lock_screen"/>
激活时,广播接收者会收到onreceive消息;
DevicePolicyManager:Public interface for managing policies enforced on a device. Most clients of this class must have published a DeviceAdminReceiver that the user has currently enabled.
解屏Demo:不能检测按Home键。
KeyguardManager:Class that can be used to lock and unlock the keyboard.
public void onDestroy(){ *** startService(new Intent(XXService.this, StarLockService.class));}
检测是否按下Home键,2.2以后,修改PhoneWindowManager.java源码; 抓Log;
锁屏Demo的显示的动画,mView.onAnimationStart(); mView.onAnimationEnd(); 使用 AlphaAnimation;
锁屏功能需要DevicePolicyManager;清除用户数据/sd卡数据,mDevicePolicyManager.wipeData(***);