Merge "Add indexable setting items"
This commit is contained in:
committed by
Android (Google) Code Review
commit
4c96ab379b
@@ -86,8 +86,7 @@
|
|||||||
<com.android.settings.RestrictedListPreference
|
<com.android.settings.RestrictedListPreference
|
||||||
android:key="privacy_lock_screen_notifications"
|
android:key="privacy_lock_screen_notifications"
|
||||||
android:title="@string/lock_screen_notifs_title"
|
android:title="@string/lock_screen_notifs_title"
|
||||||
android:summary="@string/summary_placeholder"
|
android:summary="@string/summary_placeholder"/>
|
||||||
settings:searchable="false"/>
|
|
||||||
|
|
||||||
<!-- Show media on lock screen -->
|
<!-- Show media on lock screen -->
|
||||||
<SwitchPreference
|
<SwitchPreference
|
||||||
@@ -117,8 +116,7 @@
|
|||||||
android:key="privacy_lock_screen_work_profile_notifications"
|
android:key="privacy_lock_screen_work_profile_notifications"
|
||||||
android:title="@string/locked_work_profile_notification_title"
|
android:title="@string/locked_work_profile_notification_title"
|
||||||
android:summary="@string/summary_placeholder"
|
android:summary="@string/summary_placeholder"
|
||||||
android:order="999"
|
android:order="999"/>
|
||||||
settings:searchable="false"/>
|
|
||||||
</PreferenceCategory>
|
</PreferenceCategory>
|
||||||
|
|
||||||
<!-- Content Capture -->
|
<!-- Content Capture -->
|
||||||
|
|||||||
@@ -25,9 +25,12 @@ import static android.app.admin.DevicePolicyResources.Strings.Settings.WORK_PROF
|
|||||||
import android.app.settings.SettingsEnums;
|
import android.app.settings.SettingsEnums;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.os.UserHandle;
|
||||||
|
import android.os.UserManager;
|
||||||
import android.provider.SearchIndexableResource;
|
import android.provider.SearchIndexableResource;
|
||||||
|
|
||||||
import com.android.settings.R;
|
import com.android.settings.R;
|
||||||
|
import com.android.settings.Utils;
|
||||||
import com.android.settings.dashboard.DashboardFragment;
|
import com.android.settings.dashboard.DashboardFragment;
|
||||||
import com.android.settings.notification.LockScreenNotificationPreferenceController;
|
import com.android.settings.notification.LockScreenNotificationPreferenceController;
|
||||||
import com.android.settings.safetycenter.SafetyCenterManagerWrapper;
|
import com.android.settings.safetycenter.SafetyCenterManagerWrapper;
|
||||||
@@ -131,5 +134,21 @@ public class PrivacyDashboardFragment extends DashboardFragment {
|
|||||||
Context context) {
|
Context context) {
|
||||||
return buildPreferenceControllers(context, null);
|
return buildPreferenceControllers(context, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<String> getNonIndexableKeys(Context context) {
|
||||||
|
final List<String> keys = super.getNonIndexableKeys(context);
|
||||||
|
final int profileUserId =
|
||||||
|
Utils.getManagedProfileId(
|
||||||
|
UserManager.get(context), UserHandle.myUserId());
|
||||||
|
// If work profile is supported, we should keep the search result.
|
||||||
|
if (profileUserId != UserHandle.USER_NULL) {
|
||||||
|
return keys;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Otherwise, we should hide the search result.
|
||||||
|
keys.add(KEY_NOTIFICATION_WORK_PROFILE_NOTIFICATIONS);
|
||||||
|
return keys;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user