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