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

Commit 4e844afd authored by Marin Shalamanov's avatar Marin Shalamanov
Browse files

Use type safe display IDs.

Bug: 160679868
Test: m && flash device
Test: take screnshot on device
Change-Id: I36346a8e90f8f2843aae12b48bd7971d2b5017c4
parent 2df8e038
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -1170,14 +1170,14 @@ int main(int argc, char* const argv[]) {
            }
            break;
        case 'd':
            gPhysicalDisplayId = atoll(optarg);
            if (gPhysicalDisplayId == 0) {
            gPhysicalDisplayId = PhysicalDisplayId(atoll(optarg));
            if (gPhysicalDisplayId.value == 0) {
                fprintf(stderr, "Please specify a valid physical display id\n");
                return 2;
            } else if (SurfaceComposerClient::
                    getPhysicalDisplayToken(gPhysicalDisplayId) == nullptr) {
                fprintf(stderr, "Invalid physical display id: %"
                        ANDROID_PHYSICAL_DISPLAY_ID_FORMAT "\n", gPhysicalDisplayId);
                fprintf(stderr, "Invalid physical display id: %s\n",
                        to_string(gPhysicalDisplayId).c_str());
                return 2;
            }
            break;