Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 518c0afa authored by Yuhao Zheng's avatar Yuhao Zheng Committed by Android (Google) Code Review
Browse files

Merge "Fix for the toggle airplane mode hidden API" into klp-dev

parents ecf612a1 5530e4b5
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -4684,12 +4684,12 @@ public class ConnectivityService extends IConnectivityManager.Stub {
    @Override
    public void setAirplaneMode(boolean enable) {
        enforceConnectivityInternalPermission();
        final long ident = Binder.clearCallingIdentity();
        try {
            final ContentResolver cr = mContext.getContentResolver();
            Settings.Global.putInt(cr, Settings.Global.AIRPLANE_MODE_ON, enable ? 1 : 0);
            Intent intent = new Intent(Intent.ACTION_AIRPLANE_MODE_CHANGED);
            intent.putExtra("state", enable);
        final long ident = Binder.clearCallingIdentity();
        try {
            mContext.sendBroadcast(intent);
        } finally {
            Binder.restoreCallingIdentity(ident);