Search in sources :

Example 21 with VPackage

use of com.lody.virtual.server.pm.parser.VPackage in project VirtualApp by asLody.

the class VPackageManagerService method createNewUser.

void createNewUser(int userId, File userPath) {
    for (VPackage p : mPackages.values()) {
        PackageSetting setting = (PackageSetting) p.mExtras;
        setting.modifyUserState(userId);
    }
}
Also used : VPackage(com.lody.virtual.server.pm.parser.VPackage)

Example 22 with VPackage

use of com.lody.virtual.server.pm.parser.VPackage in project VirtualApp by asLody.

the class VPackageManagerService method getActivityInfo.

@Override
public ActivityInfo getActivityInfo(ComponentName component, int flags, int userId) {
    checkUserId(userId);
    flags = updateFlagsNought(flags);
    synchronized (mPackages) {
        VPackage p = mPackages.get(component.getPackageName());
        if (p != null) {
            PackageSetting ps = (PackageSetting) p.mExtras;
            VPackage.ActivityComponent a = mActivities.mActivities.get(component);
            if (a != null) {
                ActivityInfo activityInfo = PackageParserEx.generateActivityInfo(a, flags, ps.readUserState(userId), userId);
                ComponentFixer.fixComponentInfo(ps, activityInfo, userId);
                return activityInfo;
            }
        }
    }
    return null;
}
Also used : ActivityInfo(android.content.pm.ActivityInfo) VPackage(com.lody.virtual.server.pm.parser.VPackage)

Example 23 with VPackage

use of com.lody.virtual.server.pm.parser.VPackage in project VirtualApp by asLody.

the class VPackageManagerService method resolveContentProvider.

@Override
public ProviderInfo resolveContentProvider(String name, int flags, int userId) {
    checkUserId(userId);
    flags = updateFlagsNought(flags);
    synchronized (mPackages) {
        final VPackage.ProviderComponent provider = mProvidersByAuthority.get(name);
        if (provider != null) {
            PackageSetting ps = (PackageSetting) provider.owner.mExtras;
            ProviderInfo providerInfo = PackageParserEx.generateProviderInfo(provider, flags, ps.readUserState(userId), userId);
            VPackage p = mPackages.get(providerInfo.packageName);
            PackageSetting settings = (PackageSetting) p.mExtras;
            ComponentFixer.fixComponentInfo(settings, providerInfo, userId);
            return providerInfo;
        }
    }
    return null;
}
Also used : VPackage(com.lody.virtual.server.pm.parser.VPackage) ProviderInfo(android.content.pm.ProviderInfo)

Aggregations

VPackage (com.lody.virtual.server.pm.parser.VPackage)23 ArrayList (java.util.ArrayList)10 ActivityInfo (android.content.pm.ActivityInfo)5 ComponentName (android.content.ComponentName)4 ResolveInfo (android.content.pm.ResolveInfo)4 ProviderInfo (android.content.pm.ProviderInfo)3 ServiceInfo (android.content.pm.ServiceInfo)2 InstalledAppInfo (com.lody.virtual.remote.InstalledAppInfo)2 VParceledListSlice (com.lody.virtual.remote.VParceledListSlice)2 File (java.io.File)2 TargetApi (android.annotation.TargetApi)1 BroadcastReceiver (android.content.BroadcastReceiver)1 IntentFilter (android.content.IntentFilter)1 ApplicationInfo (android.content.pm.ApplicationInfo)1 PackageInfo (android.content.pm.PackageInfo)1 InstallResult (com.lody.virtual.remote.InstallResult)1 PackageSetting (com.lody.virtual.server.pm.PackageSetting)1 IOException (java.io.IOException)1