Skip to content

Commit 906401b

Browse files
committed
feat(background-mode): add missing functions
closes #1078
1 parent ffdbab7 commit 906401b

File tree

1 file changed

+45
-2
lines changed

1 file changed

+45
-2
lines changed

src/plugins/backgroundmode.ts

Lines changed: 45 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import { Cordova, CordovaFunctionOverride, Plugin } from './plugin';
2-
1+
import { Cordova, Plugin } from './plugin';
32
import { Observable } from 'rxjs/Observable';
43

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

126+
/**
127+
* Override the back button on Android to go to background instead of closing the app.
128+
*/
129+
@Cordova({
130+
platforms: ['Android'],
131+
sync: true
132+
})
133+
static overrideBackButton(): void {}
134+
135+
/**
136+
* Exclude the app from the recent task list works on Android 5.0+.
137+
*/
138+
@Cordova({
139+
platforms: ['Android'],
140+
sync: true
141+
})
142+
static excludeFromTaskList(): void {}
143+
144+
/**
145+
* The method works async instead of isActive() or isEnabled().
146+
*/
147+
@Cordova({
148+
platforms: ['Android']
149+
})
150+
static isScreenOff(): Promise<boolean> { return; }
151+
152+
/**
153+
* Turn screen on
154+
*/
155+
@Cordova({
156+
platforms: ['Android'],
157+
sync: true
158+
})
159+
static wakeUp(): void {}
160+
161+
/**
162+
* Turn screen on and show app even locked
163+
*/
164+
@Cordova({
165+
platforms: ['Android'],
166+
sync: true
167+
})
168+
static unlock(): void {}
169+
127170
}

0 commit comments

Comments
 (0)