Merge "Start Safety & regulatory manual with new task" into sc-v2-dev am: 0a942ab338
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/15895173
Change-Id: I8dbd4c80dd48d8592b43478f9c88f2dbe7d89389
diff --git a/res/xml/my_device_info.xml b/res/xml/my_device_info.xml
index 818069b..35082fd 100644
--- a/res/xml/my_device_info.xml
+++ b/res/xml/my_device_info.xml
@@ -84,9 +84,7 @@
<Preference
android:key="safety_info"
android:order="17"
- android:title="@string/safety_and_regulatory_info">
- <intent android:action="android.settings.SHOW_SAFETY_AND_REGULATORY_INFO"/>
- </Preference>
+ android:title="@string/safety_and_regulatory_info"/>
</PreferenceCategory>
<PreferenceCategory
diff --git a/src/com/android/settings/deviceinfo/SafetyInfoPreferenceController.java b/src/com/android/settings/deviceinfo/SafetyInfoPreferenceController.java
index 10dbd19..92e4576 100644
--- a/src/com/android/settings/deviceinfo/SafetyInfoPreferenceController.java
+++ b/src/com/android/settings/deviceinfo/SafetyInfoPreferenceController.java
@@ -18,6 +18,9 @@
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
+import android.text.TextUtils;
+
+import androidx.preference.Preference;
import com.android.settings.core.PreferenceControllerMixin;
import com.android.settingslib.core.AbstractPreferenceController;
@@ -44,4 +47,16 @@
public String getPreferenceKey() {
return "safety_info";
}
+
+ @Override
+ public boolean handlePreferenceTreeClick(Preference preference) {
+ if (!TextUtils.equals(preference.getKey(), getPreferenceKey())) {
+ return false;
+ }
+
+ final Intent intent = new Intent(INTENT_PROBE);
+ intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+ mContext.startActivity(intent);
+ return true;
+ }
}