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:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user