Merge "Fix Settings app crash cause by BadParcelableException" into udc-dev am: 6853b5d733
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/22848117 Change-Id: I40ad3c374585d14685c8ec564ce0738fd95344ab Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -19,6 +19,7 @@ package com.android.settings.fuelgauge.batterytip.tips;
|
|||||||
import android.app.settings.SettingsEnums;
|
import android.app.settings.SettingsEnums;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
import android.os.Parcel;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
import androidx.preference.Preference;
|
import androidx.preference.Preference;
|
||||||
@@ -43,6 +44,10 @@ public class BatteryDefenderTip extends BatteryTip {
|
|||||||
mIsPluggedIn = isPluggedIn;
|
mIsPluggedIn = isPluggedIn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private BatteryDefenderTip(Parcel in) {
|
||||||
|
super(in);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CharSequence getTitle(Context context) {
|
public CharSequence getTitle(Context context) {
|
||||||
return context.getString(R.string.battery_tip_limited_temporarily_title);
|
return context.getString(R.string.battery_tip_limited_temporarily_title);
|
||||||
@@ -113,4 +118,14 @@ public class BatteryDefenderTip extends BatteryTip {
|
|||||||
|
|
||||||
Log.i(TAG, "send resume charging broadcast intent=" + intent);
|
Log.i(TAG, "send resume charging broadcast intent=" + intent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static final Creator CREATOR = new Creator() {
|
||||||
|
public BatteryTip createFromParcel(Parcel in) {
|
||||||
|
return new BatteryDefenderTip(in);
|
||||||
|
}
|
||||||
|
|
||||||
|
public BatteryTip[] newArray(int size) {
|
||||||
|
return new BatteryDefenderTip[size];
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
@@ -19,6 +19,7 @@ package com.android.settings.fuelgauge.batterytip.tips;
|
|||||||
import android.app.settings.SettingsEnums;
|
import android.app.settings.SettingsEnums;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
import android.os.Parcel;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
import androidx.preference.Preference;
|
import androidx.preference.Preference;
|
||||||
@@ -43,6 +44,10 @@ public class DockDefenderTip extends BatteryTip {
|
|||||||
mMode = mode;
|
mMode = mode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private DockDefenderTip(Parcel in) {
|
||||||
|
super(in);
|
||||||
|
}
|
||||||
|
|
||||||
public int getMode() {
|
public int getMode() {
|
||||||
return mMode;
|
return mMode;
|
||||||
}
|
}
|
||||||
@@ -157,4 +162,14 @@ public class DockDefenderTip extends BatteryTip {
|
|||||||
|
|
||||||
Log.i(TAG, "send resume charging broadcast intent=" + intent);
|
Log.i(TAG, "send resume charging broadcast intent=" + intent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static final Creator CREATOR = new Creator() {
|
||||||
|
public BatteryTip createFromParcel(Parcel in) {
|
||||||
|
return new DockDefenderTip(in);
|
||||||
|
}
|
||||||
|
|
||||||
|
public BatteryTip[] newArray(int size) {
|
||||||
|
return new DockDefenderTip[size];
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
@@ -18,7 +18,7 @@ package com.android.settings.fuelgauge.batterytip.tips;
|
|||||||
|
|
||||||
import android.app.settings.SettingsEnums;
|
import android.app.settings.SettingsEnums;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.os.Parcel;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
import androidx.preference.Preference;
|
import androidx.preference.Preference;
|
||||||
@@ -36,6 +36,10 @@ public final class IncompatibleChargerTip extends BatteryTip {
|
|||||||
super(TipType.INCOMPATIBLE_CHARGER, state, /* showDialog */ false);
|
super(TipType.INCOMPATIBLE_CHARGER, state, /* showDialog */ false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private IncompatibleChargerTip(Parcel in) {
|
||||||
|
super(in);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CharSequence getTitle(Context context) {
|
public CharSequence getTitle(Context context) {
|
||||||
return context.getString(R.string.battery_tip_incompatible_charging_title);
|
return context.getString(R.string.battery_tip_incompatible_charging_title);
|
||||||
@@ -84,4 +88,14 @@ public final class IncompatibleChargerTip extends BatteryTip {
|
|||||||
cardPreference.setPrimaryButtonContentDescription(context.getString(
|
cardPreference.setPrimaryButtonContentDescription(context.getString(
|
||||||
R.string.battery_tip_incompatible_charging_content_description));
|
R.string.battery_tip_incompatible_charging_content_description));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static final Creator CREATOR = new Creator() {
|
||||||
|
public BatteryTip createFromParcel(Parcel in) {
|
||||||
|
return new IncompatibleChargerTip(in);
|
||||||
|
}
|
||||||
|
|
||||||
|
public BatteryTip[] newArray(int size) {
|
||||||
|
return new IncompatibleChargerTip[size];
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user