Created
June 6, 2011 14:04
-
-
Save thorikawa/1010322 to your computer and use it in GitHub Desktop.
Android DrmFramework Sample
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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