summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author TreeHugger Robot <treehugger-gerrit@google.com> 2017-02-04 03:14:10 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2017-02-04 03:14:13 +0000
commita07efe52d59a8d9652140d44f1744a43fdb690a5 (patch)
treeca67f73ed9381009d8165aaf8a32396bc1ef6756
parent18d4421797f2a4895ea90bc168b08e1a597d0e4b (diff)
parent977429b7d119de8070cf2e4f6c7ebf8f350e5d8c (diff)
Merge "Shift responsibility of DB cleanup to TvProvider"
-rw-r--r--services/core/java/com/android/server/tv/TvInputManagerService.java44
1 files changed, 0 insertions, 44 deletions
diff --git a/services/core/java/com/android/server/tv/TvInputManagerService.java b/services/core/java/com/android/server/tv/TvInputManagerService.java
index 8cc53f070fbd..e0261304f0f0 100644
--- a/services/core/java/com/android/server/tv/TvInputManagerService.java
+++ b/services/core/java/com/android/server/tv/TvInputManagerService.java
@@ -23,15 +23,12 @@ import android.annotation.Nullable;
import android.app.ActivityManager;
import android.content.BroadcastReceiver;
import android.content.ComponentName;
-import android.content.ContentProviderOperation;
-import android.content.ContentProviderResult;
import android.content.ContentResolver;
import android.content.ContentUris;
import android.content.ContentValues;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
-import android.content.OperationApplicationException;
import android.content.ServiceConnection;
import android.content.pm.ActivityInfo;
import android.content.pm.PackageManager;
@@ -84,12 +81,9 @@ import com.android.internal.util.IndentingPrintWriter;
import com.android.server.IoThread;
import com.android.server.SystemService;
-import org.xmlpull.v1.XmlPullParserException;
-
import java.io.File;
import java.io.FileDescriptor;
import java.io.FileNotFoundException;
-import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
@@ -241,44 +235,6 @@ public final class TvInputManagerService extends SystemService {
// the update can be handled in {@link #onSomePackagesChanged}.
return true;
}
-
- @Override
- public void onPackageRemoved(String packageName, int uid) {
- synchronized (mLock) {
- UserState userState = getOrCreateUserStateLocked(getChangingUserId());
- if (!userState.packageSet.contains(packageName)) {
- // Not a TV input package.
- return;
- }
- }
-
- ArrayList<ContentProviderOperation> operations = new ArrayList<>();
-
- String selection = TvContract.BaseTvColumns.COLUMN_PACKAGE_NAME + "=?";
- String[] selectionArgs = { packageName };
-
- operations.add(ContentProviderOperation.newDelete(TvContract.Channels.CONTENT_URI)
- .withSelection(selection, selectionArgs).build());
- operations.add(ContentProviderOperation.newDelete(TvContract.Programs.CONTENT_URI)
- .withSelection(selection, selectionArgs).build());
- operations.add(ContentProviderOperation
- .newDelete(TvContract.WatchedPrograms.CONTENT_URI)
- .withSelection(selection, selectionArgs).build());
-
- ContentProviderResult[] results = null;
- try {
- ContentResolver cr = getContentResolverForUser(getChangingUserId());
- results = cr.applyBatch(TvContract.AUTHORITY, operations);
- } catch (RemoteException | OperationApplicationException e) {
- Slog.e(TAG, "error in applyBatch", e);
- }
-
- if (DEBUG) {
- Slog.d(TAG, "onPackageRemoved(packageName=" + packageName + ", uid=" + uid
- + ")");
- Slog.d(TAG, "results=" + results);
- }
- }
};
monitor.register(mContext, null, UserHandle.ALL, true);