public final class

Camera2Initializer

extends ContentProvider

 java.lang.Object

↳ContentProvider

↳androidx.camera.camera2.impl.Camera2Initializer

Overview

A ContentProvider used to initialize CameraX from a .

Summary

Constructors
publicCamera2Initializer()

Methods
public intdelete(Uri uri, java.lang.String s, java.lang.String strings[])

public java.lang.StringgetType(Uri uri)

public Uriinsert(Uri uri, ContentValues contentValues)

public booleanonCreate()

public Cursorquery(Uri uri, java.lang.String strings[], java.lang.String s, java.lang.String strings1[], java.lang.String s1)

public intupdate(Uri uri, ContentValues contentValues, java.lang.String s, java.lang.String strings[])

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructors

public Camera2Initializer()

Methods

public boolean onCreate()

public Cursor query(Uri uri, java.lang.String strings[], java.lang.String s, java.lang.String strings1[], java.lang.String s1)

public java.lang.String getType(Uri uri)

public Uri insert(Uri uri, ContentValues contentValues)

public int delete(Uri uri, java.lang.String s, java.lang.String strings[])

public int update(Uri uri, ContentValues contentValues, java.lang.String s, java.lang.String strings[])

Source

/*
 * Copyright 2019 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package androidx.camera.camera2.impl;

import android.content.ContentProvider;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.net.Uri;
import android.util.Log;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.RestrictTo;
import androidx.camera.camera2.Camera2AppConfig;
import androidx.camera.core.CameraX;

/**
 * A {@link ContentProvider} used to initialize {@link CameraX} from a {@link Context}.
 *
 * @hide
 */
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public final class Camera2Initializer extends ContentProvider {
    private static final String TAG = "Camera2Initializer";

    @Override
    public boolean onCreate() {
        Log.d(TAG, "CameraX initializing with Camera2 ...");

        CameraX.init(getContext(), Camera2AppConfig.create(getContext()));
        return false;
    }

    @Nullable
    @Override
    public Cursor query(
            @NonNull Uri uri,
            @Nullable String[] strings,
            @Nullable String s,
            @Nullable String[] strings1,
            @Nullable String s1) {
        return null;
    }

    @Nullable
    @Override
    public String getType(@NonNull Uri uri) {
        return null;
    }

    @Nullable
    @Override
    public Uri insert(@NonNull Uri uri, @Nullable ContentValues contentValues) {
        return null;
    }

    @Override
    public int delete(@NonNull Uri uri, @Nullable String s, @Nullable String[] strings) {
        return 0;
    }

    @Override
    public int update(
            @NonNull Uri uri,
            @Nullable ContentValues contentValues,
            @Nullable String s,
            @Nullable String[] strings) {
        return 0;
    }
}