mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-23 04:33:54 -04:00
Resolve lint warnings in HotspotService.java
This commit is contained in:
parent
e45f36d29e
commit
2bdff5aba6
@ -39,6 +39,7 @@ public class HotspotService extends Service {
|
|||||||
@Override public void onCreate() {
|
@Override public void onCreate() {
|
||||||
super.onCreate();
|
super.onCreate();
|
||||||
|
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||||
stopReceiver = new BroadcastReceiver() {
|
stopReceiver = new BroadcastReceiver() {
|
||||||
@Override
|
@Override
|
||||||
public void onReceive(Context context, Intent intent) {
|
public void onReceive(Context context, Intent intent) {
|
||||||
@ -47,6 +48,7 @@ public class HotspotService extends Service {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
}
|
||||||
registerReceiver(stopReceiver, new IntentFilter(ACTION_STOP));
|
registerReceiver(stopReceiver, new IntentFilter(ACTION_STOP));
|
||||||
notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
|
notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
|
||||||
startForeground(HOTSPOT_NOTIFICATION_ID,
|
startForeground(HOTSPOT_NOTIFICATION_ID,
|
||||||
@ -110,7 +112,7 @@ public class HotspotService extends Service {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@RequiresApi(Build.VERSION_CODES.O)
|
@RequiresApi(Build.VERSION_CODES.O)
|
||||||
private void stopHotspot() {
|
void stopHotspot() {
|
||||||
hotspotManager.turnOffHotspot();
|
hotspotManager.turnOffHotspot();
|
||||||
stopForeground(true);
|
stopForeground(true);
|
||||||
stopSelf();
|
stopSelf();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user