summaryrefslogtreecommitdiffstats
path: root/src/com/android/providers/contacts/VoicemailContentProvider.java
blob: fb0957cbb06db33411d906804b8b878595f3afc3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
/*
 * Copyright (C) 2011 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 com.android.providers.contacts;

import static com.android.providers.contacts.util.DbQueryUtils.checkForSupportedColumns;
import static com.android.providers.contacts.util.DbQueryUtils.concatenateClauses;
import static com.android.providers.contacts.util.DbQueryUtils.getEqualityClause;

import com.android.providers.contacts.ContactsDatabaseHelper.Tables;
import com.android.providers.contacts.util.CloseUtils;
import com.android.providers.contacts.util.TypedUriMatcherImpl;

import android.content.ComponentName;
import android.content.ContentProvider;
import android.content.ContentResolver;
import android.content.ContentUris;
import android.content.ContentValues;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.content.pm.ResolveInfo;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteQueryBuilder;
import android.net.Uri;
import android.os.Binder;
import android.os.ParcelFileDescriptor;
import android.provider.CallLog.Calls;
import android.provider.VoicemailContract;
import android.provider.VoicemailContract.Voicemails;
import android.util.Log;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

// TODO: Restrict access to only voicemail columns (i.e no access to call_log
// specific fields)
// TODO: Port unit tests from perforce.
/**
 * An implementation of the Voicemail content provider.
 */
public class VoicemailContentProvider extends ContentProvider {
    private static final String TAG = "VoicemailContentProvider";

    /** The private directory in which to store the data associated with the voicemail. */
    private static final String DATA_DIRECTORY = "voicemail-data";

    private static final String[] MIME_TYPE_ONLY_PROJECTION = new String[] { Voicemails.MIME_TYPE };
    private static final String[] FILENAME_ONLY_PROJECTION = new String[] { Voicemails._DATA };
    private static final String VOICEMAILS_TABLE_NAME = Tables.CALLS;

    // Voicemail projection map
    private static final ProjectionMap sVoicemailProjectionMap = new ProjectionMap.Builder()
            .add(Voicemails._ID)
            .add(Voicemails.NUMBER)
            .add(Voicemails.DATE)
            .add(Voicemails.DURATION)
            .add(Voicemails.NEW)
            .add(Voicemails.STATE)
            .add(Voicemails.SOURCE_DATA)
            .add(Voicemails.SOURCE_PACKAGE)
            .add(Voicemails.HAS_CONTENT)
            .add(Voicemails.MIME_TYPE)
            .add(Voicemails._DATA)
            .build();
    private ContentResolver mContentResolver;
    private ContactsDatabaseHelper mDbHelper;
    private VoicemailPermissions mVoicemailPermissions;

    @Override
    public boolean onCreate() {
        Context context = context();
        mContentResolver = context.getContentResolver();
        mDbHelper = getDatabaseHelper(context);
        mVoicemailPermissions = new VoicemailPermissions(context);
        return true;
    }

    /*package for testing*/ ContactsDatabaseHelper getDatabaseHelper(Context context) {
        return ContactsDatabaseHelper.getInstance(context);
    }

    /*package for testing*/ Context context() {
        return getContext();
    }

    @Override
    public String getType(Uri uri) {
        UriData uriData = null;
        try {
            uriData = createUriData(uri);
        } catch (IllegalArgumentException ignored) {
            // Special case: for illegal URIs, we return null rather than thrown an exception.
            return null;
        }
        // TODO: DB lookup for the mime type may cause strict mode exception for the callers of
        // getType(). See if this could be avoided.
        if (uriData.hasId()) {
            // An individual voicemail - so lookup the MIME type in the db.
            return lookupMimeType(uriData);
        }
        // Not an individual voicemail - must be a directory listing type.
        return VoicemailContract.DIR_TYPE;
    }

    /** Query the db for the MIME type of the given URI, called only from {@link #getType(Uri)}. */
    private String lookupMimeType(UriData uriData) {
        Cursor cursor = null;
        try {
            // Use queryInternal, bypassing provider permission check. This is needed because
            // getType() can be called from any application context (even without voicemail
            // permissions) to know the MIME type of the URI. There is no security issue here as we
            // do not expose any sensitive data through this interface.
            cursor = queryInternal(uriData, MIME_TYPE_ONLY_PROJECTION, null, null, null);
            if (cursor.moveToFirst()) {
                return cursor.getString(cursor.getColumnIndex(Voicemails.MIME_TYPE));
            }
        } finally {
            CloseUtils.closeQuietly(cursor);
        }
        return null;
    }

    @Override
    public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs,
            String sortOrder) {
        mVoicemailPermissions.checkCallerHasOwnVoicemailAccess();
        UriData uriData = createUriData(uri);
        checkPackagePermission(uriData);
        return queryInternal(uriData, projection,
                concatenateClauses(selection, getPackageRestrictionClause()), selectionArgs,
                sortOrder);
    }

    /**
     * Internal version of query(), that does not apply any provider restriction and lets the query
     * flow through without such checks.
     * <p>
     * This is useful for internal queries when we do not worry about access permissions.
     */
    private Cursor queryInternal(UriData uriData, String[] projection, String selection,
            String[] selectionArgs, String sortOrder) {
        SQLiteQueryBuilder qb = new SQLiteQueryBuilder();
        qb.setTables(Tables.CALLS);
        qb.setProjectionMap(sVoicemailProjectionMap);
        qb.setStrict(true);

        String combinedClause = concatenateClauses(selection, getWhereClause(uriData),
                getCallTypeClause());
        SQLiteDatabase db = mDbHelper.getReadableDatabase();
        Cursor c = qb.query(db, projection, combinedClause, selectionArgs, null, null, sortOrder);
        if (c != null) {
            c.setNotificationUri(mContentResolver, VoicemailContract.CONTENT_URI);
        }
        return c;
    }

    private String getWhereClause(UriData uriData) {
        return concatenateClauses(
                (uriData.hasId() ?
                        getEqualityClause(Voicemails._ID, uriData.getId())
                        : null),
                (uriData.hasSourcePackage() ?
                        getEqualityClause(Voicemails.SOURCE_PACKAGE, uriData.getSourcePackage())
                        : null));
    }

    @Override
    public int bulkInsert(Uri uri, ContentValues[] valuesArray) {
        mVoicemailPermissions.checkCallerHasOwnVoicemailAccess();
        // TODO: There is scope to optimize this method further. At the least we can avoid doing the
        // extra work related to the calling provider and checking permissions.
        UriData uriData = createUriData(uri);
        int numInserted = 0;
        for (ContentValues values : valuesArray) {
            if (insertInternal(uriData, values, false) != null) {
                numInserted++;
            }
        }
        if (numInserted > 0) {
            notifyChange(uri, Intent.ACTION_PROVIDER_CHANGED);
        }
        return numInserted;
    }

    @Override
    public Uri insert(Uri uri, ContentValues values) {
        mVoicemailPermissions.checkCallerHasOwnVoicemailAccess();
        return insertInternal(createUriData(uri), values, true);
    }

    private Uri insertInternal(UriData uriData, ContentValues values,
            boolean sendProviderChangedNotification) {
        checkForSupportedColumns(sVoicemailProjectionMap, values);
        ContentValues copiedValues = new ContentValues(values);
        checkInsertSupported(uriData);
        checkAndAddSourcePackageIntoValues(uriData, copiedValues);

        // "_data" column is used by base ContentProvider's openFileHelper() to determine filename
        // when Input/Output stream is requested to be opened.
        copiedValues.put(Voicemails._DATA, generateDataFile());

        // call type is always voicemail.
        copiedValues.put(Calls.TYPE, Calls.VOICEMAIL_TYPE);

        SQLiteDatabase db = mDbHelper.getWritableDatabase();
        long rowId = db.insert(VOICEMAILS_TABLE_NAME, null, copiedValues);
        if (rowId > 0) {
            Uri newUri = ContentUris.withAppendedId(
                    Uri.withAppendedPath(VoicemailContract.CONTENT_URI_SOURCE,
                            copiedValues.getAsString(Voicemails.SOURCE_PACKAGE)), rowId);

            if (sendProviderChangedNotification) {
                notifyChange(newUri, VoicemailContract.ACTION_NEW_VOICEMAIL,
                        Intent.ACTION_PROVIDER_CHANGED);
            } else {
                notifyChange(newUri, VoicemailContract.ACTION_NEW_VOICEMAIL);
            }
            // Populate the 'voicemail_uri' field to be used by the call_log provider.
            updateVoicemailUri(db, newUri);
            return newUri;
        }
        return null;
    }

    private void updateVoicemailUri(SQLiteDatabase db, Uri newUri) {
        ContentValues values = new ContentValues();
        values.put(Calls.VOICEMAIL_URI, newUri.toString());
        // Directly update the db because we cannot update voicemail_uri through external
        // update() due to projectionMap check. This also avoids unnecessary permission
        // checks that are already done as part of insert request.
        db.update(VOICEMAILS_TABLE_NAME, values, getWhereClause(createUriData(newUri)), null);
    }

    private void checkAndAddSourcePackageIntoValues(UriData uriData, ContentValues values) {
        // If content values don't contain the provider, calculate the right provider to use.
        if (!values.containsKey(Voicemails.SOURCE_PACKAGE)) {
            String provider = uriData.hasSourcePackage() ?
                    uriData.getSourcePackage() : getCallingPackage();
            values.put(Voicemails.SOURCE_PACKAGE, provider);
        }
        // If you put a provider in the URI and in the values, they must match.
        if (uriData.hasSourcePackage() && values.containsKey(Voicemails.SOURCE_PACKAGE)) {
            if (!uriData.getSourcePackage().equals(values.get(Voicemails.SOURCE_PACKAGE))) {
                throw new SecurityException(
                        "Provider in URI was " + uriData.getSourcePackage() +
                        " but doesn't match provider in ContentValues which was "
                        + values.get(Voicemails.SOURCE_PACKAGE));
            }
        }
        // You must have access to the provider given in values.
        if (!mVoicemailPermissions.callerHasFullAccess()) {
            checkPackagesMatch(getCallingPackage(), values.getAsString(Voicemails.SOURCE_PACKAGE),
                    uriData.getUri());
        }
    }

    /**
     * Checks that the callingProvider is same as voicemailProvider. Throws {@link
     * SecurityException} if they don't match.
     */
    private final void checkPackagesMatch(String callingProvider, String voicemailProvider,
            Uri uri) {
        if (!voicemailProvider.equals(callingProvider)) {
            String errorMsg = String.format("Permission denied for URI: %s\n. " +
                    "Provider %s cannot perform this operation for %s. Requires %s permission.",
                    uri, callingProvider, voicemailProvider,
                    Manifest.permission.READ_WRITE_ALL_VOICEMAIL);
            throw new SecurityException(errorMsg);
        }
    }

    private void checkInsertSupported(UriData uriData) {
        if (uriData.hasId()) {
            throw new UnsupportedOperationException(String.format(
                    "Cannot insert URI: %s. Inserted URIs should not contain an id.",
                    uriData.getUri()));
        }
    }

    @Override
    public int update(Uri uri, ContentValues values, String selection, String[] selectionArgs) {
        mVoicemailPermissions.checkCallerHasOwnVoicemailAccess();
        UriData uriData = createUriData(uri);
        checkPackagePermission(uriData);
        checkForSupportedColumns(sVoicemailProjectionMap, values);
        checkUpdateSupported(uriData);
        final SQLiteDatabase db = mDbHelper.getWritableDatabase();
        // TODO: This implementation does not allow bulk update because it only accepts
        // URI that include message Id. I think we do want to support bulk update.
        String combinedClause = concatenateClauses(selection, getPackageRestrictionClause(),
                getWhereClause(uriData), getCallTypeClause());
        int count = db.update(VOICEMAILS_TABLE_NAME, values, combinedClause, selectionArgs);
        if (count > 0) {
            notifyChange(uri, Intent.ACTION_PROVIDER_CHANGED);
        }
        return count;
    }

    private void checkUpdateSupported(UriData uriData) {
        if (!uriData.hasId()) {
            throw new UnsupportedOperationException(String.format(
                    "Cannot update URI: %s.  Bulk update not supported", uriData.getUri()));
        }
    }

    @Override
    public int delete(Uri uri, String selection, String[] selectionArgs) {
        mVoicemailPermissions.checkCallerHasOwnVoicemailAccess();
        UriData uriData = createUriData(uri);
        checkPackagePermission(uriData);
        final SQLiteDatabase db = mDbHelper.getWritableDatabase();
        String combinedClause = concatenateClauses(selection, getPackageRestrictionClause(),
                getWhereClause(uriData), getCallTypeClause());

        // Delete all the files associated with this query.  Once we've deleted the rows, there will
        // be no way left to get hold of the files.
        Cursor cursor = null;
        try {
            cursor = queryInternal(uriData, FILENAME_ONLY_PROJECTION, selection, selectionArgs,
                    null);
            while (cursor.moveToNext()) {
                File file = new File(cursor.getString(0));
                if (file.exists()) {
                    boolean success = file.delete();
                    if (!success) {
                        Log.e(TAG, "Failed to delete file: " + file.getAbsolutePath());
                    }
                }
            }
        } finally {
            CloseUtils.closeQuietly(cursor);
        }

        // Now delete the rows themselves.
        int count = db.delete(VOICEMAILS_TABLE_NAME, combinedClause, selectionArgs);
        if (count > 0) {
            notifyChange(uri, Intent.ACTION_PROVIDER_CHANGED);
        }
        return count;
    }

    @Override
    public ParcelFileDescriptor openFile(Uri uri, String mode) throws FileNotFoundException {
        mVoicemailPermissions.checkCallerHasOwnVoicemailAccess();
        UriData uriData = createUriData(uri);
        checkPackagePermission(uriData);

        // This relies on "_data" column to be populated with the file path.
        ParcelFileDescriptor openFileHelper = openFileHelper(uri, mode);

        // If the open succeeded, then update the file exists bit in the table.
        if (mode.contains("w")) {
            ContentValues contentValues = new ContentValues();
            contentValues.put(Voicemails.HAS_CONTENT, 1);
            update(uri, contentValues, null, null);
        }

        return openFileHelper;
    }

    /**
     * Notifies the content resolver and fires required broadcast intent(s) to notify about the
     * change.
     *
     * @param notificationUri The URI that got impacted due to the change. This is the URI that is
     *            included in content resolver and broadcast intent notification.
     * @param intentActions List of intent actions that needs to be fired. A separate intent is
     *            fired for each intent action.
     */
    private void notifyChange(Uri notificationUri, String... intentActions) {
        // Notify the observers.
        mContentResolver.notifyChange(notificationUri, null, true);
        String callingPackage = getCallingPackage();
        // Fire notification intents.
        for (String intentAction : intentActions) {
            // TODO: We can possibly be more intelligent here and send targeted intents based on
            // what voicemail permission the package has. If possible, here is what we would like to
            // do for a given broadcast intent -
            // 1) Send it to all packages that have READ_WRITE_ALL_VOICEMAIL permission.
            // 2) Send it to only the owner package that has just READ_WRITE_OWN_VOICEMAIL, if not
            // already sent in (1).
            for (ComponentName component :
                    getBroadcastReceiverComponents(intentAction, notificationUri)) {
                Intent intent = new Intent(intentAction, notificationUri);
                intent.setComponent(component);
                intent.putExtra(VoicemailContract.EXTRA_SELF_CHANGE,
                        callingPackage.equals(component.getPackageName()));
                context().sendBroadcast(intent, Manifest.permission.READ_WRITE_OWN_VOICEMAIL);
            }
        }
    }

    /** Determines the packages that can possibly receive the specified intent. */
    protected List<ComponentName> getBroadcastReceiverComponents(String intentAction, Uri uri) {
        Intent intent = new Intent(intentAction, uri);
        List<ComponentName> receiverComponents = new ArrayList<ComponentName>();
        // For broadcast receivers ResolveInfo.activityInfo is the one that is populated.
        for (ResolveInfo resolveInfo :
                context().getPackageManager().queryBroadcastReceivers(intent, 0)) {
            ActivityInfo activityInfo = resolveInfo.activityInfo;
            receiverComponents.add(new ComponentName(activityInfo.packageName, activityInfo.name));
        }
        return receiverComponents;
    }

    /** Generates a random file for storing audio data. */
    private String generateDataFile() {
        try {
            File dataDirectory = context().getDir(DATA_DIRECTORY, Context.MODE_PRIVATE);
            File voicemailFile = File.createTempFile("voicemail", "", dataDirectory);
            return voicemailFile.getAbsolutePath();
        } catch (IOException e) {
            // If we are unable to create a temporary file, something went horribly wrong.
            throw new RuntimeException("unable to create temp file", e);
        }
    }

    /**
     * Decorates a URI by providing methods to get various properties from the URI.
     */
    private static class UriData {
        private final Uri mUri;
        private final String mId;
        private final String mSourcePackage;

        public UriData(Uri uri, String id, String sourcePackage) {
            mUri = uri;
            mId = id;
            mSourcePackage = sourcePackage;
        }

        /** Gets the original URI to which this {@link UriData} corresponds. */
        public final Uri getUri() {
            return mUri;
        }

        /** Tells us if our URI has an individual voicemail id. */
        public final boolean hasId() {
            return mId != null;
        }

        /** Gets the ID for the voicemail. */
        public final String getId() {
            return mId;
        }

        /** Tells us if our URI has a source package string. */
        public final boolean hasSourcePackage() {
            return mSourcePackage != null;
        }

        /** Gets the source package. */
        public final String getSourcePackage() {
            return mSourcePackage;
        }
    }

    /**
     * Checks that either the caller has READ_WRITE_ALL_VOICEMAIL permission, or has the
     * READ_WRITE_OWN_VOICEMAIL permission and is using a URI that matches
     * /voicemail/source/[source-package] where [source-package] is the same as the calling
     * package.
     *
     * @throws SecurityException if the check fails.
     */
    private void checkPackagePermission(UriData uriData) {
        if (!mVoicemailPermissions.callerHasFullAccess()) {
            if (!uriData.hasSourcePackage()) {
                // You cannot have a match if this is not a provider uri.
                throw new SecurityException(String.format(
                        "Provider %s does not have %s permission." +
                                "\nPlease use /voicemail/provider/ query path instead.\nURI: %s",
                        getCallingPackage(), Manifest.permission.READ_WRITE_ALL_VOICEMAIL,
                        uriData.getUri()));
            }
            checkPackagesMatch(getCallingPackage(), uriData.getSourcePackage(), uriData.getUri());
        }
    }

    private static TypedUriMatcherImpl<VoicemailUriType> createUriMatcher() {
        return new TypedUriMatcherImpl<VoicemailUriType>(
                VoicemailContract.AUTHORITY, VoicemailUriType.values());
    }

    /** Get a {@link UriData} corresponding to a given uri. */
    private UriData createUriData(Uri uri) {
        List<String> segments = uri.getPathSegments();
        switch (createUriMatcher().match(uri)) {
            case VOICEMAILS:
                return new UriData(uri, null, null);
            case VOICEMAILS_ID:
                return new UriData(uri, segments.get(1), null);
            case VOICEMAILS_SOURCE:
                return new UriData(uri, null, segments.get(2));
            case VOICEMAILS_SOURCE_ID:
                return new UriData(uri, segments.get(3), segments.get(2));
            case NO_MATCH:
                throw new IllegalArgumentException("Invalid URI: " + uri);
            default:
                throw new IllegalStateException("Impossible, all cases are covered");
        }
    }

    /**
     * Gets the name of the calling package.
     * <p>
     * It's possible (though unlikely) for there to be more than one calling package (requires that
     * your manifest say you want to share process ids) in which case we will return an arbitrary
     * package name. It's also possible (though very unlikely) for us to be unable to work out what
     * your calling package is, in which case we will return null.
     */
    /* package for test */String getCallingPackage() {
        int caller = Binder.getCallingUid();
        if (caller == 0) {
            return null;
        }
        String[] callerPackages = context().getPackageManager().getPackagesForUid(caller);
        if (callerPackages == null || callerPackages.length == 0) {
            return null;
        }
        if (callerPackages.length == 1) {
            return callerPackages[0];
        }
        // If we have more than one caller package, which is very unlikely, let's return the one
        // with the highest permissions. If more than one has the same permission, we don't care
        // which one we return.
        String bestSoFar = callerPackages[0];
        for (String callerPackage : callerPackages) {
            if (mVoicemailPermissions.packageHasFullAccess(callerPackage)) {
                // Full always wins, we can return early.
                return callerPackage;
            }
            if (mVoicemailPermissions.packageHasOwnVoicemailAccess(callerPackage)) {
                bestSoFar = callerPackage;
            }
        }
        return bestSoFar;
    }

    /**
     * Creates a clause to restrict the selection to the calling provider or null if the caller has
     * access to all data.
     */
    private String getPackageRestrictionClause() {
        if (mVoicemailPermissions.callerHasFullAccess()) {
            return null;
        }
        return getEqualityClause(Voicemails.SOURCE_PACKAGE, getCallingPackage());
    }


    /** Creates a clause to restrict the selection to only voicemail call type.*/
    private String getCallTypeClause() {
        return getEqualityClause(Calls.TYPE, String.valueOf(Calls.VOICEMAIL_TYPE));
    }

}