mProvider is null before register is called. But toString call mProvider.getProviderId() without null check and caused NullPointerException. This commit add null check and fix this issue. Bug: 228796405 Test: m Change-Id: Ic8e23b21d11705219f1a8fddd544941fbddb183e