expo-keep-awake 12.8.2 → 13.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -10,11 +10,21 @@
10
10
 
11
11
  ### 💡 Others
12
12
 
13
- ## 12.8.2 — 2024-01-18
13
+ ## 13.0.1 — 2024-04-23
14
14
 
15
15
  _This version does not introduce any user-facing changes._
16
16
 
17
- ## 12.8.1 — 2024-01-10
17
+ ## 13.0.0 — 2024-04-18
18
+
19
+ ### 💡 Others
20
+
21
+ - Removed deprecated backward compatible Gradle settings. ([#28083](https://github.com/expo/expo/pull/28083) by [@kudo](https://github.com/kudo))
22
+
23
+ ## 12.8.2 - 2024-01-18
24
+
25
+ _This version does not introduce any user-facing changes._
26
+
27
+ ## 12.8.1 - 2024-01-10
18
28
 
19
29
  ### 🎉 New features
20
30
 
@@ -1,107 +1,19 @@
1
1
  apply plugin: 'com.android.library'
2
- apply plugin: 'kotlin-android'
3
- apply plugin: 'maven-publish'
4
2
 
5
3
  group = 'host.exp.exponent'
6
- version = '12.8.2'
4
+ version = '13.0.1'
7
5
 
8
6
  def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
9
- if (expoModulesCorePlugin.exists()) {
10
- apply from: expoModulesCorePlugin
11
- applyKotlinExpoModulesCorePlugin()
12
- // Remove this check, but keep the contents after SDK49 support is dropped
13
- if (safeExtGet("expoProvidesDefaultConfig", false)) {
14
- useExpoPublishing()
15
- useCoreDependencies()
16
- }
17
- }
18
-
19
- buildscript {
20
- // Simple helper that allows the root project to override versions declared by this library.
21
- ext.safeExtGet = { prop, fallback ->
22
- rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
23
- }
24
-
25
- // Ensures backward compatibility
26
- ext.getKotlinVersion = {
27
- if (ext.has("kotlinVersion")) {
28
- ext.kotlinVersion()
29
- } else {
30
- ext.safeExtGet("kotlinVersion", "1.8.10")
31
- }
32
- }
33
-
34
- repositories {
35
- mavenCentral()
36
- }
37
-
38
- dependencies {
39
- classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${getKotlinVersion()}")
40
- }
41
- }
42
-
43
- // Remove this if and it's contents, when support for SDK49 is dropped
44
- if (!safeExtGet("expoProvidesDefaultConfig", false)) {
45
- afterEvaluate {
46
- publishing {
47
- publications {
48
- release(MavenPublication) {
49
- from components.release
50
- }
51
- }
52
- repositories {
53
- maven {
54
- url = mavenLocal().url
55
- }
56
- }
57
- }
58
- }
59
- }
7
+ apply from: expoModulesCorePlugin
8
+ applyKotlinExpoModulesCorePlugin()
9
+ useCoreDependencies()
10
+ useDefaultAndroidSdkVersions()
11
+ useExpoPublishing()
60
12
 
61
13
  android {
62
- // Remove this if and it's contents, when support for SDK49 is dropped
63
- if (!safeExtGet("expoProvidesDefaultConfig", false)) {
64
- compileSdkVersion safeExtGet("compileSdkVersion", 34)
65
-
66
- defaultConfig {
67
- minSdkVersion safeExtGet("minSdkVersion", 23)
68
- targetSdkVersion safeExtGet("targetSdkVersion", 34)
69
- }
70
-
71
- publishing {
72
- singleVariant("release") {
73
- withSourcesJar()
74
- }
75
- }
76
-
77
- lintOptions {
78
- abortOnError false
79
- }
80
- }
81
-
82
- def agpVersion = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION
83
- if (agpVersion.tokenize('.')[0].toInteger() < 8) {
84
- compileOptions {
85
- sourceCompatibility JavaVersion.VERSION_11
86
- targetCompatibility JavaVersion.VERSION_11
87
- }
88
-
89
- kotlinOptions {
90
- jvmTarget = JavaVersion.VERSION_11.majorVersion
91
- }
92
- }
93
-
94
14
  namespace "expo.modules.keepawake"
95
15
  defaultConfig {
96
16
  versionCode 16
97
- versionName "12.8.2"
98
- }
99
- }
100
-
101
- dependencies {
102
- // Remove this if and it's contents, when support for SDK49 is dropped
103
- if (!safeExtGet("expoProvidesDefaultConfig", false)) {
104
- implementation project(':expo-modules-core')
105
- implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${getKotlinVersion()}"
17
+ versionName "13.0.1"
106
18
  }
107
19
  }
@@ -2,29 +2,26 @@ package expo.modules.keepawake
2
2
 
3
3
  import android.app.Activity
4
4
  import android.view.WindowManager
5
-
6
- import expo.modules.core.interfaces.services.KeepAwakeManager
7
- import expo.modules.core.interfaces.InternalModule
8
5
  import expo.modules.core.ModuleRegistry
9
- import expo.modules.core.ModuleRegistryDelegate
10
6
  import expo.modules.core.errors.CurrentActivityNotFoundException
11
7
  import expo.modules.core.interfaces.ActivityProvider
8
+ import expo.modules.core.interfaces.InternalModule
9
+ import expo.modules.core.interfaces.services.KeepAwakeManager
12
10
 
13
- import java.util.HashSet
14
-
15
- class ExpoKeepAwakeManager(private val moduleRegistryDelegate: ModuleRegistryDelegate = ModuleRegistryDelegate()) : KeepAwakeManager, InternalModule {
11
+ class ExpoKeepAwakeManager : KeepAwakeManager, InternalModule {
16
12
  private val tags: MutableSet<String> = HashSet()
17
13
 
18
- private inline fun <reified T> moduleRegistry() = moduleRegistryDelegate.getFromModuleRegistry<T>()
14
+ private lateinit var moduleRegistry: ModuleRegistry
19
15
 
20
16
  override fun onCreate(moduleRegistry: ModuleRegistry) {
21
- moduleRegistryDelegate.onCreate(moduleRegistry)
17
+ this.moduleRegistry = moduleRegistry
22
18
  }
23
19
 
24
20
  @get:Throws(CurrentActivityNotFoundException::class)
25
21
  private val currentActivity: Activity
26
22
  get() {
27
- val activityProvider: ActivityProvider by moduleRegistry()
23
+ val activityProvider = moduleRegistry.getModule(ActivityProvider::class.java)
24
+ ?: throw CurrentActivityNotFoundException()
28
25
  return if (activityProvider.currentActivity != null) {
29
26
  activityProvider.currentActivity
30
27
  } else {
@@ -30,7 +30,7 @@ class KeepAwakeModule : Module() {
30
30
  }
31
31
  }
32
32
 
33
- AsyncFunction("isActivated") {
33
+ AsyncFunction<Boolean>("isActivated") {
34
34
  return@AsyncFunction keepAwakeManager.isActivated
35
35
  }
36
36
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-keep-awake",
3
- "version": "12.8.2",
3
+ "version": "13.0.1",
4
4
  "description": "Provides a React component that prevents the screen sleeping when rendered. It also exposes static methods to control the behavior imperatively.",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -42,5 +42,5 @@
42
42
  "jest": {
43
43
  "preset": "expo-module-scripts"
44
44
  },
45
- "gitHead": "102899632731658eecba006c0d1c79b98ba8f5f7"
45
+ "gitHead": "ee4f30ef3b5fa567ad1bf94794197f7683fdd481"
46
46
  }