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

Commit 827204b0 authored by Santiago Etchebehere's avatar Santiago Etchebehere
Browse files

Implement handling of My Photos wallpapers

Use the delegate to handle the result of opening a the photos picker.

Bug: 124400926
Change-Id: I6c35915f5e4ba2c61379e5ec96b5a53adfe5e0b5
parent 226938f8
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@
 */
package com.android.customization.picker;

import android.app.Activity;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
@@ -281,6 +282,20 @@ public class CustomizationPickerActivity extends FragmentActivity implements Wal
        }
    }

    @Override
    protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        if (mDelegate.handleActivityResult(requestCode, resultCode, data)) {
            finishActivityWithResultOk();
        }
    }

    private void finishActivityWithResultOk() {
        overridePendingTransition(R.anim.fade_in, R.anim.fade_out);
        setResult(Activity.RESULT_OK);
        finish();
    }

    /**
     * Represents a section of the Picker (eg "ThemeBundle", "Clock", etc).
     * There should be a concrete subclass per available section, providing the corresponding