refactor(package): service/receiver/push/sync 收敛到 runtime
- 常驻服务、广播接收器、推送与同步编排统一放 runtime 层 - 同步 AndroidManifest 组件名与 JgyUtils 中的组件全类名常量
This commit is contained in:
1 parent
0d87e1be23
commit
e24d8c3c13
36 files changed
+123
-123
No files matched your search
@@ -1,76 +0,0 @@
|
||||
package com.fuying.sn.service;
|
||||
|
||||
import android.app.Service;
|
||||
import android.content.Intent;
|
||||
import android.os.IBinder;
|
||||
import android.os.RemoteException;
|
||||
import android.provider.Settings;
|
||||
import android.util.Log;
|
||||
|
||||
import com.fuying.sn.BuildConfig;
|
||||
import com.fuying.sn.IGetInfoInterface;
|
||||
import com.fuying.sn.core.common.config.CommonConfig;
|
||||
import com.fuying.sn.platform.app.RunningAppManager;
|
||||
|
||||
public class RemoteService extends Service {
|
||||
private static final String TAG = "RemoteService";
|
||||
|
||||
public RemoteService() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBinder onBind(Intent intent) {
|
||||
Log.e(TAG, "onBind: ");
|
||||
return mBinde;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
Log.e(TAG, "onCreate: ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int onStartCommand(Intent intent, int flags, int startId) {
|
||||
Log.e(TAG, "onStartCommand: ");
|
||||
return super.onStartCommand(intent, flags, startId);
|
||||
}
|
||||
|
||||
private IBinder mBinde = new IGetInfoInterface.Stub() {
|
||||
@Override
|
||||
public void basicTypes(int anInt, long aLong, boolean aBoolean, float aFloat, double aDouble, String aString) throws RemoteException {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isControl() throws RemoteException {
|
||||
int is_control = Settings.System.getInt(getContentResolver(), CommonConfig.KEY_IS_CONTROL, 1);
|
||||
Log.e(TAG, "inControlTime: is_control = " + is_control);
|
||||
return is_control == 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean inControl(String pkg) throws RemoteException {
|
||||
if (BuildConfig.VERSION_CODE < 88) {
|
||||
boolean control = RunningAppManager.getInstance().inControlTime(pkg);
|
||||
Log.e(TAG, "inControl: " + control);
|
||||
return control;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDisableContent(String pkg) throws RemoteException {
|
||||
if (BuildConfig.VERSION_CODE < 88) {
|
||||
String content = RunningAppManager.getInstance().getDisableContent(pkg);
|
||||
if (BuildConfig.DEBUG) {
|
||||
Log.e(TAG, "getDisableContent: " + content);
|
||||
}
|
||||
return content;
|
||||
} else {
|
||||
return "新版本测试";
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user