Skip to content

Commit

Permalink
Merge branch 'master' of github.com:Tornaco/Thanox
Browse files Browse the repository at this point in the history
  • Loading branch information
Tornaco committed Sep 25, 2023
2 parents 32f7233 + 47dd34a commit a2c138e
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 13 deletions.
2 changes: 1 addition & 1 deletion android/android_framework/hidden-api/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ java {
}

dependencies {
api(files("${rootProject.rootDir.path}/android_sdk/30/android-30.jar"))
api(files("${rootProject.rootDir.path}/android_sdk/33/android-33.jar"))
}
Original file line number Diff line number Diff line change
Expand Up @@ -96,19 +96,24 @@ public void runSafety() {
private void waitForSystemReady(Runnable runnable) {
XLog.w("waitForSystemReady, current thread: %s", Thread.currentThread());
new Thread(() -> {
ServiceManager.waitForService("package");
ServiceManager.waitForService("activity");
ServiceManager.waitForService(Context.USER_SERVICE);
ServiceManager.waitForService(Context.APP_OPS_SERVICE);
while (!ActivityThread.isSystem() || !isSystemReady()) {
try {
XLog.d("waitForSystemReady, wait a moment.");
Thread.sleep(100);
} catch (InterruptedException e) {
// Noop.
try {
ServiceManager.waitForService("package");
ServiceManager.waitForService("activity");
ServiceManager.waitForService(Context.USER_SERVICE);
ServiceManager.waitForService(Context.APP_OPS_SERVICE);
while (!ActivityThread.isSystem() || !isSystemReady()) {
try {
XLog.d("waitForSystemReady, wait a moment.");
Thread.sleep(100);
} catch (InterruptedException e) {
// Noop.
}
}
XLog.i("Call runnable");
runnable.run();
} catch (Throwable e) {
XLog.e(e, "waitForSystemReady");
}
runnable.run();
}).start();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ public ContextProxy(Context base, String tag) {
this.tag = tag;
}

@Override
public int getAssociatedDisplayId() {
return getBaseContext().getAssociatedDisplayId();
}

@Override
public void enforceCallingPermission(String permission, String message) {
XLog.i("SystemServiceContextHooks enforceCallingPermission@%s %s %s", tag, permission, message);
Expand Down Expand Up @@ -53,4 +58,6 @@ public boolean bindServiceAsUser(Intent service, ServiceConnection conn, int fla
return false;
}
}


}
Binary file added android/android_sdk/33/android-33.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion android/internal/Thanox-Internal

0 comments on commit a2c138e

Please sign in to comment.