Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 29fef7d7 authored by Mikhail Naganov's avatar Mikhail Naganov
Browse files

AppOpsCallback: do not log error on null package name

Java side can pass 'null' as packageName parameter for
IAppOpsCallback::opChanged, e.g. when calling it via
AppOpsService.notifyWatchersOfChange.

BnAppOpsCallback on the native side should not emit
"Reading a NULL string not supported here" error logs in
this case. For that, a different overload of
'Parcel::readString16' method must be used.

Bug: 130038586
Test: turn DND on / off, watch logcat
Change-Id: I69d28d6a998d75acf987bf49fb0cbfb75cb95828
parent 8cd204d6
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -57,7 +57,8 @@ status_t BnAppOpsCallback::onTransact(
        case OP_CHANGED_TRANSACTION: {
            CHECK_INTERFACE(IAppOpsCallback, data, reply);
            int32_t op = data.readInt32();
            String16 packageName = data.readString16();
            String16 packageName;
            (void)data.readString16(&packageName);
            opChanged(op, packageName);
            reply->writeNoException();
            return NO_ERROR;