ConnectivityService is going to be a mainline module, it can only use formal APIs or @SystemApi. So use public API - Context#getSystemService() instead of hidden API - ServiceManager#checkService(). Bug: 170598012 Test: atest FrameworksNetTests Change-Id: I9824caa7aec57e70f0ba405fcce39f9bc068732d