android 锁屏4.4动画,Android4.4 锁屏界面简单解析

Android4.4 锁屏界面简单解析

1、锁屏界面永远不出现

/frameworks/base/packages/Keyguard/src/com/android/keyguard/KeyguardViewMediator.java

将 private boolean mExternallyEnabled = true;

修改为:private boolean mExternallyEnabled = false;

@Override

void onPhoneStateChanged(int phoneState) {

synchronized (KeyguardViewMediator.this) {

if (TelephonyManager.CALL_STATE_IDLE == phoneState  // call ending

&& !mScreenOn                           // screen off

&& mExternallyEnabled) {                // not disabled by any app

// note: this is a way to gracefully reenable the keyguard when the call

// ends and the screen is off without always reenabling the keyguard

// each time the screen turns off while in call (and having an occasional ugly

// flicker while turning back on the screen and disabling the keyguard again).

if (DEBUG) Log.d(TAG, "screen is off and call ended, let's make sure the "

+ "keyguard is showing");

doKeyguardLocked(null);

}

}

};

2、取消自动关屏和休眠

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

-1

相对应的:

private void upgradeScreenTimeout(SQLiteDatabase db) {

// Change screen timeout to current default

db.beginTransaction();

SQLiteStatement stmt = null;

try {

stmt = db.compileStatement("INSERT OR REPLACE INTO system(name,value)"

+ " VALUES(?,?);");

loadIntegerSetting(stmt, Settings.System.SCREEN_OFF_TIMEOUT,

R.integer.def_screen_off_timeout);

db.setTransactionSuccessful();

} finally {

db.endTransaction();

if (stmt != null)

stmt.close();

}

}

private void loadSystemSettings(SQLiteDatabase db) {

SQLiteStatement stmt = null;

try {

stmt = db.compileStatement("INSERT OR IGNORE INTO system(name,value)"

+ " VALUES(?,?);");

loadBooleanSetting(stmt, Settings.System.DIM_SCREEN,

R.bool.def_dim_screen);

loadIntegerSetting(stmt, Settings.System.SCREEN_OFF_TIMEOUT,

R.integer.def_screen_off_timeout); //

// Set default cdma DTMF type

loadSetting(stmt, Settings.System.DTMF_TONE_TYPE_WHEN_DIALING, 0);

......

} finally {

if (stmt != null) stmt.close();

}

}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值