diff options
-rw-r--r-- | debuggerd/debuggerd.cpp | 2 | ||||
-rw-r--r-- | healthd/BatteryMonitor.cpp | 19 | ||||
-rw-r--r-- | healthd/BatteryMonitor.h | 1 | ||||
-rw-r--r-- | init/bootchart.cpp | 2 | ||||
-rw-r--r-- | logd/LogBuffer.cpp | 5 | ||||
-rw-r--r-- | rootdir/init.rc | 24 |
6 files changed, 39 insertions, 14 deletions
diff --git a/debuggerd/debuggerd.cpp b/debuggerd/debuggerd.cpp index e0a864d..984b931 100644 --- a/debuggerd/debuggerd.cpp +++ b/debuggerd/debuggerd.cpp @@ -554,7 +554,7 @@ static int do_server() { return 1; fcntl(s, F_SETFD, FD_CLOEXEC); - ALOGI("debuggerd: " __DATE__ " " __TIME__ "\n"); + ALOGI("debuggerd: starting\n"); for (;;) { sockaddr addr; diff --git a/healthd/BatteryMonitor.cpp b/healthd/BatteryMonitor.cpp index f40bce6..67a8ad0 100644 --- a/healthd/BatteryMonitor.cpp +++ b/healthd/BatteryMonitor.cpp @@ -40,6 +40,7 @@ #define POWER_SUPPLY_SYSFS_PATH "/sys/class/" POWER_SUPPLY_SUBSYSTEM #define FAKE_BATTERY_CAPACITY 42 #define FAKE_BATTERY_TEMPERATURE 424 +#define ALWAYS_PLUGGED_CAPACITY 100 namespace android { @@ -208,6 +209,15 @@ bool BatteryMonitor::update(void) { mBatteryFixedTemperature : getIntField(mHealthdConfig->batteryTemperaturePath); + // For devices which do not have battery and are always plugged + // into power souce. + if (mAlwaysPluggedDevice) { + props.chargerAcOnline = true; + props.batteryPresent = true; + props.batteryStatus = BATTERY_STATUS_CHARGING; + props.batteryHealth = BATTERY_HEALTH_GOOD; + } + const int SIZE = 128; char buf[SIZE]; String8 btech; @@ -822,8 +832,15 @@ void BatteryMonitor::init(struct healthd_config *hc) { closedir(dir); } - if (!mChargerNames.size()) + // This indicates that there is no charger driver registered. + // Typically the case for devices which do not have a battery and + // and are always plugged into AC mains. + if (!mChargerNames.size()) { KLOG_ERROR(LOG_TAG, "No charger supplies found\n"); + mBatteryFixedCapacity = ALWAYS_PLUGGED_CAPACITY; + mBatteryFixedTemperature = FAKE_BATTERY_TEMPERATURE; + mAlwaysPluggedDevice = true; + } if (!mBatteryDevicePresent && !mDockBatteryDevicePresent) { KLOG_WARNING(LOG_TAG, "No battery devices found\n"); hc->periodic_chores_interval_fast = -1; diff --git a/healthd/BatteryMonitor.h b/healthd/BatteryMonitor.h index 6e3ec98..4320348 100644 --- a/healthd/BatteryMonitor.h +++ b/healthd/BatteryMonitor.h @@ -51,6 +51,7 @@ class BatteryMonitor { Vector<String8> mChargerNames; bool mBatteryDevicePresent; bool mDockBatteryDevicePresent; + bool mAlwaysPluggedDevice; int mBatteryFixedCapacity; int mBatteryFixedTemperature; struct BatteryProperties props; diff --git a/init/bootchart.cpp b/init/bootchart.cpp index 95687cb..df8359d 100644 --- a/init/bootchart.cpp +++ b/init/bootchart.cpp @@ -89,7 +89,7 @@ static void log_header() { if (out == NULL) { return; } - fprintf(out, "version = Android init 0.8 " __TIME__ "\n"); + fprintf(out, "version = Android init 0.8\n"); fprintf(out, "title = Boot chart for Android (%s)\n", date); fprintf(out, "system.uname = %s %s %s %s\n", uts.sysname, uts.release, uts.version, uts.machine); fprintf(out, "system.release = %s\n", fingerprint); diff --git a/logd/LogBuffer.cpp b/logd/LogBuffer.cpp index 559fa2e..d72a78c 100644 --- a/logd/LogBuffer.cpp +++ b/logd/LogBuffer.cpp @@ -435,7 +435,10 @@ void LogBuffer::prune(log_id_t id, unsigned long pruneRows, uid_t caller_uid) { worst_sizes = sorted[0]->getSizes(); // Calculate threshold as 12.5% of available storage size_t threshold = log_buffer_size(id) / 8; - if (worst_sizes > threshold) { + if ((worst_sizes > threshold) + // Allow time horizon to extend roughly tenfold, assume + // average entry length is 100 characters. + && (worst_sizes > (10 * sorted[0]->getDropped()))) { worst = sorted[0]->getKey(); second_worst_sizes = sorted[1]->getSizes(); if (second_worst_sizes < threshold) { diff --git a/rootdir/init.rc b/rootdir/init.rc index 4b644bc..5c6b606 100644 --- a/rootdir/init.rc +++ b/rootdir/init.rc @@ -144,23 +144,27 @@ on init # sets up initial cpusets for ActivityManager mkdir /dev/cpuset mount cpuset none /dev/cpuset + + # this ensures that the cpusets are present and usable, but the device's + # init.rc must actually set the correct cpus mkdir /dev/cpuset/foreground + write /dev/cpuset/foreground/cpus 0 + write /dev/cpuset/foreground/mems 0 mkdir /dev/cpuset/foreground/boost + write /dev/cpuset/foreground/boost/cpus 0 + write /dev/cpuset/foreground/boost/mems 0 mkdir /dev/cpuset/background + write /dev/cpuset/background/cpus 0 + write /dev/cpuset/background/mems 0 + # system-background is for system tasks that should only run on # little cores, not on bigs - # to be used only by init, so don't change the permissions + # to be used only by init, so don't change system-bg permissions mkdir /dev/cpuset/system-background - # this ensures that the cpusets are present and usable, but the device's - # init.rc must actually set the correct cpus - write /dev/cpuset/foreground/cpus 0 - write /dev/cpuset/foreground/boost/cpus 0 - write /dev/cpuset/background/cpus 0 write /dev/cpuset/system-background/cpus 0 - write /dev/cpuset/foreground/mems 0 - write /dev/cpuset/foreground/boost/mems 0 - write /dev/cpuset/background/mems 0 write /dev/cpuset/system-background/mems 0 + + # change permissions for all cpusets we'll touch at runtime chown system system /dev/cpuset chown system system /dev/cpuset/foreground chown system system /dev/cpuset/foreground/boost @@ -670,7 +674,7 @@ service defaultcrypto /system/bin/vdc --wait cryptfs mountdefaultencrypted # encryption) or trigger_restart_min_framework (other encryption) # One shot invocation to encrypt unencrypted volumes -service encrypt /system/bin/vdc --wait cryptfs enablecrypto inplace default +service encrypt /system/bin/vdc --wait cryptfs enablecrypto inplace default noui disabled oneshot # vold will set vold.decrypt to trigger_restart_framework (default |