Revert^2 "Improve App notification loading"
c5f1cb11e0
Change-Id: I5a6d39e0a5f2b7bd30bcc12e207b8bb23857c6d8
This commit is contained in:
@@ -34,7 +34,7 @@ public class VibrationPreferenceController extends NotificationPreferenceControl
|
||||
private final Vibrator mVibrator;
|
||||
|
||||
public VibrationPreferenceController(Context context, NotificationBackend backend) {
|
||||
super(context, backend);
|
||||
super(context, backend, KEY_VIBRATE);
|
||||
mVibrator = context.getSystemService(Vibrator.class);
|
||||
}
|
||||
|
||||
@@ -44,14 +44,15 @@ public class VibrationPreferenceController extends NotificationPreferenceControl
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAvailable() {
|
||||
if (!super.isAvailable() || mChannel == null) {
|
||||
return false;
|
||||
}
|
||||
return checkCanBeVisible(NotificationManager.IMPORTANCE_DEFAULT)
|
||||
&& !isDefaultChannel()
|
||||
&& mVibrator != null
|
||||
&& mVibrator.hasVibrator();
|
||||
public int getAvailabilityStatus() {
|
||||
if (super.getAvailabilityStatus() == CONDITIONALLY_UNAVAILABLE || mChannel == null) {
|
||||
return CONDITIONALLY_UNAVAILABLE;
|
||||
}
|
||||
if (checkCanBeVisible(NotificationManager.IMPORTANCE_DEFAULT) && !isDefaultChannel()
|
||||
&& mVibrator != null && mVibrator.hasVibrator()) {
|
||||
return AVAILABLE;
|
||||
}
|
||||
return CONDITIONALLY_UNAVAILABLE;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user