[VOL-1806] : Remove redundant device state updation

This fix removes,
1. Code block that updates ONU states on getting onu_indication with operational state changes(Since this is taken care by ONU adapter)
2. Code block that sets OLT oper state as UNKNOWN on OLT disable(since this is taken care by core itself).

Change-Id: I95cdcd4d9b8ef4339c7456dded03a116be1801fa
diff --git a/adaptercore/device_handler.go b/adaptercore/device_handler.go
index b085177..96e6189 100644
--- a/adaptercore/device_handler.go
+++ b/adaptercore/device_handler.go
@@ -21,7 +21,6 @@
 	"context"
 	"errors"
 	"fmt"
-	"google.golang.org/grpc/codes"
 	"io"
 	"net"
 	"strconv"
@@ -29,6 +28,8 @@
 	"sync"
 	"time"
 
+	"google.golang.org/grpc/codes"
+
 	"github.com/gogo/protobuf/proto"
 	"github.com/golang/protobuf/ptypes"
 	"github.com/mdlayher/ethernet"
@@ -838,23 +839,6 @@
 	dh.updateOnuAdminState(onuInd)
 	// operState
 	if onuInd.OperState == "down" {
-		if onuDevice.ConnectStatus != common.ConnectStatus_UNREACHABLE {
-			err := dh.coreProxy.DeviceStateUpdate(context.TODO(), onuDevice.Id, common.ConnectStatus_UNREACHABLE,
-				onuDevice.OperStatus)
-			if err != nil {
-				log.Errorw("unable to update onu state", log.Fields{"DeviceID": onuDevice.Id})
-				return
-			}
-			log.Debugln("onu-oper-state-is-down")
-		}
-		if onuDevice.OperStatus != common.OperStatus_DISCOVERED {
-			err := dh.coreProxy.DeviceStateUpdate(context.TODO(), onuDevice.Id, common.ConnectStatus_UNREACHABLE,
-				common.OperStatus_DISCOVERED)
-			if err != nil {
-				log.Errorw("unable to update onu state", log.Fields{"DeviceID": onuDevice.Id})
-				return
-			}
-		}
 		log.Debugw("inter-adapter-send-onu-ind", log.Fields{"onuIndication": onuInd})
 
 		// TODO NEW CORE do not hardcode adapter name. Handler needs Adapter reference
@@ -865,13 +849,6 @@
 				"From Adapter": "openolt", "DevieType": onuDevice.Type, "DeviceID": onuDevice.Id})
 		}
 	} else if onuInd.OperState == "up" {
-		if onuDevice.ConnectStatus != common.ConnectStatus_REACHABLE {
-			err := dh.coreProxy.DeviceStateUpdate(context.TODO(), onuDevice.Id, common.ConnectStatus_REACHABLE, onuDevice.OperStatus)
-			if err != nil {
-				log.Errorw("unable to update onu state", log.Fields{"DeviceID": onuDevice.Id})
-				return
-			}
-		}
 		if onuDevice.OperStatus != common.OperStatus_DISCOVERED {
 			log.Warnw("ignore onu indication", log.Fields{"intfID": onuInd.IntfId, "onuID": onuInd.OnuId, "operStatus": onuDevice.OperStatus, "msgOperStatus": onuInd.OperState})
 			return
@@ -999,14 +976,6 @@
 		return err
 	}
 
-	//Update the device oper state
-	cloned.OperStatus = voltha.OperStatus_UNKNOWN
-	dh.device = cloned
-
-	if err := dh.coreProxy.DeviceStateUpdate(context.TODO(), cloned.Id, cloned.ConnectStatus, cloned.OperStatus); err != nil {
-		log.Errorw("error-updating-device-state", log.Fields{"deviceID": device.Id, "error": err})
-		return err
-	}
 	log.Debugw("Disable_device-end", log.Fields{"deviceID": device.Id})
 	return nil
 }