Here will call TitleBar.showPlayerIcon() then you check to see if the currentMode is MODE_PLAYER or not, I think it might be better to check like if (mode != MODE_PLAYER && PlayerView.dataSource.length > 0), then you don't have to check again in TitleBar.showPlayerIcon().