Example usage for android.media MediaDrm getPropertyString

List of usage examples for android.media MediaDrm getPropertyString

Introduction

In this page you can find the example usage for android.media MediaDrm getPropertyString.

Prototype

@NonNull
public native String getPropertyString(@NonNull @StringProperty String propertyName);

Source Link

Document

Read a MediaDrm String property value, given the property name string.

Usage

From source file:at.amartinz.hardware.drm.BaseDrmInfo.java

@Nullable
private static String getProperty(MediaDrm drm, String propertyName) {
    String property;/*from  www .j av  a2  s . c om*/
    try {
        property = drm.getPropertyString(propertyName);
    } catch (Exception exc) {
        property = null;
    }

    return BaseDrmInfo.sanitize(property);
}

From source file:at.amartinz.hardware.drm.BaseDrmInfo.java

private static boolean getBooleanProperty(MediaDrm drm, String propertyName) {
    String property;// w  w  w  . j  av  a  2 s  .c  o  m
    try {
        property = drm.getPropertyString(propertyName);
    } catch (Exception exc) {
        property = null;
    }
    property = BaseDrmInfo.sanitize(property);

    if (TextUtils.isEmpty(property)) {
        return false;
    }

    property = property.toLowerCase();

    return "true".equals(property) || "1".equals(property) || "yes".equals(property)
            || Boolean.parseBoolean(property);
}

From source file:mtmo.test.mediadrm.MainActivity.java

private void checkMarlinPluginInfo() {
    try {//  w  ww  .  j  a  va 2  s .  co m
        MediaDrm mediaDrm = new MediaDrm(Constants.MBB_UUID);
        String duid = mediaDrm.getPropertyString(Constants.QUERY_NAME_DUID);
        mLogger.d("duid: " + duid);
    } catch (UnsupportedSchemeException e) {
        Toast.makeText(MainActivity.this, "Unsupported Scheme", Toast.LENGTH_LONG).show();
        e.printStackTrace();
    } catch (IllegalArgumentException e) {
        e.printStackTrace();
    }
    return;
}