Looks like Post Install script doesn't update Feature Parameters values. I tried to use Without Sharing context and enqueueing a queueable job but nothing helps.
public inherited sharing class InstallHandler implements System.InstallHandler {
public void onInstall(InstallContext context) {
new SecurityTrampoline().collect();
}
public without sharing class SecurityTrampoline {
public void collect() {
FeatureManagement.setPackageIntegerValue('IntegerMetric', 404);
System.enqueueJob(new SaveIntegerMetrics());
}
}
public without sharing class SaveIntegerMetrics implements Queueable, Database.AllowsCallouts{
public void execute(System.QueueableContext c) {
FeatureManagement.setPackageIntegerValue('IntegerMetric', 213);
}
}
}
Also I have defined the Subscriber-to-LMO Integer Feature Parameter
<?xml version="1.0" encoding="UTF-8"?>
<FeatureParameterInteger xmlns="http://soap.sforce.com/2006/04/metadata">
<dataflowDirection>SubscriberToLmo</dataflowDirection>
<masterLabel>IntegerMetric</masterLabel>
<value>0</value>
</FeatureParameterInteger>