diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000..1ca9b25469 --- /dev/null +++ b/.gitignore @@ -0,0 +1,17 @@ +.gradle +/local.properties +/.idea/caches +/.idea/libraries +/.idea/modules.xml +/.idea/workspace.xml +/.idea/navEditor.xml +/.idea/assetWizardSettings.xml +/.idea/deploymentTargetDropDown.xml +.DS_Store +/build +/captures +.externalNativeBuild +.cxx +keystore.properties +*.keystore +local.properties diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000000..9c342a49f9 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,16 @@ +[submodule "lib/platform_external_libphonenumber"] + path = lib/platform_external_libphonenumber + url = https://github.com/GrapheneOS/platform_external_libphonenumber + branch = main +[submodule "lib/platform_frameworks_ex"] + path = lib/platform_frameworks_ex + url = https://github.com/GrapheneOS/platform_frameworks_ex + branch = main +[submodule "lib/platform_frameworks_opt_vcard"] + path = lib/platform_frameworks_opt_vcard + url = https://github.com/GrapheneOS/platform_frameworks_opt_vcard + branch = main +[submodule "lib/platform_packages_apps_PhoneCommon"] + path = lib/platform_packages_apps_PhoneCommon + url = https://github.com/GrapheneOS/platform_packages_apps_PhoneCommon + branch = main diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000000..26d33521af --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000000..b589d56e9f --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/deploymentTargetSelector.xml b/.idea/deploymentTargetSelector.xml new file mode 100644 index 0000000000..b268ef36cd --- /dev/null +++ b/.idea/deploymentTargetSelector.xml @@ -0,0 +1,10 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml new file mode 100644 index 0000000000..d7b4d00e2d --- /dev/null +++ b/.idea/gradle.xml @@ -0,0 +1,25 @@ + + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000000..cbcb0e4c65 --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,186 @@ + + + + \ No newline at end of file diff --git a/.idea/kotlinc.xml b/.idea/kotlinc.xml new file mode 100644 index 0000000000..c224ad564b --- /dev/null +++ b/.idea/kotlinc.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/migrations.xml b/.idea/migrations.xml new file mode 100644 index 0000000000..f8051a6f97 --- /dev/null +++ b/.idea/migrations.xml @@ -0,0 +1,10 @@ + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000000..3b0be22846 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,10 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml new file mode 100644 index 0000000000..16660f1d80 --- /dev/null +++ b/.idea/runConfigurations.xml @@ -0,0 +1,17 @@ + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000000..77ec63edf2 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 66d5767f14..1fb3ec7480 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -15,13 +15,12 @@ --> + android:minSdkVersion="35" + android:targetSdkVersion="35"/> @@ -67,8 +66,10 @@ @@ -295,12 +296,12 @@ + android:theme="@style/PeopleActivityTheme"/> + android:theme="@style/PeopleActivityTheme"/> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s +' "$PWD" ) || exit + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { + echo "$*" +} >&2 + +die () { + echo + echo "$*" + echo + exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD=$JAVA_HOME/jre/sh/java + else + JAVACMD=$JAVA_HOME/bin/java + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD=java + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + + # Now convert the arguments - kludge to limit ourselves to /bin/sh + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) + fi + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg + done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat new file mode 100644 index 0000000000..9d21a21834 --- /dev/null +++ b/gradlew.bat @@ -0,0 +1,94 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem + +@if "%DEBUG%"=="" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if %ERRORLEVEL% equ 0 goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if %ERRORLEVEL% equ 0 goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/lib/platform_external_libphonenumber b/lib/platform_external_libphonenumber new file mode 160000 index 0000000000..4814ded38b --- /dev/null +++ b/lib/platform_external_libphonenumber @@ -0,0 +1 @@ +Subproject commit 4814ded38ba34c69da1fcb949b9d47640d854c50 diff --git a/lib/platform_frameworks_ex b/lib/platform_frameworks_ex new file mode 160000 index 0000000000..dbacb84fe6 --- /dev/null +++ b/lib/platform_frameworks_ex @@ -0,0 +1 @@ +Subproject commit dbacb84fe6e498775194b6e2cdc3e09d8ce25ab8 diff --git a/lib/platform_frameworks_opt_vcard b/lib/platform_frameworks_opt_vcard new file mode 160000 index 0000000000..274080f626 --- /dev/null +++ b/lib/platform_frameworks_opt_vcard @@ -0,0 +1 @@ +Subproject commit 274080f626ebfee216f926c5a8e2a932cb2b01dd diff --git a/lib/platform_packages_apps_PhoneCommon b/lib/platform_packages_apps_PhoneCommon new file mode 160000 index 0000000000..0f8bb7daab --- /dev/null +++ b/lib/platform_packages_apps_PhoneCommon @@ -0,0 +1 @@ +Subproject commit 0f8bb7daabecebdc56c2114f112ff229b17d19f1 diff --git a/res/drawable-anydpi-v26/ic_add_contact_shortcut.xml b/res/drawable-anydpi-v26/ic_add_contact_shortcut.xml index fbd7a09a9a..3d39d4c3b7 100644 --- a/res/drawable-anydpi-v26/ic_add_contact_shortcut.xml +++ b/res/drawable-anydpi-v26/ic_add_contact_shortcut.xml @@ -14,6 +14,6 @@ limitations under the License. --> - + \ No newline at end of file diff --git a/res/drawable-sw600dp/quantum_launchscreen_contacts.xml b/res/drawable-sw600dp/quantum_launchscreen_contacts.xml index 0272a01c33..7da5bca3fd 100755 --- a/res/drawable-sw600dp/quantum_launchscreen_contacts.xml +++ b/res/drawable-sw600dp/quantum_launchscreen_contacts.xml @@ -16,7 +16,7 @@ - + diff --git a/res/drawable/floating_action_button.xml b/res/drawable/floating_action_button.xml index 796920e204..3d88ffc346 100644 --- a/res/drawable/floating_action_button.xml +++ b/res/drawable/floating_action_button.xml @@ -18,7 +18,7 @@ android:color="@color/contacts_accent_color"> - + \ No newline at end of file diff --git a/res/drawable/ic_add_circle_24dp.xml b/res/drawable/ic_add_circle_24dp.xml index ebaab3498f..22a40d5f87 100644 --- a/res/drawable/ic_add_circle_24dp.xml +++ b/res/drawable/ic_add_circle_24dp.xml @@ -20,7 +20,7 @@ android:width="24dp" android:viewportHeight="192.0" android:viewportWidth="192.0"> - diff --git a/res/drawable/ic_add_contact_shortcut.xml b/res/drawable/ic_add_contact_shortcut.xml index 85a7e61bd7..b995d42e36 100644 --- a/res/drawable/ic_add_contact_shortcut.xml +++ b/res/drawable/ic_add_contact_shortcut.xml @@ -20,7 +20,7 @@ android:width="24dp" android:viewportHeight="192.0" android:viewportWidth="192.0"> - diff --git a/res/drawable/ic_launcher_foreground.xml b/res/drawable/ic_launcher_foreground.xml new file mode 100644 index 0000000000..05c3b3047c --- /dev/null +++ b/res/drawable/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + diff --git a/res/drawable/item_background_material_dark.xml b/res/drawable/item_background_material_dark.xml index 87b1e17471..ebbc6f1668 100644 --- a/res/drawable/item_background_material_dark.xml +++ b/res/drawable/item_background_material_dark.xml @@ -18,6 +18,6 @@ - + \ No newline at end of file diff --git a/res/drawable/quantum_ic_account_circle_vd_theme_24.xml b/res/drawable/quantum_ic_account_circle_vd_theme_24.xml index df2f6e7a63..afadabb9c5 100644 --- a/res/drawable/quantum_ic_account_circle_vd_theme_24.xml +++ b/res/drawable/quantum_ic_account_circle_vd_theme_24.xml @@ -21,6 +21,6 @@ android:viewportHeight="24.0" android:tint="?attr/colorControlNormal"> diff --git a/res/drawable/quantum_ic_add_vd_theme_24.xml b/res/drawable/quantum_ic_add_vd_theme_24.xml index 167dafee63..d2d9d37a8f 100644 --- a/res/drawable/quantum_ic_add_vd_theme_24.xml +++ b/res/drawable/quantum_ic_add_vd_theme_24.xml @@ -21,6 +21,6 @@ android:viewportHeight="24.0" android:tint="?attr/colorControlNormal"> diff --git a/res/drawable/quantum_ic_arrow_back_vd_theme_24.xml b/res/drawable/quantum_ic_arrow_back_vd_theme_24.xml index 174cf12fba..158febd6dc 100644 --- a/res/drawable/quantum_ic_arrow_back_vd_theme_24.xml +++ b/res/drawable/quantum_ic_arrow_back_vd_theme_24.xml @@ -21,6 +21,6 @@ android:viewportHeight="24.0" android:tint="?attr/colorControlNormal"> diff --git a/res/drawable/quantum_ic_arrow_drop_down_vd_theme_24.xml b/res/drawable/quantum_ic_arrow_drop_down_vd_theme_24.xml index 87c39de0b6..f3b75b1e97 100644 --- a/res/drawable/quantum_ic_arrow_drop_down_vd_theme_24.xml +++ b/res/drawable/quantum_ic_arrow_drop_down_vd_theme_24.xml @@ -21,6 +21,6 @@ android:viewportHeight="24.0" android:tint="?attr/colorControlNormal"> diff --git a/res/drawable/quantum_ic_assistant_vd_theme_24.xml b/res/drawable/quantum_ic_assistant_vd_theme_24.xml index 2d5135bda9..3f45f6877c 100644 --- a/res/drawable/quantum_ic_assistant_vd_theme_24.xml +++ b/res/drawable/quantum_ic_assistant_vd_theme_24.xml @@ -21,6 +21,6 @@ android:viewportHeight="24.0" android:tint="?attr/colorControlNormal"> diff --git a/res/drawable/quantum_ic_business_vd_theme_24.xml b/res/drawable/quantum_ic_business_vd_theme_24.xml index 684265b4f4..f58a9dfce8 100644 --- a/res/drawable/quantum_ic_business_vd_theme_24.xml +++ b/res/drawable/quantum_ic_business_vd_theme_24.xml @@ -21,6 +21,6 @@ android:viewportHeight="24.0" android:tint="?attr/colorControlNormal"> \ No newline at end of file diff --git a/res/drawable/quantum_ic_call_received_vd_theme_24.xml b/res/drawable/quantum_ic_call_received_vd_theme_24.xml index 3793f74b73..b74b63ce8b 100644 --- a/res/drawable/quantum_ic_call_received_vd_theme_24.xml +++ b/res/drawable/quantum_ic_call_received_vd_theme_24.xml @@ -21,6 +21,6 @@ android:viewportHeight="24.0" android:tint="?attr/colorControlNormal"> \ No newline at end of file diff --git a/res/drawable/quantum_ic_camera_alt_vd_theme_24.xml b/res/drawable/quantum_ic_camera_alt_vd_theme_24.xml index 07ed76be11..49a16e74bb 100644 --- a/res/drawable/quantum_ic_camera_alt_vd_theme_24.xml +++ b/res/drawable/quantum_ic_camera_alt_vd_theme_24.xml @@ -21,9 +21,9 @@ android:viewportHeight="24.0" android:tint="?attr/colorControlNormal"> diff --git a/res/drawable/quantum_ic_cancel_vd_theme_24.xml b/res/drawable/quantum_ic_cancel_vd_theme_24.xml index 409ba75eb2..59acf99ce0 100644 --- a/res/drawable/quantum_ic_cancel_vd_theme_24.xml +++ b/res/drawable/quantum_ic_cancel_vd_theme_24.xml @@ -21,6 +21,6 @@ android:viewportHeight="24.0" android:tint="?attr/colorControlNormal"> diff --git a/res/drawable/quantum_ic_circles_ext_vd_theme_24.xml b/res/drawable/quantum_ic_circles_ext_vd_theme_24.xml index 73baff2682..527b636d9d 100644 --- a/res/drawable/quantum_ic_circles_ext_vd_theme_24.xml +++ b/res/drawable/quantum_ic_circles_ext_vd_theme_24.xml @@ -21,6 +21,6 @@ android:viewportHeight="24.0" android:tint="?attr/colorControlNormal"> diff --git a/res/drawable/quantum_ic_close_vd_theme_24.xml b/res/drawable/quantum_ic_close_vd_theme_24.xml index 0aafe4b5a1..f677bdfc06 100644 --- a/res/drawable/quantum_ic_close_vd_theme_24.xml +++ b/res/drawable/quantum_ic_close_vd_theme_24.xml @@ -21,6 +21,6 @@ android:viewportHeight="24.0" android:tint="?attr/colorControlNormal"> diff --git a/res/drawable/quantum_ic_content_copy_vd_theme_24.xml b/res/drawable/quantum_ic_content_copy_vd_theme_24.xml index b43eb4aada..754d2307c1 100644 --- a/res/drawable/quantum_ic_content_copy_vd_theme_24.xml +++ b/res/drawable/quantum_ic_content_copy_vd_theme_24.xml @@ -21,6 +21,6 @@ android:viewportHeight="24.0" android:tint="?attr/colorControlNormal"> diff --git a/res/drawable/quantum_ic_create_vd_theme_24.xml b/res/drawable/quantum_ic_create_vd_theme_24.xml index 8f161bc438..e35194688c 100644 --- a/res/drawable/quantum_ic_create_vd_theme_24.xml +++ b/res/drawable/quantum_ic_create_vd_theme_24.xml @@ -21,6 +21,6 @@ android:viewportHeight="24.0" android:tint="?attr/colorControlNormal"> diff --git a/res/drawable/quantum_ic_delete_vd_theme_24.xml b/res/drawable/quantum_ic_delete_vd_theme_24.xml index 698a0bcfed..0a5742721a 100644 --- a/res/drawable/quantum_ic_delete_vd_theme_24.xml +++ b/res/drawable/quantum_ic_delete_vd_theme_24.xml @@ -21,6 +21,6 @@ android:viewportHeight="24.0" android:tint="?attr/colorControlNormal"> diff --git a/res/drawable/quantum_ic_dialer_sip_vd_theme_24.xml b/res/drawable/quantum_ic_dialer_sip_vd_theme_24.xml index 6ef33dbd0d..094721c81c 100644 --- a/res/drawable/quantum_ic_dialer_sip_vd_theme_24.xml +++ b/res/drawable/quantum_ic_dialer_sip_vd_theme_24.xml @@ -21,6 +21,6 @@ android:viewportHeight="24.0" android:tint="?attr/colorControlNormal"> diff --git a/res/drawable/quantum_ic_directions_vd_theme_24.xml b/res/drawable/quantum_ic_directions_vd_theme_24.xml index 7da99e052f..9a02be6bf3 100644 --- a/res/drawable/quantum_ic_directions_vd_theme_24.xml +++ b/res/drawable/quantum_ic_directions_vd_theme_24.xml @@ -21,6 +21,6 @@ android:viewportHeight="24.0" android:tint="?attr/colorControlNormal"> \ No newline at end of file diff --git a/res/drawable/quantum_ic_done_vd_theme_24.xml b/res/drawable/quantum_ic_done_vd_theme_24.xml index 0c810e80e4..51918f96cc 100644 --- a/res/drawable/quantum_ic_done_vd_theme_24.xml +++ b/res/drawable/quantum_ic_done_vd_theme_24.xml @@ -21,6 +21,6 @@ android:viewportHeight="24.0" android:tint="?attr/colorControlNormal"> diff --git a/res/drawable/quantum_ic_email_vd_theme_24.xml b/res/drawable/quantum_ic_email_vd_theme_24.xml index 724f45a770..7b3f6a39eb 100644 --- a/res/drawable/quantum_ic_email_vd_theme_24.xml +++ b/res/drawable/quantum_ic_email_vd_theme_24.xml @@ -21,6 +21,6 @@ android:viewportHeight="24.0" android:tint="?attr/colorControlNormal"> diff --git a/res/drawable/quantum_ic_error_vd_theme_24.xml b/res/drawable/quantum_ic_error_vd_theme_24.xml index b9dbeb41db..8715a1f7fc 100644 --- a/res/drawable/quantum_ic_error_vd_theme_24.xml +++ b/res/drawable/quantum_ic_error_vd_theme_24.xml @@ -21,6 +21,6 @@ android:viewportHeight="24.0" android:tint="?attr/colorControlNormal"> diff --git a/res/drawable/quantum_ic_event_vd_theme_24.xml b/res/drawable/quantum_ic_event_vd_theme_24.xml index e0107b1231..880b6c19e8 100644 --- a/res/drawable/quantum_ic_event_vd_theme_24.xml +++ b/res/drawable/quantum_ic_event_vd_theme_24.xml @@ -21,6 +21,6 @@ android:viewportHeight="24.0" android:tint="?attr/colorControlNormal"> diff --git a/res/drawable/quantum_ic_expand_less_vd_theme_24.xml b/res/drawable/quantum_ic_expand_less_vd_theme_24.xml index 2f60a68c04..df768ca301 100644 --- a/res/drawable/quantum_ic_expand_less_vd_theme_24.xml +++ b/res/drawable/quantum_ic_expand_less_vd_theme_24.xml @@ -21,6 +21,6 @@ android:viewportHeight="24.0" android:tint="?attr/colorControlNormal"> diff --git a/res/drawable/quantum_ic_expand_more_vd_theme_24.xml b/res/drawable/quantum_ic_expand_more_vd_theme_24.xml index 9fbfe48ec3..9ef3c337c7 100644 --- a/res/drawable/quantum_ic_expand_more_vd_theme_24.xml +++ b/res/drawable/quantum_ic_expand_more_vd_theme_24.xml @@ -21,6 +21,6 @@ android:viewportHeight="24.0" android:tint="?attr/colorControlNormal"> diff --git a/res/drawable/quantum_ic_hangout_vd_theme_24.xml b/res/drawable/quantum_ic_hangout_vd_theme_24.xml index ab07ba8fd0..83c94da19f 100644 --- a/res/drawable/quantum_ic_hangout_vd_theme_24.xml +++ b/res/drawable/quantum_ic_hangout_vd_theme_24.xml @@ -21,6 +21,6 @@ android:viewportHeight="24.0" android:tint="?attr/colorControlNormal"> diff --git a/res/drawable/quantum_ic_hangout_video_vd_theme_24.xml b/res/drawable/quantum_ic_hangout_video_vd_theme_24.xml index 1ce818a97d..38359c81f6 100644 --- a/res/drawable/quantum_ic_hangout_video_vd_theme_24.xml +++ b/res/drawable/quantum_ic_hangout_video_vd_theme_24.xml @@ -21,6 +21,6 @@ android:viewportHeight="24.0" android:tint="?attr/colorControlNormal"> diff --git a/res/drawable/quantum_ic_help_vd_theme_24.xml b/res/drawable/quantum_ic_help_vd_theme_24.xml index 385d7204c9..a3113c6aa8 100644 --- a/res/drawable/quantum_ic_help_vd_theme_24.xml +++ b/res/drawable/quantum_ic_help_vd_theme_24.xml @@ -21,6 +21,6 @@ android:viewportHeight="24.0" android:tint="?attr/colorControlNormal"> diff --git a/res/drawable/quantum_ic_history_vd_theme_24.xml b/res/drawable/quantum_ic_history_vd_theme_24.xml index 51621fd908..6ab16a34fb 100644 --- a/res/drawable/quantum_ic_history_vd_theme_24.xml +++ b/res/drawable/quantum_ic_history_vd_theme_24.xml @@ -21,6 +21,6 @@ android:viewportHeight="24.0" android:tint="?attr/colorControlNormal"> diff --git a/res/drawable/quantum_ic_insert_comment_vd_theme_24.xml b/res/drawable/quantum_ic_insert_comment_vd_theme_24.xml index 247cb1bead..acce87077d 100644 --- a/res/drawable/quantum_ic_insert_comment_vd_theme_24.xml +++ b/res/drawable/quantum_ic_insert_comment_vd_theme_24.xml @@ -21,6 +21,6 @@ android:viewportHeight="24.0" android:tint="?attr/colorControlNormal"> diff --git a/res/drawable/quantum_ic_label_vd_theme_24.xml b/res/drawable/quantum_ic_label_vd_theme_24.xml index 5630805057..bdad914e07 100644 --- a/res/drawable/quantum_ic_label_vd_theme_24.xml +++ b/res/drawable/quantum_ic_label_vd_theme_24.xml @@ -21,6 +21,6 @@ android:viewportHeight="24.0" android:tint="?attr/colorControlNormal"> diff --git a/res/drawable/quantum_ic_link_vd_theme_24.xml b/res/drawable/quantum_ic_link_vd_theme_24.xml index 67a167ebab..6a2cf120d8 100644 --- a/res/drawable/quantum_ic_link_vd_theme_24.xml +++ b/res/drawable/quantum_ic_link_vd_theme_24.xml @@ -21,6 +21,6 @@ android:viewportHeight="24.0" android:tint="?attr/colorControlNormal"> diff --git a/res/drawable/quantum_ic_menu_vd_theme_24.xml b/res/drawable/quantum_ic_menu_vd_theme_24.xml index ba6adcbc42..5d9f8645cc 100644 --- a/res/drawable/quantum_ic_menu_vd_theme_24.xml +++ b/res/drawable/quantum_ic_menu_vd_theme_24.xml @@ -21,6 +21,6 @@ android:viewportHeight="24.0" android:tint="?attr/colorControlNormal"> diff --git a/res/drawable/quantum_ic_message_vd_theme_24.xml b/res/drawable/quantum_ic_message_vd_theme_24.xml index a06a1da6ef..5ed19af5ef 100644 --- a/res/drawable/quantum_ic_message_vd_theme_24.xml +++ b/res/drawable/quantum_ic_message_vd_theme_24.xml @@ -21,6 +21,6 @@ android:viewportHeight="24.0" android:tint="?attr/colorControlNormal"> diff --git a/res/drawable/quantum_ic_mic_vd_theme_24.xml b/res/drawable/quantum_ic_mic_vd_theme_24.xml index ea4bef41bd..0cc9ad8fb4 100644 --- a/res/drawable/quantum_ic_mic_vd_theme_24.xml +++ b/res/drawable/quantum_ic_mic_vd_theme_24.xml @@ -21,6 +21,6 @@ android:viewportHeight="24.0" android:tint="?attr/colorControlNormal"> diff --git a/res/drawable/quantum_ic_more_vert_vd_theme_24.xml b/res/drawable/quantum_ic_more_vert_vd_theme_24.xml index 442451fe1c..638f50aae9 100644 --- a/res/drawable/quantum_ic_more_vert_vd_theme_24.xml +++ b/res/drawable/quantum_ic_more_vert_vd_theme_24.xml @@ -21,6 +21,6 @@ android:viewportHeight="24.0" android:tint="?attr/colorControlNormal"> diff --git a/res/drawable/quantum_ic_perm_phone_msg_vd_theme_24.xml b/res/drawable/quantum_ic_perm_phone_msg_vd_theme_24.xml index d7e0fb430c..b6dcab5019 100644 --- a/res/drawable/quantum_ic_perm_phone_msg_vd_theme_24.xml +++ b/res/drawable/quantum_ic_perm_phone_msg_vd_theme_24.xml @@ -21,6 +21,6 @@ android:viewportHeight="24.0" android:tint="?attr/colorControlNormal"> diff --git a/res/drawable/quantum_ic_person_add_vd_theme_24.xml b/res/drawable/quantum_ic_person_add_vd_theme_24.xml index 48a017f334..1ae6abb0a0 100644 --- a/res/drawable/quantum_ic_person_add_vd_theme_24.xml +++ b/res/drawable/quantum_ic_person_add_vd_theme_24.xml @@ -21,6 +21,6 @@ android:viewportHeight="24.0" android:tint="?attr/colorControlNormal"> diff --git a/res/drawable/quantum_ic_person_vd_theme_24.xml b/res/drawable/quantum_ic_person_vd_theme_24.xml index a5d9c8c063..2674d25725 100644 --- a/res/drawable/quantum_ic_person_vd_theme_24.xml +++ b/res/drawable/quantum_ic_person_vd_theme_24.xml @@ -21,6 +21,6 @@ android:viewportHeight="24.0" android:tint="?attr/colorControlNormal"> diff --git a/res/drawable/quantum_ic_phone_vd_theme_24.xml b/res/drawable/quantum_ic_phone_vd_theme_24.xml index 8d37e2bfed..e60f4ab035 100644 --- a/res/drawable/quantum_ic_phone_vd_theme_24.xml +++ b/res/drawable/quantum_ic_phone_vd_theme_24.xml @@ -21,6 +21,6 @@ android:viewportHeight="24.0" android:tint="?attr/colorControlNormal"> diff --git a/res/drawable/quantum_ic_place_vd_theme_24.xml b/res/drawable/quantum_ic_place_vd_theme_24.xml index 4276861aa7..ad5f075259 100644 --- a/res/drawable/quantum_ic_place_vd_theme_24.xml +++ b/res/drawable/quantum_ic_place_vd_theme_24.xml @@ -21,6 +21,6 @@ android:viewportHeight="24.0" android:tint="?attr/colorControlNormal"> diff --git a/res/drawable/quantum_ic_public_vd_theme_24.xml b/res/drawable/quantum_ic_public_vd_theme_24.xml index 6dffe5ce23..972f994cf0 100644 --- a/res/drawable/quantum_ic_public_vd_theme_24.xml +++ b/res/drawable/quantum_ic_public_vd_theme_24.xml @@ -21,6 +21,6 @@ android:viewportHeight="24.0" android:tint="?attr/colorControlNormal"> diff --git a/res/drawable/quantum_ic_search_vd_theme_24.xml b/res/drawable/quantum_ic_search_vd_theme_24.xml index 5c5632a84b..97a63c2e25 100644 --- a/res/drawable/quantum_ic_search_vd_theme_24.xml +++ b/res/drawable/quantum_ic_search_vd_theme_24.xml @@ -21,6 +21,6 @@ android:viewportHeight="24.0" android:tint="?attr/colorControlNormal"> diff --git a/res/drawable/quantum_ic_settings_vd_theme_24.xml b/res/drawable/quantum_ic_settings_vd_theme_24.xml index 1867c79553..032d2e34f8 100644 --- a/res/drawable/quantum_ic_settings_vd_theme_24.xml +++ b/res/drawable/quantum_ic_settings_vd_theme_24.xml @@ -21,6 +21,6 @@ android:viewportHeight="24.0" android:tint="?attr/colorControlNormal"> diff --git a/res/drawable/quantum_ic_share_vd_theme_24.xml b/res/drawable/quantum_ic_share_vd_theme_24.xml index f024a22efd..f07bcf3e12 100644 --- a/res/drawable/quantum_ic_share_vd_theme_24.xml +++ b/res/drawable/quantum_ic_share_vd_theme_24.xml @@ -21,6 +21,6 @@ android:viewportHeight="24.0" android:tint="?attr/colorControlNormal"> diff --git a/res/drawable/quantum_ic_sim_card_vd_theme_24.xml b/res/drawable/quantum_ic_sim_card_vd_theme_24.xml index 2bc9387f6a..b4d0dffa18 100644 --- a/res/drawable/quantum_ic_sim_card_vd_theme_24.xml +++ b/res/drawable/quantum_ic_sim_card_vd_theme_24.xml @@ -21,6 +21,6 @@ android:viewportHeight="24.0" android:tint="?attr/colorControlNormal"> diff --git a/res/drawable/quantum_ic_smartphone_vd_theme_24.xml b/res/drawable/quantum_ic_smartphone_vd_theme_24.xml index 9f987e75cb..dd89af92c4 100644 --- a/res/drawable/quantum_ic_smartphone_vd_theme_24.xml +++ b/res/drawable/quantum_ic_smartphone_vd_theme_24.xml @@ -21,6 +21,6 @@ android:viewportHeight="24.0" android:tint="?attr/colorControlNormal"> diff --git a/res/drawable/quantum_ic_star_border_vd_theme_24.xml b/res/drawable/quantum_ic_star_border_vd_theme_24.xml index e266072cde..cb8dd01403 100644 --- a/res/drawable/quantum_ic_star_border_vd_theme_24.xml +++ b/res/drawable/quantum_ic_star_border_vd_theme_24.xml @@ -21,6 +21,6 @@ android:viewportHeight="24.0" android:tint="?attr/colorControlNormal"> diff --git a/res/drawable/quantum_ic_star_vd_theme_24.xml b/res/drawable/quantum_ic_star_vd_theme_24.xml index f5a93c6f03..be5f05802d 100644 --- a/res/drawable/quantum_ic_star_vd_theme_24.xml +++ b/res/drawable/quantum_ic_star_vd_theme_24.xml @@ -21,6 +21,6 @@ android:viewportHeight="24.0" android:tint="?attr/colorControlNormal"> diff --git a/res/drawable/quantum_ic_videocam_vd_theme_24.xml b/res/drawable/quantum_ic_videocam_vd_theme_24.xml index 87408576b6..09969480f4 100644 --- a/res/drawable/quantum_ic_videocam_vd_theme_24.xml +++ b/res/drawable/quantum_ic_videocam_vd_theme_24.xml @@ -21,6 +21,6 @@ android:viewportHeight="24.0" android:tint="?attr/colorControlNormal"> diff --git a/res/drawable/quantum_launchscreen_contacts.xml b/res/drawable/quantum_launchscreen_contacts.xml index 276b2da337..b64cfa81fb 100755 --- a/res/drawable/quantum_launchscreen_contacts.xml +++ b/res/drawable/quantum_launchscreen_contacts.xml @@ -16,7 +16,7 @@ - + diff --git a/res/drawable/ripple_background.xml b/res/drawable/ripple_background.xml index 574dff1c4f..6e6d58b41b 100644 --- a/res/drawable/ripple_background.xml +++ b/res/drawable/ripple_background.xml @@ -16,4 +16,4 @@ --> \ No newline at end of file + android:color="?attr/colorControlHighlight" /> \ No newline at end of file diff --git a/res/drawable/searchedittext_custom_cursor.xml b/res/drawable/searchedittext_custom_cursor.xml index 473b94c6f5..0f56a2b061 100644 --- a/res/drawable/searchedittext_custom_cursor.xml +++ b/res/drawable/searchedittext_custom_cursor.xml @@ -16,5 +16,5 @@ - + \ No newline at end of file diff --git a/res/layout/contact_list_content.xml b/res/layout/contact_list_content.xml index 901e04c661..5694f89761 100644 --- a/res/layout/contact_list_content.xml +++ b/res/layout/contact_list_content.xml @@ -45,7 +45,6 @@ android:paddingTop="16dp" android:paddingBottom="16dp" android:layout_weight="1" - android:textColor="@android:color/black" android:textSize="16sp"/> \ No newline at end of file diff --git a/res/layout/edit_delete_button.xml b/res/layout/edit_delete_button.xml index 2eea95057b..4f80eb4a63 100644 --- a/res/layout/edit_delete_button.xml +++ b/res/layout/edit_delete_button.xml @@ -30,7 +30,7 @@ android:duplicateParentState="true" android:background="?android:attr/selectableItemBackground" android:src="@drawable/quantum_ic_close_vd_theme_24" - android:tint="@color/quantum_black_hint_text" + android:tint="@color/hint_text_color" android:paddingLeft="@dimen/editor_round_button_padding_left" android:paddingRight="@dimen/editor_round_button_padding_right" android:paddingStart="@dimen/editor_round_button_padding_left" diff --git a/res/layout/editor_account_header.xml b/res/layout/editor_account_header.xml index 9a4ed803b4..db2a29150f 100644 --- a/res/layout/editor_account_header.xml +++ b/res/layout/editor_account_header.xml @@ -67,7 +67,7 @@ - > + \ No newline at end of file diff --git a/res/layout/raw_contact_list_item.xml b/res/layout/raw_contact_list_item.xml index 70bf3941a7..981ae9cf77 100644 --- a/res/layout/raw_contact_list_item.xml +++ b/res/layout/raw_contact_list_item.xml @@ -41,7 +41,7 @@ @@ -63,7 +63,7 @@ diff --git a/res/layout/selection_bar.xml b/res/layout/selection_bar.xml index 272a2fcf9d..c4b2b103c0 100644 --- a/res/layout/selection_bar.xml +++ b/res/layout/selection_bar.xml @@ -25,7 +25,7 @@ android:layout_width="@dimen/selection_bar_close_icon_size" android:layout_height="@dimen/selection_bar_close_icon_size" android:layout_gravity="center_vertical|start" - android:tint="@color/quantum_black_secondary_text" + android:tint="@color/text_color_secondary" android:background="?attr/selectableItemBackgroundBorderless" android:contentDescription="@string/action_menu_back_from_edit_select" android:src="@drawable/quantum_ic_close_vd_theme_24"/> diff --git a/res/menu/quickcontact.xml b/res/menu/quickcontact.xml index 7d87708b4b..39e1574fee 100644 --- a/res/menu/quickcontact.xml +++ b/res/menu/quickcontact.xml @@ -19,10 +19,12 @@ + + + + + diff --git a/res/mipmap-anydpi/ic_launcher_round.xml b/res/mipmap-anydpi/ic_launcher_round.xml new file mode 100644 index 0000000000..5c84730caa --- /dev/null +++ b/res/mipmap-anydpi/ic_launcher_round.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/res/values-en-rAU/strings.xml b/res/values-en-rAU/strings.xml index e4d3500f18..0a38c53f72 100644 --- a/res/values-en-rAU/strings.xml +++ b/res/values-en-rAU/strings.xml @@ -176,7 +176,7 @@ "Remove contacts" "My local profile" "My %1$s profile" - "Take a moment to add an account that will back up your contacts to Google." + "Take a moment to add an account that will back up your contacts." "New contacts will be saved to %1$s." "Choose a default account for new contacts:" "Create new contact" diff --git a/res/values-en-rGB/strings.xml b/res/values-en-rGB/strings.xml index e4d3500f18..0a38c53f72 100644 --- a/res/values-en-rGB/strings.xml +++ b/res/values-en-rGB/strings.xml @@ -176,7 +176,7 @@ "Remove contacts" "My local profile" "My %1$s profile" - "Take a moment to add an account that will back up your contacts to Google." + "Take a moment to add an account that will back up your contacts." "New contacts will be saved to %1$s." "Choose a default account for new contacts:" "Create new contact" diff --git a/res/values-en-rIN/strings.xml b/res/values-en-rIN/strings.xml index e4d3500f18..0a38c53f72 100644 --- a/res/values-en-rIN/strings.xml +++ b/res/values-en-rIN/strings.xml @@ -176,7 +176,7 @@ "Remove contacts" "My local profile" "My %1$s profile" - "Take a moment to add an account that will back up your contacts to Google." + "Take a moment to add an account that will back up your contacts." "New contacts will be saved to %1$s." "Choose a default account for new contacts:" "Create new contact" diff --git a/res/values-night/colors.xml b/res/values-night/colors.xml new file mode 100644 index 0000000000..c1e423a7e4 --- /dev/null +++ b/res/values-night/colors.xml @@ -0,0 +1,226 @@ + + + + #191919 + #DDFFFFFF + #D9FFFFFF + #61FFFFFF + + #B4B4B4 + #D6D6D6 + + #CC2A56C6 + + #99FFFFFF + + @color/primary_color + + #060606 + + #5B5B5B + + #265AB6 + #3872D7 + + #546E7A + #607D8B + + + #525252 + + + @android:color/white + + + #000000 + + + #252323 + + #2aad6f + #ff2e58 + + + @color/background_primary + + + #BEBDBD + + + #E0B0AEAE + + + #40CBCBCB + + + #26C1C1C1 + + + #4DC6C6C6 + + + #343434 + + + #0f9d58 + #dd4b37 + #4285f4 + #f4b400 + + + #CBCACA + + @color/dialtacts_secondary_text_color + + + #C9C9C9 + + + #393838 + + + #D5D5D5 + + + #C8C8C8 + + #7FFFFFFF + + #060606 + #FFF + + + + #DB4437 + #E91E63 + #9C27B0 + #673AB7 + #3F51B5 + #4285F4 + #039BE5 + #0097A7 + #009688 + #0F9D58 + #689F38 + #EF6C00 + #FF5722 + #757575 + + + + + #C53929 + #C2185B + #7B1FA2 + #512DA8 + #303F9F + #3367D6 + #0277BD + #006064 + #00796B + #0B8043 + #33691E + #E65100 + #E64A19 + #424242 + + + + #607D8B + + #455A64 + + + #4B4B4B + + #000000 + + + @color/actionbar_background_color + + + #8CFFFFFF + + #DFFFFFFF + + #C8C7C7 + + + #FFFFFF + + #000000 + + #66FFFFFF + + + #181717 + #2C2C2C + + + #d1041c + + + #FFFFFF + + + #414141 + + + #8000C853 + + + #000000 + @color/searchbox_hint_text_color + + + #000000 + + #9C9C9C + + + @color/actionbar_text_color_black + #444444 + + + #EAEAEA + + + #7f7f7f + + + #585858 + + + #252424 + + + #181717 + + + #1F1F1F + + @android:color/black + @color/background_primary + diff --git a/res/values/colors.xml b/res/values/colors.xml index aeba877162..ece7f69df4 100644 --- a/res/values/colors.xml +++ b/res/values/colors.xml @@ -14,16 +14,10 @@ limitations under the License. --> - #F5F5F5 - - - #dd000000 - - - #89000000 - - - #61000000 + #F5F5F5 + #dd000000 + #89000000 + #61000000 #737373 #202020 @@ -73,7 +67,7 @@ #7f7f7f - #40000000 + #A0000000 #40000000 @@ -93,23 +87,17 @@ #4285f4 #f4b400 - - #a0ffffff - #363636 @color/dialtacts_secondary_text_color - @color/dialtacts_theme_color + @color/primary_color #363636 - - #2a56c6 - #DDDDDD @@ -202,7 +190,7 @@ #66000000 - @color/dialtacts_theme_color + @color/primary_color #f9f9f9 @@ -253,7 +241,7 @@ #E8E8E8 - - #1A000000 - + @android:color/white + @android:color/white + @android:color/transparent diff --git a/res/values/ic_launcher_background.xml b/res/values/ic_launcher_background.xml new file mode 100644 index 0000000000..f42ada656e --- /dev/null +++ b/res/values/ic_launcher_background.xml @@ -0,0 +1,4 @@ + + + #FFFFFF + diff --git a/res/values/strings.xml b/res/values/strings.xml index fc24b1089e..0890232806 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -549,7 +549,7 @@ My %1$s profile - Take a minute to add an account that will back up your contacts to Google. + Take a minute to add an account that will back up your contacts. New contacts will be saved to %1$s. @@ -1555,4 +1555,6 @@ Carrier service numbers + Select + \ No newline at end of file diff --git a/res/values/styles.xml b/res/values/styles.xml index ffd800fc1e..6543f9237f 100644 --- a/res/values/styles.xml +++ b/res/values/styles.xml @@ -22,7 +22,7 @@ true - - - - - - - @@ -386,7 +343,7 @@ @@ -451,13 +408,13 @@ background and text color. See also android:style/Widget.Holo.TextView.ListSepar #737373 - - @@ -467,7 +424,7 @@ background and text color. See also android:style/Widget.Holo.TextView.ListSepar match_parent - - @@ -581,7 +540,7 @@ background and text color. See also android:style/Widget.Holo.TextView.ListSepar center_vertical|start 12dp 12dp - @color/quantum_black_secondary_text + @color/text_color_secondary 14sp diff --git a/res/xml/preference_about.xml b/res/xml/preference_about.xml index a109db68ed..6b31d238f0 100644 --- a/res/xml/preference_about.xml +++ b/res/xml/preference_about.xml @@ -25,16 +25,4 @@ android:key="@string/pref_open_source_licenses_key" android:title="@string/about_open_source_licenses" android:summary="@string/about_open_source_licenses_summary"/> - - - - - - diff --git a/settings.gradle.kts b/settings.gradle.kts new file mode 100644 index 0000000000..6db34070cb --- /dev/null +++ b/settings.gradle.kts @@ -0,0 +1,19 @@ +pluginManagement { + repositories { + google() + mavenCentral() + } +} +dependencyResolutionManagement { + repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) + repositories { + google() + mavenCentral() + } +} + +include(":app") +include(":lib:platform_external_libphonenumber") +include(":lib:platform_frameworks_ex:common") +include(":lib:platform_frameworks_opt_vcard") +include(":lib:platform_packages_apps_PhoneCommon") diff --git a/src/com/android/contacts/ContactSaveService.java b/src/com/android/contacts/ContactSaveService.java old mode 100755 new mode 100644 diff --git a/src/com/android/contacts/NonPhoneActivity.java b/src/com/android/contacts/NonPhoneActivity.java index ba56d70908..41766480fe 100644 --- a/src/com/android/contacts/NonPhoneActivity.java +++ b/src/com/android/contacts/NonPhoneActivity.java @@ -17,7 +17,7 @@ package com.android.contacts; import android.app.Activity; -import android.app.AlertDialog; +import androidx.appcompat.app.AlertDialog; import android.app.Dialog; import android.app.DialogFragment; import android.content.DialogInterface; diff --git a/src/com/android/contacts/SimImportService.java b/src/com/android/contacts/SimImportService.java index f6703fc0d1..77941e943d 100644 --- a/src/com/android/contacts/SimImportService.java +++ b/src/com/android/contacts/SimImportService.java @@ -196,7 +196,7 @@ private Notification getCompletedNotification() { builder.setOngoing(false) .setAutoCancel(true) .setContentTitle(this.getString(R.string.importing_sim_finished_title)) - .setColor(this.getResources().getColor(R.color.dialtacts_theme_color)) + .setColor(this.getResources().getColor(R.color.primary_color)) .setSmallIcon(R.drawable.quantum_ic_done_vd_theme_24) .setContentIntent(PendingIntent.getActivity(this, 0, intent, FLAG_IMMUTABLE)); return builder.build(); @@ -210,7 +210,7 @@ private Notification getFailedNotification() { .setAutoCancel(true) .setContentTitle(this.getString(R.string.importing_sim_failed_title)) .setContentText(this.getString(R.string.importing_sim_failed_message)) - .setColor(this.getResources().getColor(R.color.dialtacts_theme_color)) + .setColor(this.getResources().getColor(R.color.primary_color)) .setSmallIcon(R.drawable.quantum_ic_error_vd_theme_24) .setContentIntent(PendingIntent.getActivity(this, 0, intent, FLAG_IMMUTABLE)); return builder.build(); @@ -223,7 +223,7 @@ private Notification getImportingNotification() { builder.setOngoing(true) .setProgress(/* current */ 0, /* max */ 100, /* indeterminate */ true) .setContentTitle(description) - .setColor(this.getResources().getColor(R.color.dialtacts_theme_color)) + .setColor(this.getResources().getColor(R.color.primary_color)) .setSmallIcon(android.R.drawable.stat_sys_download); return builder.build(); } diff --git a/src/com/android/contacts/SystemApis.java b/src/com/android/contacts/SystemApis.java new file mode 100644 index 0000000000..17106bfd5f --- /dev/null +++ b/src/com/android/contacts/SystemApis.java @@ -0,0 +1,7 @@ +package com.android.contacts; + +public class SystemApis { + // android.Manifest.permission.SET_DEFAULT_ACCOUNT_FOR_CONTACTS + public static final String SET_DEFAULT_ACCOUNT_FOR_CONTACTS = + "android.permission.SET_DEFAULT_ACCOUNT_FOR_CONTACTS"; +} diff --git a/src/com/android/contacts/activities/ActionBarAdapter.java b/src/com/android/contacts/activities/ActionBarAdapter.java index e6f29a4ab6..8f1cd9ca34 100644 --- a/src/com/android/contacts/activities/ActionBarAdapter.java +++ b/src/com/android/contacts/activities/ActionBarAdapter.java @@ -441,7 +441,7 @@ public void run() { */ public void updateOverflowButtonColor() { final String overflowDescription = mActivity.getResources().getString( - R.string.abc_action_menu_overflow_description); + androidx.appcompat.R.string.abc_action_menu_overflow_description); final ViewGroup decorView = (ViewGroup) mActivity.getWindow().getDecorView(); final ViewTreeObserver viewTreeObserver = decorView.getViewTreeObserver(); viewTreeObserver.addOnGlobalLayoutListener( diff --git a/src/com/android/contacts/activities/ContactEditorAccountsChangedActivity.java b/src/com/android/contacts/activities/ContactEditorAccountsChangedActivity.java index 8f0509baba..67d0cfa931 100644 --- a/src/com/android/contacts/activities/ContactEditorAccountsChangedActivity.java +++ b/src/com/android/contacts/activities/ContactEditorAccountsChangedActivity.java @@ -17,7 +17,7 @@ package com.android.contacts.activities; import android.app.Activity; -import android.app.AlertDialog; +import androidx.appcompat.app.AlertDialog; import android.content.DialogInterface; import android.content.Intent; import android.os.Bundle; @@ -171,34 +171,11 @@ public void onClick(View v) { } }); } else { - // If the user has 0 writable accounts, we will just show the user a message with 2 - // possible action buttons. - view = View.inflate(this, - R.layout.contact_editor_accounts_changed_activity_with_text, null); - - final TextView textView = (TextView) view.findViewById(R.id.text); - final Button leftButton = (Button) view.findViewById(R.id.left_button); - final Button rightButton = (Button) view.findViewById(R.id.right_button); - - textView.setText(getString(R.string.contact_editor_prompt_zero_accounts)); - - // This button allows the user to continue editing the contact as a phone-only - // local contact. - leftButton.setText(getString(android.R.string.cancel)); - leftButton.setOnClickListener(new OnClickListener() { - @Override - public void onClick(View v) { - // Remember that the user wants to create local contacts, so the user is not - // prompted again with this activity. - saveAccountAndReturnResult(AccountWithDataSet.getNullAccount()); - finish(); - } - }); - - // This button allows the user to add a new account to the device and return to - // this app afterwards. - rightButton.setText(getString(R.string.add_account)); - rightButton.setOnClickListener(mAddAccountClickListener); + view = null; // Only to make the compiler happy + // If the user has 0 writable accounts, don't bother, let them continue editing + // the contact as a phone-only local contact. + saveAccountAndReturnResult(AccountWithDataSet.getNullAccount()); + finish(); } if (mDialog != null && mDialog.isShowing()) { diff --git a/src/com/android/contacts/activities/ContactSelectionActivity.java b/src/com/android/contacts/activities/ContactSelectionActivity.java index 9273c612fa..c65ab61296 100644 --- a/src/com/android/contacts/activities/ContactSelectionActivity.java +++ b/src/com/android/contacts/activities/ContactSelectionActivity.java @@ -49,6 +49,7 @@ import com.android.contacts.list.GroupMemberPickerFragment; import com.android.contacts.list.JoinContactListFragment; import com.android.contacts.list.LegacyPhoneNumberPickerFragment; +import com.android.contacts.list.MultiContactsPickerFragment; import com.android.contacts.list.MultiSelectContactsListFragment; import com.android.contacts.list.MultiSelectContactsListFragment.OnCheckBoxListActionListener; import com.android.contacts.list.MultiSelectEmailAddressesListFragment; @@ -159,8 +160,6 @@ private void prepareSearchViewAndActionBar(Bundle savedState) { // Postal address pickers (and legacy pickers) don't support search, so just show // "HomeAsUp" button and title. mIsSearchSupported = mRequest.getActionCode() != ContactsRequest.ACTION_PICK_POSTAL - && mRequest.getActionCode() != ContactsRequest.ACTION_PICK_EMAILS - && mRequest.getActionCode() != ContactsRequest.ACTION_PICK_PHONES && !mRequest.isLegacyCompatibilityMode(); configureSearchMode(); } @@ -211,6 +210,10 @@ private void configureActivityTitle() { titleResId = R.string.contactPickerActivityTitle; break; } + case ContactsRequest.ACTION_PICK_CONTACTS: { + titleResId = R.string.pickerSelectContactsActivityTitle; + break; + } case ContactsRequest.ACTION_PICK_OR_CREATE_CONTACT: { titleResId = R.string.contactPickerActivityTitle; break; @@ -285,6 +288,12 @@ public void configureListFragment() { break; } + case ContactsRequest.ACTION_PICK_CONTACTS: { + var fragment = new MultiContactsPickerFragment(); + mListFragment = fragment; + break; + } + case ContactsRequest.ACTION_PICK_OR_CREATE_CONTACT: { ContactPickerFragment fragment = new ContactPickerFragment(); fragment.setCreateContactEnabled(!mRequest.isSearchMode()); @@ -418,6 +427,8 @@ public void setupActionListener() { ((GroupMemberPickerFragment) mListFragment).setListener( new GroupMemberPickerListener()); getMultiSelectListFragment().setCheckBoxListListener(this); + } else if (mListFragment instanceof MultiContactsPickerFragment) { + getMultiSelectListFragment().setCheckBoxListListener(this); } else { throw new IllegalStateException("Unsupported list fragment type: " + mListFragment); } diff --git a/src/com/android/contacts/activities/PeopleActivity.java b/src/com/android/contacts/activities/PeopleActivity.java index ceb3d59e91..4027a7f427 100644 --- a/src/com/android/contacts/activities/PeopleActivity.java +++ b/src/com/android/contacts/activities/PeopleActivity.java @@ -37,6 +37,7 @@ import android.provider.ContactsContract.Intents; import android.provider.ContactsContract.ProviderStatus; import androidx.annotation.LayoutRes; +import androidx.appcompat.graphics.drawable.DrawerArrowDrawable; import androidx.coordinatorlayout.widget.CoordinatorLayout; import com.google.android.material.snackbar.Snackbar; import androidx.core.content.ContextCompat; @@ -388,6 +389,10 @@ public void onClick(View v) { } }); + DrawerArrowDrawable drawerArrowDrawable = new DrawerArrowDrawable(this); + drawerArrowDrawable.setColor(ContextCompat.getColor(this, R.color.actionbar_icon_color)); + mToggle.setDrawerArrowDrawable(drawerArrowDrawable); + // Set up navigation mode. if (savedState != null) { mCurrentView = ContactsView.values()[savedState.getInt(KEY_CONTACTS_VIEW)]; @@ -521,7 +526,11 @@ private boolean processIntent(boolean forNewIntent) { onCreateGroupMenuItemClicked(); return true; } - case ContactsRequest.ACTION_VIEW_GROUP: + case ContactsRequest.ACTION_VIEW_GROUP: { + mShouldSwitchToGroupView = true; + mIsLaunchedIntoGroupView = true; + return true; + } case ContactsRequest.ACTION_EDIT_GROUP: { mShouldSwitchToGroupView = true; return true; @@ -801,6 +810,10 @@ public void onBackPressed() { closeDrawer(); return; } + if (mIsLaunchedIntoGroupView) { + finish(); + return; + } // Handle the back event in "second level". if (isGroupView()) { @@ -906,12 +919,17 @@ protected void onSaveInstanceState(Bundle outState) { } outState.putInt(KEY_CONTACTS_VIEW, mCurrentView.ordinal()); outState.putParcelable(KEY_GROUP_URI, mGroupUri); + outState.putBoolean(KEY_LAUNCHED_INTO_GROUP_VIEW, mIsLaunchedIntoGroupView); } + private static final String KEY_LAUNCHED_INTO_GROUP_VIEW = "isLaunchedIntoGroupView"; + private boolean mIsLaunchedIntoGroupView; + @Override protected void onRestoreInstanceState(Bundle savedInstanceState) { super.onRestoreInstanceState(savedInstanceState); mGroupUri = savedInstanceState.getParcelable(KEY_GROUP_URI); + mIsLaunchedIntoGroupView = savedInstanceState.getBoolean(KEY_LAUNCHED_INTO_GROUP_VIEW, false); } private void onGroupDeleted(final Intent intent) { diff --git a/src/com/android/contacts/activities/ShowOrCreateActivity.java b/src/com/android/contacts/activities/ShowOrCreateActivity.java index 8c943640e0..c06813dea2 100755 --- a/src/com/android/contacts/activities/ShowOrCreateActivity.java +++ b/src/com/android/contacts/activities/ShowOrCreateActivity.java @@ -17,7 +17,7 @@ package com.android.contacts.activities; import android.app.Activity; -import android.app.AlertDialog; +import androidx.appcompat.app.AlertDialog; import android.app.Dialog; import android.content.ComponentName; import android.content.DialogInterface; @@ -219,7 +219,7 @@ protected Dialog onCreateDialog(int id) { final CharSequence message = getResources().getString( R.string.add_contact_dlg_message_fmt, mCreateDescrip); - return new AlertDialog.Builder(this) + return new AlertDialog.Builder(this, androidx.appcompat.R.style.Theme_AppCompat_DayNight_Dialog_Alert) .setMessage(message) .setPositiveButton(android.R.string.ok, new IntentClickListener(this, createIntent)) diff --git a/src/com/android/contacts/datepicker/DatePickerDialog.java b/src/com/android/contacts/datepicker/DatePickerDialog.java index de04af92f8..c1161201d7 100644 --- a/src/com/android/contacts/datepicker/DatePickerDialog.java +++ b/src/com/android/contacts/datepicker/DatePickerDialog.java @@ -19,7 +19,7 @@ // This is a fork of the standard Android DatePicker that additionally allows toggling the year // on/off. -import android.app.AlertDialog; +import androidx.appcompat.app.AlertDialog; import android.content.Context; import android.content.DialogInterface; import android.content.DialogInterface.OnClickListener; diff --git a/src/com/android/contacts/dialog/ClearFrequentsDialog.java b/src/com/android/contacts/dialog/ClearFrequentsDialog.java index 7591de3ff7..9b74501169 100644 --- a/src/com/android/contacts/dialog/ClearFrequentsDialog.java +++ b/src/com/android/contacts/dialog/ClearFrequentsDialog.java @@ -16,7 +16,7 @@ package com.android.contacts.dialog; -import android.app.AlertDialog; +import androidx.appcompat.app.AlertDialog; import android.app.Dialog; import android.app.DialogFragment; import android.app.FragmentManager; diff --git a/src/com/android/contacts/editor/JoinContactConfirmationDialogFragment.java b/src/com/android/contacts/editor/JoinContactConfirmationDialogFragment.java index d238c384c5..983ca72b80 100644 --- a/src/com/android/contacts/editor/JoinContactConfirmationDialogFragment.java +++ b/src/com/android/contacts/editor/JoinContactConfirmationDialogFragment.java @@ -16,7 +16,7 @@ package com.android.contacts.editor; -import android.app.AlertDialog; +import androidx.appcompat.app.AlertDialog; import android.app.Dialog; import android.app.DialogFragment; import android.content.DialogInterface; diff --git a/src/com/android/contacts/editor/LabeledEditorView.java b/src/com/android/contacts/editor/LabeledEditorView.java index 3df322285a..9957ce3754 100644 --- a/src/com/android/contacts/editor/LabeledEditorView.java +++ b/src/com/android/contacts/editor/LabeledEditorView.java @@ -16,7 +16,7 @@ package com.android.contacts.editor; -import android.app.AlertDialog; +import androidx.appcompat.app.AlertDialog; import android.app.Dialog; import android.content.Context; import android.content.DialogInterface; diff --git a/src/com/android/contacts/editor/PickRawContactDialogFragment.java b/src/com/android/contacts/editor/PickRawContactDialogFragment.java index 5a9c9fd07f..7af2b24737 100644 --- a/src/com/android/contacts/editor/PickRawContactDialogFragment.java +++ b/src/com/android/contacts/editor/PickRawContactDialogFragment.java @@ -1,6 +1,6 @@ package com.android.contacts.editor; -import android.app.AlertDialog; +import androidx.appcompat.app.AlertDialog; import android.app.Dialog; import android.app.DialogFragment; import android.content.Context; diff --git a/src/com/android/contacts/editor/SelectAccountDialogFragment.java b/src/com/android/contacts/editor/SelectAccountDialogFragment.java index 3b41c86ade..dfe0d3783b 100644 --- a/src/com/android/contacts/editor/SelectAccountDialogFragment.java +++ b/src/com/android/contacts/editor/SelectAccountDialogFragment.java @@ -17,7 +17,7 @@ package com.android.contacts.editor; import android.app.Activity; -import android.app.AlertDialog; +import androidx.appcompat.app.AlertDialog; import android.app.Dialog; import android.app.DialogFragment; import android.app.FragmentManager; diff --git a/src/com/android/contacts/editor/SplitContactConfirmationDialogFragment.java b/src/com/android/contacts/editor/SplitContactConfirmationDialogFragment.java index 9b4e2348cc..7816e063a2 100644 --- a/src/com/android/contacts/editor/SplitContactConfirmationDialogFragment.java +++ b/src/com/android/contacts/editor/SplitContactConfirmationDialogFragment.java @@ -16,7 +16,7 @@ package com.android.contacts.editor; -import android.app.AlertDialog; +import androidx.appcompat.app.AlertDialog; import android.app.Dialog; import android.app.DialogFragment; import android.app.Fragment; diff --git a/src/com/android/contacts/interactions/ContactDeletionInteraction.java b/src/com/android/contacts/interactions/ContactDeletionInteraction.java index 7438f0df38..335eb244ba 100644 --- a/src/com/android/contacts/interactions/ContactDeletionInteraction.java +++ b/src/com/android/contacts/interactions/ContactDeletionInteraction.java @@ -17,7 +17,6 @@ package com.android.contacts.interactions; import android.app.Activity; -import android.app.AlertDialog; import android.app.Fragment; import android.app.FragmentManager; import android.app.LoaderManager; @@ -36,6 +35,7 @@ import android.text.TextUtils; import android.util.Log; import android.widget.Toast; +import androidx.appcompat.app.AlertDialog; import com.android.contacts.ContactSaveService; import com.android.contacts.R; diff --git a/src/com/android/contacts/interactions/ContactMultiDeletionInteraction.java b/src/com/android/contacts/interactions/ContactMultiDeletionInteraction.java index 47b76a5399..2d2f62b8f8 100644 --- a/src/com/android/contacts/interactions/ContactMultiDeletionInteraction.java +++ b/src/com/android/contacts/interactions/ContactMultiDeletionInteraction.java @@ -17,7 +17,7 @@ package com.android.contacts.interactions; import android.app.Activity; -import android.app.AlertDialog; +import androidx.appcompat.app.AlertDialog; import android.app.Fragment; import android.app.FragmentManager; import android.app.LoaderManager.LoaderCallbacks; diff --git a/src/com/android/contacts/interactions/ExportDialogFragment.java b/src/com/android/contacts/interactions/ExportDialogFragment.java index c7ce072302..44a34a9b72 100644 --- a/src/com/android/contacts/interactions/ExportDialogFragment.java +++ b/src/com/android/contacts/interactions/ExportDialogFragment.java @@ -17,7 +17,7 @@ package com.android.contacts.interactions; import android.app.Activity; -import android.app.AlertDialog; +import androidx.appcompat.app.AlertDialog; import android.app.Dialog; import android.app.DialogFragment; import android.app.FragmentManager; diff --git a/src/com/android/contacts/interactions/GroupDeletionDialogFragment.java b/src/com/android/contacts/interactions/GroupDeletionDialogFragment.java index 01361b2a37..32898cc32b 100644 --- a/src/com/android/contacts/interactions/GroupDeletionDialogFragment.java +++ b/src/com/android/contacts/interactions/GroupDeletionDialogFragment.java @@ -15,7 +15,7 @@ */ package com.android.contacts.interactions; -import android.app.AlertDialog; +import androidx.appcompat.app.AlertDialog; import android.app.Dialog; import android.app.DialogFragment; import android.app.FragmentManager; diff --git a/src/com/android/contacts/interactions/ImportDialogFragment.java b/src/com/android/contacts/interactions/ImportDialogFragment.java index 693536a9bc..74f313b379 100644 --- a/src/com/android/contacts/interactions/ImportDialogFragment.java +++ b/src/com/android/contacts/interactions/ImportDialogFragment.java @@ -17,7 +17,7 @@ package com.android.contacts.interactions; import android.app.Activity; -import android.app.AlertDialog; +import androidx.appcompat.app.AlertDialog; import android.app.Dialog; import android.app.DialogFragment; import android.app.FragmentManager; diff --git a/src/com/android/contacts/list/AccountFilterActivity.java b/src/com/android/contacts/list/AccountFilterActivity.java index 6559489fd6..711a838769 100644 --- a/src/com/android/contacts/list/AccountFilterActivity.java +++ b/src/com/android/contacts/list/AccountFilterActivity.java @@ -16,7 +16,6 @@ package com.android.contacts.list; -import android.app.ActionBar; import android.app.Activity; import android.content.Context; import android.content.Intent; @@ -29,6 +28,8 @@ import android.widget.BaseAdapter; import android.widget.ListView; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; import com.android.contacts.R; import com.android.contacts.model.AccountTypeManager; @@ -39,7 +40,7 @@ * Shows a list of all available accounts, letting the user select under which account to view * contacts. */ -public class AccountFilterActivity extends Activity implements AdapterView.OnItemClickListener { +public class AccountFilterActivity extends AppCompatActivity implements AdapterView.OnItemClickListener { private static final int SUBACTIVITY_CUSTOMIZE_FILTER = 0; @@ -63,7 +64,7 @@ protected void onCreate(Bundle icicle) { mListView = (ListView) findViewById(android.R.id.list); mListView.setOnItemClickListener(this); - ActionBar actionBar = getActionBar(); + ActionBar actionBar = getSupportActionBar(); if (actionBar != null) { actionBar.setDisplayHomeAsUpEnabled(true); } diff --git a/src/com/android/contacts/list/ContactsIntentResolver.java b/src/com/android/contacts/list/ContactsIntentResolver.java index 7cf9f5ad49..5299f3df25 100644 --- a/src/com/android/contacts/list/ContactsIntentResolver.java +++ b/src/com/android/contacts/list/ContactsIntentResolver.java @@ -84,12 +84,20 @@ public ContactsRequest resolveIntent(Intent intent) { } else if (Intent.ACTION_PICK.equals(action)) { final String resolvedType = intent.resolveType(mContext); if (Contacts.CONTENT_TYPE.equals(resolvedType)) { - request.setActionCode(ContactsRequest.ACTION_PICK_CONTACT); + if (intent.getBooleanExtra(Intent.EXTRA_ALLOW_MULTIPLE, false)) { + request.setActionCode(ContactsRequest.ACTION_PICK_CONTACTS); + } else { + request.setActionCode(ContactsRequest.ACTION_PICK_CONTACT); + } } else if (People.CONTENT_TYPE.equals(resolvedType)) { request.setActionCode(ContactsRequest.ACTION_PICK_CONTACT); request.setLegacyCompatibilityMode(true); } else if (Phone.CONTENT_TYPE.equals(resolvedType)) { - request.setActionCode(ContactsRequest.ACTION_PICK_PHONE); + if (intent.getBooleanExtra(Intent.EXTRA_ALLOW_MULTIPLE, false)) { + request.setActionCode(ContactsRequest.ACTION_PICK_PHONES); + } else { + request.setActionCode(ContactsRequest.ACTION_PICK_PHONE); + } } else if (Phones.CONTENT_TYPE.equals(resolvedType)) { request.setActionCode(ContactsRequest.ACTION_PICK_PHONE); request.setLegacyCompatibilityMode(true); @@ -99,7 +107,11 @@ public ContactsRequest resolveIntent(Intent intent) { request.setActionCode(ContactsRequest.ACTION_PICK_POSTAL); request.setLegacyCompatibilityMode(true); } else if (Email.CONTENT_TYPE.equals(resolvedType)) { - request.setActionCode(ContactsRequest.ACTION_PICK_EMAIL); + if (intent.getBooleanExtra(Intent.EXTRA_ALLOW_MULTIPLE, false)) { + request.setActionCode(ContactsRequest.ACTION_PICK_EMAILS); + } else { + request.setActionCode(ContactsRequest.ACTION_PICK_EMAIL); + } } else if (Groups.CONTENT_TYPE.equals(resolvedType)) { request.setActionCode(ContactsRequest.ACTION_PICK_GROUP_MEMBERS); request.setAccountWithDataSet(new AccountWithDataSet( diff --git a/src/com/android/contacts/list/ContactsRequest.java b/src/com/android/contacts/list/ContactsRequest.java index f581b0a850..1482df2b35 100644 --- a/src/com/android/contacts/list/ContactsRequest.java +++ b/src/com/android/contacts/list/ContactsRequest.java @@ -62,6 +62,7 @@ public class ContactsRequest { /** Show all contacts and pick them when clicking */ public static final int ACTION_PICK_CONTACT = 60; + public static final int ACTION_PICK_CONTACTS = 61; /** Show all contacts as well as the option to create a new one */ public static final int ACTION_PICK_OR_CREATE_CONTACT = 70; diff --git a/src/com/android/contacts/list/CustomContactListFilterActivity.java b/src/com/android/contacts/list/CustomContactListFilterActivity.java index 5bc3c3508a..7bb70d6740 100644 --- a/src/com/android/contacts/list/CustomContactListFilterActivity.java +++ b/src/com/android/contacts/list/CustomContactListFilterActivity.java @@ -16,9 +16,8 @@ package com.android.contacts.list; -import android.app.ActionBar; import android.app.Activity; -import android.app.AlertDialog; +import androidx.appcompat.app.AlertDialog; import android.app.Dialog; import android.app.DialogFragment; import android.app.LoaderManager.LoaderCallbacks; @@ -56,6 +55,9 @@ import android.widget.ExpandableListView.ExpandableListContextMenuInfo; import android.widget.TextView; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatActivity; + import com.android.contacts.R; import com.android.contacts.model.AccountTypeManager; import com.android.contacts.model.ValuesDelta; @@ -84,7 +86,7 @@ * Shows a list of all available {@link Groups} available, letting the user * select which ones they want to be visible. */ -public class CustomContactListFilterActivity extends Activity implements +public class CustomContactListFilterActivity extends AppCompatActivity implements ExpandableListView.OnChildClickListener, LoaderCallbacks { private static final String TAG = "CustomContactListFilter"; @@ -125,7 +127,8 @@ public void onLayoutChange(final View v, final int left, final int top, final in mList.setAdapter(mAdapter); - ActionBar actionBar = getActionBar(); + + ActionBar actionBar = getSupportActionBar(); if (actionBar != null) { // android.R.id.home will be triggered in onOptionsItemSelected() actionBar.setDisplayHomeAsUpEnabled(true); @@ -598,7 +601,7 @@ public View getGroupView(int groupPosition, boolean isExpanded, View convertView text2.setText(account.mAccountInfo.getTypeLabel()); final int textColor = mContext.getResources().getColor(isExpanded - ? R.color.dialtacts_theme_color + ? R.color.primary_color : R.color.account_filter_text_color); text1.setTextColor(textColor); text2.setTextColor(textColor); diff --git a/src/com/android/contacts/list/EnableGlobalSyncDialogFragment.java b/src/com/android/contacts/list/EnableGlobalSyncDialogFragment.java index 08822d10c6..bf537bd0d6 100644 --- a/src/com/android/contacts/list/EnableGlobalSyncDialogFragment.java +++ b/src/com/android/contacts/list/EnableGlobalSyncDialogFragment.java @@ -16,7 +16,7 @@ package com.android.contacts.list; -import android.app.AlertDialog; +import androidx.appcompat.app.AlertDialog; import android.app.Dialog; import android.app.DialogFragment; import android.content.DialogInterface; diff --git a/src/com/android/contacts/list/MultiContactsPickerFragment.java b/src/com/android/contacts/list/MultiContactsPickerFragment.java new file mode 100644 index 0000000000..ccd3c46daf --- /dev/null +++ b/src/com/android/contacts/list/MultiContactsPickerFragment.java @@ -0,0 +1,73 @@ +package com.android.contacts.list; + +import android.provider.ContactsContract.Contacts; +import android.view.LayoutInflater; +import android.view.Menu; +import android.view.MenuInflater; +import android.view.MenuItem; +import android.view.View; +import android.view.ViewGroup; + +import com.android.contacts.R; + +public class MultiContactsPickerFragment extends + MultiSelectContactsListFragment { + + public static final String TAG = MultiContactsPickerFragment.class.getSimpleName(); + + public MultiContactsPickerFragment() { + setPhotoLoaderEnabled(true); + setSectionHeaderDisplayEnabled(true); + setHasOptionsMenu(true); + } + + @Override + protected View inflateView(LayoutInflater inflater, ViewGroup container) { + return inflater.inflate(R.layout.contact_list_content, null); + } + + @Override + protected DefaultContactListAdapter createListAdapter() { + var adapter = new DefaultContactListAdapter(getActivity()); + adapter.setSectionHeaderDisplayEnabled(true); + adapter.setDisplayPhotos(true); + return adapter; + } + + @Override + public void onCreateOptionsMenu(Menu menu, MenuInflater menuInflater) { + super.onCreateOptionsMenu(menu, menuInflater); + menuInflater.inflate(R.menu.items_multi_select, menu); + } + + @Override + public void onPrepareOptionsMenu(Menu menu) { + final MenuItem item = menu.findItem(R.id.menu_send); + item.setVisible(getAdapter().hasSelectedItems()); + item.getActionView().setOnClickListener(v -> onOptionsItemSelected(item)); + + updateMenuItemSendForPickerIntent(item);; + } + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + if (item.getItemId() == R.id.menu_send) { + setResultAndFinish(getSelectedContactIdsArray(), + Contacts.CONTENT_URI, Contacts.CONTENT_ITEM_TYPE); + return true; + } + + return super.onOptionsItemSelected(item); + } + + @Override + protected boolean onItemLongClick(int position, long id) { + return true; + } + + @Override + public void onStart() { + super.onStart(); + displayCheckBoxes(true); + } +} diff --git a/src/com/android/contacts/list/MultiSelectContactsListFragment.java b/src/com/android/contacts/list/MultiSelectContactsListFragment.java index 83b1ec910b..691e4f68e1 100644 --- a/src/com/android/contacts/list/MultiSelectContactsListFragment.java +++ b/src/com/android/contacts/list/MultiSelectContactsListFragment.java @@ -16,15 +16,19 @@ package com.android.contacts.list; +import android.content.ClipData; import android.content.Context; +import android.content.Intent; import android.database.Cursor; import android.graphics.drawable.Drawable; import android.icu.text.MessageFormat; +import android.net.Uri; import android.os.Bundle; import android.provider.ContactsContract; import androidx.core.view.ViewCompat; import android.util.Log; import android.view.LayoutInflater; +import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; import android.view.accessibility.AccessibilityEvent; @@ -36,6 +40,7 @@ import com.android.contacts.R; import com.android.contacts.activities.ActionBarAdapter; +import com.android.contacts.activities.ContactSelectionActivity; import com.android.contacts.group.GroupMembersFragment; import com.android.contacts.list.MultiSelectEntryContactListAdapter.SelectedContactsListener; import com.android.contacts.logging.ListEvent.ActionType; @@ -51,6 +56,7 @@ import java.util.List; import java.util.Locale; import java.util.Map; +import java.util.Objects; import java.util.TreeSet; /** @@ -447,4 +453,40 @@ private void setListViewPaddingTop(View listView, int paddingTop) { public ActionBarAdapter getActionBarAdapter() { return null; } + + protected boolean isLaunchedForPickerIntent() { + return getArguments().getBoolean(Intent.EXTRA_ALLOW_MULTIPLE, false); + } + + protected void maybeUpdateMenuItemSendForPickerIntent(MenuItem item) { + if (isLaunchedForPickerIntent()) { + updateMenuItemSendForPickerIntent(item); + } + } + + protected void updateMenuItemSendForPickerIntent(MenuItem item) { + ((TextView) item.getActionView()).setText(R.string.multi_picker_select_action); + item.setTitle(R.string.multi_picker_select_action); + } + + protected void setResultAndFinish(long[] itemIds, Uri baseUri, String itemMimeType) { + var activity = (ContactSelectionActivity) getActivity(); + + ClipData cd = null; + for (long itemId : itemIds) { + Uri uri = baseUri.buildUpon().appendPath(Long.toString(itemId)).build(); + var cdi = new ClipData.Item(uri); + if (cd == null) { + String[] mimes = { itemMimeType }; + cd = new ClipData("", mimes, cdi); + } else { + cd.addItem(cdi); + } + } + + var i = new Intent(); + i.setClipData(Objects.requireNonNull(cd)); + + activity.returnPickerResult(i); + } } diff --git a/src/com/android/contacts/list/MultiSelectEmailAddressesListFragment.java b/src/com/android/contacts/list/MultiSelectEmailAddressesListFragment.java index 6f6a3c7ea2..62e6cb8731 100644 --- a/src/com/android/contacts/list/MultiSelectEmailAddressesListFragment.java +++ b/src/com/android/contacts/list/MultiSelectEmailAddressesListFragment.java @@ -17,6 +17,7 @@ import android.content.Intent; import android.os.Bundle; +import android.provider.ContactsContract; import android.text.TextUtils; import android.view.LayoutInflater; import android.view.Menu; @@ -39,7 +40,6 @@ public class MultiSelectEmailAddressesListFragment public MultiSelectEmailAddressesListFragment() { setPhotoLoaderEnabled(true); setSectionHeaderDisplayEnabled(false); - setSearchMode(false); setHasOptionsMenu(true); setListType(ListEvent.ListType.PICK_EMAIL); } @@ -68,6 +68,8 @@ public void onClick(View v) { onOptionsItemSelected(item); } }); + + maybeUpdateMenuItemSendForPickerIntent(item); } @Override @@ -78,6 +80,14 @@ public void onActivityResult(int requestCode, int resultCode, Intent data) { @Override public boolean onOptionsItemSelected(MenuItem item) { if (item.getItemId() == R.id.menu_send) { + + if (isLaunchedForPickerIntent()) { + setResultAndFinish(getSelectedContactIdsArray(), + ContactsContract.CommonDataKinds.Email.CONTENT_URI, + ContactsContract.CommonDataKinds.Email.CONTENT_ITEM_TYPE); + return true; + } + final String scheme = getActivity().getIntent().getStringExtra( UiIntentActions.SELECTION_SEND_SCHEME); final String title = getActivity().getIntent().getStringExtra( diff --git a/src/com/android/contacts/list/MultiSelectPhoneNumbersListFragment.java b/src/com/android/contacts/list/MultiSelectPhoneNumbersListFragment.java index 2b7021e2e3..4c9cc2a968 100644 --- a/src/com/android/contacts/list/MultiSelectPhoneNumbersListFragment.java +++ b/src/com/android/contacts/list/MultiSelectPhoneNumbersListFragment.java @@ -17,6 +17,7 @@ import android.content.Intent; import android.os.Bundle; +import android.provider.ContactsContract; import android.text.TextUtils; import android.view.LayoutInflater; import android.view.Menu; @@ -39,7 +40,6 @@ public class MultiSelectPhoneNumbersListFragment public MultiSelectPhoneNumbersListFragment() { setPhotoLoaderEnabled(true); setSectionHeaderDisplayEnabled(false); - setSearchMode(false); setHasOptionsMenu(true); setListType(ListEvent.ListType.PICK_PHONE); } @@ -68,6 +68,8 @@ public void onClick(View v) { onOptionsItemSelected(item); } }); + + maybeUpdateMenuItemSendForPickerIntent(item); } @Override @@ -78,6 +80,14 @@ public void onActivityResult(int requestCode, int resultCode, Intent data) { @Override public boolean onOptionsItemSelected(MenuItem item) { if (item.getItemId() == R.id.menu_send) { + + if (isLaunchedForPickerIntent()) { + setResultAndFinish(getSelectedContactIdsArray(), + ContactsContract.CommonDataKinds.Phone.CONTENT_URI, + ContactsContract.CommonDataKinds.Phone.CONTENT_ITEM_TYPE); + return true; + } + final String scheme = getActivity().getIntent().getStringExtra( UiIntentActions.SELECTION_SEND_SCHEME); final String title = getActivity().getIntent().getStringExtra( diff --git a/src/com/android/contacts/model/DeviceLocalAccountLocator.java b/src/com/android/contacts/model/DeviceLocalAccountLocator.java index e8a2ba0ffe..9a70ef0dc5 100644 --- a/src/com/android/contacts/model/DeviceLocalAccountLocator.java +++ b/src/com/android/contacts/model/DeviceLocalAccountLocator.java @@ -45,13 +45,6 @@ public DeviceLocalAccountLocator(Context context, AccountManager accountManager) * Returns a list of device local accounts */ public List getDeviceLocalAccounts() { - @SuppressWarnings("MissingPermission") final Account[] accounts = mAccountManager - .getAccountsByType(GoogleAccountType.ACCOUNT_TYPE); - - if (accounts.length > 0 && !mLocalAccount.get(0).hasData(mContext)) { - return Collections.emptyList(); - } else { - return mLocalAccount; - } + return mLocalAccount; } } diff --git a/src/com/android/contacts/preference/AboutPreferenceFragment.java b/src/com/android/contacts/preference/AboutPreferenceFragment.java index 378948033a..721ab0460a 100644 --- a/src/com/android/contacts/preference/AboutPreferenceFragment.java +++ b/src/com/android/contacts/preference/AboutPreferenceFragment.java @@ -34,10 +34,6 @@ * This fragment shows the preferences for "about". */ public class AboutPreferenceFragment extends PreferenceFragment { - - public static final String PRIVACY_POLICY_URL = "http://www.google.com/policies/privacy"; - public static final String TERMS_OF_SERVICE_URL = "http://www.google.com/policies/terms"; - public static AboutPreferenceFragment newInstance() { return new AboutPreferenceFragment(); } @@ -63,30 +59,6 @@ public void onCreate(Bundle savedInstanceState) { final Preference licensePreference = findPreference( getString(R.string.pref_open_source_licenses_key)); licensePreference.setIntent(new Intent(getActivity(), LicenseActivity.class)); - - final Preference privacyPolicyPreference = findPreference("pref_privacy_policy"); - final Preference termsOfServicePreference = findPreference("pref_terms_of_service"); - - final Preference.OnPreferenceClickListener listener = - new Preference.OnPreferenceClickListener() { - @Override - public boolean onPreferenceClick(Preference preference) { - try { - if (preference == privacyPolicyPreference) { - startActivityForUrl(PRIVACY_POLICY_URL); - } else if (preference == termsOfServicePreference) { - startActivityForUrl(TERMS_OF_SERVICE_URL); - } - } catch (ActivityNotFoundException ex) { - Toast.makeText(getContext(), getString(R.string.url_open_error_toast), - Toast.LENGTH_SHORT).show(); - } - return true; - } - }; - - privacyPolicyPreference.setOnPreferenceClickListener(listener); - termsOfServicePreference.setOnPreferenceClickListener(listener); } @Override diff --git a/src/com/android/contacts/preference/ContactsPreferences.java b/src/com/android/contacts/preference/ContactsPreferences.java index e5f0cda842..7e4d682ead 100644 --- a/src/com/android/contacts/preference/ContactsPreferences.java +++ b/src/com/android/contacts/preference/ContactsPreferences.java @@ -16,7 +16,7 @@ package com.android.contacts.preference; -import static android.Manifest.permission.SET_DEFAULT_ACCOUNT_FOR_CONTACTS; +import static com.android.contacts.SystemApis.SET_DEFAULT_ACCOUNT_FOR_CONTACTS; import android.accounts.Account; import android.annotation.SuppressLint; @@ -279,8 +279,16 @@ private void setDefaultAccountToCp2(AccountWithDataSet accountWithDataSet) { .permitDiskReads() .build()); try { - ContactsContract.Settings.setDefaultAccount(mContext.getContentResolver(), - accountWithDataSet == null ? null : accountWithDataSet.getAccountOrNull()); + var extras = new android.os.Bundle(); + Account account = accountWithDataSet == null ? null : accountWithDataSet.getAccountOrNull(); + if (account != null) { + extras.putString(ContactsContract.Settings.ACCOUNT_NAME, account.name); + extras.putString(ContactsContract.Settings.ACCOUNT_TYPE, account.type); + } + + // TODO: mark ContactsContract.Settings.setDefaultAccount with @UnsupportedAppUsage and + // call it via reflection instead + mContext.getContentResolver().call(ContactsContract.AUTHORITY_URI, "setDefaultAccount", null, extras); } finally { StrictMode.setThreadPolicy(oldPolicy); } diff --git a/src/com/android/contacts/preference/DisplayOptionsPreferenceFragment.java b/src/com/android/contacts/preference/DisplayOptionsPreferenceFragment.java index 7097be3be7..30538a9cc4 100644 --- a/src/com/android/contacts/preference/DisplayOptionsPreferenceFragment.java +++ b/src/com/android/contacts/preference/DisplayOptionsPreferenceFragment.java @@ -468,7 +468,8 @@ private String getSetDefaultAccountActivityPackage() { for (ResolveInfo resolveInfo : resolveInfos) { String packageName = resolveInfo.activityInfo.packageName; if (packageManager.checkPermission( - android.Manifest.permission.SET_DEFAULT_ACCOUNT_FOR_CONTACTS, packageName) + com.android.contacts.SystemApis.SET_DEFAULT_ACCOUNT_FOR_CONTACTS, + packageName) == PackageManager.PERMISSION_GRANTED) { return packageName; } diff --git a/src/com/android/contacts/util/AccountSelectionUtil.java b/src/com/android/contacts/util/AccountSelectionUtil.java index bfe8a08b30..e1444e5061 100644 --- a/src/com/android/contacts/util/AccountSelectionUtil.java +++ b/src/com/android/contacts/util/AccountSelectionUtil.java @@ -17,7 +17,7 @@ package com.android.contacts.util; import android.app.Activity; -import android.app.AlertDialog; +import androidx.appcompat.app.AlertDialog; import android.app.Dialog; import android.content.Context; import android.content.DialogInterface; diff --git a/src/com/android/contacts/util/StructuredPostalUtils.java b/src/com/android/contacts/util/StructuredPostalUtils.java index 6e46176ca8..f5f454948e 100644 --- a/src/com/android/contacts/util/StructuredPostalUtils.java +++ b/src/com/android/contacts/util/StructuredPostalUtils.java @@ -32,10 +32,6 @@ public static Uri getPostalAddressUri(String postalAddress) { } public static Intent getViewPostalAddressDirectionsIntent(String postalAddress) { - return new Intent(Intent.ACTION_VIEW, getPostalAddressDirectionsUri(postalAddress)); - } - - public static Uri getPostalAddressDirectionsUri(String postalAddress) { - return Uri.parse("https://maps.google.com/maps?daddr=" + Uri.encode(postalAddress)); + return new Intent(Intent.ACTION_VIEW, getPostalAddressUri(postalAddress)); } } diff --git a/src/com/android/contacts/vcard/CancelActivity.java b/src/com/android/contacts/vcard/CancelActivity.java index a6b58cc86b..0dd691a252 100644 --- a/src/com/android/contacts/vcard/CancelActivity.java +++ b/src/com/android/contacts/vcard/CancelActivity.java @@ -16,7 +16,7 @@ package com.android.contacts.vcard; import android.app.Activity; -import android.app.AlertDialog; +import androidx.appcompat.app.AlertDialog; import android.app.Dialog; import android.content.ComponentName; import android.content.Context; diff --git a/src/com/android/contacts/vcard/ExportVCardActivity.java b/src/com/android/contacts/vcard/ExportVCardActivity.java index 87a1eb1d55..0c029db763 100755 --- a/src/com/android/contacts/vcard/ExportVCardActivity.java +++ b/src/com/android/contacts/vcard/ExportVCardActivity.java @@ -16,7 +16,7 @@ package com.android.contacts.vcard; import android.app.Activity; -import android.app.AlertDialog; +import androidx.appcompat.app.AlertDialog; import android.app.Dialog; import android.content.ComponentName; import android.content.Context; diff --git a/src/com/android/contacts/vcard/ImportProcessor.java b/src/com/android/contacts/vcard/ImportProcessor.java index c6fcccb8c2..8eff2cc963 100644 --- a/src/com/android/contacts/vcard/ImportProcessor.java +++ b/src/com/android/contacts/vcard/ImportProcessor.java @@ -30,6 +30,7 @@ import com.android.vcard.VCardParser; import com.android.vcard.VCardParser_V21; import com.android.vcard.VCardParser_V30; +import com.android.vcard.VCardParser_V40; import com.android.vcard.exception.VCardException; import com.android.vcard.exception.VCardNotSupportedException; import com.android.vcard.exception.VCardVersionException; @@ -135,7 +136,8 @@ private void runInternal() { */ possibleVCardVersions = new int[] { ImportVCardActivity.VCARD_VERSION_V21, - ImportVCardActivity.VCARD_VERSION_V30 + ImportVCardActivity.VCARD_VERSION_V30, + ImportVCardActivity.VCARD_VERSION_V40 }; } else { possibleVCardVersions = new int[] { @@ -231,9 +233,13 @@ private boolean readOneVCard(InputStream is, int vcardType, String charset, // In the worst case, a user may call cancel() just before creating // mVCardParser. synchronized (this) { - mVCardParser = (vcardVersion == ImportVCardActivity.VCARD_VERSION_V30 ? - new VCardParser_V30(vcardType) : - new VCardParser_V21(vcardType)); + if (vcardVersion == ImportVCardActivity.VCARD_VERSION_V30) { + mVCardParser = new VCardParser_V30(vcardType); + } else if (vcardVersion == ImportVCardActivity.VCARD_VERSION_V40) { + mVCardParser = new VCardParser_V40(vcardType); + } else { + mVCardParser = new VCardParser_V21(vcardType); + } if (isCancelled()) { Log.i(LOG_TAG, "ImportProcessor already recieves cancel request, so " + "send cancel request to vCard parser too."); diff --git a/src/com/android/contacts/vcard/ImportVCardActivity.java b/src/com/android/contacts/vcard/ImportVCardActivity.java index 3eb7bdbe31..24c00f8fe1 100644 --- a/src/com/android/contacts/vcard/ImportVCardActivity.java +++ b/src/com/android/contacts/vcard/ImportVCardActivity.java @@ -17,7 +17,7 @@ package com.android.contacts.vcard; import android.app.Activity; -import android.app.AlertDialog; +import androidx.appcompat.app.AlertDialog; import android.app.Dialog; import android.app.Notification; import android.app.NotificationManager; @@ -49,6 +49,7 @@ import com.android.vcard.VCardParser; import com.android.vcard.VCardParser_V21; import com.android.vcard.VCardParser_V30; +import com.android.vcard.VCardParser_V40; import com.android.vcard.VCardSourceDetector; import com.android.vcard.exception.VCardException; import com.android.vcard.exception.VCardNestedException; @@ -83,6 +84,7 @@ public class ImportVCardActivity extends Activity implements ImportVCardDialogFr /* package */ final static int VCARD_VERSION_AUTO_DETECT = 0; /* package */ final static int VCARD_VERSION_V21 = 1; /* package */ final static int VCARD_VERSION_V30 = 2; + /* package */ final static int VCARD_VERSION_V40 = 3; private static final int REQUEST_OPEN_DOCUMENT = 100; @@ -321,6 +323,7 @@ private ImportRequest constructImportRequest(final byte[] data, int vcardVersion = VCARD_VERSION_V21; try { boolean shouldUseV30 = false; + boolean shouldUseV40 = false; InputStream is; if (data != null) { is = new ByteArrayInputStream(data); @@ -354,7 +357,28 @@ private ImportRequest constructImportRequest(final byte[] data, mVCardParser.addInterpreter(detector); mVCardParser.parse(is); } catch (VCardVersionException e2) { - throw new VCardException("vCard with unspported version."); + try { + is.close(); + } catch (IOException e) { + } + + shouldUseV30 = false; + shouldUseV40 = true; + if (data != null) { + is = new ByteArrayInputStream(data); + } else { + is = resolver.openInputStream(localDataUri); + } + mVCardParser = new VCardParser_V40(); + try { + counter = new VCardEntryCounter(); + detector = new VCardSourceDetector(); + mVCardParser.addInterpreter(counter); + mVCardParser.addInterpreter(detector); + mVCardParser.parse(is); + } catch (VCardVersionException e3) { + throw new VCardException("vCard with unspported version."); + } } } finally { if (is != null) { @@ -365,7 +389,13 @@ private ImportRequest constructImportRequest(final byte[] data, } } - vcardVersion = shouldUseV30 ? VCARD_VERSION_V30 : VCARD_VERSION_V21; + if (shouldUseV30) { + vcardVersion = VCARD_VERSION_V30; + } else if (shouldUseV40) { + vcardVersion = VCARD_VERSION_V40; + } else { + vcardVersion = VCARD_VERSION_V21; + } } catch (VCardNestedException e) { Log.w(LOG_TAG, "Nested Exception is found (it may be false-positive)."); // Go through without throwing the Exception, as we may be able to detect the diff --git a/src/com/android/contacts/vcard/ImportVCardDialogFragment.java b/src/com/android/contacts/vcard/ImportVCardDialogFragment.java index 7ad67d1356..021cfb4efb 100644 --- a/src/com/android/contacts/vcard/ImportVCardDialogFragment.java +++ b/src/com/android/contacts/vcard/ImportVCardDialogFragment.java @@ -16,7 +16,7 @@ package com.android.contacts.vcard; import android.app.Activity; -import android.app.AlertDialog; +import androidx.appcompat.app.AlertDialog; import android.app.Dialog; import android.app.DialogFragment; import android.content.DialogInterface; diff --git a/src/com/android/contacts/vcard/NfcImportVCardActivity.java b/src/com/android/contacts/vcard/NfcImportVCardActivity.java index 88fa760356..f41e564463 100644 --- a/src/com/android/contacts/vcard/NfcImportVCardActivity.java +++ b/src/com/android/contacts/vcard/NfcImportVCardActivity.java @@ -46,6 +46,7 @@ import com.android.vcard.VCardParser; import com.android.vcard.VCardParser_V21; import com.android.vcard.VCardParser_V30; +import com.android.vcard.VCardParser_V40; import com.android.vcard.VCardSourceDetector; import com.android.vcard.exception.VCardException; import com.android.vcard.exception.VCardNestedException; @@ -126,9 +127,20 @@ public void onPostExecute(ImportRequest request) { parser.addInterpreter(detector); parser.parse(is); } catch (VCardVersionException e2) { - FeedbackHelper.sendFeedback(this, TAG, "vcard with unsupported version", e2); - showFailureNotification(R.string.fail_reason_not_supported); - return null; + is.reset(); + vcardVersion = ImportVCardActivity.VCARD_VERSION_V40; + parser = new VCardParser_V40(); + try { + counter = new VCardEntryCounter(); + detector = new VCardSourceDetector(); + parser.addInterpreter(counter); + parser.addInterpreter(detector); + parser.parse(is); + } catch (VCardVersionException e3) { + FeedbackHelper.sendFeedback(this, TAG, "vcard with unsupported version", e2); + showFailureNotification(R.string.fail_reason_not_supported); + return null; + } } } finally { try { diff --git a/src/com/android/contacts/vcard/NotificationImportExportListener.java b/src/com/android/contacts/vcard/NotificationImportExportListener.java index cc60668a9d..44da94abc0 100755 --- a/src/com/android/contacts/vcard/NotificationImportExportListener.java +++ b/src/com/android/contacts/vcard/NotificationImportExportListener.java @@ -227,7 +227,7 @@ public void onCancelRequest(CancelRequest request, int type) { .setProgress(totalCount, currentCount, totalCount == - 1) .setTicker(tickerText) .setContentTitle(description) - .setColor(context.getResources().getColor(R.color.dialtacts_theme_color)) + .setColor(context.getResources().getColor(R.color.primary_color)) .setSmallIcon(type == VCardService.TYPE_IMPORT ? android.R.drawable.stat_sys_download : android.R.drawable.stat_sys_upload) @@ -253,7 +253,7 @@ public void onCancelRequest(CancelRequest request, int type) { ContactsNotificationChannelsUtil.DEFAULT_CHANNEL) .setAutoCancel(true) .setSmallIcon(android.R.drawable.stat_notify_error) - .setColor(context.getResources().getColor(R.color.dialtacts_theme_color)) + .setColor(context.getResources().getColor(R.color.primary_color)) .setContentTitle(description) .setContentText(description) .build(); @@ -272,7 +272,7 @@ public void onCancelRequest(CancelRequest request, int type) { return new NotificationCompat.Builder(context, ContactsNotificationChannelsUtil.DEFAULT_CHANNEL) .setAutoCancel(true) - .setColor(context.getResources().getColor(R.color.dialtacts_theme_color)) + .setColor(context.getResources().getColor(R.color.primary_color)) .setSmallIcon(R.drawable.quantum_ic_done_vd_theme_24) .setContentTitle(title) .setContentText(description) @@ -292,7 +292,7 @@ public void onCancelRequest(CancelRequest request, int type) { return new NotificationCompat.Builder(context, ContactsNotificationChannelsUtil.DEFAULT_CHANNEL) .setAutoCancel(true) - .setColor(context.getResources().getColor(R.color.dialtacts_theme_color)) + .setColor(context.getResources().getColor(R.color.primary_color)) .setSmallIcon(android.R.drawable.stat_notify_error) .setContentTitle(context.getString(R.string.vcard_import_failed)) .setContentText(reason) diff --git a/src/com/android/contacts/widget/SelectPhoneAccountDialogFragment.java b/src/com/android/contacts/widget/SelectPhoneAccountDialogFragment.java index da2b468da6..0735c92ba8 100644 --- a/src/com/android/contacts/widget/SelectPhoneAccountDialogFragment.java +++ b/src/com/android/contacts/widget/SelectPhoneAccountDialogFragment.java @@ -16,7 +16,7 @@ package com.android.contacts.widget; -import android.app.AlertDialog; +import androidx.appcompat.app.AlertDialog; import android.app.Dialog; import android.app.DialogFragment; import android.content.Context; diff --git a/tests/src/com/android/contacts/tests/allintents/SelectAccountDialogFragment.java b/tests/src/com/android/contacts/tests/allintents/SelectAccountDialogFragment.java index 10661db8b8..41442329f7 100644 --- a/tests/src/com/android/contacts/tests/allintents/SelectAccountDialogFragment.java +++ b/tests/src/com/android/contacts/tests/allintents/SelectAccountDialogFragment.java @@ -18,7 +18,7 @@ import android.accounts.Account; import android.accounts.AccountManager; -import android.app.AlertDialog; +import androidx.appcompat.app.AlertDialog; import android.app.Dialog; import android.app.DialogFragment; import android.content.DialogInterface;