An alternative to this would be using dynamic hook registration as outlined in T272032#6834213 but dynamic hook registration in production code is extremely frowned upon specially given the fact that it makes the code much more unpredictable. Bug: T297016 Bug: T284538 Change-Id: Ib1eb09c2040c6263c40b526fe0af3878b3866241