use of com.android.dialer.configprovider.ConfigProvider in project android_packages_apps_Dialer by LineageOS.
the class PostCall method shouldPromptUserToSendMessage.
private static boolean shouldPromptUserToSendMessage(Context context) {
SharedPreferences manager = DialerUtils.getDefaultSharedPreferenceForDeviceProtectedStorageContext(context);
long disconnectTimeMillis = manager.getLong(KEY_POST_CALL_CALL_DISCONNECT_TIME, -1);
long connectTimeMillis = manager.getLong(KEY_POST_CALL_CALL_CONNECT_TIME, -1);
long timeSinceDisconnect = System.currentTimeMillis() - disconnectTimeMillis;
long callDurationMillis = disconnectTimeMillis - connectTimeMillis;
ConfigProvider binding = ConfigProviderBindings.get(context);
return disconnectTimeMillis != -1 && connectTimeMillis != -1 && isSimReady(context) && binding.getLong("postcall_last_call_threshold", 30_000) > timeSinceDisconnect && (connectTimeMillis == 0 || binding.getLong("postcall_call_duration_threshold", 35_000) > callDurationMillis) && getPhoneNumber(context) != null;
}
Aggregations