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

Commit afbb32a3 authored by Tyler Gunn's avatar Tyler Gunn
Browse files

Cleanup telecom resources dependencies.

1. Made copies of `noApplications` and `android_system_label` string
resources referenced from frameworks/base into Telecom; used
`BACKUP_MESSAGE_ID` to reference the original translation console entries
so that the translations from the original items will get copied into the
new strings in Telecom (saves translation work).
2. Deleted from comments indicating we needed to import
com.android.internal.R.
3. Moved unloggable_phone_numbers from frameworks/base to Telecom; this
is not a well used config.
4. Deleted MultiLineTitleEditTextPreference which had a system resource
reference; we don't actually use this class at all.

Flag: com.android.server.telecom.flags.resolve_hidden_dependencies_two
Bug: 308205987
Test: Re-run unit tests and perform basic correctness testing.
Change-Id: Icbaf6f15c26ae72540ef4468cac8082b06a463b7
parent 11242d1a
Loading
Loading
Loading
Loading
+28 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
** Copyright 2018, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You my obtain a copy of the License at
**
**     http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
-->

<!-- These resources are around just to allow their values to be customized
     for different hardware and product builds. -->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
  <!-- String array containing numbers that shouldn't be logged
       016 present here for Spain's gender violence number -->
  <string-array translatable="false" name="unloggable_phone_numbers">
    <item>016</item>
  </string-array>
</resources>
+4 −0
Original line number Diff line number Diff line
@@ -92,4 +92,8 @@
        <!-- Used for internal targets -->
        <item>com.google.android.bluetooth</item>
    </string-array>

    <!-- String array containing numbers that shouldn't be logged. Country-specific.
         Copied from frameworks/base/core/res/res/values/config.xml -->
    <string-array name="unloggable_phone_numbers" />
</resources>
+10 −0
Original line number Diff line number Diff line
@@ -444,4 +444,14 @@
    <!-- In-call screen: error message shown when the user attempts to dial an MMI code during an
         ongoing emergency call. -->
    <string name="emergencyCall_reject_mmi">MMI codes cannot be dialed during an emergency call.</string>
    <!-- Text to display when attempting to send an SMS in response to an incoming call but there
         no SMS apps on the device.  Realistically should never happen.
         This is a copy of the frameworks noApplications resource with the message ID specified. -->
    <!-- [BACKUP_MESSAGE_ID: 1186909265235544019] -->
    <string name="noApplications">No apps can perform this action.</string>

    <!-- Label for the Android system components when they are shown to the user.
         Used when referring to "android" from the incoming call notification. -->
    <!-- [BACKUP_MESSAGE_ID: 5974767339591067210] -->
    <string name="android_system_label">Android System</string>
</resources>
+8 −2
Original line number Diff line number Diff line
@@ -476,8 +476,14 @@ public final class CallLogManager extends CallsManagerListenerBase {
        String[] unloggableNumbersFromCarrierConfig = carrierConfig == null ? null
                : carrierConfig.getStringArray(
                        CarrierConfigManager.KEY_UNLOGGABLE_NUMBERS_STRING_ARRAY);
        String[] unloggableNumbersFromMccConfig = mContext.getResources()
        String[] unloggableNumbersFromMccConfig;
        if (mFeatureFlags.resolveHiddenDependenciesTwo()) {
            unloggableNumbersFromMccConfig = mContext.getResources()
                    .getStringArray(com.android.server.telecom.R.array.unloggable_phone_numbers);
        } else {
            unloggableNumbersFromMccConfig = mContext.getResources()
                    .getStringArray(com.android.internal.R.array.unloggable_phone_numbers);
        }
        return Stream.concat(
                unloggableNumbersFromCarrierConfig == null ?
                        Stream.empty() : Arrays.stream(unloggableNumbersFromCarrierConfig),
+14 −2
Original line number Diff line number Diff line
@@ -3243,8 +3243,20 @@ public class CallsManager extends Call.ListenerBase
            }).start();
        }

        final boolean requireCallCapableAccountByHandle = mContext.getResources().getBoolean(
        final boolean requireCallCapableAccountByHandle;
        if (mFeatureFlags.resolveHiddenDependenciesTwo()) {
            // This was previously only configured "true" for wear and cuttlefish builds.
            // For cases where no target phone account handle were given this determines whether
            // the phone account registrar query to get call capable phone accounts looks for a
            // specific URI scheme or not.  On non-wear and cuttlefish builds we ued to just check
            // all call capable phone accounts without accounting for scheme; that logic was
            // flawed since dialing a tel: uri number REQUIRES a call capable tel: phone account.
            // We are in effect removing this option.
            requireCallCapableAccountByHandle = true;
        } else {
            requireCallCapableAccountByHandle = mContext.getResources().getBoolean(
                    com.android.internal.R.bool.config_requireCallCapableAccountForHandle);
        }
        final boolean isOutgoingCallPermitted = isOutgoingCallPermitted(call,
                call.getTargetPhoneAccount());
        final String callHandleScheme =
Loading