bool MockCDMSession::update(Uint8Array* key, RefPtr<Uint8Array>&, unsigned short& errorCode, unsigned long&) { for (unsigned i = 0; i < keyPrefix()->length(); ++i) { if (i >= key->length() || key->item(i) != keyPrefix()->item(i)) { errorCode = MediaKeyError::MEDIA_KEYERR_CLIENT; return false; } } return true; }
void KeySequenceWidget::updateOutput() { QString s; if (m_KeySequence.isMouseButton()) s = mousePrefix() + m_KeySequence.toString() + mousePostfix(); else s = keyPrefix() + m_KeySequence.toString() + keyPostfix(); setText(s); }
static void setKeyPrefix_native(JNIEnv* env, jobject clazz, jlong w, jstring keyPrefixObj) { int err; BackupDataWriter* writer = (BackupDataWriter*)w; const char* keyPrefixUTF = env->GetStringUTFChars(keyPrefixObj, NULL); String8 keyPrefix(keyPrefixUTF ? keyPrefixUTF : ""); writer->SetKeyPrefix(keyPrefix); env->ReleaseStringUTFChars(keyPrefixObj, keyPrefixUTF); }