Merge "Fix several bugs in AppOp code that were introduced by device aware AppOp" into main