summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/com/android/settings/SettingsPreferenceFragment.java7
-rw-r--r--src/com/android/settings/applications/AppOpsState.java27
-rw-r--r--src/com/android/settings/applications/AppOpsSummary.java1
-rw-r--r--src/com/android/settings/fuelgauge/PowerUsageSummary.java16
-rw-r--r--src/com/android/settings/wifi/WifiSettings.java7
5 files changed, 47 insertions, 11 deletions
diff --git a/src/com/android/settings/SettingsPreferenceFragment.java b/src/com/android/settings/SettingsPreferenceFragment.java
index b418826f7..42c0b404a 100644
--- a/src/com/android/settings/SettingsPreferenceFragment.java
+++ b/src/com/android/settings/SettingsPreferenceFragment.java
@@ -233,8 +233,11 @@ public class SettingsPreferenceFragment extends PreferenceFragment implements Di
mParentFragment = getFragmentManager().findFragmentById(mParentFragmentId);
if (!(mParentFragment instanceof DialogCreatable)) {
throw new IllegalArgumentException(
- KEY_PARENT_FRAGMENT_ID + " must implement "
- + DialogCreatable.class.getName());
+ (mParentFragment != null
+ ? mParentFragment.getClass().getName()
+ : mParentFragmentId)
+ + " must implement "
+ + DialogCreatable.class.getName());
}
}
// This dialog fragment could be created from non-SettingsPreferenceFragment
diff --git a/src/com/android/settings/applications/AppOpsState.java b/src/com/android/settings/applications/AppOpsState.java
index 43fa090cd..5e7098a39 100644
--- a/src/com/android/settings/applications/AppOpsState.java
+++ b/src/com/android/settings/applications/AppOpsState.java
@@ -124,17 +124,40 @@ public class AppOpsState {
true }
);
+ public static final OpsTemplate MESSAGING_TEMPLATE = new OpsTemplate(
+ new int[] { AppOpsManager.OP_READ_SMS,
+ AppOpsManager.OP_RECEIVE_SMS,
+ AppOpsManager.OP_RECEIVE_EMERGECY_SMS,
+ AppOpsManager.OP_RECEIVE_MMS,
+ AppOpsManager.OP_RECEIVE_WAP_PUSH,
+ AppOpsManager.OP_WRITE_SMS,
+ AppOpsManager.OP_SEND_SMS,
+ AppOpsManager.OP_READ_ICC_SMS,
+ AppOpsManager.OP_WRITE_ICC_SMS },
+ new boolean[] { true,
+ true,
+ true,
+ true,
+ true,
+ true,
+ true,
+ true,
+ true }
+ );
+
public static final OpsTemplate DEVICE_TEMPLATE = new OpsTemplate(
new int[] { AppOpsManager.OP_VIBRATE,
AppOpsManager.OP_POST_NOTIFICATION,
- AppOpsManager.OP_CALL_PHONE },
+ AppOpsManager.OP_CALL_PHONE,
+ AppOpsManager.OP_WRITE_SETTINGS },
new boolean[] { false,
false,
+ true,
true }
);
public static final OpsTemplate[] ALL_TEMPLATES = new OpsTemplate[] {
- LOCATION_TEMPLATE, PERSONAL_TEMPLATE, DEVICE_TEMPLATE
+ LOCATION_TEMPLATE, PERSONAL_TEMPLATE, MESSAGING_TEMPLATE, DEVICE_TEMPLATE
};
/**
diff --git a/src/com/android/settings/applications/AppOpsSummary.java b/src/com/android/settings/applications/AppOpsSummary.java
index 1e0cd4115..b0d9ad158 100644
--- a/src/com/android/settings/applications/AppOpsSummary.java
+++ b/src/com/android/settings/applications/AppOpsSummary.java
@@ -42,6 +42,7 @@ public class AppOpsSummary extends Fragment {
static AppOpsState.OpsTemplate[] sPageTemplates = new AppOpsState.OpsTemplate[] {
AppOpsState.LOCATION_TEMPLATE,
AppOpsState.PERSONAL_TEMPLATE,
+ AppOpsState.MESSAGING_TEMPLATE,
AppOpsState.DEVICE_TEMPLATE
};
diff --git a/src/com/android/settings/fuelgauge/PowerUsageSummary.java b/src/com/android/settings/fuelgauge/PowerUsageSummary.java
index 128d3a380..8ee896012 100644
--- a/src/com/android/settings/fuelgauge/PowerUsageSummary.java
+++ b/src/com/android/settings/fuelgauge/PowerUsageSummary.java
@@ -22,6 +22,7 @@ import android.content.Intent;
import android.content.IntentFilter;
import android.content.pm.UserInfo;
import android.graphics.drawable.Drawable;
+import android.hardware.Sensor;
import android.hardware.SensorManager;
import android.net.Uri;
import android.os.BatteryStats;
@@ -559,20 +560,23 @@ public class PowerUsageSummary extends PreferenceFragment implements Runnable {
for (Map.Entry<Integer, ? extends BatteryStats.Uid.Sensor> sensorEntry
: sensorStats.entrySet()) {
Uid.Sensor sensor = sensorEntry.getValue();
- int sensorType = sensor.getHandle();
+ int sensorHandle = sensor.getHandle();
BatteryStats.Timer timer = sensor.getSensorTime();
long sensorTime = timer.getTotalTimeLocked(uSecTime, which) / 1000;
double multiplier = 0;
- switch (sensorType) {
+ switch (sensorHandle) {
case Uid.Sensor.GPS:
multiplier = mPowerProfile.getAveragePower(PowerProfile.POWER_GPS_ON);
gpsTime = sensorTime;
break;
default:
- android.hardware.Sensor sensorData =
- sensorManager.getDefaultSensor(sensorType);
- if (sensorData != null) {
- multiplier = sensorData.getPower();
+ List<Sensor> sensorList = sensorManager.getSensorList(
+ android.hardware.Sensor.TYPE_ALL);
+ for (android.hardware.Sensor s : sensorList) {
+ if (s.getHandle() == sensorHandle) {
+ multiplier = s.getPower();
+ break;
+ }
}
}
p = (multiplier * sensorTime) / 1000;
diff --git a/src/com/android/settings/wifi/WifiSettings.java b/src/com/android/settings/wifi/WifiSettings.java
index 60f89b767..82b700000 100644
--- a/src/com/android/settings/wifi/WifiSettings.java
+++ b/src/com/android/settings/wifi/WifiSettings.java
@@ -814,7 +814,12 @@ public class WifiSettings extends SettingsPreferenceFragment
WifiManager.EXTRA_NEW_STATE);
if (!mConnected.get() && SupplicantState.isHandshakeState(state)) {
updateConnectionState(WifiInfo.getDetailedStateOf(state));
- }
+ } else {
+ // During a connect, we may have the supplicant
+ // state change affect the detailed network state.
+ // Make sure a lost connection is updated as well.
+ updateConnectionState(null);
+ }
} else if (WifiManager.NETWORK_STATE_CHANGED_ACTION.equals(action)) {
NetworkInfo info = (NetworkInfo) intent.getParcelableExtra(
WifiManager.EXTRA_NETWORK_INFO);