Merge "Fix initialization order" into main
diff --git a/src/com/android/car/rotary/RotaryService.java b/src/com/android/car/rotary/RotaryService.java
index c85e893..76b610e 100644
--- a/src/com/android/car/rotary/RotaryService.java
+++ b/src/com/android/car/rotary/RotaryService.java
@@ -592,6 +592,13 @@
     public void onCreate() {
         L.v("onCreate");
         super.onCreate();
+        if (getBaseContext() != null) {
+            mContentResolver = getContentResolver();
+        }
+        if (mContentResolver == null) {
+            L.w("ContentResolver not available");
+        }
+
         Resources res = getResources();
         mRotationAcceleration3xMs = res.getInteger(R.integer.rotation_acceleration_3x_ms);
         mRotationAcceleration2xMs = res.getInteger(R.integer.rotation_acceleration_2x_ms);
@@ -678,13 +685,6 @@
         filter.addAction(Intent.ACTION_PACKAGE_REMOVED);
         filter.addDataScheme("package");
         registerReceiver(mAppInstallUninstallReceiver, filter);
-
-        if (getBaseContext() != null) {
-            mContentResolver = getContentResolver();
-        }
-        if (mContentResolver == null) {
-            L.w("ContentResolver not available");
-        }
     }
 
     /**