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

Commit 657c22c2 authored by Harshit Mahajan's avatar Harshit Mahajan Committed by Automerger Merge Worker
Browse files

Merge "Refactoring recovery related code" into main am: c41f52c3 am: aa32ee64

parents 958a6cad aa32ee64
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -151,7 +151,7 @@ public abstract class ExplicitHealthCheckService extends Service {
     */
    @NonNull public abstract List<String> onGetRequestedPackages();

    private final Handler mHandler = new Handler(Looper.getMainLooper(), null, true);
    private final Handler mHandler = Handler.createAsync(Looper.getMainLooper());
    @Nullable private RemoteCallback mCallback;

    @Override
+1 −1
Original line number Diff line number Diff line
@@ -343,7 +343,7 @@ class ExplicitHealthCheckController {
            };

            mContext.bindServiceAsUser(intent, mConnection,
                    Context.BIND_AUTO_CREATE, UserHandle.of(UserHandle.USER_SYSTEM));
                    Context.BIND_AUTO_CREATE, UserHandle.SYSTEM);
            Slog.i(TAG, "Explicit health check service is bound");
        }
    }
+5 −3
Original line number Diff line number Diff line
@@ -514,7 +514,8 @@ public class RescueParty {
        Exception res = null;
        final ContentResolver resolver = context.getContentResolver();
        try {
            Settings.Global.resetToDefaultsAsUser(resolver, null, mode, UserHandle.USER_SYSTEM);
            Settings.Global.resetToDefaultsAsUser(resolver, null, mode,
                UserHandle.SYSTEM.getIdentifier());
        } catch (Exception e) {
            res = new RuntimeException("Failed to reset global settings", e);
        }
@@ -771,12 +772,13 @@ public class RescueParty {
    }

    private static int[] getAllUserIds() {
        int[] userIds = { UserHandle.USER_SYSTEM };
        int systemUserId = UserHandle.SYSTEM.getIdentifier();
        int[] userIds = { systemUserId };
        try {
            for (File file : FileUtils.listFilesOrEmpty(Environment.getDataSystemDeDirectory())) {
                try {
                    final int userId = Integer.parseInt(file.getName());
                    if (userId != UserHandle.USER_SYSTEM) {
                    if (userId != systemUserId) {
                        userIds = ArrayUtils.appendInt(userIds, userId);
                    }
                } catch (NumberFormatException ignored) {