fix No visible @interface
This commit is contained in:
parent
dc8a177e15
commit
ffd2783187
@ -25,48 +25,29 @@
|
|||||||
@implementation PowerManagement
|
@implementation PowerManagement
|
||||||
- (void) acquire:(CDVInvokedUrlCommand*)command
|
- (void) acquire:(CDVInvokedUrlCommand*)command
|
||||||
{
|
{
|
||||||
CDVPluginResult* result = nil;
|
|
||||||
NSString* jsString = nil;
|
|
||||||
NSString* callbackId = command.callbackId;
|
|
||||||
|
|
||||||
// Acquire a reference to the local UIApplication singleton
|
// Acquire a reference to the local UIApplication singleton
|
||||||
UIApplication* app = [UIApplication sharedApplication];
|
UIApplication* app = [UIApplication sharedApplication];
|
||||||
|
|
||||||
|
CDVPluginResult *pluginResult = nil;
|
||||||
if( ![app isIdleTimerDisabled] ) {
|
if( ![app isIdleTimerDisabled] ) {
|
||||||
[app setIdleTimerDisabled:true];
|
[app setIdleTimerDisabled:true];
|
||||||
|
|
||||||
result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK];
|
|
||||||
jsString = [result toSuccessCallbackString:callbackId];
|
|
||||||
}
|
}
|
||||||
else {
|
pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK];
|
||||||
result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ILLEGAL_ACCESS_EXCEPTION messageAsString:@"IdleTimer already disabled"];
|
[self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
|
||||||
jsString = [result toErrorCallbackString:callbackId];
|
|
||||||
}
|
|
||||||
|
|
||||||
[self writeJavascript:jsString];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
- (void) release:(CDVInvokedUrlCommand*)command
|
- (void) release:(CDVInvokedUrlCommand*)command
|
||||||
{
|
{
|
||||||
CDVPluginResult* result = nil;
|
|
||||||
NSString* jsString = nil;
|
|
||||||
NSString* callbackId = command.callbackId;
|
|
||||||
|
|
||||||
// Acquire a reference to the local UIApplication singleton
|
// Acquire a reference to the local UIApplication singleton
|
||||||
UIApplication* app = [UIApplication sharedApplication];
|
UIApplication* app = [UIApplication sharedApplication];
|
||||||
|
|
||||||
|
|
||||||
|
CDVPluginResult *pluginResult = nil;
|
||||||
if( [app isIdleTimerDisabled] ) {
|
if( [app isIdleTimerDisabled] ) {
|
||||||
[app setIdleTimerDisabled:false];
|
[app setIdleTimerDisabled:false];
|
||||||
|
|
||||||
result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK];
|
|
||||||
jsString = [result toSuccessCallbackString:callbackId];
|
|
||||||
}
|
}
|
||||||
else {
|
pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK];
|
||||||
result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ILLEGAL_ACCESS_EXCEPTION messageAsString:@"IdleTimer not disabled"];
|
[self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
|
||||||
jsString = [result toErrorCallbackString:callbackId];
|
|
||||||
}
|
|
||||||
|
|
||||||
[self writeJavascript:jsString];
|
|
||||||
}
|
}
|
||||||
@end
|
@end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user