Loading packages/SystemUI/src/com/android/systemui/statusbar/policy/SmartReplyConstants.java +6 −18 Original line number Diff line number Diff line Loading @@ -118,7 +118,8 @@ public final class SmartReplyConstants { mRequiresTargetingP = readDeviceConfigBooleanOrDefaultIfEmpty( SystemUiDeviceConfigFlags.SSIN_REQUIRES_TARGETING_P, mDefaultRequiresP); mMaxSqueezeRemeasureAttempts = readDeviceConfigIntegerOrDefaultIfEmpty( mMaxSqueezeRemeasureAttempts = DeviceConfig.getInt( DeviceConfig.NAMESPACE_SYSTEMUI, SystemUiDeviceConfigFlags.SSIN_MAX_SQUEEZE_REMEASURE_ATTEMPTS, mDefaultMaxSqueezeRemeasureAttempts); mEditChoicesBeforeSending = readDeviceConfigBooleanOrDefaultIfEmpty( Loading @@ -127,10 +128,12 @@ public final class SmartReplyConstants { mShowInHeadsUp = readDeviceConfigBooleanOrDefaultIfEmpty( SystemUiDeviceConfigFlags.SSIN_SHOW_IN_HEADS_UP, mDefaultShowInHeadsUp); mMinNumSystemGeneratedReplies = readDeviceConfigIntegerOrDefaultIfEmpty( mMinNumSystemGeneratedReplies = DeviceConfig.getInt( DeviceConfig.NAMESPACE_SYSTEMUI, SystemUiDeviceConfigFlags.SSIN_MIN_NUM_SYSTEM_GENERATED_REPLIES, mDefaultMinNumSystemGeneratedReplies); mMaxNumActions = readDeviceConfigIntegerOrDefaultIfEmpty( mMaxNumActions = DeviceConfig.getInt( DeviceConfig.NAMESPACE_SYSTEMUI, SystemUiDeviceConfigFlags.SSIN_MAX_NUM_ACTIONS, mDefaultMaxNumActions); } Loading @@ -152,21 +155,6 @@ public final class SmartReplyConstants { return defaultValue; } private static int readDeviceConfigIntegerOrDefaultIfEmpty(String propertyName, int defaultValue) { String value = DeviceConfig.getProperty(DeviceConfig.NAMESPACE_SYSTEMUI, propertyName); if (TextUtils.isEmpty(value)) { return defaultValue; } try { return Integer.parseInt(value); } catch (NumberFormatException e) { Log.e(TAG, "Tried to read an integer flag, property name=" + propertyName + ", value=" + value); return defaultValue; } } /** Returns whether smart replies in notifications are enabled. */ public boolean isEnabled() { return mEnabled; Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/policy/SmartReplyConstants.java +6 −18 Original line number Diff line number Diff line Loading @@ -118,7 +118,8 @@ public final class SmartReplyConstants { mRequiresTargetingP = readDeviceConfigBooleanOrDefaultIfEmpty( SystemUiDeviceConfigFlags.SSIN_REQUIRES_TARGETING_P, mDefaultRequiresP); mMaxSqueezeRemeasureAttempts = readDeviceConfigIntegerOrDefaultIfEmpty( mMaxSqueezeRemeasureAttempts = DeviceConfig.getInt( DeviceConfig.NAMESPACE_SYSTEMUI, SystemUiDeviceConfigFlags.SSIN_MAX_SQUEEZE_REMEASURE_ATTEMPTS, mDefaultMaxSqueezeRemeasureAttempts); mEditChoicesBeforeSending = readDeviceConfigBooleanOrDefaultIfEmpty( Loading @@ -127,10 +128,12 @@ public final class SmartReplyConstants { mShowInHeadsUp = readDeviceConfigBooleanOrDefaultIfEmpty( SystemUiDeviceConfigFlags.SSIN_SHOW_IN_HEADS_UP, mDefaultShowInHeadsUp); mMinNumSystemGeneratedReplies = readDeviceConfigIntegerOrDefaultIfEmpty( mMinNumSystemGeneratedReplies = DeviceConfig.getInt( DeviceConfig.NAMESPACE_SYSTEMUI, SystemUiDeviceConfigFlags.SSIN_MIN_NUM_SYSTEM_GENERATED_REPLIES, mDefaultMinNumSystemGeneratedReplies); mMaxNumActions = readDeviceConfigIntegerOrDefaultIfEmpty( mMaxNumActions = DeviceConfig.getInt( DeviceConfig.NAMESPACE_SYSTEMUI, SystemUiDeviceConfigFlags.SSIN_MAX_NUM_ACTIONS, mDefaultMaxNumActions); } Loading @@ -152,21 +155,6 @@ public final class SmartReplyConstants { return defaultValue; } private static int readDeviceConfigIntegerOrDefaultIfEmpty(String propertyName, int defaultValue) { String value = DeviceConfig.getProperty(DeviceConfig.NAMESPACE_SYSTEMUI, propertyName); if (TextUtils.isEmpty(value)) { return defaultValue; } try { return Integer.parseInt(value); } catch (NumberFormatException e) { Log.e(TAG, "Tried to read an integer flag, property name=" + propertyName + ", value=" + value); return defaultValue; } } /** Returns whether smart replies in notifications are enabled. */ public boolean isEnabled() { return mEnabled; Loading