diff options
-rw-r--r-- | src/com/android/settings/RadioInfo.java | 42 | ||||
-rw-r--r-- | src/com/android/settings/widget/SettingsAppWidgetProvider.java | 10 |
2 files changed, 40 insertions, 12 deletions
diff --git a/src/com/android/settings/RadioInfo.java b/src/com/android/settings/RadioInfo.java index 4665471..ce236fd 100644 --- a/src/com/android/settings/RadioInfo.java +++ b/src/com/android/settings/RadioInfo.java @@ -37,6 +37,7 @@ import android.telephony.PhoneStateListener; import android.telephony.ServiceState; import android.telephony.TelephonyManager; import android.telephony.NeighboringCellInfo; +import android.telephony.cdma.CdmaCellLocation; import android.telephony.gsm.GsmCellLocation; import android.text.format.DateUtils; import android.util.Log; @@ -621,21 +622,42 @@ public class RadioInfo extends Activity { } private final void updateLocation(CellLocation location) { - int lac = -1; - int cid = -1; + Resources r = getResources(); if (location instanceof GsmCellLocation) { GsmCellLocation loc = (GsmCellLocation)location; - lac = loc.getLac(); - cid = loc.getCid(); + int lac = loc.getLac(); + int cid = loc.getCid(); + mLocation.setText(r.getString(R.string.radioInfo_lac) + " = " + + ((lac == -1) ? "unknown" : Integer.toHexString(lac)) + + " " + + r.getString(R.string.radioInfo_cid) + " = " + + ((cid == -1) ? "unknown" : Integer.toHexString(cid))); + } else if (location instanceof CdmaCellLocation) { + CdmaCellLocation loc = (CdmaCellLocation)location; + int bid = loc.getBaseStationId(); + int sid = loc.getSystemId(); + int nid = loc.getNetworkId(); + int lat = loc.getBaseStationLatitude(); + int lon = loc.getBaseStationLongitude(); + mLocation.setText("BID = " + + ((bid == -1) ? "unknown" : Integer.toHexString(bid)) + + " " + + "SID = " + + ((sid == -1) ? "unknown" : Integer.toHexString(sid)) + + " " + + "NID = " + + ((nid == -1) ? "unknown" : Integer.toHexString(nid)) + + "\n" + + "LAT = " + + ((lat == -1) ? "unknown" : Integer.toHexString(lat)) + + " " + + "LONG = " + + ((lon == -1) ? "unknown" : Integer.toHexString(lon))); + } else { + mLocation.setText("unknown"); } - Resources r = getResources(); - mLocation.setText(r.getString(R.string.radioInfo_lac) + " = " - + ((lac == -1) ? "unknown" : Integer.toHexString(lac)) - + " " - + r.getString(R.string.radioInfo_cid) + " = " - + ((cid == -1) ? "unknown" : Integer.toHexString(cid))); } private final void updateNeighboringCids(ArrayList<NeighboringCellInfo> cids) { diff --git a/src/com/android/settings/widget/SettingsAppWidgetProvider.java b/src/com/android/settings/widget/SettingsAppWidgetProvider.java index ab77b05..37896bf 100644 --- a/src/com/android/settings/widget/SettingsAppWidgetProvider.java +++ b/src/com/android/settings/widget/SettingsAppWidgetProvider.java @@ -390,8 +390,14 @@ public class SettingsAppWidgetProvider extends AppWidgetProvider { } power.setBacklightBrightness(brightness); Settings.System.putInt(cr, Settings.System.SCREEN_BRIGHTNESS, brightness); - brightness = Settings.System.getInt(cr, - Settings.System.SCREEN_BRIGHTNESS); + if (context.getResources().getBoolean( + com.android.internal.R.bool.config_automatic_brightness_available)) { + // Disable automatic brightness + power.setAutoBrightness(false); + Settings.System.putInt(context.getContentResolver(), + Settings.System.SCREEN_BRIGHTNESS_MODE, + 0); + } } } catch (RemoteException e) { Log.d(TAG, "toggleBrightness: " + e); |