Skip to content

Commit 48c3760

Browse files
committed
Slight changes to screen lock mechanism
1 parent f72cd37 commit 48c3760

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

android/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ android {
1616
defaultConfig {
1717
minSdkVersion safeExtGet('minSdkVersion', 16)
1818
targetSdkVersion safeExtGet('targetSdkVersion', 28)
19-
versionCode 6
20-
versionName "0.1.5"
19+
versionCode 7
20+
versionName "0.1.6"
2121
}
2222
}
2323

android/src/main/java/com/stumbleapp/utils/UtilsModule.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import android.annotation.TargetApi;
1212
import android.annotation.SuppressLint;
1313
import android.app.Activity;
14+
import android.app.KeyguardManager;
1415
import android.os.Build;
1516

1617
import android.os.PowerManager;
@@ -194,6 +195,10 @@ public void acquireScreenLock() {
194195
try {
195196
activity.setTurnScreenOn( true );
196197
activity.setShowWhenLocked( true );
198+
199+
ReactApplicationContext reactContext = getReactApplicationContext();
200+
KeyguardManager keyguardManager = (KeyguardManager) reactContext.getSystemService( Context.KEYGUARD_SERVICE );
201+
keyguardManager.requestDismissKeyguard( activity, null );
197202
} catch ( NoSuchMethodError e ) {
198203
e.printStackTrace();
199204
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-app-utils",
3-
"version": "0.1.5",
3+
"version": "0.1.6",
44
"description": "A simple React-Native utils library with useful functions.",
55
"nativePackage": true,
66
"main": "index.js",

0 commit comments

Comments
 (0)