Apple Inc. has agreed to pay a settlement of up to $500 million, following a lawsuit accusing the company of…