레이블이 Screen lock인 게시물을 표시합니다. 모든 게시물 표시
레이블이 Screen lock인 게시물을 표시합니다. 모든 게시물 표시

2012년 3월 6일 화요일

android(ICS,JB)에서 Lock Screen 설정 None으로 만들기

JB에서부터는 아래 코드를 적용해서 default가 none으로 설정되지 않습니다.

def_lockscreen_disabled 값을 true로 주시면 코드 수정없이 됩니다.

overlay/frameworks/base/packages/SettingsProvider/res/values/defaults.xml


<?xml version="1.0" encoding="utf-8"?>
<!--
/**
 * Copyright (c) 2009, The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
-->
<resources>
    <bool name="def_accelerometer_rotation">false</bool>
    <bool name="def_lockscreen_disabled">true</bool>
    <integer name="def_screen_off_timeout">604800000</integer>
    <bool name="def_install_non_market_apps">true</bool>
</resources>

---------------------------------------------------------------------------------------------------------


http://codewalkerster.blogspot.com/2011/11/android-lockscreen.html

gingerbread에서는 Screen lock을 PhoneWindowManager.java를 직접 수정하여 없앨 수 있었습니다.

ICS 부터는 아래와 같이 Screen lock - None이란 항목이 있습니다.



그런데 첫 부팅 후 default가 None으로 설정하려고 합니다.

framework/base/core/java/com/android/internal/widget/LockPatternUtils.java

    public boolean isLockScreenDisabled() {
        return !isSecure() && getLong(DISABLE_LOCKSCREEN_KEY, 1) != 0;
        //return !isSecure() && getLong(DISABLE_LOCKSCREEN_KEY, 0) != 0;
    }


    public int getKeyguardStoredPasswordQuality() {
        int quality =
                (int) getLong(PASSWORD_TYPE_KEY, DevicePolicyManager.PASSWORD_QUALITY_UNSPECIFIED);
                //(int) getLong(PASSWORD_TYPE_KEY, DevicePolicyManager.PASSWORD_QUALITY_SOMETHING);
        // If the user has chosen to use weak biometric sensor, then return the backup locking
        // method and treat biometric as a special case.
        if (quality == DevicePolicyManager.PASSWORD_QUALITY_BIOMETRIC_WEAK) {
            quality =
                (int) getLong(PASSWORD_TYPE_ALTERNATE_KEY,
                        DevicePolicyManager.PASSWORD_QUALITY_SOMETHING);
        }    
        return quality;
    }