Merge "Fixing crash when using multi-window" into udc-qpr-dev
This commit is contained in:
@@ -16,12 +16,12 @@
|
||||
|
||||
package com.android.quickstep;
|
||||
|
||||
import android.app.ActivityThread;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.pm.ApplicationInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.os.RemoteException;
|
||||
import android.os.Process;
|
||||
import android.os.UserHandle;
|
||||
import android.util.Log;
|
||||
|
||||
import com.android.launcher3.model.data.AppInfo;
|
||||
@@ -55,9 +55,13 @@ public class InstantAppResolverImpl extends InstantAppResolver {
|
||||
|
||||
@Override
|
||||
public boolean isInstantApp(String packageName, int userId) {
|
||||
if (!Process.myUserHandle().equals(UserHandle.of(userId))) {
|
||||
// Instant app can only exist on current user
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
return ActivityThread.getPackageManager().isInstantApp(packageName, userId);
|
||||
} catch (RemoteException e) {
|
||||
return mPM.isInstantApp(packageName);
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "Failed to determine whether package is instant app " + packageName, e);
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user