Skip to content

Commit

Permalink
feat(background-mode): add missing functions
Browse files Browse the repository at this point in the history
 closes #1078
  • Loading branch information
ihadeed committed Mar 2, 2017
1 parent ffdbab7 commit 906401b
Showing 1 changed file with 45 additions and 2 deletions.
47 changes: 45 additions & 2 deletions src/plugins/backgroundmode.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Cordova, CordovaFunctionOverride, Plugin } from './plugin';

import { Cordova, Plugin } from './plugin';
import { Observable } from 'rxjs/Observable';

/**
Expand Down Expand Up @@ -124,4 +123,48 @@ export class BackgroundMode {
})
static on(event: string): Observable<any> { return; }

/**
* Override the back button on Android to go to background instead of closing the app.
*/
@Cordova({
platforms: ['Android'],
sync: true
})
static overrideBackButton(): void {}

/**
* Exclude the app from the recent task list works on Android 5.0+.
*/
@Cordova({
platforms: ['Android'],
sync: true
})
static excludeFromTaskList(): void {}

/**
* The method works async instead of isActive() or isEnabled().
*/
@Cordova({
platforms: ['Android']
})
static isScreenOff(): Promise<boolean> { return; }

/**
* Turn screen on
*/
@Cordova({
platforms: ['Android'],
sync: true
})
static wakeUp(): void {}

/**
* Turn screen on and show app even locked
*/
@Cordova({
platforms: ['Android'],
sync: true
})
static unlock(): void {}

}

0 comments on commit 906401b

Please sign in to comment.