Boris Johnson is in trouble with the police. It won't be the first time, of course: during his student days the London mayor famously spent a night in a cell after the Oxford cops called halt on a night of Bullingdon Club antisocial behaviour. This time he might not get out of jail so easily.

According to a statement Johnson released on Thursday night, the revelation that former News of the World deputy editor Neil Wallis – arrested this week in connection with phone-hacking – had been lucratively employed by the Metropolitan police as a media adviser, prompted a "a very frank discussion" with Met commissioner Paul Stephenson, who was one of the senior officers in receipt of Wallis's expertise.

Another was John Yates, the assistant commissioner who has apologised for declining to order a fresh investigation into the activities of the News of the World two years ago. Wallis's spell with the Met began three months after Yates's bad decision, but Stephenson failed to disclose that Wallis had worked for him to either David Cameron, the Commons culture select committee or the Metropolitan police authority in recent meetings about the hacking scandal.

That doesn't look too clever, but for now the mayor is standing by his chief policeman. Along with his policing deputy, the Metropolitan Police Authority chair Kit Malthouse, he's standing by Yates too, rejecting a call for his resignation from a Tory London assembly member during mayor's question time on Wednesday. In this, Johnson is starting to resemble his predecessor Ken Livingstone in ways that don't bode well.

Livingstone doggedly supported Stephenson's predecessor Ian Blair when he was being accused of racism, cover-up, incompetence, "political correctness" and just about everything except sheep-worrying – not least by Malthouse, writing in the Times. Blair was also under fire over a Met contract awarded to a friend. He was later cleared of any wrongdoing, but not before Livingstone was removed from City Hall and Johnson and Malthouse had then in effect forced him to resign.

Part of their case for leaving Blair with nowhere to go but the sweet umbrage of his memoirs was that he'd become distracted by all the controversies and metamorphosed into a corrosive bad news story in the process. They had a point. But Johnson's position is beginning to echo Livingstone's because Stephenson's is starting to echo Blair's. And in some ways, Johnson's predicament is trickier. Stephenson was his and Malthouse's preferred successor to Blair, partly on the grounds that he was uncomplicated, crime-busting cop with no commentariat pretensions, and inclined to give the media a wide berth. He looks a little less uncomplicated now.

Then there is the delicate matter of Johnson's own attitude to the hacking saga. His dismissal of it last September as "codswallop" confected by the Guardian and the Labour party was made in the midst of political badinage and maybe in good faith, but it makes him look a little flippant now. Political opponents are probing for something more damning. Johnson, of course, is himself a News of the World voicemail victim. Had he offered to help plod nail the intruder when he was told of this in 2006? If not, why not? "Were you compromised by the information that News International may have had on you?" asked assembly Labour group leader Len Duvall on Wednesday.

Johnson said he'd told the police that he'd assist in any prosecution if essential, but he was candid about being reluctant. "I had no particular desire to get involved in a court case that revolved around some extremely unpleasant interference in my private life … Why should I, when the police were absolutely clear to me that they had abundant evidence that would have secured a prosecution?"

That may not be a smoking gun, but it reveals a second motive for him having had a hands-off approach to the hacking affair since becoming mayor in 2008. The first is his continuing and very obvious political interest in keeping on News International's right side as he seeks re-election next year. Only last month he joined Sebastian Coe in making a presentation to the News International board about the London Olympics. Four days later the Sun published an article by him attacking Ken Clarke's proposals for so-called "soft justice".

A London mayor's relationship with the Met is constitutionally imprecise, but if he wants something done he's in a good position to demand it. Until the last week forced his hand, Johnson has done the opposite over phone hacking. If Yates or even Stephenson end up walking the plank, it is likely to be the home secretary who shoves them out over the waves – but for Johnson the awkward questions would continue.

His carefully evasive soundbites about crime rates and staffing levels become toothless under scrutiny. London's popular community policing teams are to be shorn of 150 of the sergeants who lead them, with a similar number likely to follow. The emotive issue of knife crimes against young people is gathering profile again as Met figures show that these, in all their forms, have been on the rise throughout Johnson's three years in power.