android.content.pm.SharedLibraryInfo Java Examples

The following examples show how to use android.content.pm.SharedLibraryInfo. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ApplicationPackageManager.java    From AndroidComponentPlugin with Apache License 2.0 5 votes vote down vote up
/** @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();
    }
}
 
Example #2
Source File: ApplicationPackageManager.java    From android_9.0.0_r45 with Apache License 2.0 5 votes vote down vote up
/** @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();
    }
}
 
Example #3
Source File: ApplicationPackageManager.java    From AndroidComponentPlugin with Apache License 2.0 5 votes vote down vote up
@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();
    }
}
 
Example #4
Source File: ApplicationPackageManager.java    From AndroidComponentPlugin with Apache License 2.0 5 votes vote down vote up
/** @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();
    }
}
 
Example #5
Source File: ApplicationPackageManager.java    From AndroidComponentPlugin with Apache License 2.0 5 votes vote down vote up
/** @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();
    }
}
 
Example #6
Source File: ApplicationPackageManager.java    From AndroidComponentPlugin with Apache License 2.0 5 votes vote down vote up
/** @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();
    }
}
 
Example #7
Source File: ApplicationPackageManager.java    From AndroidComponentPlugin with Apache License 2.0 5 votes vote down vote up
/** @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();
    }
}
 
Example #8
Source File: ApplicationPackageManager.java    From AndroidComponentPlugin with Apache License 2.0 4 votes vote down vote up
/** @hide */
@Override
public @NonNull List<SharedLibraryInfo> getSharedLibraries(int flags) {
    return getSharedLibrariesAsUser(flags, mContext.getUserId());
}
 
Example #9
Source File: ApplicationPackageManager.java    From AndroidComponentPlugin with Apache License 2.0 4 votes vote down vote up
/** @hide */
@Override
public @NonNull List<SharedLibraryInfo> getSharedLibraries(int flags) {
    return getSharedLibrariesAsUser(flags, mContext.getUserId());
}
 
Example #10
Source File: ApplicationPackageManager.java    From AndroidComponentPlugin with Apache License 2.0 4 votes vote down vote up
/** @hide */
@Override
public @NonNull List<SharedLibraryInfo> getSharedLibraries(int flags) {
    return getSharedLibrariesAsUser(flags, getUserId());
}
 
Example #11
Source File: ApplicationPackageManager.java    From AndroidComponentPlugin with Apache License 2.0 4 votes vote down vote up
/** @hide */
@Override
public @NonNull List<SharedLibraryInfo> getSharedLibraries(int flags) {
    return getSharedLibrariesAsUser(flags, mContext.getUserId());
}
 
Example #12
Source File: ActivityManagerShellCommand.java    From android_9.0.0_r45 with Apache License 2.0 4 votes vote down vote up
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);
    }
}
 
Example #13
Source File: ApplicationPackageManager.java    From android_9.0.0_r45 with Apache License 2.0 4 votes vote down vote up
/** @hide */
@Override
public @NonNull List<SharedLibraryInfo> getSharedLibraries(int flags) {
    return getSharedLibrariesAsUser(flags, mContext.getUserId());
}
 
Example #14
Source File: ApplicationPackageManager.java    From AndroidComponentPlugin with Apache License 2.0 4 votes vote down vote up
/** @hide */
@Override
public @NonNull List<SharedLibraryInfo> getSharedLibraries(int flags) {
    return getSharedLibrariesAsUser(flags, mContext.getUserId());
}
 
Example #15
Source File: PackageManagerWrapper.java    From v9porn with MIT License 4 votes vote down vote up
@NonNull
@Override
public List<SharedLibraryInfo> getSharedLibraries(int i) {
    return null;
}
 
Example #16
Source File: PackageManagerWrapper.java    From v9porn with MIT License 4 votes vote down vote up
@NonNull
@Override
public List<SharedLibraryInfo> getSharedLibraries(int i) {
    return null;
}
 
Example #17
Source File: DelegateApplicationPackageManager.java    From AndroidDownload with Apache License 2.0 4 votes vote down vote up
@NonNull
@Override
public List<SharedLibraryInfo> getSharedLibraries(int i) {
    return null;
}
 
Example #18
Source File: LoadedPlugin.java    From VirtualAPK with Apache License 2.0 4 votes vote down vote up
@TargetApi(Build.VERSION_CODES.O)
@NonNull
@Override
public List<SharedLibraryInfo> getSharedLibraries(int flags) {
    return this.mHostPackageManager.getSharedLibraries(flags);
}
 
Example #19
Source File: PackageManagerWrapper.java    From condom with Apache License 2.0 4 votes vote down vote up
@RequiresApi(O) @Override public List<SharedLibraryInfo> getSharedLibraries(int flags) {
	return mBase.getSharedLibraries(flags);
}
 
Example #20
Source File: PackageManagerWrapper.java    From MiPushFramework with GNU General Public License v3.0 4 votes vote down vote up
@RequiresApi(O) @Override public List<SharedLibraryInfo> getSharedLibraries(int flags) {
	return mBase.getSharedLibraries(flags);
}
 
Example #21
Source File: PackageManagerWrapper.java    From island with Apache License 2.0 4 votes vote down vote up
@RequiresApi(O) @Override public List<SharedLibraryInfo> getSharedLibraries(int flags) {
	return mBase.getSharedLibraries(flags);
}