List of usage examples for android.telephony ServiceState newFromBundle
@UnsupportedAppUsage public static ServiceState newFromBundle(Bundle m)
From source file:com.android.mms.ui.MessageUtils.java
public static int getCellularState(int selectedSubId, Context context) { MmsLog.d(TAG, "getCellularState() subid: " + selectedSubId); ITelephonyEx telephonyEx = ITelephonyEx.Stub .asInterface(ServiceManager.getService(Context.TELEPHONY_SERVICE_EX)); Bundle bundle = null;/* w ww. ja va 2 s . c om*/ try { bundle = telephonyEx.getServiceState(selectedSubId); } catch (RemoteException e) { e.printStackTrace(); return ServiceState.STATE_OUT_OF_SERVICE; } if (bundle != null) { return ServiceState.newFromBundle(bundle).getState(); } else { return ServiceState.STATE_OUT_OF_SERVICE; } }