Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: adblockplussbrowser/src/main/java/org/adblockplus/sbrowser/contentblocker/ContentBlockerContentProvider.java

Issue 29716681: Issue 6454 - IllegalStateException crash (Closed)
Patch Set: Adjusting engine check Created March 9, 2018, 11:42 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-present eyeo GmbH 3 * Copyright (C) 2006-present eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details. 12 * GNU General Public License for more details.
13 * 13 *
14 * You should have received a copy of the GNU General Public License 14 * You should have received a copy of the GNU General Public License
15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. 15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
16 */ 16 */
17 17
18 package org.adblockplus.sbrowser.contentblocker; 18 package org.adblockplus.sbrowser.contentblocker;
19 19
20 import java.io.File; 20 import java.io.File;
21 import java.io.FileNotFoundException; 21 import java.io.FileNotFoundException;
22 import java.io.IOException; 22 import java.io.IOException;
23 23
24 import org.adblockplus.adblockplussbrowser.R; 24 import org.adblockplus.adblockplussbrowser.R;
25 import org.adblockplus.sbrowser.contentblocker.engine.Engine; 25 import org.adblockplus.sbrowser.contentblocker.engine.Engine;
26 import org.adblockplus.sbrowser.contentblocker.engine.EngineService; 26 import org.adblockplus.sbrowser.contentblocker.engine.EngineManager;
27 import org.adblockplus.sbrowser.contentblocker.util.SharedPrefsUtils; 27 import org.adblockplus.sbrowser.contentblocker.util.SharedPrefsUtils;
28 28
29 import android.content.ContentProvider; 29 import android.content.ContentProvider;
30 import android.content.ContentValues; 30 import android.content.ContentValues;
31 import android.content.Intent; 31 import android.content.Intent;
32 import android.database.Cursor; 32 import android.database.Cursor;
33 import android.net.Uri; 33 import android.net.Uri;
34 import android.os.Bundle; 34 import android.os.Bundle;
35 import android.os.ParcelFileDescriptor; 35 import android.os.ParcelFileDescriptor;
36 import android.support.annotation.NonNull; 36 import android.support.annotation.NonNull;
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 { 75 {
76 Log.e(TAG, "File creation failed: " + e.getMessage(), e); 76 Log.e(TAG, "File creation failed: " + e.getMessage(), e);
77 return null; 77 return null;
78 } 78 }
79 } 79 }
80 80
81 @Override 81 @Override
82 public boolean onCreate() 82 public boolean onCreate()
83 { 83 {
84 Log.i(TAG, "onCreate() called"); 84 Log.i(TAG, "onCreate() called");
85 getContext().startService(new Intent(getContext(), EngineService.class)); 85 EngineManager.getInstance().retrieveEngine(getContext(), null);
86 Log.i(TAG, "Requested service startup"); 86 Log.i(TAG, "Requested engine startup");
87 return true; 87 return true;
88 } 88 }
89 89
90 @Override 90 @Override
91 public Cursor query(@NonNull final Uri uri, final String[] projection, final S tring selection, 91 public Cursor query(@NonNull final Uri uri, final String[] projection, final S tring selection,
92 final String[] selectionArgs, final String sortOrder) 92 final String[] selectionArgs, final String sortOrder)
93 { 93 {
94 return null; 94 return null;
95 } 95 }
96 96
(...skipping 15 matching lines...) Expand all
112 return 0; 112 return 0;
113 } 113 }
114 114
115 @Override 115 @Override
116 public int update(@NonNull final Uri uri, final ContentValues values, final St ring selection, 116 public int update(@NonNull final Uri uri, final ContentValues values, final St ring selection,
117 final String[] selectionArgs) 117 final String[] selectionArgs)
118 { 118 {
119 return 0; 119 return 0;
120 } 120 }
121 } 121 }
OLDNEW

Powered by Google App Engine
This is Rietveld