The Nexus 5 has a magnetic sensor to detect when the case cover is closed shut. I suspect this is being triggered by a speaker or some other magnetic element of the MacBook.
I've seen the opposite happen - the MacBook screen turning off - when placing an open macbook on top of a closed one. I'm guessing that case is to do with magnets activating the closed-sensor.<p>I've replicated this with a Nexus 6 by placing it over the speakers of an MBP (it locks the screen, rather than turning it off) which also suggests magnetic? I'm thinking Motorola planned a Nexus 6 case similar to the Galaxy Note flip cover.
<a href="http://knowyourmeme.com/memes/fucking-magnets-how-do-they-work" rel="nofollow">http://knowyourmeme.com/memes/fucking-magnets-how-do-they-wo...</a><p>This is just my own biased opinion, but if you're reading HN, shouldn't this one have been just about as obvious as it gets?!?!
I had a similar issue, except it was my MacBook going to sleep - when I used it on the Tokyo subway.<p><a href="http://west.io/post/2015/05/01-the-case-of-the-sleeping-macbook/" rel="nofollow">http://west.io/post/2015/05/01-the-case-of-the-sleeping-macb...</a>
Had the same problem with an Acer Chromebook and a Nexus 4, the Chromebook goes in sleep mode when the phone is placed over the keyboard in a particular position.