Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit af6d3a6c authored by Nicolas Geoffray's avatar Nicolas Geoffray
Browse files

Remove old code that isn't relevant anymore.

In order to reduce the CorePlatformAPI surface.

Test: m
Bug: 154796679
Change-Id: I428fe21d764bf6897942d7e67d85297d826d3716
parent ebe415b3
Loading
Loading
Loading
Loading
+3 −22
Original line number Original line Diff line number Diff line
@@ -49,11 +49,8 @@ import com.android.internal.util.DumpUtils;
import com.android.internal.util.IndentingPrintWriter;
import com.android.internal.util.IndentingPrintWriter;
import com.android.server.EventLogTags;
import com.android.server.EventLogTags;
import com.android.server.SystemService;
import com.android.server.SystemService;
import com.android.server.pm.InstructionSets;
import com.android.server.pm.PackageManagerService;
import com.android.server.pm.PackageManagerService;


import dalvik.system.VMRuntime;

import java.io.File;
import java.io.File;
import java.io.FileDescriptor;
import java.io.FileDescriptor;
import java.io.IOException;
import java.io.IOException;
@@ -214,7 +211,7 @@ public class DeviceStorageMonitorService extends SystemService {
                newLevel = State.LEVEL_FULL;
                newLevel = State.LEVEL_FULL;
            } else if (usableBytes <= lowBytes) {
            } else if (usableBytes <= lowBytes) {
                newLevel = State.LEVEL_LOW;
                newLevel = State.LEVEL_LOW;
            } else if (StorageManager.UUID_DEFAULT.equals(uuid) && !isBootImageOnDisk()
            } else if (StorageManager.UUID_DEFAULT.equals(uuid)
                    && usableBytes < BOOT_IMAGE_STORAGE_REQUIREMENT) {
                    && usableBytes < BOOT_IMAGE_STORAGE_REQUIREMENT) {
                newLevel = State.LEVEL_LOW;
                newLevel = State.LEVEL_LOW;
            } else {
            } else {
@@ -261,15 +258,6 @@ public class DeviceStorageMonitorService extends SystemService {
        };
        };
    }
    }


    private static boolean isBootImageOnDisk() {
        for (String instructionSet : InstructionSets.getAllDexCodeInstructionSets()) {
            if (!VMRuntime.isBootClassPathOnDisk(instructionSet)) {
                return false;
            }
        }
        return true;
    }

    @Override
    @Override
    public void onStart() {
    public void onStart() {
        final Context context = getContext();
        final Context context = getContext();
@@ -467,15 +455,8 @@ public class DeviceStorageMonitorService extends SystemService {
            final CharSequence title = context.getText(
            final CharSequence title = context.getText(
                    com.android.internal.R.string.low_internal_storage_view_title);
                    com.android.internal.R.string.low_internal_storage_view_title);


            final CharSequence details;
            final CharSequence details = context.getText(
            if (StorageManager.UUID_DEFAULT.equals(uuid)) {
                details = context.getText(isBootImageOnDisk()
                        ? com.android.internal.R.string.low_internal_storage_view_text
                        : com.android.internal.R.string.low_internal_storage_view_text_no_boot);
            } else {
                details = context.getText(
                    com.android.internal.R.string.low_internal_storage_view_text);
                    com.android.internal.R.string.low_internal_storage_view_text);
            }


            PendingIntent intent = PendingIntent.getActivityAsUser(context, 0, lowMemIntent, 0,
            PendingIntent intent = PendingIntent.getActivityAsUser(context, 0, lowMemIntent, 0,
                    null, UserHandle.CURRENT);
                    null, UserHandle.CURRENT);
+0 −6
Original line number Original line Diff line number Diff line
@@ -555,12 +555,6 @@ public final class SystemServer {
            }
            }
        }
        }


        // Diagnostic to ensure that the system is in a base healthy state. Done here as a common
        // non-zygote process.
        if (!VMRuntime.hasBootImageSpaces()) {
            Slog.wtf(TAG, "Runtime is not running with a boot image!");
        }

        // Loop forever.
        // Loop forever.
        Looper.loop();
        Looper.loop();
        throw new RuntimeException("Main thread loop unexpectedly exited");
        throw new RuntimeException("Main thread loop unexpectedly exited");