Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
VideoLAN
VLC-iOS
Commits
ee606932
Commit
ee606932
authored
Aug 03, 2013
by
Felix Paul Kühne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prevent device from going to sleep during ongoing download processes (close #9062)
parent
7bac1e20
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
2 deletions
+10
-2
AspenProject/VLCDropboxController.m
AspenProject/VLCDropboxController.m
+6
-2
AspenProject/VLCHTTPFileDownloader.m
AspenProject/VLCHTTPFileDownloader.m
+2
-0
AspenProject/VLCHTTPUploaderController.m
AspenProject/VLCHTTPUploaderController.m
+2
-0
No files found.
AspenProject/VLCDropboxController.m
View file @
ee606932
...
...
@@ -170,15 +170,19 @@
-
(
void
)
networkRequestStarted
{
_outstandingNetworkRequests
++
;
if
(
_outstandingNetworkRequests
==
1
)
if
(
_outstandingNetworkRequests
==
1
)
{
[[
UIApplication
sharedApplication
]
setNetworkActivityIndicatorVisible
:
YES
];
[
UIApplication
sharedApplication
].
idleTimerDisabled
=
YES
;
}
}
-
(
void
)
networkRequestStopped
{
_outstandingNetworkRequests
--
;
if
(
_outstandingNetworkRequests
==
0
)
if
(
_outstandingNetworkRequests
==
0
)
{
[[
UIApplication
sharedApplication
]
setNetworkActivityIndicatorVisible
:
NO
];
[
UIApplication
sharedApplication
].
idleTimerDisabled
=
NO
;
}
}
#pragma mark - VLC internal communication and delegate
...
...
AspenProject/VLCHTTPFileDownloader.m
View file @
ee606932
...
...
@@ -44,6 +44,7 @@
}
else
{
_downloadInProgress
=
YES
;
[
UIApplication
sharedApplication
].
networkActivityIndicatorVisible
=
YES
;
[
UIApplication
sharedApplication
].
idleTimerDisabled
=
YES
;
}
}
...
...
@@ -128,6 +129,7 @@
{
_downloadInProgress
=
NO
;
[
UIApplication
sharedApplication
].
networkActivityIndicatorVisible
=
NO
;
[
UIApplication
sharedApplication
].
idleTimerDisabled
=
NO
;
[
self
.
delegate
downloadEnded
];
}
...
...
AspenProject/VLCHTTPUploaderController.m
View file @
ee606932
...
...
@@ -284,6 +284,7 @@ static const int httpLogLevel = HTTP_LOG_LEVEL_VERBOSE; // | HTTP_LOG_FLAG_TRACE
storeFile
=
[
NSFileHandle
fileHandleForWritingAtPath
:
filePath
];
[
uploadedFiles
addObject
:
[
NSString
stringWithFormat
:
@"/upload/%@"
,
filename
]];
[
UIApplication
sharedApplication
].
networkActivityIndicatorVisible
=
YES
;
[
UIApplication
sharedApplication
].
idleTimerDisabled
=
YES
;
}
}
...
...
@@ -301,6 +302,7 @@ static const int httpLogLevel = HTTP_LOG_LEVEL_VERBOSE; // | HTTP_LOG_FLAG_TRACE
[
storeFile
closeFile
];
storeFile
=
nil
;
[
UIApplication
sharedApplication
].
networkActivityIndicatorVisible
=
NO
;
[
UIApplication
sharedApplication
].
idleTimerDisabled
=
NO
;
/* update media library when file upload was completed */
VLCAppDelegate
*
appDelegate
=
[
UIApplication
sharedApplication
].
delegate
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment