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

Commit dd25b711 authored by Dipen Pradhan's avatar Dipen Pradhan
Browse files

Add config for "Share" action in TextView context menu

"Share" text action is not applicable to all platforms, this config
allows disabling the action item.
Example - Automotive (AAOS) does not support it

Bug: 162463255

Test: atest TextViewTest EditTextTest, manual check
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:712f9d38e3ea2b42fad56b52fbaed83442f2856e)
Merged-In: I825a85bdf566c0a319bd91b523284757af6be68e
Change-Id: I825a85bdf566c0a319bd91b523284757af6be68e
parent 46058d80
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -14996,7 +14996,9 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
    }
    boolean canShare() {
        if (!getContext().canStartActivityForResult() || !isDeviceProvisioned()) {
        if (!getContext().canStartActivityForResult() || !isDeviceProvisioned()
                || !getContext().getResources().getBoolean(
                com.android.internal.R.bool.config_textShareSupported)) {
            return false;
        }
        return canCopy();
+4 −0
Original line number Diff line number Diff line
@@ -6589,6 +6589,10 @@
         for the non-customized ones. -->
    <string name="config_hapticFeedbackCustomizationFile" />

    <!-- Enables or disables the "Share" action item shown in the context menu that appears upon
        long-pressing on selected text. Enabled by default. -->
    <bool name="config_textShareSupported">true</bool>

    <!-- Whether or not ActivityManager PSS profiling is disabled. -->
    <bool name="config_am_disablePssProfiling">false</bool>
</resources>
+1 −0
Original line number Diff line number Diff line
@@ -3051,6 +3051,7 @@
  <java-symbol type="id" name="addToDictionaryButton" />
  <java-symbol type="id" name="deleteButton" />
  <!-- TextView -->
  <java-symbol type="bool" name="config_textShareSupported" />
  <java-symbol type="string" name="failed_to_copy_to_clipboard" />

  <java-symbol type="id" name="notification_material_reply_container" />