Where in the source code is the implementation of the changes occurring in Airplane Mode?

19 views
Skip to first unread message

Akhilesh Gupta

unread,
Jul 21, 2009, 5:30:27 AM7/21/09
to android-platform
I am compiling android from source and wish to modify the airplane
mode to suit my needs.
A) I want to switch off only certain radios(instead of all wireless
radios) in the airplane mode.
B) The GUI on the phone should correspondingly get updated according
to the radios that were switched off.

I have done the following till now:
I looked up code in :
1. src/com/android/settings/AirplaneModeEnabler.java : Implements
toggling of airplane mode from settings-> wireless controls menu.
2. phone/com/android/internal/policy/impl/GlobalActions.java :
Implements toggling of airplane mode from Global Actions menu
(obtained by long pressing the red end call key on home screen)

Both of these call:
Settings.System.putInt(mContext.getContentResolver
(),Settings.System.AIRPLANE_MODE_ON, enabling ? 1 : 0);
to set the airplane mode.

core/java/android/provider/Settings.java has the Settings provider
containing global system-level device preferences.

A) I think this part of the problem can be solved by using the
following string constant in android.provider.Settings.system:

public static final String AIRPLANE_MODE_RADIOS
A comma separated list of radios that need to be disabled when
airplane mode is on. This overrides WIFI_ON and BLUETOOTH_ON, if Wi-Fi
and bluetooth are included in the comma separated list.

B) For this I need to know where in the platform the implementation of
the airplane mode takes place i.e. the code which is invoked when
Settings.System.AIRPLANE_MODE_ON is set to 1.
This might contain the code which disables/enables certain radios and
updates the GUI to reflect the transition to the airplane mode. Can
someone guide me on where I might find this to update the GUI
according to my needs?


Thanks for your time and patience.
Akhilesh Gupta

Jack Ha

unread,
Jul 21, 2009, 12:01:41 PM7/21/09
to android-platform
In AirplaneModeEnabler.setAirplaneModeOn(), after the AIRPLANE_MODE_ON
setting is changed, it sends out a ACTION_AIRPLANE_MODE_CHANGED intent
broadcast.

You can look at the BroadcastReceiver in WifiService.java and
BluetoothDeviceService.java where the action takes place.


--
Jack Ha
Open Source Development Center
・T・ ・ ・Mobile・ stick together

The views, opinions and statements in this email are those of
the author solely in their individual capacity, and do not
necessarily represent those of T-Mobile USA, Inc.


On Jul 21, 2:30 am, Akhilesh Gupta <akhilesh.iitde...@gmail.com>
wrote:
Reply all
Reply to author
Forward
0 new messages