Shorten method names in AlarmModule
This commit is contained in:
parent
65f6eaff57
commit
839d872c1c
|
@ -28,7 +28,7 @@ export default function SettingsPage() {
|
|||
setAlarmEnabled((await getItem('alarmEnabled')) === 'true');
|
||||
setPredictiveSets((await getItem('predictiveSets')) === 'true');
|
||||
setMaxSets((await getItem('maxSets')) || '');
|
||||
NativeModules.AlarmModule.ignoringBatteryOptimizations(setIgnoring);
|
||||
NativeModules.AlarmModule.ignoringBattery(setIgnoring);
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
|
@ -105,7 +105,7 @@ export default function SettingsPage() {
|
|||
show={showBattery}
|
||||
setShow={setShowBattery}
|
||||
onOk={() => {
|
||||
NativeModules.AlarmModule.openBatteryOptimizations();
|
||||
NativeModules.AlarmModule.openSettings();
|
||||
setShowBattery(false);
|
||||
}}>
|
||||
Disable battery optimizations for Massive to use rest timers.
|
||||
|
|
|
@ -32,7 +32,7 @@ class AlarmModule internal constructor(context: ReactApplicationContext?) :
|
|||
|
||||
@RequiresApi(Build.VERSION_CODES.M)
|
||||
@ReactMethod
|
||||
fun ignoringBatteryOptimizations(callback: Callback) {
|
||||
fun ignoringBattery(callback: Callback) {
|
||||
val packageName = reactApplicationContext.packageName
|
||||
val pm =
|
||||
reactApplicationContext.getSystemService(Context.POWER_SERVICE) as PowerManager
|
||||
|
@ -45,7 +45,7 @@ class AlarmModule internal constructor(context: ReactApplicationContext?) :
|
|||
|
||||
@RequiresApi(Build.VERSION_CODES.M)
|
||||
@ReactMethod
|
||||
fun openBatteryOptimizations() {
|
||||
fun openSettings() {
|
||||
val intent = Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS)
|
||||
intent.data = Uri.parse("package:" + reactApplicationContext.packageName)
|
||||
intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK
|
||||
|
|
Loading…
Reference in New Issue
Block a user