From: Markus Pfeiffer
Date: Tue, 21 Nov 2023 14:37:22 +0000 (+0100)
Subject: android: Show warning message for read-only profiles in detail view
X-Git-Tag: android-2.5.0^2~31
X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5f9f279a33b8cf8f1efdfbb636815206f9a676ce;p=thirdparty%2Fstrongswan.git
android: Show warning message for read-only profiles in detail view
Show a message explaining that a managed profile can't be edited in
its detail view.
---
diff --git a/src/frontends/android/app/src/main/java/org/strongswan/android/ui/VpnProfileDetailActivity.java b/src/frontends/android/app/src/main/java/org/strongswan/android/ui/VpnProfileDetailActivity.java
index b01e67f881..4a6aac45f5 100644
--- a/src/frontends/android/app/src/main/java/org/strongswan/android/ui/VpnProfileDetailActivity.java
+++ b/src/frontends/android/app/src/main/java/org/strongswan/android/ui/VpnProfileDetailActivity.java
@@ -98,6 +98,7 @@ public class VpnProfileDetailActivity extends AppCompatActivity
private SelectedAppsHandling mSelectedAppsHandling = SelectedAppsHandling.SELECTED_APPS_DISABLE;
private SortedSet mSelectedApps = new TreeSet<>();
private VpnProfile mProfile;
+ private View mManagedProfile;
private MultiAutoCompleteTextView mName;
private TextInputLayoutHelper mNameWrap;
private EditText mGateway;
@@ -195,6 +196,8 @@ public class VpnProfileDetailActivity extends AppCompatActivity
setContentView(R.layout.profile_detail_view);
+ mManagedProfile = findViewById(R.id.managed_profile);
+
mName = findViewById(R.id.name);
mNameWrap = findViewById(R.id.name_wrap);
mGateway = findViewById(R.id.gateway);
@@ -857,6 +860,8 @@ public class VpnProfileDetailActivity extends AppCompatActivity
private void setReadOnly(final boolean readOnly)
{
+ mManagedProfile.setVisibility(readOnly ? View.VISIBLE : View.GONE);
+
mName.setEnabled(!readOnly);
mGateway.setEnabled(!readOnly);
mUsername.setEnabled(!readOnly);
diff --git a/src/frontends/android/app/src/main/res/layout/profile_detail_view.xml b/src/frontends/android/app/src/main/res/layout/profile_detail_view.xml
index bdded43370..5197c63f71 100644
--- a/src/frontends/android/app/src/main/res/layout/profile_detail_view.xml
+++ b/src/frontends/android/app/src/main/res/layout/profile_detail_view.xml
@@ -16,541 +16,567 @@
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
-->
-
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
+ android:background="@drawable/state_background"
+ android:drawableStart="@android:drawable/ic_dialog_alert"
+ android:drawablePadding="8dp"
+ android:padding="8dp"
+ android:text="@string/alert_text_vpn_profile_read_only"
+ android:textColor="?android:attr/textColorPrimary"
+ android:textAppearance="?android:attr/textAppearanceSmall"
+ android:textStyle="bold"
+ android:visibility="gone"
+ app:layout_constraintTop_toTopOf="parent"
+ tools:visibility="visible" />
+
+
+ android:animateLayoutChanges="true"
+ android:orientation="vertical"
+ android:padding="10dp">
+ android:layout_marginTop="6dp"
+ android:hint="@string/profile_gateway_label"
+ app:helper_text="@string/profile_gateway_hint">
+ android:inputType="textNoSuggestions"
+ android:singleLine="true" />
-
-
-
-
-
-
-
-
-
+ android:layout_marginLeft="4dp"
+ android:text="@string/profile_vpn_type_label"
+ android:textSize="12sp" />
-
+ android:entries="@array/vpn_types"
+ android:spinnerMode="dropdown" />
+ android:id="@+id/tnc_notice"
+ layout="@layout/two_line_button"
+ android:visibility="gone" />
-
+ android:orientation="vertical">
-
+
-
+
-
+
+
+
-
+
-
+
-
+
+
+ android:layout_marginBottom="4dp"
+ android:orientation="vertical">
-
+
-
+
-
+
+
+
+ android:text="@string/profile_ca_label"
+ android:textSize="12sp" />
-
-
-
+ android:layout_marginTop="4dp"
+ android:text="@string/profile_ca_auto_label" />
-
+
+ android:layout_marginTop="8dp"
+ android:hint="@string/profile_name_label"
+ app:helper_text="@string/profile_name_hint">
+ android:singleLine="true" />
-
-
-
+ android:text="@string/profile_show_advanced_label" />
-
-
-
+ android:orientation="vertical">
-
-
-
-
-
+ android:layout_marginLeft="4dp"
+ android:layout_marginTop="10dp"
+ android:text="@string/profile_advanced_label"
+ android:textSize="20sp" />
-
+
+
+
+
+
+
+ android:hint="@string/profile_local_id_label"
+ app:helper_text="@string/profile_local_id_hint_user">
-
+
-
+
-
+ android:hint="@string/profile_dns_servers_label"
+ app:helper_text="@string/profile_dns_servers_hint">
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
-
+
-
+
-
+
-
+
-
+
+
+
-
+
+
+
-
+
+
+
-
+ android:layout_marginStart="4dp"
+ android:layout_marginLeft="4dp"
+ android:layout_marginBottom="10dp"
+ android:text="@string/profile_strict_revocation_hint"
+ android:textSize="12sp" />
+
+
-
+
+
+
-
+
-
+
+
+
+
+ android:hint="@string/profile_included_subnets_label"
+ app:helper_text="@string/profile_included_subnets_hint">
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
+
+
-
+
-
+
+
+
+
+ android:hint="@string/profile_proposals_ike_label"
+ app:helper_text="@string/profile_proposals_ike_hint">
-
+
-
+
-
+ android:hint="@string/profile_proposals_esp_label"
+ app:helper_text="@string/profile_proposals_esp_hint">
-
+
-
+
-
+
+
+
-
+
-
+
-
+
+
diff --git a/src/frontends/android/app/src/main/res/values-de/strings.xml b/src/frontends/android/app/src/main/res/values-de/strings.xml
index 19d5a1a541..4e16f5d8dd 100644
--- a/src/frontends/android/app/src/main/res/values-de/strings.xml
+++ b/src/frontends/android/app/src/main/res/values-de/strings.xml
@@ -149,6 +149,7 @@
Bitte geben Sie mit Leerzeichen getrennte, gültige Subnetzte und/oder IP-Adressen einBitte geben Sie mit Leerzeichen getrennte, gültige IP-Adressen einBitte geben Sie eine mit Bindestrichen getrennte, gültige Liste von Algorithmen ein
+ Dieses Profil wird von Ihrem Administrator verwaltet und kann nicht bearbeitet werden. Nur das Passwort kann geändert werdenEAP-TNC kann Ihre Privatsphäre beeinträchtigenGerätedaten werden an den Server-Betreiber gesendetTrusted Network Connect (TNC) erlaubt Server-Betreibern den Gesundheitszustand von Endgeräten zu prüfen.
Dazu kann der Betreiber Daten verlangen, wie etwa eine eindeutige Identifikationsnummer, eine Liste der installierten Pakete, Systemeinstellungen oder kryptografische Prüfsummen von Dateien.
Solche Daten werden nur übermittelt nachdem die Identität des Servers geprüft wurde.]]>
diff --git a/src/frontends/android/app/src/main/res/values-pl/strings.xml b/src/frontends/android/app/src/main/res/values-pl/strings.xml
index 737eddf868..68089da938 100644
--- a/src/frontends/android/app/src/main/res/values-pl/strings.xml
+++ b/src/frontends/android/app/src/main/res/values-pl/strings.xml
@@ -151,6 +151,7 @@
Please enter valid subnets and/or IP addresses, separated by spacesPlease enter valid IP addresses, separated by spacesPlease enter a valid list of algorithms, separated by hyphens
+ This VPN profile is managed by your administrator and can\'t be modified. You can only change the passwordEAP-TNC may affect your privacyDevice data is sent to the server operatorTrusted Network Connect (TNC) allows server operators to assess the health of a client device.
For that purpose the server operator may request data such as a unique identifier, a list of installed packages, system settings, or cryptographic checksums of files.
Any data will be sent only after verifying the server\'s identity.]]>
diff --git a/src/frontends/android/app/src/main/res/values-ru/strings.xml b/src/frontends/android/app/src/main/res/values-ru/strings.xml
index 2bbe2b4dc1..ab35f29e75 100644
--- a/src/frontends/android/app/src/main/res/values-ru/strings.xml
+++ b/src/frontends/android/app/src/main/res/values-ru/strings.xml
@@ -145,6 +145,7 @@
Please enter valid subnets and/or IP addresses, separated by spacesPlease enter valid IP addresses, separated by spacesPlease enter a valid list of algorithms, separated by hyphens
+ This VPN profile is managed by your administrator and can\'t be modified. You can only change the passwordEAP-TNC may affect your privacyDevice data is sent to the server operatorTrusted Network Connect (TNC) allows server operators to assess the health of a client device.
For that purpose the server operator may request data such as a unique identifier, a list of installed packages, system settings, or cryptographic checksums of files.
Any data will be sent only after verifying the server\'s identity.]]>
diff --git a/src/frontends/android/app/src/main/res/values-uk/strings.xml b/src/frontends/android/app/src/main/res/values-uk/strings.xml
index 3868fc4756..677d7c95d2 100644
--- a/src/frontends/android/app/src/main/res/values-uk/strings.xml
+++ b/src/frontends/android/app/src/main/res/values-uk/strings.xml
@@ -146,6 +146,7 @@
Please enter valid subnets and/or IP addresses, separated by spacesPlease enter valid IP addresses, separated by spacesPlease enter a valid list of algorithms, separated by hyphens
+ This VPN profile is managed by your administrator and can\'t be modified. You can only change the passwordEAP-TNC may affect your privacyDevice data is sent to the server operatorTrusted Network Connect (TNC) allows server operators to assess the health of a client device.
For that purpose the server operator may request data such as a unique identifier, a list of installed packages, system settings, or cryptographic checksums of files.
For that purpose the server operator may request data such as a unique identifier, a list of installed packages, system settings, or cryptographic checksums of files.
Any data will be sent only after verifying the server\'s identity.]]>