1 /*
2 * Copyright (c) 2021 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16 #include "sensor_client_stub.h"
17
18 #include "message_parcel.h"
19 #include "sensor_log.h"
20
21 namespace OHOS {
22 namespace Sensors {
23 using namespace OHOS::HiviewDFX;
24
25 namespace {
26 constexpr HiLogLabel LABEL = { LOG_CORE, SENSOR_LOG_DOMAIN, "SensorClientStub" };
27 }
28
OnRemoteRequest(uint32_t code,MessageParcel & data,MessageParcel & reply,MessageOption & option)29 int32_t SensorClientStub::OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply,
30 MessageOption &option)
31 {
32 std::u16string descriptor = SensorClientStub::GetDescriptor();
33 std::u16string remoteDescriptor = data.ReadInterfaceToken();
34 if (descriptor != remoteDescriptor) {
35 SEN_HILOGE("client and service descriptors are inconsistent");
36 return OBJECT_NULL;
37 }
38 SEN_HILOGD("begin, cmd:%{public}u", code);
39 return NO_ERROR;
40 }
41 } // namespace Sensors
42 } // namespace OHOS
43