2 * Copyright (C) 2012 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, write to
17 * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
18 * http://www.gnu.org/copyleft/gpl.html
24 #if defined(TARGET_ANDROID)
26 #include "AndroidAppFile.h"
30 #include "utils/log.h"
31 #include "utils/URIUtils.h"
33 #include "android/activity/XBMCApp.h"
34 using namespace XFILE;
36 CFileAndroidApp::CFileAndroidApp(void)
42 CFileAndroidApp::~CFileAndroidApp(void)
47 bool CFileAndroidApp::Open(const CURL& url)
51 m_appname = URIUtils::GetFileName(url.Get());
52 m_appname = m_appname.Left(m_appname.size() - 4);
54 return m_appname.size() > 0;
57 bool CFileAndroidApp::Exists(const CURL& url)
62 unsigned int CFileAndroidApp::Read(void* lpBuf, int64_t uiBufSize)
64 CXBMCApp::GetIcon(m_appname, lpBuf, uiBufSize);
68 void CFileAndroidApp::Close()
72 int64_t CFileAndroidApp::GetLength()
74 CXBMCApp::GetIconSize(m_appname, &m_iconWidth, &m_iconHeight);
75 return m_iconWidth * m_iconHeight * 4;
78 unsigned int CFileAndroidApp::GetIconWidth()
83 unsigned int CFileAndroidApp::GetIconHeight()
88 int CFileAndroidApp::GetChunkSize()
92 int CFileAndroidApp::Stat(const CURL& url, struct __stat64* buffer)
96 int CFileAndroidApp::IoControl(EIoControl request, void* param)
98 if(request == IOCTRL_SEEK_POSSIBLE)