MediaDrmCredentialManager.java revision 68043e1e95eeb07d5cae7aca370b26518b0867d6
1// Copyright 2013 The Chromium Authors. All rights reserved. 2// Use of this source code is governed by a BSD-style license that can be 3// found in the LICENSE file. 4 5package org.chromium.content.browser; 6 7import org.chromium.base.CalledByNative; 8import org.chromium.base.JNINamespace; 9 10/** 11 * A wrapper of the android MediaDrmCredentialManager 12 */ 13@JNINamespace("content") 14public class MediaDrmCredentialManager { 15 private int mNativeMediaDrmCredentialManager; 16 17 /** 18 * Callback interface for getting notified from credential reset. 19 */ 20 public interface MediaDrmCredentialManagerCallback { 21 /** 22 * This method will be called when credential reset attempt is done. 23 * @param succeeded Whether or not it succeeded. 24 */ 25 @CalledByNative("MediaDrmCredentialManagerCallback") 26 public void onCredentialResetFinished(boolean succeeded); 27 } 28 29 /** 30 * Attempts to reset the DRM credentials. 31 * @param callback It notifies whether or not it succeeded. 32 */ 33 public static void resetCredentials(MediaDrmCredentialManagerCallback callback) { 34 nativeResetCredentials(callback); 35 } 36 37 private static native void nativeResetCredentials(MediaDrmCredentialManagerCallback callback); 38} 39