如何解决闹钟界面会先出现解锁界面?[DESCRIPTION]进入“Clock”,点闹钟图标,会先出现解锁界面,解锁后才出现闹钟定义界面。如何去除这个解锁界面,进入”clock”时,直接进入闹钟显示[SOLUTION]ic_clock_strip_alARMres/Layout/desk_clock_buttons.xml:android:src=”@drawable/ic_clock_strip_alarm”src/com/android/deskclock/DeskClock.java: final ImageButton alarmButton =
(ImageButton) findViewById(R.id.alarm_button);
final ImageButton alarmButton = (ImageButton)
findViewById(R.id.alarm_button);
alarmButton.setOnCLIckListener(alarmClickListener);
startActivity(new Intent(DeskClock.this, AlarmClock.class));
ATTACHED TO WINDOW
D/LockScreen( 86): updateLayout: status=SiMMIssing
Settings.Secure.DEVICE_PROVISIONED
//jeff
loadIntegerSetting(stmt, Settings.Secure.DEVICE_PROVISIONED,
R.integer.def_device_provisioned);
mKeyguardView.requestFocus();
public synchronized void verifyUnlock() {
private void handleShow() {
private void showLocked() {
public void setKeyguardEnabled(boolean enabled) {
private void doKeyguard() {
public void onScreenTurnedOff(int why) {
DELAYED_KEYGUARD_ACTION
TelephonyManager.ACTION_PHONE_STATE_CHANGED
src/com/android/deskclock/DeskClock.java
php?mod=tag&id=6090″ target=”_blank” class=”relatedlink”>Frameworks/base/policy/src/com/android/internal/policy/impl/LockScreen.java
frameworks/base/policy/src/com/android/internal/policy/impl/LockPatternKeyguardView.jav
a
frameworks/base/policy/src/com/android/internal/policy/impl/KeyguardViewMediator.java
frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
private void updateLockScreenTimeout() {
Log.d(TAG, “[jeff]updateLockScreenTimeout() enable:”+enable);
Log.d(TAG, “[jeff]updateLockScreenTimeout()
mAllowLockscreenWhenOn:”+mAllowLockscreenWhenOn+”,mScreenOn:”+mScreenOn+”,mKeyguardMe
diator.isSecure():”+mKeyguardMediator.isSecure());
D/WindowManager( 86): [jeff]updateLockScreenTimeout() enable:false
D/WindowManager( 86): [jeff]updateLockScreenTimeout()
mAllowLockscreenWhenOn:false,mScreenOn:true,mKeyguardMediator.isSecure():true
D/WindowManager( 86): [jeff]updateLockScreenTimeout() enable:true
D/WindowManager( 86): [jeff]updateLockScreenTimeout()
mAllowLockscreenWhenOn:true,mScreenOn:true,mKeyguardMediator.isSecure():true
可以看出是由于mAllowLockscreenWhenOn变化导致,而赋值在:
public void animatingWindowLw(WindowState win,
WindowManager.LayoutParams attrs) {
if ((attrs.flags & FLAG_ALLOW_LOCK_WHILE_SCREEN_ON) != 0) {
mAllowLockscreenWhenOn = true;
}
}
所以在packages/apps/目录下搜索,确实deskclock中有加入这个属性
FLAG_ALLOW_LOCK_WHILE_SCREEN_ON
jeff@translogic:~/android/iputer-2.3.7/jeff-2.3.7_r1$ grep
“FLAG_ALLOW_LOCK_WHILE_SCREEN_ON” packages/apps/ -r –include=*.java
packages/apps/DeskClock/src/com/android/deskclock/AlarmAlertFullScreen.java: |
WindowManager.LayoutParams.FLAG_ALLOW_LOCK_WHILE_SCREEN_ON);
packages/apps/DeskClock/src/com/android/deskclock/DeskClock.java: |
WindowManager.LayoutParams.FLAG_ALLOW_LOCK_WHILE_SCREEN_ON
packages/apps/CellBroADCastReceiver/src/com/android/cellbroadcastreceiver/CellBroadcast
AlertDialog.java: | WindowManager.LayoutParams.FLAG_ALLOW_LOCK_WHILE_SCREEN_ON);
将这3个都屏蔽。 问题解决。
来源:一牛网论坛