[core] Fix on Android Q- (#585)
This commit is contained in:
parent
5032bc0b15
commit
c8f2dffbca
|
|
@ -32,7 +32,6 @@ public class LSPApplicationServiceClient implements ILSPApplicationService {
|
||||||
static ILSPApplicationService service = null;
|
static ILSPApplicationService service = null;
|
||||||
static IBinder serviceBinder = null;
|
static IBinder serviceBinder = null;
|
||||||
|
|
||||||
static String baseCachePath = null;
|
|
||||||
static String processName = null;
|
static String processName = null;
|
||||||
|
|
||||||
public static LSPApplicationServiceClient serviceClient = null;
|
public static LSPApplicationServiceClient serviceClient = null;
|
||||||
|
|
|
||||||
|
|
@ -21,24 +21,23 @@ public class LSPSystemServerService extends ILSPSystemServerService.Stub impleme
|
||||||
binderDied();
|
binderDied();
|
||||||
}
|
}
|
||||||
|
|
||||||
private final IServiceCallback serviceCallback = new IServiceCallback.Stub() {
|
|
||||||
@Override
|
|
||||||
public void onRegistration(String name, IBinder binder) {
|
|
||||||
if (name.equals(PROXY_SERVICE_NAME) && binder != null && binder != LSPSystemServerService.this) {
|
|
||||||
Log.d(TAG, "Register " + name + " " + binder);
|
|
||||||
originService = binder;
|
|
||||||
LSPSystemServerService.this.linkToDeath();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public IBinder asBinder() {
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
public LSPSystemServerService() {
|
public LSPSystemServerService() {
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
|
||||||
|
var serviceCallback = new IServiceCallback.Stub() {
|
||||||
|
@Override
|
||||||
|
public void onRegistration(String name, IBinder binder) {
|
||||||
|
if (name.equals(PROXY_SERVICE_NAME) && binder != null && binder != LSPSystemServerService.this) {
|
||||||
|
Log.d(TAG, "Register " + name + " " + binder);
|
||||||
|
originService = binder;
|
||||||
|
LSPSystemServerService.this.linkToDeath();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IBinder asBinder() {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
};
|
||||||
try {
|
try {
|
||||||
getSystemServiceManager().registerForNotifications(PROXY_SERVICE_NAME, serviceCallback);
|
getSystemServiceManager().registerForNotifications(PROXY_SERVICE_NAME, serviceCallback);
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue