Skip to content

Commit

Permalink
make configurations read at PushServiceMain.onCreate, fix must open M…
Browse files Browse the repository at this point in the history
…iPushFrameworkApp to read the configurations bug
  • Loading branch information
NihilityT committed Sep 26, 2022
1 parent 62be768 commit 90f0aab
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import android.content.Context;
import android.content.Intent;
import android.content.res.Configuration;
import android.widget.Toast;

import androidx.annotation.RequiresApi;
import androidx.core.app.NotificationChannelCompat;
Expand All @@ -27,6 +28,8 @@
import com.xiaomi.xmpush.thrift.PushMetaInfo;
import com.xiaomi.xmsf.R;
import com.xiaomi.xmsf.push.control.XMOutbound;
import com.xiaomi.xmsf.push.utils.Configurations;
import com.xiaomi.xmsf.utils.ConfigCenter;

import org.apache.thrift.TBase;

Expand Down Expand Up @@ -88,6 +91,10 @@ public class PushServiceMain extends XMPushService {

@Override
public void onCreate() {
boolean success = Configurations.getInstance().init(this,
ConfigCenter.getInstance().getConfigurationDirectory(this));
Toast.makeText(this, "configurations loaded: " + success, Toast.LENGTH_SHORT).show();

super.onCreate();
logger.d("Service started");

Expand Down

0 comments on commit 90f0aab

Please sign in to comment.