File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed
src/main/java/it/pgp/currenttoggles Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -9,8 +9,8 @@ android {
99 applicationId " it.pgp.currenttoggles"
1010 minSdkVersion 21 // for sdk 19 and lower, just use the great PowerToggles :)
1111 targetSdkVersion 28 // do not raise this, otherwise wifi toggle won't work without root on api 29+
12- versionCode 124230211
13- versionName " 1.2.4 "
12+ versionCode 125230305
13+ versionName " 1.2.5 "
1414 }
1515
1616 buildTypes {
Original file line number Diff line number Diff line change @@ -150,8 +150,11 @@ public static void toggleAirplane(Context context) {
150150 int airplaneEnabled = Misc .isAirplaneModeEnabled (context ) ? 1 : 0 ;
151151 showToast (context , msgs [airplaneEnabled ], airplaneEnabled == 0 );
152152 try {
153+ String command = Build .VERSION .SDK_INT < 30 ?
154+ "settings put global airplane_mode_on " +(1 -airplaneEnabled )+" && am broadcast -a android.intent.action.AIRPLANE_MODE" :
155+ "cmd connectivity airplane-mode " +(airplaneEnabled == 0 ? "enable" : "disable" );
153156 RootHandler .executeCommandAndWaitFor (
154- "settings put global airplane_mode_on " +( 1 - airplaneEnabled )+ " && am broadcast -a android.intent.action.AIRPLANE_MODE" ,
157+ command ,
155158 null , true , null );
156159 }
157160 catch (IOException e ) {
You can’t perform that action at this time.
0 commit comments