Automated import from //branches/master/...@142436,142436
This commit is contained in:

committed by
The Android Open Source Project
parent
4f7c1f740e
commit
5990cc129c
@@ -68,22 +68,5 @@
|
||||
<TextView android:id="@+id/uptime" style="@style/info_value" />
|
||||
</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>
|
||||
|
||||
|
@@ -87,10 +87,5 @@
|
||||
android:title="@string/status_up_time"
|
||||
android:summary="@string/device_info_not_available"
|
||||
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>
|
||||
|
@@ -43,9 +43,6 @@ public class BatteryInfo extends Activity {
|
||||
private TextView mTemperature;
|
||||
private TextView mTechnology;
|
||||
private TextView mUptime;
|
||||
private TextView mAwakeBattery;
|
||||
private TextView mAwakePlugged;
|
||||
private TextView mScreenOn;
|
||||
private IBatteryStats mBatteryStats;
|
||||
private IPowerManager mScreenStats;
|
||||
|
||||
@@ -58,6 +55,7 @@ public class BatteryInfo extends Activity {
|
||||
case EVENT_TICK:
|
||||
updateBatteryStats();
|
||||
sendEmptyMessageDelayed(EVENT_TICK, 1000);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -157,9 +155,6 @@ public class BatteryInfo extends Activity {
|
||||
mVoltage = (TextView)findViewById(R.id.voltage);
|
||||
mTemperature = (TextView)findViewById(R.id.temperature);
|
||||
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
|
||||
mBatteryStats = IBatteryStats.Stub.asInterface(ServiceManager.getService("batteryinfo"));
|
||||
@@ -182,27 +177,6 @@ public class BatteryInfo extends Activity {
|
||||
long uptime = SystemClock.elapsedRealtime();
|
||||
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 Preference mSignalStrength;
|
||||
private Preference mUptime;
|
||||
private Preference mAwakeTime;
|
||||
|
||||
private static String sUnknown;
|
||||
|
||||
@@ -181,7 +180,6 @@ public class Status extends PreferenceActivity {
|
||||
// Note - missing in zaku build, be careful later...
|
||||
mSignalStrength = findPreference("signal_strength");
|
||||
mUptime = findPreference("up_time");
|
||||
mAwakeTime = findPreference("awake_time");
|
||||
|
||||
setSummaryText("imei", mPhone.getDeviceId());
|
||||
setSummaryText("imei_sv",
|
||||
@@ -363,7 +361,6 @@ public class Status extends PreferenceActivity {
|
||||
}
|
||||
|
||||
mUptime.setSummary(convert(ut));
|
||||
mAwakeTime.setSummary(convert(at) + " (" + (((1000 * at / ut) + 5) / 10) + "%)");
|
||||
}
|
||||
|
||||
private String pad(int n) {
|
||||
|
Reference in New Issue
Block a user