Add Local FeatureFlags client to system servier.

This allows system server code to call
FeatureFlagsService just as non-system server code does.

Bug: 279054964
Test: manually added and accessed flags in system server.
Change-Id: Iacbbdca4f7edd9c6f6e90a98af9004ebf4c93872
This commit is contained in:
Dave Mankoff
2023-05-15 19:00:04 +00:00
parent f593888d38
commit 7c3cae6b71
2 changed files with 6 additions and 2 deletions

View File

@@ -110,7 +110,8 @@ public class FeatureFlags {
try {
mIFeatureFlags.registerCallback(mIFeatureFlagsCallback);
} catch (RemoteException e) {
// Won't happen in tests.
// Shouldn't happen with things passed into tests.
Log.e(TAG, "Could not register callbacks!", e);
}
}
}

View File

@@ -16,6 +16,7 @@
package com.android.server.flags;
import android.content.Context;
import android.flags.FeatureFlags;
import android.util.Slog;
import com.android.server.SystemService;
@@ -52,8 +53,10 @@ public class FeatureFlagsService extends SystemService {
@Override
public void onStart() {
Slog.d(TAG, "Started Feature Flag Service");
FeatureFlagsBinder service = new FeatureFlagsBinder(mFlagStore, mShellCommand);
publishBinderService(
Context.FEATURE_FLAGS_SERVICE, new FeatureFlagsBinder(mFlagStore, mShellCommand));
Context.FEATURE_FLAGS_SERVICE, service);
publishLocalService(FeatureFlags.class, new FeatureFlags(service));
}
}