Change to ParaceledListSlice
This commit is contained in:
parent
183dccde17
commit
d27e012442
|
|
@ -27,7 +27,7 @@ public class LSPosedServiceClient {
|
|||
|
||||
List<PackageInfo> ps = null;
|
||||
try {
|
||||
ps = service.getInstalledPackagesFromAllUsers(0);
|
||||
ps = service.getInstalledPackagesFromAllUsers(0).getList();
|
||||
} catch (RemoteException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,10 +6,9 @@ import android.os.Looper;
|
|||
import android.os.RemoteException;
|
||||
import android.util.Log;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import de.robv.android.xposed.XposedBridge;
|
||||
import io.github.xposed.xposedservice.IXposedService;
|
||||
import io.github.xposed.xposedservice.utils.ParceledListSlice;
|
||||
|
||||
public class LSPosedService extends IXposedService.Stub {
|
||||
public static final String TAG = "LSPosedService";
|
||||
|
|
@ -55,7 +54,7 @@ public class LSPosedService extends IXposedService.Stub {
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<PackageInfo> getInstalledPackagesFromAllUsers(int flags) throws RemoteException {
|
||||
public ParceledListSlice<PackageInfo> getInstalledPackagesFromAllUsers(int flags) throws RemoteException {
|
||||
return PackageService.getInstalledPackagesFromAllUsers(flags);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,9 +9,9 @@ import android.os.ServiceManager;
|
|||
import android.util.Log;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import io.github.lsposed.lspd.nativebridge.ConfigManager;
|
||||
import io.github.xposed.xposedservice.utils.ParceledListSlice;
|
||||
|
||||
public class PackageService {
|
||||
private static IPackageManager pm = null;
|
||||
|
|
@ -46,17 +46,13 @@ public class PackageService {
|
|||
return res;
|
||||
}
|
||||
|
||||
public static List<PackageInfo> getInstalledPackagesFromAllUsers(int flags) throws RemoteException {
|
||||
if (!isInstaller(Binder.getCallingUid())) {
|
||||
throw new RemoteException("Permission denied");
|
||||
}
|
||||
public static ParceledListSlice<PackageInfo> getInstalledPackagesFromAllUsers(int flags) throws RemoteException {
|
||||
ArrayList<PackageInfo> res = new ArrayList<>();
|
||||
IPackageManager pm = getPackageManager();
|
||||
if (pm == null) return res;
|
||||
if (pm == null) return new ParceledListSlice<>(res);
|
||||
for (int uid : UserService.getUsers()) {
|
||||
Log.w("LSPosed", "uid: " + uid);
|
||||
res.addAll(pm.getInstalledPackages(flags, uid).getList());
|
||||
}
|
||||
return res;
|
||||
return new ParceledListSlice<>(res);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,10 +19,10 @@ public interface IPackageManager extends IInterface {
|
|||
String[] getPackagesForUid(int uid)
|
||||
throws RemoteException;
|
||||
|
||||
ParceledListSlice getInstalledPackages(int flags, int userId)
|
||||
ParceledListSlice<PackageInfo> getInstalledPackages(int flags, int userId)
|
||||
throws RemoteException;
|
||||
|
||||
ParceledListSlice getInstalledApplications(int flags, int userId)
|
||||
ParceledListSlice<ApplicationInfo> getInstalledApplications(int flags, int userId)
|
||||
throws RemoteException;
|
||||
|
||||
int getUidForSharedUser(String sharedUserName)
|
||||
|
|
|
|||
|
|
@ -1,94 +1,7 @@
|
|||
package android.content.res;
|
||||
|
||||
import android.graphics.drawable.Drawable;
|
||||
|
||||
public class TypedArray {
|
||||
// /** Only for API stubs creation, DO NOT USE! */
|
||||
// /*package*/ TypedArray() {
|
||||
// throw new UnsupportedOperationException("STUB");
|
||||
// }
|
||||
//
|
||||
protected TypedArray(Resources resources) {
|
||||
throw new UnsupportedOperationException("STUB");
|
||||
}
|
||||
//
|
||||
// protected TypedArray(Resources resources, int[] data, int[] indices, int len) {
|
||||
// throw new UnsupportedOperationException("STUB");
|
||||
// }
|
||||
//
|
||||
// public boolean getBoolean(int index, boolean defValue) {
|
||||
// throw new UnsupportedOperationException("STUB");
|
||||
// }
|
||||
//
|
||||
// public int getColor(int index, int defValue) {
|
||||
// throw new UnsupportedOperationException("STUB");
|
||||
// }
|
||||
//
|
||||
// public ColorStateList getColorStateList(int index) {
|
||||
// throw new UnsupportedOperationException("STUB");
|
||||
// }
|
||||
//
|
||||
// public float getDimension(int index, float defValue) {
|
||||
// throw new UnsupportedOperationException("STUB");
|
||||
// }
|
||||
//
|
||||
// public int getDimensionPixelOffset(int index, int defValue) {
|
||||
// throw new UnsupportedOperationException("STUB");
|
||||
// }
|
||||
//
|
||||
// public int getDimensionPixelSize(int index, int defValue) {
|
||||
// throw new UnsupportedOperationException("STUB");
|
||||
// }
|
||||
//
|
||||
// public Drawable getDrawable(int index) {
|
||||
// throw new UnsupportedOperationException("STUB");
|
||||
// }
|
||||
//
|
||||
// public float getFloat(int index, float defValue) {
|
||||
// throw new UnsupportedOperationException("STUB");
|
||||
// }
|
||||
//
|
||||
// public float getFraction(int index, int base, int pbase, float defValue) {
|
||||
// throw new UnsupportedOperationException("STUB");
|
||||
// }
|
||||
//
|
||||
// public int getInt(int index, int defValue) {
|
||||
// throw new UnsupportedOperationException("STUB");
|
||||
// }
|
||||
//
|
||||
// public int getInteger(int index, int defValue) {
|
||||
// throw new UnsupportedOperationException("STUB");
|
||||
// }
|
||||
//
|
||||
// public int getLayoutDimension(int index, int defValue) {
|
||||
// throw new UnsupportedOperationException("STUB");
|
||||
// }
|
||||
//
|
||||
// public int getLayoutDimension(int index, String name) {
|
||||
// throw new UnsupportedOperationException("STUB");
|
||||
// }
|
||||
//
|
||||
// public int getResourceId(int index, int defValue) {
|
||||
// throw new UnsupportedOperationException("STUB");
|
||||
// }
|
||||
//
|
||||
// public Resources getResources() {
|
||||
// throw new UnsupportedOperationException("STUB");
|
||||
// }
|
||||
//
|
||||
// public String getString(int index) {
|
||||
// throw new UnsupportedOperationException("STUB");
|
||||
// }
|
||||
//
|
||||
// public CharSequence getText(int index) {
|
||||
// throw new UnsupportedOperationException("STUB");
|
||||
// }
|
||||
//
|
||||
// public CharSequence[] getTextArray(int index) {
|
||||
// throw new UnsupportedOperationException("STUB");
|
||||
// }
|
||||
//
|
||||
// public void recycle() {
|
||||
// throw new UnsupportedOperationException("STUB");
|
||||
// }
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue