blob: 60e6e70daacf5246a86fcaaf3ba765e4db3857df [file] [log] [blame]
aimitakeshid074e302010-07-29 10:12:27 +09001/*
2 * Copyright (C) 2010 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
Takeshi Aimidc549d62010-09-20 23:40:41 +090017//#define LOG_NDEBUG 0
aimitakeshid074e302010-07-29 10:12:27 +090018#define LOG_TAG "DrmIOService"
19#include <utils/Log.h>
20
21#include <binder/IServiceManager.h>
22#include "DrmIOService.h"
23#include "ReadWriteUtils.h"
24
25using namespace android;
26
27void DrmIOService::instantiate() {
28 LOGV("instantiate");
29 defaultServiceManager()->addService(String16("drm.drmIOService"), new DrmIOService());
30}
31
32DrmIOService::DrmIOService() {
33 LOGV("created");
34}
35
36DrmIOService::~DrmIOService() {
37 LOGV("Destroyed");
38}
39
40void DrmIOService::writeToFile(const String8& filePath, const String8& dataBuffer) {
41 LOGV("Entering writeToFile");
42 ReadWriteUtils::writeToFile(filePath, dataBuffer);
43}
44
45String8 DrmIOService::readFromFile(const String8& filePath) {
46 LOGV("Entering readFromFile");
47 return ReadWriteUtils::readBytes(filePath);
48}
49