Disable the lock screen forever

Open the following file from Android framework. /android/frameworks/base/policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewMediator.java Go to “doKeyguardLocked(Bundle options)” function. Add below code at appropriate place. [code lang=”java”] +final boolean disableLockScreenForever = SystemProperties.getBoolean(“keyguard.disable”, true); +if(disableLockScreenForever){ + if(DEBUG) Log.d(TAG,”doKeyguard: not showing lock screen forever”); + return; +} if (DEBUG) Log.d(TAG, “doKeyguard: showing the lock screen”); showLocked(options); [/code] Go to “maybeSendUserPresentBroadcast” function. Add below…


Open the following file from Android framework.

/android/frameworks/base/policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewMediator.java

  • Go to “doKeyguardLocked(Bundle options)” function.
  • Add below code at appropriate place.

[code lang=”java”]
+final boolean disableLockScreenForever = SystemProperties.getBoolean(“keyguard.disable”, true);
+if(disableLockScreenForever){
+ if(DEBUG) Log.d(TAG,”doKeyguard: not showing lock screen forever”);
+ return;
+}
if (DEBUG) Log.d(TAG, “doKeyguard: showing the lock screen”);
showLocked(options);
[/code]

  • Go to “maybeSendUserPresentBroadcast” function.
  • Add below code at appropriate place.

[code lang=”java”]
if (mSystemReady && mLockPatternUtils.isLockScreenDisabled()
&& mUserManager.getUsers(true).size() == 1) {
// Lock screen is disabled because the user has set the preference to “None”.
// In this case, send out ACTION_USER_PRESENT here instead of in
// handleKeyguardDone()
+ sendUserPresentBroadcast();
+// Because of we dont neet screen lock ,so the nomal preocedure will break.
+// when breaked,we need to sendbroadcast where original the unlock keyguard will do
+} else if (mSystemReady && !mLockPatternUtils.isLockScreenDisabled() && SystemProperties.getBoolean(“keyguard.disable”, true)) {
+ Log.d(TAG,”maybeSendUserPresentBroadcast:unNormal send broadcast”);
sendUserPresentBroadcast();
}
[/code]


Leave a Reply

Discover more from Prabhu System Technology

Subscribe now to keep reading and get access to the full archive.

Continue reading