File tree Expand file tree Collapse file tree 2 files changed +1
-7
lines changed
src/net/osmand/telegram/ui Expand file tree Collapse file tree 2 files changed +1
-7
lines changed Original file line number Diff line number Diff line change 88 <uses-permission android : name =" android.permission.ACCESS_NETWORK_STATE" />
99 <uses-permission android : name =" android.permission.INTERNET" />
1010 <uses-permission android : name =" android.permission.WRITE_EXTERNAL_STORAGE" />
11- <uses-permission android : name =" android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />
1211 <uses-permission android : name =" android.permission.FOREGROUND_SERVICE" />
1312
1413 <queries >
Original file line number Diff line number Diff line change @@ -52,14 +52,9 @@ class BatteryOptimizationBottomSheet : DialogFragment() {
5252 setText(R .string.go_to_settings)
5353 setOnClickListener {
5454 if (Build .VERSION .SDK_INT >= 26 ) {
55- val pkg = app.packageName
5655 val pm = app.getSystemService(PowerManager ::class .java)
5756 if (pm != null ) {
58- val intent = if (! pm.isIgnoringBatteryOptimizations(pkg)) {
59- Intent (Settings .ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS ).setData(Uri .parse(" package:$pkg " ))
60- } else {
61- Intent (Settings .ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS )
62- }
57+ val intent = Intent (Settings .ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS )
6358 if (intent.resolveActivity(app.packageManager) != null ) {
6459 startActivity(intent)
6560 } else {
You can’t perform that action at this time.
0 commit comments