2 * Copyright (C) 2012-2013 Team XBMC
5 * This Program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2, or (at your option)
10 * This Program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with XBMC; see the file COPYING. If not, see
17 * <http://www.gnu.org/licenses/>.
23 #if defined(TARGET_ANDROID)
25 #include "AndroidAppFile.h"
29 #include "utils/log.h"
30 #include "utils/URIUtils.h"
32 #include "android/activity/XBMCApp.h"
33 using namespace XFILE;
35 CFileAndroidApp::CFileAndroidApp(void)
41 CFileAndroidApp::~CFileAndroidApp(void)
46 bool CFileAndroidApp::Open(const CURL& url)
50 m_appname = URIUtils::GetFileName(url.Get());
51 m_appname = m_appname.substr(0, m_appname.size() - 4);
53 return m_appname.size() > 0;
56 bool CFileAndroidApp::Exists(const CURL& url)
61 unsigned int CFileAndroidApp::Read(void* lpBuf, int64_t uiBufSize)
63 CXBMCApp::GetIcon(m_appname, lpBuf, uiBufSize);
67 void CFileAndroidApp::Close()
71 int64_t CFileAndroidApp::GetLength()
73 CXBMCApp::GetIconSize(m_appname, &m_iconWidth, &m_iconHeight);
74 return m_iconWidth * m_iconHeight * 4;
77 unsigned int CFileAndroidApp::GetIconWidth()
82 unsigned int CFileAndroidApp::GetIconHeight()
87 int CFileAndroidApp::GetChunkSize()
91 int CFileAndroidApp::Stat(const CURL& url, struct __stat64* buffer)
95 int CFileAndroidApp::IoControl(EIoControl request, void* param)
97 if(request == IOCTRL_SEEK_POSSIBLE)