Misc fixes
- Deprecate CopyablePreference - Update search icon for connected device page Fix: 36006104 Fix: 35948464 Test: make RunSettingsRoboTests Change-Id: I0f48028b50d347484b4dd2c7844e782d374715d4
This commit is contained in:
@@ -14,64 +14,76 @@
|
||||
limitations under the License.
|
||||
-->
|
||||
|
||||
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:title="@string/device_status_activity_title">
|
||||
<PreferenceScreen
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:title="@string/device_status_activity_title">
|
||||
|
||||
<com.android.settings.CopyablePreference android:key="battery_status"
|
||||
<Preference
|
||||
android:key="battery_status"
|
||||
android:enabled="false"
|
||||
android:shouldDisableView="false"
|
||||
android:title="@string/battery_status_title"
|
||||
android:summary="@string/device_info_not_available"
|
||||
android:persistent="false" />
|
||||
<com.android.settings.CopyablePreference android:key="battery_level"
|
||||
android:summary="@string/device_info_not_available" />
|
||||
<Preference
|
||||
android:key="battery_level"
|
||||
android:enabled="false"
|
||||
android:shouldDisableView="false"
|
||||
android:title="@string/battery_level_title"
|
||||
android:summary="@string/device_info_not_available"
|
||||
android:persistent="false" />
|
||||
<Preference android:key="sim_status"
|
||||
<Preference
|
||||
android:key="sim_status"
|
||||
android:title="@string/sim_status_title"
|
||||
android:persistent="false">
|
||||
<intent android:targetPackage="com.android.settings"
|
||||
<intent
|
||||
android:targetPackage="com.android.settings"
|
||||
android:targetClass="com.android.settings.Settings$SimStatusActivity" />
|
||||
</Preference>
|
||||
<Preference android:key="imei_info"
|
||||
<Preference
|
||||
android:key="imei_info"
|
||||
android:title="@string/imei_information_title"
|
||||
android:persistent="false">
|
||||
<intent android:targetPackage="com.android.settings"
|
||||
<intent
|
||||
android:targetPackage="com.android.settings"
|
||||
android:targetClass="com.android.settings.Settings$ImeiInformationActivity" />
|
||||
</Preference>
|
||||
<com.android.settings.CopyablePreference android:key="wifi_ip_address"
|
||||
<Preference
|
||||
android:key="wifi_ip_address"
|
||||
android:enabled="false"
|
||||
android:shouldDisableView="false"
|
||||
android:title="@string/wifi_advanced_ip_address_title"
|
||||
android:summary="@string/device_info_not_available"
|
||||
android:persistent="false" />
|
||||
<com.android.settings.CopyablePreference android:key="wifi_mac_address"
|
||||
<Preference
|
||||
android:key="wifi_mac_address"
|
||||
android:enabled="false"
|
||||
android:shouldDisableView="false"
|
||||
android:title="@string/status_wifi_mac_address"
|
||||
android:summary="@string/device_info_not_available"
|
||||
android:persistent="false" />
|
||||
<com.android.settings.CopyablePreference android:key="bt_address"
|
||||
<Preference
|
||||
android:key="bt_address"
|
||||
android:enabled="false"
|
||||
android:shouldDisableView="false"
|
||||
android:title="@string/status_bt_address"
|
||||
android:summary="@string/device_info_not_available"
|
||||
android:persistent="false" />
|
||||
<com.android.settings.CopyablePreference android:key="serial_number"
|
||||
<Preference
|
||||
android:key="serial_number"
|
||||
android:enabled="false"
|
||||
android:shouldDisableView="false"
|
||||
android:title="@string/status_serial_number"
|
||||
android:summary="@string/device_info_not_available"
|
||||
android:persistent="false" />
|
||||
<com.android.settings.CopyablePreference android:key="up_time"
|
||||
<Preference
|
||||
android:key="up_time"
|
||||
android:enabled="false"
|
||||
android:shouldDisableView="false"
|
||||
android:title="@string/status_up_time"
|
||||
android:summary="@string/device_info_not_available"
|
||||
android:persistent="false" />
|
||||
<com.android.settings.CopyablePreference android:key="wimax_mac_address"
|
||||
<Preference
|
||||
android:key="wimax_mac_address"
|
||||
android:enabled="false"
|
||||
android:shouldDisableView="false"
|
||||
android:title="@string/status_wimax_mac_address"
|
||||
|
@@ -1,63 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2015 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.android.settings;
|
||||
|
||||
import android.content.ClipboardManager;
|
||||
import android.content.Context;
|
||||
import android.support.v7.preference.Preference;
|
||||
import android.support.v7.preference.PreferenceViewHolder;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.View;
|
||||
import android.view.View.OnLongClickListener;
|
||||
import android.widget.Toast;
|
||||
|
||||
public class CopyablePreference extends Preference {
|
||||
|
||||
public CopyablePreference(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
}
|
||||
|
||||
public CopyablePreference(Context context) {
|
||||
this(context, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(PreferenceViewHolder holder) {
|
||||
super.onBindViewHolder(holder);
|
||||
holder.setDividerAllowedAbove(true);
|
||||
holder.setDividerAllowedBelow(true);
|
||||
holder.itemView.setLongClickable(true);
|
||||
holder.itemView.setOnLongClickListener(new OnLongClickListener() {
|
||||
@Override
|
||||
public boolean onLongClick(View v) {
|
||||
copyPreference(getContext(), CopyablePreference.this);
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public CharSequence getCopyableText() {
|
||||
return getSummary();
|
||||
}
|
||||
|
||||
public static void copyPreference(Context context, CopyablePreference pref) {
|
||||
ClipboardManager cm =
|
||||
(ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE);
|
||||
cm.setText(pref.getCopyableText());
|
||||
Toast.makeText(context, com.android.internal.R.string.text_copied, Toast.LENGTH_SHORT)
|
||||
.show();
|
||||
}
|
||||
}
|
@@ -16,8 +16,11 @@
|
||||
|
||||
package com.android.settings.notification;
|
||||
|
||||
import android.app.*;
|
||||
import android.app.Activity;
|
||||
import android.app.ActivityManager;
|
||||
import android.app.INotificationManager;
|
||||
import android.app.Notification;
|
||||
import android.app.PendingIntent;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.IntentSender;
|
||||
@@ -26,7 +29,12 @@ import android.content.pm.PackageManager;
|
||||
import android.content.res.Resources;
|
||||
import android.graphics.Typeface;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.*;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Parcel;
|
||||
import android.os.RemoteException;
|
||||
import android.os.ServiceManager;
|
||||
import android.os.UserHandle;
|
||||
import android.service.notification.NotificationListenerService;
|
||||
import android.service.notification.NotificationListenerService.Ranking;
|
||||
import android.service.notification.NotificationListenerService.RankingMap;
|
||||
@@ -45,13 +53,15 @@ import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
|
||||
import com.android.settings.CopyablePreference;
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.SettingsPreferenceFragment;
|
||||
import com.android.settings.Utils;
|
||||
|
||||
import java.lang.StringBuilder;
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public class NotificationStation extends SettingsPreferenceFragment {
|
||||
private static final String TAG = NotificationStation.class.getSimpleName();
|
||||
@@ -533,7 +543,7 @@ public class NotificationStation extends SettingsPreferenceFragment {
|
||||
return null;
|
||||
}
|
||||
|
||||
private static class HistoricalNotificationPreference extends CopyablePreference {
|
||||
private static class HistoricalNotificationPreference extends Preference {
|
||||
private final HistoricalNotificationInfo mInfo;
|
||||
|
||||
public HistoricalNotificationPreference(Context context, HistoricalNotificationInfo info) {
|
||||
@@ -573,14 +583,6 @@ public class NotificationStation extends SettingsPreferenceFragment {
|
||||
row.itemView.setAlpha(mInfo.active ? 1.0f : 0.5f);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CharSequence getCopyableText() {
|
||||
return new SpannableStringBuilder(mInfo.title)
|
||||
.append(" [").append(new Date(mInfo.timestamp).toString())
|
||||
.append("]\n").append(mInfo.pkgname)
|
||||
.append("\n").append(mInfo.extra);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void performClick() {
|
||||
// Intent intent = new Intent(android.provider.Settings.ACTION_APPLICATION_DETAILS_SETTINGS,
|
||||
|
@@ -166,7 +166,7 @@ public final class SearchIndexableResources {
|
||||
R.drawable.ic_settings_notifications);
|
||||
addIndex(SystemDashboardFragment.class, NO_DATA_RES_ID, R.drawable.ic_settings_about);
|
||||
addIndex(StorageDashboardFragment.class, NO_DATA_RES_ID, R.drawable.ic_settings_storage);
|
||||
addIndex(ConnectedDeviceDashboardFragment.class, NO_DATA_RES_ID, R.drawable.ic_bt_laptop);
|
||||
addIndex(ConnectedDeviceDashboardFragment.class, NO_DATA_RES_ID, R.drawable.ic_devices_other);
|
||||
addIndex(EnterprisePrivacySettings.class, NO_DATA_RES_ID, R.drawable.ic_settings_about);
|
||||
addIndex(PaymentSettings.class, NO_DATA_RES_ID, R.drawable.ic_settings_nfc_payment);
|
||||
addIndex(
|
||||
|
Reference in New Issue
Block a user