Skip to content

Instantly share code, notes, and snippets.

@thorikawa
Created June 6, 2011 14:04
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save thorikawa/1010322 to your computer and use it in GitHub Desktop.
Save thorikawa/1010322 to your computer and use it in GitHub Desktop.
Android DrmFramework Sample
package com.polysfactory.DrmFrameworkTest;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import android.app.Activity;
import android.drm.DrmManagerClient;
import android.os.Bundle;
import android.util.Log;
import android.widget.TextView;
public class Top extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
TextView hello = (TextView) findViewById(R.id.Hello);
String text = "";
DrmManagerClient drmManagerClient = new DrmManagerClient(this);
Method load;
try {
load = DrmManagerClient.class.getMethod("loadPlugIns");
load.invoke(drmManagerClient);
} catch (SecurityException e) {
e.printStackTrace();
} catch (NoSuchMethodException e) {
e.printStackTrace();
} catch (IllegalArgumentException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (InvocationTargetException e) {
e.printStackTrace();
}
String[] engines = drmManagerClient.getAvailableDrmEngines();
for (String engine : engines) {
text += engine + "\n";
Log.i("DrmFrameworkTest", engine);
}
hello.setText(text);
}
}
@thorikawa
Copy link
Author

Xperia Arcでの出力結果

INFO/DrmFrameworkTest(2179): Basic test plugin that supports types needed for Drm Framework verification
INFO/DrmFrameworkTest(2179): OMA V1 Forward Lock
INFO/DrmFrameworkTest(2179): OMA v1 Separate Delivery

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment