1 /* 2 * Copyright (C) 2013 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package com.android.camera.data; 18 19 import android.content.Context; 20 import android.net.Uri; 21 import android.os.Bundle; 22 23 import com.android.camera.util.RefocusHelper; 24 25 /** 26 * Asynchronously loads RGBZ data. 27 */ 28 public class RgbzMetadataLoader { 29 private static final String KEY_RGBZ_INFO = "metadata_key_rgbz_info"; 30 31 /** 32 * @return whether the data has RGBZ metadata. 33 */ 34 public static boolean hasRGBZData(final LocalData data) { 35 return data.getMetadata().getBoolean(KEY_RGBZ_INFO); 36 } 37 38 /** 39 * Checks whether this file is an RGBZ file and fill in the metadata. 40 * 41 * @param context The app context. 42 */ 43 public static void loadRgbzMetadata(final Context context, Uri contentUri, Bundle metadata) { 44 if (RefocusHelper.isRGBZ(context, contentUri)) { 45 metadata.putBoolean(KEY_RGBZ_INFO, true); 46 } 47 } 48 } 49