Update ArtManagerLocal constructor to take the context.

ART Services needs the context for:

1. Getting PowerManager and AppHibernationManager
2. Getting resource strings such as R.string.config_systemUi

Bug: 236954191
Test: adb shell pm art optimize-package -m speed-profile -f \
  com.google.android.youtube
Ignore-AOSP-First: ART Services
Change-Id: I47d79e251fa5a1e327c6db8fd08f2a0e76a1e492
diff --git a/libartservice/service/java/com/android/server/art/DexOptHelper.java b/libartservice/service/java/com/android/server/art/DexOptHelper.java
index 64060ca..f6df0c3 100644
--- a/libartservice/service/java/com/android/server/art/DexOptHelper.java
+++ b/libartservice/service/java/com/android/server/art/DexOptHelper.java
@@ -56,7 +56,7 @@
 
     @NonNull private final Injector mInjector;
 
-    public DexOptHelper(@Nullable Context context) {
+    public DexOptHelper(@NonNull Context context) {
         this(new Injector(context));
     }
 
@@ -147,10 +147,9 @@
      */
     @VisibleForTesting
     public static class Injector {
-        // TODO(b/236954191): Make this @NonNull.
-        @Nullable private final Context mContext;
+        @NonNull private final Context mContext;
 
-        Injector(@Nullable Context context) {
+        Injector(@NonNull Context context) {
             mContext = context;
         }
 
@@ -159,14 +158,16 @@
             return new PrimaryDexOptimizer(mContext);
         }
 
+        // TODO(b/244289352): Investigate whether this can be @NonNull.
         @Nullable
         public AppHibernationManager getAppHibernationManager() {
-            return mContext != null ? mContext.getSystemService(AppHibernationManager.class) : null;
+            return mContext.getSystemService(AppHibernationManager.class);
         }
 
+        // TODO(b/244289352): Investigate whether this can be @NonNull.
         @Nullable
         public PowerManager getPowerManager() {
-            return mContext != null ? mContext.getSystemService(PowerManager.class) : null;
+            return mContext.getSystemService(PowerManager.class);
         }
     }
 }