mirror of
https://github.com/vectras-team/termux-x11.git
synced 2025-02-26 01:25:33 +00:00
Fix for starting intent on Android Q
This commit is contained in:
parent
a2970f6957
commit
8d7d7c5a09
@ -22,9 +22,12 @@ public class Compat {
|
||||
static final String callingPackage = "com.termux";
|
||||
static int startActivity(Intent i) {
|
||||
try {
|
||||
if (Build.VERSION.SDK_INT >= 29) {
|
||||
if (Build.VERSION.SDK_INT >= 30) {
|
||||
IActivityTaskManager taskManager = ActivityTaskManager.getService();
|
||||
return taskManager.startActivity(null, callingPackage, null, i, null, null, null, -1, 0, null, null);
|
||||
} else if (Build.VERSION.SDK_INT == 29) {
|
||||
IActivityTaskManager taskManager = ActivityTaskManager.getService();
|
||||
return taskManager.startActivity(null, callingPackage, i, null, null, null, -1, 0, null, null);
|
||||
} else {
|
||||
IActivityManager activityManager;
|
||||
IBinder binder = ServiceManager.getService("activity");
|
||||
|
@ -8,7 +8,11 @@ import android.os.RemoteException;
|
||||
|
||||
public interface IActivityTaskManager extends IInterface {
|
||||
int startActivity(IApplicationThread caller, String callingPackage, String callingFeatureId,
|
||||
Intent intent, String resolvedType, IBinder resultTo, String resultWho, int requestCode,
|
||||
int startFlags, ProfilerInfo profilerInfo, Bundle bOptions)
|
||||
Intent intent, String resolvedType, IBinder resultTo, String resultWho,
|
||||
int requestCode, int startFlags, ProfilerInfo profilerInfo, Bundle bOptions)
|
||||
throws RemoteException;
|
||||
int startActivity(IApplicationThread caller, String callingPackage, Intent intent,
|
||||
String resolvedType, IBinder resultTo, String resultWho, int requestCode,
|
||||
int flags, ProfilerInfo profilerInfo, Bundle options)
|
||||
throws RemoteException;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user