Merge "Remove summary text for Backup & reset." into nyc-mr1-dev
diff --git a/res/layout/sliding_tab_indicator_view.xml b/res/layout/sliding_tab_indicator_view.xml
index c5f61db..b594c8b 100644
--- a/res/layout/sliding_tab_indicator_view.xml
+++ b/res/layout/sliding_tab_indicator_view.xml
@@ -19,4 +19,5 @@
android:id="@+id/sliding_tab_selected_indicator"
android:layout_width="wrap_content"
android:layout_height="@dimen/pager_tabs_selected_indicator_height"
- android:background="@color/accent_color_lighter"/>
+ android:background="?android:attr/colorAccent"
+ android:theme="@*android:style/ThemeOverlay.DeviceDefault.Accent" />
diff --git a/res/values/colors.xml b/res/values/colors.xml
index b2d043f..ccc521c 100644
--- a/res/values/colors.xml
+++ b/res/values/colors.xml
@@ -100,7 +100,6 @@
<color name="importance_disabled_tint">#4d000000</color>
<!-- Accessibility SUW colors -->
- <color name="material_blue_400">#5e97f6</color>
<color name="material_blue_500">#4285F4</color>
<color name="material_blue_700">#3367D6</color>
@@ -125,11 +124,7 @@
<color name="card_background_grey">#eeeeee</color>
- <color name="primary_color">@color/material_blue_grey_900</color>
- <color name="primary_dark_color">@color/material_blue_grey_950</color>
<color name="secondary_color">#ff37474f</color>
- <color name="accent_color">@color/accent_material_light</color>
- <color name="accent_color_lighter">#ff7fcac3</color>
<!-- Gestures settings -->
<color name="gestures_setting_backgroud_color">#f5f5f5</color>
diff --git a/res/values/themes.xml b/res/values/themes.xml
index 70c5146..1268e4d 100644
--- a/res/values/themes.xml
+++ b/res/values/themes.xml
@@ -129,9 +129,7 @@
layouts against a remote context using our local theme colors. Due to the implementation
details of Theme, we can't reference any local resources and MUST instead use the values
directly. So use #ff263238 instead of @color/theme_primary and so on. -->
- <style name="Theme.SettingsBase" parent="@android:style/Theme.Material.Settings">
- <item name="android:colorPrimary">@color/primary_color</item>
- <item name="android:colorAccent">@color/accent_color</item>
+ <style name="Theme.SettingsBase" parent="@android:style/Theme.DeviceDefault.Settings">
<item name="colorSecondary">@color/secondary_color</item>
</style>
@@ -195,8 +193,7 @@
<item name="android:contentInsetStart">@dimen/actionbar_subsettings_contentInsetStart</item>
</style>
- <style name="ThemeOverlay.SwitchBar.Settings" parent="@android:style/ThemeOverlay.Material.Dark.ActionBar">
- <item name="android:colorAccent">@color/accent_color_lighter</item>
+ <style name="ThemeOverlay.SwitchBar.Settings" parent="@*android:style/ThemeOverlay.DeviceDefault.Dark.ActionBar.Accent">
<item name="switchBarMarginStart">@dimen/switchbar_subsettings_margin_start</item>
<item name="switchBarMarginEnd">@dimen/switchbar_subsettings_margin_end</item>
<item name="switchBarBackgroundColor">?attr/colorSecondary</item>
@@ -208,9 +205,7 @@
<item name="switchBarBackgroundColor">?attr/colorSecondary</item>
</style>
- <style name="Theme.DialogWhenLarge" parent="@*android:style/Theme.Material.Settings.DialogWhenLarge">
- <item name="android:colorPrimary">@color/primary_color</item>
- <item name="android:colorAccent">@color/accent_color</item>
+ <style name="Theme.DialogWhenLarge" parent="@*android:style/Theme.DeviceDefault.Settings.DialogWhenLarge">
<item name="colorSecondary">@color/secondary_color</item>
<!-- Redefine the ActionBar style for contentInsetStart -->
<item name="android:actionBarStyle">@style/Theme.ActionBar</item>
@@ -242,8 +237,7 @@
<item name="android:windowSoftInputMode">adjustResize</item>
</style>
- <style name="Theme.AlertDialog" parent="@*android:style/Theme.Material.Settings.Dialog.Alert">
- <item name="android:colorAccent">@color/accent_color</item>
+ <style name="Theme.AlertDialog" parent="@*android:style/Theme.DeviceDefault.Settings.Dialog.Alert">
<item name="android:windowSoftInputMode">adjustResize</item>
<!-- Redefine the ActionBar style for contentInsetStart -->
@@ -263,9 +257,7 @@
<item name="confirmDeviceCredentialsTopMargin">16dp</item>
</style>
- <style name="Theme.ConfirmDeviceCredentialsDark" parent="@android:style/Theme.Material">
- <item name="android:colorPrimary">@color/primary_color</item>
- <item name="android:colorAccent">@color/accent_color_lighter</item>
+ <style name="Theme.ConfirmDeviceCredentialsDark" parent="@android:style/Theme.DeviceDefault">
<item name="android:windowActionBar">false</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowBackground">?android:attr/colorPrimary</item>
diff --git a/src/com/android/settings/TetherSettings.java b/src/com/android/settings/TetherSettings.java
index 86fb1d3..3f91293 100644
--- a/src/com/android/settings/TetherSettings.java
+++ b/src/com/android/settings/TetherSettings.java
@@ -273,6 +273,14 @@
Log.d(TAG, "Restarting WifiAp due to prior config change.");
startTethering(TETHERING_WIFI);
}
+ } else if (action.equals(WifiManager.WIFI_AP_STATE_CHANGED_ACTION)) {
+ int state = intent.getIntExtra(WifiManager.EXTRA_WIFI_AP_STATE, 0);
+ if (state == WifiManager.WIFI_AP_STATE_DISABLED
+ && mRestartWifiApAfterConfigChange) {
+ mRestartWifiApAfterConfigChange = false;
+ Log.d(TAG, "Restarting WifiAp due to prior config change.");
+ startTethering(TETHERING_WIFI);
+ }
} else if (action.equals(Intent.ACTION_MEDIA_SHARED)) {
mMassStorageActive = true;
updateState();
@@ -324,6 +332,7 @@
mMassStorageActive = Environment.MEDIA_SHARED.equals(Environment.getExternalStorageState());
mTetherChangeReceiver = new TetherChangeReceiver();
IntentFilter filter = new IntentFilter(ConnectivityManager.ACTION_TETHER_STATE_CHANGED);
+ filter.addAction(WifiManager.WIFI_AP_STATE_CHANGED_ACTION);
Intent intent = activity.registerReceiver(mTetherChangeReceiver, filter);
filter = new IntentFilter();
diff --git a/src/com/android/settings/applications/LinearColorBar.java b/src/com/android/settings/applications/LinearColorBar.java
index 53b6ab6..b637671 100644
--- a/src/com/android/settings/applications/LinearColorBar.java
+++ b/src/com/android/settings/applications/LinearColorBar.java
@@ -4,7 +4,6 @@
package com.android.settings.applications;
import android.content.Context;
-import android.content.res.Resources;
import android.graphics.Canvas;
import android.graphics.LinearGradient;
import android.graphics.Paint;
@@ -13,9 +12,9 @@
import android.graphics.Shader;
import android.util.AttributeSet;
import android.util.DisplayMetrics;
-import android.util.TypedValue;
import android.view.MotionEvent;
import android.widget.LinearLayout;
+import com.android.settings.Utils;
public class LinearColorBar extends LinearLayout {
@@ -71,11 +70,7 @@
? 2 : 1;
mEdgeGradientPaint.setStrokeWidth(mLineWidth);
mEdgeGradientPaint.setAntiAlias(true);
-
- Resources.Theme theme = context.getTheme();
- TypedValue typedValue = new TypedValue();
- theme.resolveAttribute(android.R.attr.colorAccent, typedValue, true);
- mLeftColor = mMiddleColor = context.getColor(typedValue.resourceId);
+ mLeftColor = mMiddleColor = Utils.getColorAccent(context);
}
public void setOnRegionTappedListener(OnRegionTappedListener listener) {
diff --git a/src/com/android/settings/applications/RunningProcessesView.java b/src/com/android/settings/applications/RunningProcessesView.java
index 6ab3eea..7ba83c2 100644
--- a/src/com/android/settings/applications/RunningProcessesView.java
+++ b/src/com/android/settings/applications/RunningProcessesView.java
@@ -21,7 +21,6 @@
import android.app.Fragment;
import android.content.Context;
import android.content.pm.PackageManager;
-import android.content.res.Resources;
import android.os.Bundle;
import android.os.SystemClock;
import android.os.UserHandle;
@@ -29,7 +28,6 @@
import android.text.format.DateUtils;
import android.text.format.Formatter;
import android.util.AttributeSet;
-import android.util.TypedValue;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@@ -44,6 +42,7 @@
import com.android.internal.util.MemInfoReader;
import com.android.settings.R;
import com.android.settings.SettingsActivity;
+import com.android.settings.Utils;
import java.util.ArrayList;
import java.util.Collections;
@@ -451,13 +450,8 @@
mListView.addHeaderView(mHeader, null, false /* set as not selectable */);
mColorBar = (LinearColorBar)mHeader.findViewById(R.id.color_bar);
final Context context = getContext();
-
- Resources.Theme theme = context.getTheme();
- TypedValue typedValue = new TypedValue();
- theme.resolveAttribute(android.R.attr.colorAccent, typedValue, true);
-
mColorBar.setColors(context.getColor(R.color.running_processes_system_ram),
- context.getColor(typedValue.resourceId),
+ Utils.getColorAccent(context),
context.getColor(R.color.running_processes_free_ram));
mBackgroundProcessPrefix = (TextView)mHeader.findViewById(R.id.freeSizePrefix);
mAppsProcessPrefix = (TextView)mHeader.findViewById(R.id.appsSizePrefix);
diff --git a/src/com/android/settings/fingerprint/FingerprintLocationAnimationView.java b/src/com/android/settings/fingerprint/FingerprintLocationAnimationView.java
index cc1d4fd..a26883a 100644
--- a/src/com/android/settings/fingerprint/FingerprintLocationAnimationView.java
+++ b/src/com/android/settings/fingerprint/FingerprintLocationAnimationView.java
@@ -19,17 +19,18 @@
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.ValueAnimator;
+import android.annotation.ColorInt;
import android.annotation.Nullable;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.util.AttributeSet;
-import android.util.TypedValue;
import android.view.View;
import android.view.animation.AnimationUtils;
import android.view.animation.Interpolator;
import com.android.settings.R;
+import com.android.settings.Utils;
/**
* View which plays an animation to indicate where the sensor is on the device.
@@ -61,13 +62,11 @@
R.fraction.fingerprint_sensor_location_fraction_x, 1, 1);
mFractionCenterY = getResources().getFraction(
R.fraction.fingerprint_sensor_location_fraction_y, 1, 1);
- TypedValue typedValue = new TypedValue();
- context.getTheme().resolveAttribute(android.R.attr.colorAccent, typedValue, true);
- int color = getResources().getColor(typedValue.resourceId, null);
+ @ColorInt int colorAccent = Utils.getColorAccent(context);
mDotPaint.setAntiAlias(true);
mPulsePaint.setAntiAlias(true);
- mDotPaint.setColor(color);
- mPulsePaint.setColor(color);
+ mDotPaint.setColor(colorAccent);
+ mPulsePaint.setColor(colorAccent);
mLinearOutSlowInInterpolator = AnimationUtils.loadInterpolator(context,
android.R.interpolator.linear_out_slow_in);
mFastOutSlowInInterpolator = AnimationUtils.loadInterpolator(context,
diff --git a/src/com/android/settings/fuelgauge/PowerGaugePreference.java b/src/com/android/settings/fuelgauge/PowerGaugePreference.java
index b0bf4b4..9371a19 100644
--- a/src/com/android/settings/fuelgauge/PowerGaugePreference.java
+++ b/src/com/android/settings/fuelgauge/PowerGaugePreference.java
@@ -35,7 +35,7 @@
private final int mIconSize;
private BatteryEntry mInfo;
- private final CharSequence mContentDescription;
+ private CharSequence mContentDescription;
private CharSequence mProgress;
public PowerGaugePreference(Context context, Drawable icon, CharSequence contentDescription,
@@ -48,6 +48,11 @@
mIconSize = context.getResources().getDimensionPixelSize(R.dimen.app_icon_size);
}
+ public void setContentDescription(String name) {
+ mContentDescription = name;
+ notifyChanged();
+ }
+
public void setPercent(double percentOfMax, double percentOfTotal) {
mProgress = Utils.formatPercentage((int) (percentOfTotal + 0.5));
notifyChanged();
diff --git a/src/com/android/settings/fuelgauge/PowerUsageSummary.java b/src/com/android/settings/fuelgauge/PowerUsageSummary.java
index 78f9833..443b480 100644
--- a/src/com/android/settings/fuelgauge/PowerUsageSummary.java
+++ b/src/com/android/settings/fuelgauge/PowerUsageSummary.java
@@ -432,6 +432,9 @@
final UserHandle userHandle = new UserHandle(userId);
pgp.setIcon(mUm.getBadgedIconForUser(entry.getIcon(), userHandle));
pgp.setTitle(entry.name);
+ if (entry.sipper.drainType == DrainType.APP) {
+ pgp.setContentDescription(entry.name);
+ }
}
break;
case BatteryEntry.MSG_REPORT_FULLY_DRAWN:
diff --git a/src/com/android/settings/notification/ImportanceSeekBarPreference.java b/src/com/android/settings/notification/ImportanceSeekBarPreference.java
index 90a3a50..0617df9 100644
--- a/src/com/android/settings/notification/ImportanceSeekBarPreference.java
+++ b/src/com/android/settings/notification/ImportanceSeekBarPreference.java
@@ -16,8 +16,6 @@
package com.android.settings.notification;
-import android.content.res.Resources;
-import android.util.TypedValue;
import com.android.settings.R;
import com.android.settings.SeekBarPreference;
@@ -33,6 +31,7 @@
import android.widget.ImageView;
import android.widget.SeekBar;
import android.widget.TextView;
+import com.android.settings.Utils;
/**
* A slider preference that controls notification importance.
@@ -57,10 +56,7 @@
int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
setLayoutResource(R.layout.preference_importance_slider);
- Resources.Theme theme = context.getTheme();
- TypedValue typedValue = new TypedValue();
- theme.resolveAttribute(android.R.attr.colorAccent, typedValue, true);
- mActiveSliderTint = ColorStateList.valueOf(context.getColor(typedValue.resourceId));
+ mActiveSliderTint = ColorStateList.valueOf(Utils.getColorAccent(context));
mInactiveSliderTint = ColorStateList.valueOf(
context.getColor(R.color.importance_disabled_slider_color));
mHandler = new Handler();