If you need to enable or cancel the shake Effect of sliding and unlocking Based on the touch vibration switch in the settings, you need to make the following changes.
In the LockScreen method of the LockScreen. java class
Copy codeThe Code is as follows: else if (mUnlockWidget instanceof MultiWaveView ){
MultiWaveView multiWaveView = (MultiWaveView) mUnlockWidget;
MultiWaveView. setVibrateEnabled (Settings. System. getInt (mContext. getContentResolver (), // sets the unlock vibration by checking whether the touch vibration effect is set.
Settings. System. HAPTIC_FEEDBACK_ENABLED, 1 )! = 0 );
MultiWaveViewMethods multiWaveViewMethods = new MultiWaveViewMethods (multiWaveView );
MultiWaveView. setOnTriggerListener (multiWaveViewMethods );
MUnlockWidgetMethods = multiWaveViewMethods;
Also addCopy codeThe Code is as follows: class MultiWaveViewMethods implements MultiWaveView. OnTriggerListener,
UnlockWidgetCommonMethods {
Private final MultiWaveView mMultiWaveView;
Private boolean mCameraDisabled;
MultiWaveViewMethods (MultiWaveView multiWaveView ){
MMultiWaveView = multiWaveView;
MultiWaveView. setVibrateEnabled (Settings. System. getInt (mContext. getContentResolver (),
Settings. System. HAPTIC_FEEDBACK_ENABLED, 1 )! = 0 );
Final boolean cameraDisabled = mLockPatternUtils. getDevicePolicyManager ()
. GetCameraDisabled (null );
Because the MultiWaveView control is mainly used for sliding and unlocking, which has the attribute of setting whether to vibrate.