更换包名
This commit is contained in:
66
app/src/main/java/com/fuying/sn/service/RemoteService.java
Normal file
66
app/src/main/java/com/fuying/sn/service/RemoteService.java
Normal file
@@ -0,0 +1,66 @@
|
||||
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.config.CommonConfig;
|
||||
import com.fuying.sn.desktop.RunningAppManager;
|
||||
|
||||
public class RemoteService extends Service {
|
||||
private String TAG = RemoteService.class.getSimpleName();
|
||||
|
||||
public RemoteService() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBinder onBind(Intent intent) {
|
||||
Log.e(TAG, "onBind: ");
|
||||
return mBinde;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
Log.e(TAG, "onCreate: ");
|
||||
super.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 {
|
||||
return RunningAppManager.getInstance().inControlTime(pkg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDisableContent(String pkg) throws RemoteException {
|
||||
String content = RunningAppManager.getInstance().getDisableContent(pkg);
|
||||
if (BuildConfig.DEBUG) {
|
||||
Log.e(TAG, "getDisableContent: " + content);
|
||||
}
|
||||
return content;
|
||||
}
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user