android.content.pm.SharedLibraryInfo源码实例Demo

类android.content.pm.SharedLibraryInfo源码实例Demo

下面列出了android.content.pm.SharedLibraryInfo 类实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

/** @hide */
@Override
@SuppressWarnings("unchecked")
public @NonNull List<SharedLibraryInfo> getSharedLibrariesAsUser(int flags, int userId) {
    try {
        ParceledListSlice<SharedLibraryInfo> sharedLibs = mPM.getSharedLibraries(
                mContext.getOpPackageName(), flags, userId);
        if (sharedLibs == null) {
            return Collections.emptyList();
        }
        return sharedLibs.getList();
    } catch (RemoteException e) {
        throw e.rethrowFromSystemServer();
    }
}
 
/** @hide */
@Override
@SuppressWarnings("unchecked")
public @NonNull List<SharedLibraryInfo> getSharedLibrariesAsUser(int flags, int userId) {
    try {
        ParceledListSlice<SharedLibraryInfo> sharedLibs = mPM.getSharedLibraries(
                mContext.getOpPackageName(), flags, userId);
        if (sharedLibs == null) {
            return Collections.emptyList();
        }
        return sharedLibs.getList();
    } catch (RemoteException e) {
        throw e.rethrowFromSystemServer();
    }
}
 
/** @hide */
@Override
@SuppressWarnings("unchecked")
public @NonNull List<SharedLibraryInfo> getSharedLibrariesAsUser(int flags, int userId) {
    try {
        ParceledListSlice<SharedLibraryInfo> sharedLibs = mPM.getSharedLibraries(
                mContext.getOpPackageName(), flags, userId);
        if (sharedLibs == null) {
            return Collections.emptyList();
        }
        return sharedLibs.getList();
    } catch (RemoteException e) {
        throw e.rethrowFromSystemServer();
    }
}
 
/** @hide */
@Override
@SuppressWarnings("unchecked")
public @NonNull List<SharedLibraryInfo> getSharedLibrariesAsUser(int flags, int userId) {
    try {
        ParceledListSlice<SharedLibraryInfo> sharedLibs = mPM.getSharedLibraries(
                mContext.getOpPackageName(), flags, userId);
        if (sharedLibs == null) {
            return Collections.emptyList();
        }
        return sharedLibs.getList();
    } catch (RemoteException e) {
        throw e.rethrowFromSystemServer();
    }
}
 
/** @hide */
@Override
@SuppressWarnings("unchecked")
public @NonNull List<SharedLibraryInfo> getSharedLibrariesAsUser(int flags, int userId) {
    try {
        ParceledListSlice<SharedLibraryInfo> sharedLibs = mPM.getSharedLibraries(
                mContext.getOpPackageName(), flags, userId);
        if (sharedLibs == null) {
            return Collections.emptyList();
        }
        return sharedLibs.getList();
    } catch (RemoteException e) {
        throw e.rethrowFromSystemServer();
    }
}
 
@NonNull
@Override
public List<SharedLibraryInfo> getDeclaredSharedLibraries(@NonNull String packageName,
        @InstallFlags int flags) {
    try {
        ParceledListSlice<SharedLibraryInfo> sharedLibraries = mPM.getDeclaredSharedLibraries(
                packageName, flags, mContext.getUserId());
        return sharedLibraries != null ? sharedLibraries.getList() : Collections.emptyList();
    } catch (RemoteException e) {
        throw e.rethrowFromSystemServer();
    }
}
 
/** @hide */
@Override
@SuppressWarnings("unchecked")
public @NonNull List<SharedLibraryInfo> getSharedLibrariesAsUser(int flags, int userId) {
    try {
        ParceledListSlice<SharedLibraryInfo> sharedLibs = mPM.getSharedLibraries(
                mContext.getOpPackageName(), flags, userId);
        if (sharedLibs == null) {
            return Collections.emptyList();
        }
        return sharedLibs.getList();
    } catch (RemoteException e) {
        throw e.rethrowFromSystemServer();
    }
}
 
/** @hide */
@Override
public @NonNull List<SharedLibraryInfo> getSharedLibraries(int flags) {
    return getSharedLibrariesAsUser(flags, mContext.getUserId());
}
 
/** @hide */
@Override
public @NonNull List<SharedLibraryInfo> getSharedLibraries(int flags) {
    return getSharedLibrariesAsUser(flags, mContext.getUserId());
}
 
/** @hide */
@Override
public @NonNull List<SharedLibraryInfo> getSharedLibraries(int flags) {
    return getSharedLibrariesAsUser(flags, mContext.getUserId());
}
 
/** @hide */
@Override
public @NonNull List<SharedLibraryInfo> getSharedLibraries(int flags) {
    return getSharedLibrariesAsUser(flags, mContext.getUserId());
}
 
/** @hide */
@Override
public @NonNull List<SharedLibraryInfo> getSharedLibraries(int flags) {
    return getSharedLibrariesAsUser(flags, getUserId());
}
 
private void writeDeviceConfig(ProtoOutputStream protoOutputStream, long fieldId,
        PrintWriter pw, Configuration config, DisplayManager dm) {
    Point stableSize = dm.getStableDisplaySize();
    long token = -1;
    if (protoOutputStream != null) {
        token = protoOutputStream.start(fieldId);
        protoOutputStream.write(DeviceConfigurationProto.STABLE_SCREEN_WIDTH_PX, stableSize.x);
        protoOutputStream.write(DeviceConfigurationProto.STABLE_SCREEN_HEIGHT_PX, stableSize.y);
        protoOutputStream.write(DeviceConfigurationProto.STABLE_DENSITY_DPI,
                DisplayMetrics.DENSITY_DEVICE_STABLE);
    }
    if (pw != null) {
        pw.print("stable-width-px: "); pw.println(stableSize.x);
        pw.print("stable-height-px: "); pw.println(stableSize.y);
        pw.print("stable-density-dpi: "); pw.println(DisplayMetrics.DENSITY_DEVICE_STABLE);
    }

    MemInfoReader memreader = new MemInfoReader();
    memreader.readMemInfo();
    KeyguardManager kgm = mInternal.mContext.getSystemService(KeyguardManager.class);
    if (protoOutputStream != null) {
        protoOutputStream.write(DeviceConfigurationProto.TOTAL_RAM, memreader.getTotalSize());
        protoOutputStream.write(DeviceConfigurationProto.LOW_RAM,
                ActivityManager.isLowRamDeviceStatic());
        protoOutputStream.write(DeviceConfigurationProto.MAX_CORES,
                Runtime.getRuntime().availableProcessors());
        protoOutputStream.write(DeviceConfigurationProto.HAS_SECURE_SCREEN_LOCK,
                kgm.isDeviceSecure());
    }
    if (pw != null) {
        pw.print("total-ram: "); pw.println(memreader.getTotalSize());
        pw.print("low-ram: "); pw.println(ActivityManager.isLowRamDeviceStatic());
        pw.print("max-cores: "); pw.println(Runtime.getRuntime().availableProcessors());
        pw.print("has-secure-screen-lock: "); pw.println(kgm.isDeviceSecure());
    }

    ConfigurationInfo configInfo = mInternal.getDeviceConfigurationInfo();
    if (configInfo.reqGlEsVersion != ConfigurationInfo.GL_ES_VERSION_UNDEFINED) {
        if (protoOutputStream != null) {
            protoOutputStream.write(DeviceConfigurationProto.OPENGL_VERSION,
                    configInfo.reqGlEsVersion);
        }
        if (pw != null) {
            pw.print("opengl-version: 0x");
            pw.println(Integer.toHexString(configInfo.reqGlEsVersion));
        }
    }

    Set<String> glExtensionsSet = getGlExtensionsFromDriver();
    String[] glExtensions = new String[glExtensionsSet.size()];
    glExtensions = glExtensionsSet.toArray(glExtensions);
    Arrays.sort(glExtensions);
    for (int i = 0; i < glExtensions.length; i++) {
        if (protoOutputStream != null) {
            protoOutputStream.write(DeviceConfigurationProto.OPENGL_EXTENSIONS,
                    glExtensions[i]);
        }
        if (pw != null) {
            pw.print("opengl-extensions: "); pw.println(glExtensions[i]);
        }

    }

    PackageManager pm = mInternal.mContext.getPackageManager();
    List<SharedLibraryInfo> slibs = pm.getSharedLibraries(0);
    Collections.sort(slibs, Comparator.comparing(SharedLibraryInfo::getName));
    for (int i = 0; i < slibs.size(); i++) {
        if (protoOutputStream != null) {
            protoOutputStream.write(DeviceConfigurationProto.SHARED_LIBRARIES,
                    slibs.get(i).getName());
        }
        if (pw != null) {
            pw.print("shared-libraries: "); pw.println(slibs.get(i).getName());
        }
    }

    FeatureInfo[] features = pm.getSystemAvailableFeatures();
    Arrays.sort(features, (o1, o2) ->
            (o1.name == o2.name ? 0 : (o1.name == null ? -1 : o1.name.compareTo(o2.name))));
    for (int i = 0; i < features.length; i++) {
        if (features[i].name != null) {
            if (protoOutputStream != null) {
                protoOutputStream.write(DeviceConfigurationProto.FEATURES, features[i].name);
            }
            if (pw != null) {
                pw.print("features: "); pw.println(features[i].name);
            }
        }
    }

    if (protoOutputStream != null) {
        protoOutputStream.end(token);
    }
}
 
/** @hide */
@Override
public @NonNull List<SharedLibraryInfo> getSharedLibraries(int flags) {
    return getSharedLibrariesAsUser(flags, mContext.getUserId());
}
 
源代码15 项目: v9porn   文件: PackageManagerWrapper.java
@NonNull
@Override
public List<SharedLibraryInfo> getSharedLibraries(int i) {
    return null;
}
 
源代码16 项目: v9porn   文件: PackageManagerWrapper.java
@NonNull
@Override
public List<SharedLibraryInfo> getSharedLibraries(int i) {
    return null;
}
 
@NonNull
@Override
public List<SharedLibraryInfo> getSharedLibraries(int i) {
    return null;
}
 
源代码18 项目: VirtualAPK   文件: LoadedPlugin.java
@TargetApi(Build.VERSION_CODES.O)
@NonNull
@Override
public List<SharedLibraryInfo> getSharedLibraries(int flags) {
    return this.mHostPackageManager.getSharedLibraries(flags);
}
 
源代码19 项目: condom   文件: PackageManagerWrapper.java
@RequiresApi(O) @Override public List<SharedLibraryInfo> getSharedLibraries(int flags) {
	return mBase.getSharedLibraries(flags);
}
 
源代码20 项目: MiPushFramework   文件: PackageManagerWrapper.java
@RequiresApi(O) @Override public List<SharedLibraryInfo> getSharedLibraries(int flags) {
	return mBase.getSharedLibraries(flags);
}
 
源代码21 项目: island   文件: PackageManagerWrapper.java
@RequiresApi(O) @Override public List<SharedLibraryInfo> getSharedLibraries(int flags) {
	return mBase.getSharedLibraries(flags);
}
 
如果文章对您有帮助,请点击页面广告。以鼓励作者做出的努力。
 类所在包
 同包方法