开发平台基本信息
芯片: SDM450
版本: Android 9.0
kernel: msm-4.9
问题描述
与去掉录音功能同理,设备在进行入网认证的时候,为了快速通过认证,要求系统去掉通话记录功能,让实验室无法调用通话记录功能即可。
解决方法
diff --git a/packages/providers/ContactsProvider/Android.mk b/packages/providers/ContactsProvider/Android.mk
index d31ad73..b125e5f 100644
--- a/packages/providers/ContactsProvider/Android.mk
+++ b/packages/providers/ContactsProvider/Android.mk
@@ -29,4 +29,4 @@ LOCAL_PROGUARD_FLAG_FILES := proguard.flags
include $(BUILD_PACKAGE)
# Use the following include to make our test apk.
-include $(call all-makefiles-under,$(LOCAL_PATH))
+#include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/packages/providers/ContactsProvider/AndroidManifest.xml b/packages/providers/ContactsProvider/AndroidManifest.xml
index 559e60f..6cdc762 100644
--- a/packages/providers/ContactsProvider/AndroidManifest.xml
+++ b/packages/providers/ContactsProvider/AndroidManifest.xml
@@ -57,14 +57,6 @@
android:writePermission="android.permission.WRITE_CALL_LOG">
</provider>
- <provider android:name="ShadowCallLogProvider"
- android:authorities="call_log_shadow"
- android:syncable="false" android:multiprocess="false"
- android:exported="true"
- android:directBootAware="true"
- android:readPermission="android.permission.MANAGE_USERS"
- android:writePermission="android.permission.MANAGE_USERS">
- </provider>
<!-- Note: While this provider does not declare a permission explicitly, it enforces that
the caller has either ADD_VOICEMAIL or carrier privileges at a minimum to access it.
diff --git a/packages/providers/ContactsProvider/src/com/android/providers/contacts/CallLogProvider.java b/packages/providers/ContactsProvider/src/com/android/providers/contacts/CallLogProvider.java
index f71a750..27df2a3 100644
--- a/packages/providers/ContactsProvider/src/com/android/providers/contacts/CallLogProvider.java
+++ b/packages/providers/ContactsProvider/src/com/android/providers/contacts/CallLogProvider.java
@@ -60,6 +60,7 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.CountDownLatch;
+import android.util.AndroidRuntimeException;
/**
* Call log content provider.
@@ -196,11 +197,12 @@ public class CallLogProvider extends ContentProvider {
@Override
public boolean onCreate() {
- if (VERBOSE_LOGGING) {
- Log.v(TAG, "onCreate: " + this.getClass().getSimpleName()
+// if (VERBOSE_LOGGING) {
+ Log.v(TAG, "raul >> onCreate: " + this.getClass().getSimpleName()
+ " user=" + android.os.Process.myUserHandle().getIdentifier());
- }
-
+ // }
+ // throw new AndroidRuntimeException("here");
+
setAppOps(AppOpsManager.OP_READ_CALL_LOG, AppOpsManager.OP_WRITE_CALL_LOG);
if (Log.isLoggable(Constants.PERFORMANCE_TAG, Log.DEBUG)) {
Log.d(Constants.PERFORMANCE_TAG, getProviderName() + ".onCreate start");
@@ -217,17 +219,20 @@ public class CallLogProvider extends ContentProvider {
mTaskScheduler = new ContactsTaskScheduler(getClass().getSimpleName()) {
@Override
- public void onPerformTask(int taskId, Object arg) {
- performBackgroundTask(taskId, arg);
- }
- };
+ public void onPerformTask(int taskId, Object arg) {
+ Log.i("raul","performBackgroundTask(taskId, arg)");
+ // performBackgroundTask(taskId, arg);
+ }
+ };
+ Log.i("raul","mTaskScheduler.scheduleTask(BACKGROUND_TASK_INITIALIZE, null)");
mTaskScheduler.scheduleTask(BACKGROUND_TASK_INITIALIZE, null);
if (Log.isLoggable(Constants.PERFORMANCE_TAG, Log.DEBUG)) {
Log.d(Constants.PERFORMANCE_TAG, getProviderName() + ".onCreate finish");
}
return true;
+
}
@VisibleForTesting
@@ -352,6 +357,9 @@ public class CallLogProvider extends ContentProvider {
if (c != null) {
c.setNotificationUri(getContext().getContentResolver(), CallLog.CONTENT_URI);
}
+ Log.i("raul","raul cta test");
+ //throw new IllegalArgumentException("raul cta test");
+
return c;
}
@@ -550,6 +558,7 @@ public class CallLogProvider extends ContentProvider {
}
void adjustForNewPhoneAccount(PhoneAccountHandle handle) {
+ Log.i("raul","adjustForNewPhoneAccount(PhoneAccountHandle handle)");
mTaskScheduler.scheduleTask(BACKGROUND_TASK_ADJUST_PHONE_ACCOUNT, handle);
}
diff --git a/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsTaskScheduler.java b/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsTaskScheduler.java
index 1628387..4043fc3 100644
--- a/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsTaskScheduler.java
+++ b/packages/providers/ContactsProvider/src/com/android/providers/contacts/ContactsTaskScheduler.java
@@ -71,9 +71,9 @@ public abstract class ContactsTaskScheduler {
@Override
public void handleMessage(Message msg) {
- if (VERBOSE_LOGGING) {
- Log.v(TAG, "[" + mName + "] " + mThread + " dispatching " + msg.what);
- }
+ // if (VERBOSE_LOGGING) {
+ Log.v(TAG, "raul >> [" + mName + "] " + mThread + " dispatching " + msg.what);
+ // }
onPerformTask(msg.what, msg.obj);
}
}
diff --git a/packages/providers/ContactsProvider/src/com/android/providers/contacts/ShadowCallLogProvider.java b/packages/providers/ContactsProvider/src/com/android/providers/contacts/ShadowCallLogProvider.java
deleted file mode 100644
index 2cacdc2..0000000
--- a/packages/providers/ContactsProvider/src/com/android/providers/contacts/ShadowCallLogProvider.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright (C) 2016 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 android.content.Context;
-
-public class ShadowCallLogProvider extends CallLogProvider {
- protected CallLogDatabaseHelper getDatabaseHelper(final Context context) {
- return CallLogDatabaseHelper.getInstanceForShadow(context);
- }
-
- @Override
- protected boolean isShadow() {
- return true;
- }
-}