if(code==KeyEvent.KEYCODE_HOME){// If a system window has focus, then it doesn't make sense // right now to interact with applications. WindowManager.LayoutParamsattrs=win!=null?win.getAttrs():null;if(attrs!=null){finalinttype=attrs.type;if(type==WindowManager.LayoutParams.TYPE_KEYGUARD||type==WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG){// the "app" is keyguard, so give it the key returnfalse;}finalinttypeCount=WINDOW_TYPES_WHERE_HOME_DOESNT_WORK.length;for(inti=0;i<typeCount;i++){if(type==WINDOW_TYPES_WHERE_HOME_DOESNT_WORK[i]){// don't do anything, but also don't pass it to the app returntrue;}}}}