revert DeviceModule back to Kotlin

Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
This commit is contained in:
tobiasKaminsky 2019-08-20 09:45:10 +02:00
parent 969ce78e03
commit 68cebf83de
No known key found for this signature in database
GPG key ID: 0E00D4D47D0C5AF7

View file

@ -2,8 +2,11 @@
* Nextcloud Android client application
*
* @author Chris Narkiewicz
* @author Tobias Kaminsky
*
* Copyright (C) 2019 Chris Narkiewicz <hello@ezaquarii.com>
* Copyright (C) 2019 Tobias Kaminsky
* Copyright (C) 2019 Nextcloud GmbH
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -19,22 +22,25 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.nextcloud.client.device;
package com.nextcloud.client.device
import android.content.Context;
import android.os.PowerManager;
import com.nextcloud.client.preferences.AppPreferences;
import dagger.Module;
import dagger.Provides;
import android.content.Context
import android.os.PowerManager
import com.nextcloud.client.preferences.AppPreferences
import dagger.Module
import dagger.Provides
@Module
public class DeviceModule {
@Provides
PowerManagementService powerManagementService(Context context, AppPreferences preferences) {
PowerManager platformPowerManager = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
class DeviceModule {
return new PowerManagementServiceImpl(context, platformPowerManager, preferences, new DeviceInfo());
@Provides
fun powerManagementService(context: Context, preferences: AppPreferences): PowerManagementService {
val platformPowerManager = context.getSystemService(Context.POWER_SERVICE) as PowerManager
return PowerManagementServiceImpl(
context = context,
powerManager = platformPowerManager,
deviceInfo = DeviceInfo(),
preferences = preferences
)
}
}