Having been inside Google (and multiple other FAANGs) this is generally untrue, and focusing on this element of the problem misses a much larger productivity problem:
Most engineers at Google aren't "sitting around doing nothing", they are very busy shipping projects that do not matter. Their days are filled with doing work that will not move the needle on any metric that matters to the company, but they are far from idle.
The misallocation of labor is a far bigger problem than said labor slacking off, and management must own it.
Google doesn't need their engineers to fly into startup mode, work 12 hour days, or never surf Reddit on company time. Their labor is severely under-utilized because they are assigned to zero/negative-impact projects or duplicative projects (hey, somehow you gotta ship 5 chat apps at the same time, right?)
Part of the problem is that Google's upper management refuses to engage with the product at all. Entire orgs are given very broad OKRs like "increase DAUs by 10%" without virtually no guidance as to what features management is interested in. Authority to ship features also rests close to the leaf nodes of direct line-managed teams. The expectation is that teams are entrepreneurial and invent features, implement them, and ship them all without direct upper management involvement.
The result is a bunch of bad product that doesn't do anything positive for the company, were never soberly evaluated by upper management prior to building, and would never have passed the smell test if it did. This, above all other factors, is why Google produces so much product that it then has to scrap. This is the main cause of Google's low labor productivity - not because people are sitting around drinking coffee and eating free food - but because they are assigned to projects that do not pass muster, and there is an almost-comical aversion to validating product ideas before they are implemented.
The single biggest thing Google can do to improve its labor productivity isn't cracking down on slackers, it's forcing its management to actually engage with product definition so entire orgs don't burn years on things that don't matter.