Merge change 1725
* changes: Findbug fixes in Settings app
This commit is contained in:
@@ -107,7 +107,7 @@ public class ApnPreference extends Preference implements
|
|||||||
return getKey().equals(mSelectedKey);
|
return getKey().equals(mSelectedKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setChecked(boolean checked) {
|
public void setChecked() {
|
||||||
mSelectedKey = getKey();
|
mSelectedKey = getKey();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -178,7 +178,7 @@ public class ApnSettings extends PreferenceActivity implements
|
|||||||
pref.setSelectable(selectable);
|
pref.setSelectable(selectable);
|
||||||
if (selectable) {
|
if (selectable) {
|
||||||
if ((mSelectedKey != null) && mSelectedKey.equals(key)) {
|
if ((mSelectedKey != null) && mSelectedKey.equals(key)) {
|
||||||
pref.setChecked(true);
|
pref.setChecked();
|
||||||
}
|
}
|
||||||
apnList.addPreference(pref);
|
apnList.addPreference(pref);
|
||||||
} else {
|
} else {
|
||||||
|
@@ -97,7 +97,7 @@ public class BandMode extends Activity {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
private class BandListItem {
|
static private class BandListItem {
|
||||||
private int mBandMode = Phone.BM_UNSPECIFIED;
|
private int mBandMode = Phone.BM_UNSPECIFIED;
|
||||||
|
|
||||||
public BandListItem(int bm) {
|
public BandListItem(int bm) {
|
||||||
|
@@ -67,7 +67,7 @@ public class BatteryInfo extends Activity {
|
|||||||
*/
|
*/
|
||||||
private final String tenthsToFixedString(int x) {
|
private final String tenthsToFixedString(int x) {
|
||||||
int tens = x / 10;
|
int tens = x / 10;
|
||||||
return new String("" + tens + "." + (x - 10*tens));
|
return Integer.toString(tens) + "." + (x - 10 * tens);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -54,8 +54,6 @@ public class LanguageSettings extends PreferenceActivity {
|
|||||||
private String mLastInputMethodId;
|
private String mLastInputMethodId;
|
||||||
private String mLastTickedInputMethodId;
|
private String mLastTickedInputMethodId;
|
||||||
|
|
||||||
private String mRootDirectory;
|
|
||||||
|
|
||||||
static public String getInputMethodIdFromKey(String key) {
|
static public String getInputMethodIdFromKey(String key) {
|
||||||
return key;
|
return key;
|
||||||
}
|
}
|
||||||
|
@@ -426,15 +426,20 @@ public class ManageApplications extends ListActivity implements
|
|||||||
public void onGetStatsCompleted(PackageStats pStats, boolean pSucceeded) {
|
public void onGetStatsCompleted(PackageStats pStats, boolean pSucceeded) {
|
||||||
AppInfo appInfo = null;
|
AppInfo appInfo = null;
|
||||||
Bundle data = new Bundle();
|
Bundle data = new Bundle();
|
||||||
|
if (pStats != null) {
|
||||||
data.putString(ATTR_PKG_NAME, pStats.packageName);
|
data.putString(ATTR_PKG_NAME, pStats.packageName);
|
||||||
if(pSucceeded && pStats != null) {
|
if(pSucceeded) {
|
||||||
if (localLOGV) Log.i(TAG, "onGetStatsCompleted::"+pStats.packageName+", ("+
|
if (localLOGV) Log.i(TAG, "onGetStatsCompleted::"+pStats.packageName+", ("+
|
||||||
pStats.cacheSize+","+
|
pStats.cacheSize+","+
|
||||||
pStats.codeSize+", "+pStats.dataSize);
|
pStats.codeSize+", "+pStats.dataSize);
|
||||||
data.putParcelable(ATTR_APP_PKG_STATS, pStats);
|
data.putParcelable(ATTR_APP_PKG_STATS, pStats);
|
||||||
} else {
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!pSucceeded || pStats == null) {
|
||||||
Log.w(TAG, "Invalid package stats from PackageManager");
|
Log.w(TAG, "Invalid package stats from PackageManager");
|
||||||
}
|
}
|
||||||
|
|
||||||
//post message to Handler
|
//post message to Handler
|
||||||
Message msg = mHandler.obtainMessage(mMsgId, data);
|
Message msg = mHandler.obtainMessage(mMsgId, data);
|
||||||
msg.setData(data);
|
msg.setData(data);
|
||||||
@@ -705,7 +710,7 @@ public class ManageApplications extends ListActivity implements
|
|||||||
|
|
||||||
// internal structure used to track added and deleted packages when
|
// internal structure used to track added and deleted packages when
|
||||||
// the activity has focus
|
// the activity has focus
|
||||||
class AddRemoveInfo {
|
static class AddRemoveInfo {
|
||||||
String pkgName;
|
String pkgName;
|
||||||
boolean add;
|
boolean add;
|
||||||
public AddRemoveInfo(String pPkgName, boolean pAdd) {
|
public AddRemoveInfo(String pPkgName, boolean pAdd) {
|
||||||
|
@@ -257,24 +257,24 @@ public class RadioInfo extends Activity {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
private class OemCommands {
|
static private class OemCommands {
|
||||||
|
|
||||||
public final int OEM_QXDM_SDLOG_DEFAULT_FILE_SIZE = 32;
|
public static final int OEM_QXDM_SDLOG_DEFAULT_FILE_SIZE = 32;
|
||||||
public final int OEM_QXDM_SDLOG_DEFAULT_MASK = 0;
|
public static final int OEM_QXDM_SDLOG_DEFAULT_MASK = 0;
|
||||||
public final int OEM_QXDM_SDLOG_DEFAULT_MAX_INDEX = 8;
|
public static final int OEM_QXDM_SDLOG_DEFAULT_MAX_INDEX = 8;
|
||||||
|
|
||||||
final int SIZE_OF_INT = 4;
|
static final int SIZE_OF_INT = 4;
|
||||||
final int OEM_FEATURE_ENABLE = 1;
|
static final int OEM_FEATURE_ENABLE = 1;
|
||||||
final int OEM_FEATURE_DISABLE = 0;
|
static final int OEM_FEATURE_DISABLE = 0;
|
||||||
final int OEM_SIMPE_FEAUTURE_LEN = 1;
|
static final int OEM_SIMPE_FEAUTURE_LEN = 1;
|
||||||
|
|
||||||
final int OEM_QXDM_SDLOG_FUNCTAG = 0x00010000;
|
static final int OEM_QXDM_SDLOG_FUNCTAG = 0x00010000;
|
||||||
final int OEM_QXDM_SDLOG_LEN = 4;
|
static final int OEM_QXDM_SDLOG_LEN = 4;
|
||||||
final int OEM_PS_AUTO_ATTACH_FUNCTAG = 0x00020000;
|
static final int OEM_PS_AUTO_ATTACH_FUNCTAG = 0x00020000;
|
||||||
final int OEM_CIPHERING_FUNCTAG = 0x00020001;
|
static final int OEM_CIPHERING_FUNCTAG = 0x00020001;
|
||||||
final int OEM_SMSC_UPDATE_FUNCTAG = 0x00020002;
|
static final int OEM_SMSC_UPDATE_FUNCTAG = 0x00020002;
|
||||||
final int OEM_SMSC_QUERY_FUNCTAG = 0x00020003;
|
static final int OEM_SMSC_QUERY_FUNCTAG = 0x00020003;
|
||||||
final int OEM_SMSC_QUERY_LEN = 0;
|
static final int OEM_SMSC_QUERY_LEN = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The OEM interface to store QXDM to SD.
|
* The OEM interface to store QXDM to SD.
|
||||||
@@ -990,8 +990,7 @@ public class RadioInfo extends Activity {
|
|||||||
private void displayQxdmEnableResult() {
|
private void displayQxdmEnableResult() {
|
||||||
String status = mQxdmLogEnabled ? "Start QXDM Log" : "Stop QXDM Log";
|
String status = mQxdmLogEnabled ? "Start QXDM Log" : "Stop QXDM Log";
|
||||||
|
|
||||||
DialogInterface mProgressPanel = new AlertDialog.
|
new AlertDialog.Builder(this).setMessage(status).show();
|
||||||
Builder(this).setMessage(status).show();
|
|
||||||
|
|
||||||
mHandler.postDelayed(
|
mHandler.postDelayed(
|
||||||
new Runnable() {
|
new Runnable() {
|
||||||
|
@@ -107,12 +107,6 @@ public class SdCardSettings extends Activity
|
|||||||
} catch (RemoteException ex) {
|
} catch (RemoteException ex) {
|
||||||
}
|
}
|
||||||
|
|
||||||
String scanVolume = null; // this no longer exists: SystemProperties.get(MediaScanner.CURRENT_VOLUME_PROPERTY, "");
|
|
||||||
boolean scanning = "external".equals(scanVolume);
|
|
||||||
|
|
||||||
if (scanning) {
|
|
||||||
setLayout(mScanningLayout);
|
|
||||||
} else {
|
|
||||||
String status = Environment.getExternalStorageState();
|
String status = Environment.getExternalStorageState();
|
||||||
boolean readOnly = false;
|
boolean readOnly = false;
|
||||||
|
|
||||||
@@ -150,7 +144,6 @@ public class SdCardSettings extends Activity
|
|||||||
setLayout(mBadRemovalLayout);
|
setLayout(mBadRemovalLayout);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
private String formatSize(long size) {
|
private String formatSize(long size) {
|
||||||
String suffix = null;
|
String suffix = null;
|
||||||
@@ -212,8 +205,6 @@ public class SdCardSettings extends Activity
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
private int mStatus;
|
|
||||||
private IMountService mMountService;
|
private IMountService mMountService;
|
||||||
|
|
||||||
private CheckBox mMassStorage;
|
private CheckBox mMassStorage;
|
||||||
|
@@ -187,7 +187,7 @@ public class UsageStats extends Activity implements OnItemSelectedListener {
|
|||||||
holder.launchCount.setText(String.valueOf(pkgStats.launchCount));
|
holder.launchCount.setText(String.valueOf(pkgStats.launchCount));
|
||||||
holder.usageTime.setText(String.valueOf(pkgStats.usageTime)+" ms");
|
holder.usageTime.setText(String.valueOf(pkgStats.usageTime)+" ms");
|
||||||
} else {
|
} else {
|
||||||
Log.w(TAG, "No usage stats info for package:"+pkgStats.packageName);
|
Log.w(TAG, "No usage stats info for package:" + position);
|
||||||
}
|
}
|
||||||
return convertView;
|
return convertView;
|
||||||
}
|
}
|
||||||
|
@@ -160,7 +160,7 @@ public class ZoneList extends ListActivity {
|
|||||||
try {
|
try {
|
||||||
XmlResourceParser xrp = getResources().getXml(R.xml.timezones);
|
XmlResourceParser xrp = getResources().getXml(R.xml.timezones);
|
||||||
while (xrp.next() != XmlResourceParser.START_TAG)
|
while (xrp.next() != XmlResourceParser.START_TAG)
|
||||||
;
|
continue;
|
||||||
xrp.next();
|
xrp.next();
|
||||||
while (xrp.getEventType() != XmlResourceParser.END_TAG) {
|
while (xrp.getEventType() != XmlResourceParser.END_TAG) {
|
||||||
while (xrp.getEventType() != XmlResourceParser.START_TAG) {
|
while (xrp.getEventType() != XmlResourceParser.START_TAG) {
|
||||||
|
@@ -82,7 +82,7 @@ public class LocalBluetoothDevice implements Comparable<LocalBluetoothDevice> {
|
|||||||
CONNECT, DISCONNECT,
|
CONNECT, DISCONNECT,
|
||||||
}
|
}
|
||||||
|
|
||||||
class BluetoothJob {
|
static class BluetoothJob {
|
||||||
final BluetoothCommand command; // CONNECT, DISCONNECT
|
final BluetoothCommand command; // CONNECT, DISCONNECT
|
||||||
final LocalBluetoothDevice device;
|
final LocalBluetoothDevice device;
|
||||||
final Profile profile; // HEADSET, A2DP, etc
|
final Profile profile; // HEADSET, A2DP, etc
|
||||||
@@ -349,7 +349,7 @@ public class LocalBluetoothDevice implements Comparable<LocalBluetoothDevice> {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
AlertDialog ad = new AlertDialog.Builder(context)
|
new AlertDialog.Builder(context)
|
||||||
.setTitle(getName())
|
.setTitle(getName())
|
||||||
.setMessage(message)
|
.setMessage(message)
|
||||||
.setPositiveButton(android.R.string.ok, disconnectListener)
|
.setPositiveButton(android.R.string.ok, disconnectListener)
|
||||||
@@ -363,7 +363,6 @@ public class LocalBluetoothDevice implements Comparable<LocalBluetoothDevice> {
|
|||||||
// Reset the only-show-one-error-dialog tracking variable
|
// Reset the only-show-one-error-dialog tracking variable
|
||||||
mIsConnectingErrorPossible = true;
|
mIsConnectingErrorPossible = true;
|
||||||
|
|
||||||
Context context = mLocalManager.getContext();
|
|
||||||
boolean hasAtLeastOnePreferredProfile = false;
|
boolean hasAtLeastOnePreferredProfile = false;
|
||||||
for (Profile profile : mProfiles) {
|
for (Profile profile : mProfiles) {
|
||||||
LocalBluetoothProfileManager profileManager =
|
LocalBluetoothProfileManager profileManager =
|
||||||
@@ -385,7 +384,6 @@ public class LocalBluetoothDevice implements Comparable<LocalBluetoothDevice> {
|
|||||||
// Reset the only-show-one-error-dialog tracking variable
|
// Reset the only-show-one-error-dialog tracking variable
|
||||||
mIsConnectingErrorPossible = true;
|
mIsConnectingErrorPossible = true;
|
||||||
|
|
||||||
Context context = mLocalManager.getContext();
|
|
||||||
for (Profile profile : mProfiles) {
|
for (Profile profile : mProfiles) {
|
||||||
LocalBluetoothProfileManager profileManager =
|
LocalBluetoothProfileManager profileManager =
|
||||||
LocalBluetoothProfileManager.getProfileManager(mLocalManager, profile);
|
LocalBluetoothProfileManager.getProfileManager(mLocalManager, profile);
|
||||||
@@ -480,8 +478,6 @@ public class LocalBluetoothDevice implements Comparable<LocalBluetoothDevice> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void fillData() {
|
private void fillData() {
|
||||||
BluetoothDevice manager = mLocalManager.getBluetoothManager();
|
|
||||||
|
|
||||||
fetchName();
|
fetchName();
|
||||||
fetchBtClass();
|
fetchBtClass();
|
||||||
|
|
||||||
|
@@ -356,7 +356,6 @@ public class Status extends PreferenceActivity {
|
|||||||
void updateTimes() {
|
void updateTimes() {
|
||||||
long at = SystemClock.uptimeMillis() / 1000;
|
long at = SystemClock.uptimeMillis() / 1000;
|
||||||
long ut = SystemClock.elapsedRealtime() / 1000;
|
long ut = SystemClock.elapsedRealtime() / 1000;
|
||||||
long st = ut - at;
|
|
||||||
|
|
||||||
if (ut == 0) {
|
if (ut == 0) {
|
||||||
ut = 1;
|
ut = 1;
|
||||||
|
@@ -223,7 +223,6 @@ public class QuickLaunchSettings extends PreferenceActivity implements
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
String title = data.getStringExtra(BookmarkPicker.EXTRA_TITLE);
|
|
||||||
char shortcut = data.getCharExtra(BookmarkPicker.EXTRA_SHORTCUT, (char) 0);
|
char shortcut = data.getCharExtra(BookmarkPicker.EXTRA_SHORTCUT, (char) 0);
|
||||||
updateShortcut(shortcut, data);
|
updateShortcut(shortcut, data);
|
||||||
|
|
||||||
|
@@ -321,14 +321,14 @@ public class AccessPointDialog extends AlertDialog implements DialogInterface.On
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void updatePasswordCaption(String security) {
|
private void updatePasswordCaption(String security) {
|
||||||
|
if (mPasswordText != null) {
|
||||||
if (mPasswordText != null && security != null
|
if (security != null && security.equals(AccessPointState.WEP)) {
|
||||||
&& security.equals(AccessPointState.WEP)) {
|
|
||||||
mPasswordText.setText(R.string.please_type_hex_key);
|
mPasswordText.setText(R.string.please_type_hex_key);
|
||||||
} else {
|
} else {
|
||||||
mPasswordText.setText(R.string.please_type_passphrase);
|
mPasswordText.setText(R.string.please_type_passphrase);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void addInfoRow(int nameResId, String value) {
|
private void addInfoRow(int nameResId, String value) {
|
||||||
View rowView = getLayoutInflater().inflate(R.layout.wifi_ap_info_row, mTable, false);
|
View rowView = getLayoutInflater().inflate(R.layout.wifi_ap_info_row, mTable, false);
|
||||||
|
@@ -33,14 +33,11 @@ public class AccessPointPreference extends Preference implements
|
|||||||
// Signal strength indicator
|
// Signal strength indicator
|
||||||
private static final int UI_SIGNAL_LEVELS = 4;
|
private static final int UI_SIGNAL_LEVELS = 4;
|
||||||
|
|
||||||
private WifiSettings mWifiSettings;
|
|
||||||
|
|
||||||
private AccessPointState mState;
|
private AccessPointState mState;
|
||||||
|
|
||||||
public AccessPointPreference(WifiSettings wifiSettings, AccessPointState state) {
|
public AccessPointPreference(WifiSettings wifiSettings, AccessPointState state) {
|
||||||
super(wifiSettings, null);
|
super(wifiSettings, null);
|
||||||
|
|
||||||
mWifiSettings = wifiSettings;
|
|
||||||
mState = state;
|
mState = state;
|
||||||
|
|
||||||
setWidgetLayoutResource(R.layout.preference_widget_wifi_signal);
|
setWidgetLayoutResource(R.layout.preference_widget_wifi_signal);
|
||||||
|
@@ -763,7 +763,9 @@ public class WifiLayer {
|
|||||||
* We pass null for security since we have a network ID (i.e., it's
|
* We pass null for security since we have a network ID (i.e., it's
|
||||||
* not a wildcard), and rely on it matching.
|
* not a wildcard), and rely on it matching.
|
||||||
*/
|
*/
|
||||||
|
synchronized (this) {
|
||||||
return findApLocked(wifiInfo.getNetworkId(), wifiInfo.getBSSID(), ssid, null);
|
return findApLocked(wifiInfo.getNetworkId(), wifiInfo.getBSSID(), ssid, null);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -1002,9 +1004,11 @@ public class WifiLayer {
|
|||||||
* We pass null for security since we have a network ID (i.e., it's
|
* We pass null for security since we have a network ID (i.e., it's
|
||||||
* not a wildcard), and rely on it matching.
|
* not a wildcard), and rely on it matching.
|
||||||
*/
|
*/
|
||||||
|
synchronized (this) {
|
||||||
ap = findApLocked(wifiInfo.getNetworkId(), wifiInfo.getBSSID(), wifiInfo
|
ap = findApLocked(wifiInfo.getNetworkId(), wifiInfo.getBSSID(), wifiInfo
|
||||||
.getSSID(), null);
|
.getSSID(), null);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (ap != null) {
|
if (ap != null) {
|
||||||
ap.blockRefresh();
|
ap.blockRefresh();
|
||||||
|
@@ -365,8 +365,8 @@ public class WifiSettings extends PreferenceActivity implements WifiLayer.Callba
|
|||||||
}
|
}
|
||||||
|
|
||||||
mDialog = dialog;
|
mDialog = dialog;
|
||||||
dialog.setOnDismissListener(this);
|
|
||||||
if (dialog != null) {
|
if (dialog != null) {
|
||||||
|
dialog.setOnDismissListener(this);
|
||||||
dialog.show();
|
dialog.show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user