Start Safety & regulatory manual with new task

Based on the large screen design, Safety & regulatory manual should be
launched as a new task since it doesn’t fulfill the Settings UI design.
And it is not suitable to customize the background and font style with
Settings since the manual is provided by the legal team, we should keep
the content and style aligning with the server side.

Fixes: 197702066
Test: visual
Change-Id: Icaba237961cc774ed1bdca50d9095dc5409039e8
This commit is contained in:
Yanting Yang
2021-09-23 19:35:58 +08:00
parent 6bd4441314
commit a9598c2f80
2 changed files with 16 additions and 3 deletions

View File

@@ -18,6 +18,9 @@ package com.android.settings.deviceinfo;
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 class SafetyInfoPreferenceController extends AbstractPreferenceController
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;
}
}