Merge "Fix Settings app crash cause by BadParcelableException" into udc-dev
This commit is contained in:
@@ -19,6 +19,7 @@ package com.android.settings.fuelgauge.batterytip.tips;
|
||||
import android.app.settings.SettingsEnums;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Parcel;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.preference.Preference;
|
||||
@@ -43,6 +44,10 @@ public class BatteryDefenderTip extends BatteryTip {
|
||||
mIsPluggedIn = isPluggedIn;
|
||||
}
|
||||
|
||||
private BatteryDefenderTip(Parcel in) {
|
||||
super(in);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CharSequence getTitle(Context context) {
|
||||
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);
|
||||
}
|
||||
|
||||
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.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Parcel;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.preference.Preference;
|
||||
@@ -43,6 +44,10 @@ public class DockDefenderTip extends BatteryTip {
|
||||
mMode = mode;
|
||||
}
|
||||
|
||||
private DockDefenderTip(Parcel in) {
|
||||
super(in);
|
||||
}
|
||||
|
||||
public int getMode() {
|
||||
return mMode;
|
||||
}
|
||||
@@ -157,4 +162,14 @@ public class DockDefenderTip extends BatteryTip {
|
||||
|
||||
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.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Parcel;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.preference.Preference;
|
||||
@@ -36,6 +36,10 @@ public final class IncompatibleChargerTip extends BatteryTip {
|
||||
super(TipType.INCOMPATIBLE_CHARGER, state, /* showDialog */ false);
|
||||
}
|
||||
|
||||
private IncompatibleChargerTip(Parcel in) {
|
||||
super(in);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CharSequence getTitle(Context context) {
|
||||
return context.getString(R.string.battery_tip_incompatible_charging_title);
|
||||
@@ -84,4 +88,14 @@ public final class IncompatibleChargerTip extends BatteryTip {
|
||||
cardPreference.setPrimaryButtonContentDescription(context.getString(
|
||||
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