diff --git a/java/com/android/dialer/app/res/values/bliss_arrays.xml b/java/com/android/dialer/app/res/values/bliss_arrays.xml
new file mode 100644
index 0000000..7a5adb2
--- /dev/null
+++ b/java/com/android/dialer/app/res/values/bliss_arrays.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+     Copyright (C) 2018 Syberia Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+    <!-- Proximity speaker delay entries. -->
+    <string-array name="proximity_delay_entries" translatable="false">
+        <item>1000</item>
+        <item>1500</item>
+        <item>2000</item>
+        <item>2500</item>
+        <item>3000</item>
+        <item>4000</item>
+        <item>5000</item>
+    </string-array>
+
+    <!-- Proximity speaker delay values. -->
+    <string-array name="proximity_delay_values" translatable="false">
+        <item>1000</item>
+        <item>1500</item>
+        <item>2000</item>
+        <item>2500</item>
+        <item>3000</item>
+        <item>4000</item>
+        <item>5000</item>
+    </string-array>
+</resources>
diff --git a/java/com/android/dialer/app/res/values/bliss_bools.xml b/java/com/android/dialer/app/res/values/bliss_bools.xml
new file mode 100644
index 0000000..f6d0bbb
--- /dev/null
+++ b/java/com/android/dialer/app/res/values/bliss_bools.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2018 Syberia Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+<resources>
+    <!-- Disable speaker proximity preference for problematic devices -->
+    <bool name="config_enabled_speakerprox" translatable="false">true</bool>
+</resources>
diff --git a/java/com/android/dialer/app/res/values/bliss_strings.xml b/java/com/android/dialer/app/res/values/bliss_strings.xml
index 0cc849a..23616c9 100644
--- a/java/com/android/dialer/app/res/values/bliss_strings.xml
+++ b/java/com/android/dialer/app/res/values/bliss_strings.xml
@@ -22,4 +22,15 @@
     <string name="disable_proximity_sensor_summary">Do not turn off touchscreen and display in call based on proximity sensor</string>
     <string name="sensor_settings_titile">Sensors</string>
 
+    <!-- Proximity speaker -->
+    <string name="speaker_settings_label">Proximity speakerphone</string>
+    <string name="prox_auto_speaker_title">Automatic proximity speakerphone</string>
+    <string name="prox_auto_speaker_summary">Enable speakerphone automatically when your phone is removed from your ear</string>
+    <string name="prox_auto_speaker_delay_title">Speakerphone delay</string>
+    <string name="prox_auto_speaker_delay_dialog_title">Speakerphone delay in (ms)</string>
+    <string name="prox_auto_speaker_delay_summary">Speakerphone will be activated in <xliff:g id="number">%d</xliff:g> ms</string>
+    <string name="prox_auto_speaker_incall_only_title">Only while in call</string>
+    <string name="prox_auto_speaker_incall_only_summary_on">On outgoing calls, listener will only become active after the receiving party answers</string>
+    <string name="prox_auto_speaker_incall_only_summary_off">Listener will be active during all offhook call states (default)</string>
+
 </resources>
diff --git a/java/com/android/dialer/app/res/xml/speaker_settings.xml b/java/com/android/dialer/app/res/xml/speaker_settings.xml
new file mode 100644
index 0000000..c442f83
--- /dev/null
+++ b/java/com/android/dialer/app/res/xml/speaker_settings.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+     Copyright (C) 2016 The Pure Nexus Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
+
+    <SwitchPreference
+        android:key="proximity_auto_speaker"
+        android:title="@string/prox_auto_speaker_title"
+        android:summary="@string/prox_auto_speaker_summary"
+        android:persistent="false"
+        android:defaultValue="false" />
+
+    <ListPreference
+        android:key="proximity_auto_speaker_delay"
+        android:title="@string/prox_auto_speaker_delay_title"
+        android:dialogTitle="@string/prox_auto_speaker_delay_dialog_title"
+        android:entries="@array/proximity_delay_entries"
+        android:entryValues="@array/proximity_delay_values"
+        android:persistent="false"
+        android:dependency="proximity_auto_speaker" />
+
+    <SwitchPreference
+        android:key="proximity_auto_speaker_incall_only"
+        android:title="@string/prox_auto_speaker_incall_only_title"
+        android:summaryOff="@string/prox_auto_speaker_incall_only_summary_off"
+        android:summaryOn="@string/prox_auto_speaker_incall_only_summary_on"
+        android:persistent="false"
+        android:defaultValue="false"
+        android:dependency="proximity_auto_speaker" />
+
+</PreferenceScreen>
diff --git a/java/com/android/dialer/app/settings/DialerSettingsActivity.java b/java/com/android/dialer/app/settings/DialerSettingsActivity.java
index 828972e..0df826d 100644
--- a/java/com/android/dialer/app/settings/DialerSettingsActivity.java
+++ b/java/com/android/dialer/app/settings/DialerSettingsActivity.java
@@ -23,6 +23,7 @@
 import android.os.Build.VERSION;
 import android.os.Build.VERSION_CODES;
 import android.os.Bundle;
+import android.os.PowerManager;
 import android.os.UserManager;
 import android.preference.PreferenceManager;
 import android.provider.Settings;
@@ -138,6 +139,13 @@
     OtherSettingsHeader.fragment = OtherSettingsFragment.class.getName();
     target.add(OtherSettingsHeader);
 
+    if (isSpeakerAllowed()) {
+        final Header speakerSettingsHeader = new Header();
+        speakerSettingsHeader.titleRes = R.string.speaker_settings_label;
+        speakerSettingsHeader.fragment = SpeakerSettingsFragment.class.getName();
+        target.add(speakerSettingsHeader);
+    }
+
     // "Call Settings" (full settings) is shown if the current user is primary user and there
     // is only one SIM. Otherwise, "Calling accounts" is shown.
     boolean isPrimaryUser = isPrimaryUser();
@@ -346,4 +354,13 @@
     SensorManager sm = (SensorManager) this.getSystemService(Context.SENSOR_SERVICE);
     return sm.getDefaultSensor(TYPE_PROXIMITY) != null;
   }
+
+  /**
+  * @return Whether proximity speakerphone is allowed
+  */
+  private boolean isSpeakerAllowed() {
+    PowerManager pm = (PowerManager) this.getSystemService(Context.POWER_SERVICE);
+    return pm.isWakeLockLevelSupported(PowerManager.PROXIMITY_SCREEN_OFF_WAKE_LOCK)
+    && getResources().getBoolean(R.bool.config_enabled_speakerprox);
+  }
 }
diff --git a/java/com/android/dialer/app/settings/SpeakerSettingsFragment.java b/java/com/android/dialer/app/settings/SpeakerSettingsFragment.java
new file mode 100644
index 0000000..ff3e7ff
--- /dev/null
+++ b/java/com/android/dialer/app/settings/SpeakerSettingsFragment.java
@@ -0,0 +1,92 @@
+/*
+ * Copyright (C) 2016 The Pure Nexus Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License
+ */
+
+package com.android.dialer.app.settings;
+
+import android.content.ContentResolver;
+import android.os.Bundle;
+import android.preference.Preference;
+import android.preference.ListPreference;
+import android.preference.PreferenceFragment;
+import android.preference.SwitchPreference;
+import android.provider.Settings;
+
+import com.android.dialer.R;
+
+import java.util.Arrays;
+
+public class SpeakerSettingsFragment extends PreferenceFragment
+        implements Preference.OnPreferenceChangeListener {
+
+    private static final String PROXIMITY_AUTO_SPEAKER  = "proximity_auto_speaker";
+    private static final String PROXIMITY_AUTO_SPEAKER_DELAY  = "proximity_auto_speaker_delay";
+    private static final String PROXIMITY_AUTO_SPEAKER_INCALL_ONLY  = "proximity_auto_speaker_incall_only";
+
+    private SwitchPreference mProxSpeaker;
+    private ListPreference mProxSpeakerDelay;
+    private SwitchPreference mProxSpeakerIncallOnly;
+
+    @Override
+    public void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+
+        addPreferencesFromResource(R.xml.speaker_settings);
+        final ContentResolver resolver = getActivity().getContentResolver();
+
+        mProxSpeaker = (SwitchPreference) findPreference(PROXIMITY_AUTO_SPEAKER);
+        mProxSpeaker.setChecked(Settings.System.getInt(resolver,
+                Settings.System.PROXIMITY_AUTO_SPEAKER, 0) == 1);
+        mProxSpeaker.setOnPreferenceChangeListener(this);
+
+        mProxSpeakerDelay = (ListPreference) findPreference(PROXIMITY_AUTO_SPEAKER_DELAY);
+        int proxDelay = Settings.System.getInt(resolver,
+                Settings.System.PROXIMITY_AUTO_SPEAKER_DELAY, 3000);
+        mProxSpeakerDelay.setValue(String.valueOf(proxDelay));
+        mProxSpeakerDelay.setOnPreferenceChangeListener(this);
+        updateProximityDelaySummary(proxDelay);
+
+        mProxSpeakerIncallOnly = (SwitchPreference) findPreference(PROXIMITY_AUTO_SPEAKER_INCALL_ONLY);
+        mProxSpeakerIncallOnly.setChecked(Settings.System.getInt(resolver,
+                Settings.System.PROXIMITY_AUTO_SPEAKER_INCALL_ONLY, 0) == 1);
+        mProxSpeakerIncallOnly.setOnPreferenceChangeListener(this);
+    }
+
+    @Override
+    public boolean onPreferenceChange(Preference preference, Object newValue) {
+        final ContentResolver resolver = getActivity().getContentResolver();
+
+        if (preference == mProxSpeaker) {
+            Settings.System.putInt(resolver, Settings.System.PROXIMITY_AUTO_SPEAKER,
+                    ((Boolean) newValue) ? 1 : 0);
+            return true;
+        } else if (preference == mProxSpeakerDelay) {
+            int proxDelay = Integer.valueOf((String) newValue);
+            Settings.System.putInt(resolver, Settings.System.PROXIMITY_AUTO_SPEAKER_DELAY, proxDelay);
+            updateProximityDelaySummary(proxDelay);
+            return true;
+        } else if (preference == mProxSpeakerIncallOnly) {
+            Settings.System.putInt(resolver, Settings.System.PROXIMITY_AUTO_SPEAKER_INCALL_ONLY,
+                    ((Boolean) newValue) ? 1 : 0);
+            return true;
+        }
+        return false;
+    }
+
+    private void updateProximityDelaySummary(int value) {
+        String summary = getResources().getString(R.string.prox_auto_speaker_delay_summary, value);
+        mProxSpeakerDelay.setSummary(summary);
+    }
+}
diff --git a/java/com/android/incallui/ProximitySensor.java b/java/com/android/incallui/ProximitySensor.java
index 5feedbb..c423f1c 100644
--- a/java/com/android/incallui/ProximitySensor.java
+++ b/java/com/android/incallui/ProximitySensor.java
@@ -25,6 +25,13 @@
 import android.support.annotation.NonNull;
 import android.telecom.CallAudioState;
 import android.view.Display;
+import android.hardware.Sensor;
+import android.hardware.SensorEvent;
+import android.hardware.SensorEventListener;
+import android.hardware.SensorManager;
+import android.os.Handler;
+import android.provider.Settings;
+import com.android.incallui.call.TelecomAdapter;
 import com.android.dialer.common.LogUtil;
 import com.android.incallui.InCallPresenter.InCallState;
 import com.android.incallui.InCallPresenter.InCallStateListener;
@@ -42,29 +49,45 @@
  * and disabled. Most of that state is fed into this class through public methods.
  */
 public class ProximitySensor
-    implements AccelerometerListener.OrientationListener, InCallStateListener, AudioModeListener {
+    implements AccelerometerListener.OrientationListener, InCallStateListener, AudioModeListener, SensorEventListener  {
 
   private static final String TAG = ProximitySensor.class.getSimpleName();
   private static final String PREF_KEY_DISABLE_PROXI_SENSOR = "disable_proximity_sensor_key";
 
   private final PowerManager powerManager;
   private final PowerManager.WakeLock proximityWakeLock;
+  private SensorManager sensor;
+  private Sensor proxSensor;
   private final AudioModeProvider audioModeProvider;
   private final AccelerometerListener accelerometerListener;
   private final ProximityDisplayListener displayListener;
   private int orientation = AccelerometerListener.ORIENTATION_UNKNOWN;
   private boolean uiShowing = false;
+  private boolean hasIncomingCall = false;
+  private boolean isPhoneOutgoing = false;
+  private boolean proximitySpeaker = false;
+  private boolean isProxSensorFar = true;
+  private int proxSpeakerDelay = 3000;
   private boolean isPhoneOffhook = false;
   private boolean dialpadVisible;
   private boolean isAttemptingVideoCall;
   private boolean isVideoCall;
   private boolean isRttCall;
   private SharedPreferences mPrefs;
+  private Context mContext;
+   private final Handler handler = new Handler();
+   private final Runnable activateSpeaker = new Runnable() {
+    @Override
+    public void run() {
+      TelecomAdapter.getInstance().setAudioRoute(CallAudioState.ROUTE_SPEAKER);
+    }
+   };
 
   public ProximitySensor(
       @NonNull Context context,
       @NonNull AudioModeProvider audioModeProvider,
       @NonNull AccelerometerListener accelerometerListener) {
+    mContext = context;
     Trace.beginSection("ProximitySensor.Constructor");
 
     mPrefs = PreferenceManager.getDefaultSharedPreferences(context);
@@ -81,6 +104,13 @@
     } else {
       proximityWakeLock = null;
     }
+    if (powerManager.isWakeLockLevelSupported(PowerManager.PROXIMITY_SCREEN_OFF_WAKE_LOCK)) {
+      sensor = (SensorManager) mContext.getSystemService(Context.SENSOR_SERVICE);
+      proxSensor = sensor.getDefaultSensor(Sensor.TYPE_PROXIMITY);
+    } else {
+      proxSensor = null;
+      sensor = null;
+    }
     this.accelerometerListener = accelerometerListener;
     this.accelerometerListener.setListener(this);
 
@@ -101,6 +131,11 @@
     displayListener.unregister();
 
     turnOffProximitySensor(true);
+    if (sensor != null) {
+      sensor.unregisterListener(this);
+    }
+     // remove any pending audio changes scheduled
+    handler.removeCallbacks(activateSpeaker);
   }
 
   /** Called to identify when the device is laid down flat. */
@@ -125,6 +160,8 @@
     DialerCall activeCall = callList.getActiveCall();
     boolean isVideoCall = activeCall != null && activeCall.isVideoCall();
     boolean isRttCall = activeCall != null && activeCall.isActiveRttCall();
+    hasIncomingCall = (InCallState.INCOMING == newState);
+    isPhoneOutgoing = (InCallState.OUTGOING == newState);
 
     if (isOffhook != isPhoneOffhook
         || this.isVideoCall != isVideoCall
@@ -136,6 +173,14 @@
       orientation = AccelerometerListener.ORIENTATION_UNKNOWN;
       accelerometerListener.enable(isPhoneOffhook);
 
+      updateProxSpeaker();
+      updateProximitySensorMode();
+    }
+    if (hasOngoingCall && InCallState.OUTGOING == oldState) {
+      setProxSpeaker(isProxSensorFar);
+    }
+     if (hasIncomingCall) {
+
       updateProximitySensorMode();
     }
   }
@@ -145,6 +190,22 @@
     updateProximitySensorMode();
   }
 
+   /**
+   * Proximity state changed
+   */
+  @Override
+  public void onSensorChanged(SensorEvent event) {
+    if (event.values[0] != proxSensor.getMaximumRange()) {
+      isProxSensorFar = false;
+    } else {
+      isProxSensorFar = true;
+    }
+     setProxSpeaker(isProxSensorFar);
+  }
+   @Override
+  public void onAccuracyChanged(Sensor sensor, int accuracy) {
+  }
+
   public void onDialpadVisible(boolean visible) {
     dialpadVisible = visible;
     updateProximitySensorMode();
@@ -265,7 +326,7 @@
         uiShowing,
         CallAudioState.audioRouteToString(audioRoute));
 
-    if (isPhoneOffhook && !screenOnImmediately) {
+    if (isPhoneOffhook || hasIncomingCall && !screenOnImmediately) {
       LogUtil.v("ProximitySensor.updateProximitySensorMode", "turning on proximity sensor");
       // Phone is in use!  Arrange for the screen to turn off
       // automatically when the sensor detects a close object.
@@ -279,6 +340,49 @@
     Trace.endSection();
   }
 
+ private void updateProxSpeaker() {
+    if (sensor != null && proxSensor != null) {
+      if (isPhoneOffhook) {
+        sensor.registerListener(this, proxSensor,
+            SensorManager.SENSOR_DELAY_NORMAL);
+      } else {
+        sensor.unregisterListener(this);
+      }
+    }
+  }
+   private void setProxSpeaker(final boolean speaker) {
+    // remove any pending audio changes scheduled
+    handler.removeCallbacks(activateSpeaker);
+     final int audioState = audioModeProvider.getAudioState().getRoute();
+    final boolean proxSpeakerIncallOnlyPref =
+        Settings.System.getInt(mContext.getContentResolver(),
+        Settings.System.PROXIMITY_AUTO_SPEAKER_INCALL_ONLY, 0) == 1;
+    proxSpeakerDelay = Settings.System.getInt(mContext.getContentResolver(),
+        Settings.System.PROXIMITY_AUTO_SPEAKER_DELAY, 3000);
+     // if phone off hook (call in session), and prox speaker feature is on
+    if (isPhoneOffhook && Settings.System.getInt(mContext.getContentResolver(),
+        Settings.System.PROXIMITY_AUTO_SPEAKER, 0) == 1
+        // as long as AudioState isn't currently wired headset or bluetooth
+        && audioState != CallAudioState.ROUTE_WIRED_HEADSET
+        && audioState != CallAudioState.ROUTE_BLUETOOTH) {
+       // okay, we're good to start switching audio mode on proximity
+       // if proximity sensor determines audio mode should be speaker,
+      // but it currently isn't
+      if (speaker && audioState != CallAudioState.ROUTE_SPEAKER) {
+         // if prox incall only is off, we set to speaker as long as phone
+        // is off hook, ignoring whether or not the call state is outgoing
+        if (!proxSpeakerIncallOnlyPref
+            // or if prox incall only is on, we have to check the call
+            // state to decide if AudioState should be speaker
+            || (proxSpeakerIncallOnlyPref && !isPhoneOutgoing)) {
+          handler.postDelayed(activateSpeaker, proxSpeakerDelay);
+        }
+      } else if (!speaker) {
+        TelecomAdapter.getInstance().setAudioRoute(CallAudioState.ROUTE_EARPIECE);
+      }
+    }
+  }
+
   /**
    * Implementation of a {@link DisplayListener} that maintains a binary state: Screen on vs screen
    * off. Used by the proximity sensor manager to decide whether or not it needs to listen to
