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

Commit 8758d320 authored by Eugene Susla's avatar Eugene Susla
Browse files

Migrate system dialer config to RoleManager

Test: adb logcat | grep Telecomm  - to ensure correct default dialer detected
go to settings-default apps and ensure correct dialer selected in UI
Change-Id: Ib34c07b8259875dfb3c8ea848410436cbeec3796
parent 748dfe2b
Loading
Loading
Loading
Loading
+7 −0
Original line number Original line Diff line number Diff line
@@ -2182,6 +2182,13 @@ public class TextUtils {
        return Character.isWhitespace(codePoint) || codePoint == NBSP_CODE_POINT;
        return Character.isWhitespace(codePoint) || codePoint == NBSP_CODE_POINT;
    }
    }


    /** @hide */
    @Nullable
    public static String withoutPrefix(@Nullable String prefix, @Nullable String str) {
        if (prefix == null || str == null) return str;
        return str.startsWith(prefix) ? str.substring(prefix.length()) : str;
    }

    /**
    /**
     * Remove html, remove bad characters, and truncate string.
     * Remove html, remove bad characters, and truncate string.
     *
     *
+13 −0
Original line number Original line Diff line number Diff line
@@ -690,4 +690,17 @@ public class ArrayUtils {
        }
        }
        return result;
        return result;
    }
    }

    /**
     * Returns the first element from the array for which
     * condition {@code predicate} is true, or null if there is no such element
     */
    public static @Nullable <T> T find(@Nullable T[] items,
            @NonNull java.util.function.Predicate<T> predicate) {
        if (isEmpty(items)) return null;
        for (final T item : items) {
            if (predicate.test(item)) return item;
        }
        return null;
    }
}
}
+1 −0
Original line number Original line Diff line number Diff line
@@ -1936,6 +1936,7 @@
         holders, with each item in the format of "ROLE_NAME: PACKAGE_NAME_1, PACKAGE_NAME_2". -->
         holders, with each item in the format of "ROLE_NAME: PACKAGE_NAME_1, PACKAGE_NAME_2". -->
    <string-array name="config_defaultRoleHolders" translatable="false">
    <string-array name="config_defaultRoleHolders" translatable="false">
        <item>android.app.role.SMS: com.android.messaging</item>
        <item>android.app.role.SMS: com.android.messaging</item>
        <item>android.app.role.DIALER: com.android.phone</item>
    </string-array>
    </string-array>


    <!-- Enable/disable default bluetooth profiles:
    <!-- Enable/disable default bluetooth profiles: