Automated import from //branches/donutburger/...@142431,142431
This commit is contained in:

committed by
The Android Open Source Project
parent
6a5687ebf5
commit
83368552d1
@@ -68,22 +68,5 @@
|
|||||||
<TextView android:id="@+id/uptime" style="@style/info_value" />
|
<TextView android:id="@+id/uptime" style="@style/info_value" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<!-- Awaketime Battery -->
|
|
||||||
<LinearLayout style="@style/entry_layout">
|
|
||||||
<TextView android:text="@string/battery_info_awake_battery" style="@style/info_label" />
|
|
||||||
<TextView android:id="@+id/awakeBattery" style="@style/info_value" />
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<!-- Awaketime Plugged In -->
|
|
||||||
<LinearLayout style="@style/entry_layout">
|
|
||||||
<TextView android:text="@string/battery_info_awake_plugged" style="@style/info_label" />
|
|
||||||
<TextView android:id="@+id/awakePlugged" style="@style/info_value" />
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<!-- Screen On Time -->
|
|
||||||
<LinearLayout style="@style/entry_layout">
|
|
||||||
<TextView android:text="@string/battery_info_screen_on" style="@style/info_label" />
|
|
||||||
<TextView android:id="@+id/screenOn" style="@style/info_value" />
|
|
||||||
</LinearLayout>
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
@@ -87,10 +87,5 @@
|
|||||||
android:title="@string/status_up_time"
|
android:title="@string/status_up_time"
|
||||||
android:summary="@string/device_info_not_available"
|
android:summary="@string/device_info_not_available"
|
||||||
android:persistent="false" />
|
android:persistent="false" />
|
||||||
<Preference android:key="awake_time"
|
|
||||||
style="?android:attr/preferenceInformationStyle"
|
|
||||||
android:title="@string/status_awake_time"
|
|
||||||
android:summary="@string/device_info_not_available"
|
|
||||||
android:persistent="false" />
|
|
||||||
|
|
||||||
</PreferenceScreen>
|
</PreferenceScreen>
|
||||||
|
@@ -43,9 +43,6 @@ public class BatteryInfo extends Activity {
|
|||||||
private TextView mTemperature;
|
private TextView mTemperature;
|
||||||
private TextView mTechnology;
|
private TextView mTechnology;
|
||||||
private TextView mUptime;
|
private TextView mUptime;
|
||||||
private TextView mAwakeBattery;
|
|
||||||
private TextView mAwakePlugged;
|
|
||||||
private TextView mScreenOn;
|
|
||||||
private IBatteryStats mBatteryStats;
|
private IBatteryStats mBatteryStats;
|
||||||
private IPowerManager mScreenStats;
|
private IPowerManager mScreenStats;
|
||||||
|
|
||||||
@@ -58,6 +55,7 @@ public class BatteryInfo extends Activity {
|
|||||||
case EVENT_TICK:
|
case EVENT_TICK:
|
||||||
updateBatteryStats();
|
updateBatteryStats();
|
||||||
sendEmptyMessageDelayed(EVENT_TICK, 1000);
|
sendEmptyMessageDelayed(EVENT_TICK, 1000);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -157,9 +155,6 @@ public class BatteryInfo extends Activity {
|
|||||||
mVoltage = (TextView)findViewById(R.id.voltage);
|
mVoltage = (TextView)findViewById(R.id.voltage);
|
||||||
mTemperature = (TextView)findViewById(R.id.temperature);
|
mTemperature = (TextView)findViewById(R.id.temperature);
|
||||||
mUptime = (TextView) findViewById(R.id.uptime);
|
mUptime = (TextView) findViewById(R.id.uptime);
|
||||||
mAwakeBattery = (TextView) findViewById(R.id.awakeBattery);
|
|
||||||
mAwakePlugged = (TextView) findViewById(R.id.awakePlugged);
|
|
||||||
mScreenOn = (TextView) findViewById(R.id.screenOn);
|
|
||||||
|
|
||||||
// Get awake time plugged in and on battery
|
// Get awake time plugged in and on battery
|
||||||
mBatteryStats = IBatteryStats.Stub.asInterface(ServiceManager.getService("batteryinfo"));
|
mBatteryStats = IBatteryStats.Stub.asInterface(ServiceManager.getService("batteryinfo"));
|
||||||
@@ -182,27 +177,6 @@ public class BatteryInfo extends Activity {
|
|||||||
long uptime = SystemClock.elapsedRealtime();
|
long uptime = SystemClock.elapsedRealtime();
|
||||||
mUptime.setText(DateUtils.formatElapsedTime(uptime / 1000));
|
mUptime.setText(DateUtils.formatElapsedTime(uptime / 1000));
|
||||||
|
|
||||||
if (mBatteryStats != null) {
|
|
||||||
try {
|
|
||||||
long awakeTimeBattery = mBatteryStats.getAwakeTimeBattery() / 1000;
|
|
||||||
long awakeTimePluggedIn = mBatteryStats.getAwakeTimePlugged() / 1000;
|
|
||||||
mAwakeBattery.setText(DateUtils.formatElapsedTime(awakeTimeBattery / 1000)
|
|
||||||
+ " (" + (100 * awakeTimeBattery / uptime) + "%)");
|
|
||||||
mAwakePlugged.setText(DateUtils.formatElapsedTime(awakeTimePluggedIn / 1000)
|
|
||||||
+ " (" + (100 * awakeTimePluggedIn / uptime) + "%)");
|
|
||||||
} catch (RemoteException re) {
|
|
||||||
mAwakeBattery.setText("Unknown");
|
|
||||||
mAwakePlugged.setText("Unknown");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (mScreenStats != null) {
|
|
||||||
try {
|
|
||||||
long screenOnTime = mScreenStats.getScreenOnTime();
|
|
||||||
mScreenOn.setText(DateUtils.formatElapsedTime(screenOnTime / 1000));
|
|
||||||
} catch (RemoteException re) {
|
|
||||||
mScreenOn.setText("Unknown");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -74,7 +74,6 @@ public class Status extends PreferenceActivity {
|
|||||||
private Resources mRes;
|
private Resources mRes;
|
||||||
private Preference mSignalStrength;
|
private Preference mSignalStrength;
|
||||||
private Preference mUptime;
|
private Preference mUptime;
|
||||||
private Preference mAwakeTime;
|
|
||||||
|
|
||||||
private static String sUnknown;
|
private static String sUnknown;
|
||||||
|
|
||||||
@@ -181,7 +180,6 @@ public class Status extends PreferenceActivity {
|
|||||||
// Note - missing in zaku build, be careful later...
|
// Note - missing in zaku build, be careful later...
|
||||||
mSignalStrength = findPreference("signal_strength");
|
mSignalStrength = findPreference("signal_strength");
|
||||||
mUptime = findPreference("up_time");
|
mUptime = findPreference("up_time");
|
||||||
mAwakeTime = findPreference("awake_time");
|
|
||||||
|
|
||||||
setSummaryText("imei", mPhone.getDeviceId());
|
setSummaryText("imei", mPhone.getDeviceId());
|
||||||
setSummaryText("imei_sv",
|
setSummaryText("imei_sv",
|
||||||
@@ -363,7 +361,6 @@ public class Status extends PreferenceActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
mUptime.setSummary(convert(ut));
|
mUptime.setSummary(convert(ut));
|
||||||
mAwakeTime.setSummary(convert(at) + " (" + (((1000 * at / ut) + 5) / 10) + "%)");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private String pad(int n) {
|
private String pad(int n) {
|
||||||
|
Reference in New Issue
Block a user