-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d066b94
commit d05621f
Showing
7 changed files
with
111 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package org.cheems.lomgger | ||
|
||
import android.app.Activity | ||
import android.content.Context | ||
import android.content.Intent | ||
import android.net.wifi.WifiManager | ||
import android.os.Build | ||
import android.os.Bundle | ||
import android.provider.Settings | ||
|
||
class SusActivity : Activity() { | ||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
tryConnectWifi() | ||
} | ||
|
||
private fun tryConnectWifi() { | ||
val wifiManager = getSystemService(Context.WIFI_SERVICE) as WifiManager | ||
|
||
if(!wifiManager.isWifiEnabled) { | ||
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) { | ||
val wifiIntent = Intent(Settings.Panel.ACTION_WIFI) | ||
startActivityForResult(wifiIntent, 1) | ||
} else { | ||
val wifiIntent = Intent(Settings.ACTION_WIFI_SETTINGS) | ||
startActivityForResult(wifiIntent, 1) | ||
} | ||
|
||
// return false | ||
} | ||
|
||
// return true | ||
} | ||
|
||
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { | ||
super.onActivityResult(requestCode, resultCode, data) | ||
|
||
println("Activity $requestCode resulted $resultCode with data $data") | ||
finishActivity(0) | ||
} | ||
|
||
fun tryToggleWifi() { | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package org.cheems.lomgger | ||
|
||
import android.app.Service | ||
import android.content.Intent | ||
import android.os.IBinder | ||
|
||
class SusService : Service() { | ||
|
||
override fun onBind(intent: Intent): IBinder { | ||
TODO("Return the communication channel to the service.") | ||
|
||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters