[core] Fix on Android Q- (#585)

This commit is contained in:
LoveSy 2021-05-15 12:39:28 +08:00 committed by GitHub
parent 5032bc0b15
commit c8f2dffbca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 17 deletions

View File

@ -32,7 +32,6 @@ public class LSPApplicationServiceClient implements ILSPApplicationService {
static ILSPApplicationService service = null;
static IBinder serviceBinder = null;
static String baseCachePath = null;
static String processName = null;
public static LSPApplicationServiceClient serviceClient = null;

View File

@ -21,24 +21,23 @@ public class LSPSystemServerService extends ILSPSystemServerService.Stub impleme
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() {
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 {
getSystemServiceManager().registerForNotifications(PROXY_SERVICE_NAME, serviceCallback);
} catch (Throwable e) {