[高通SDM450][Android9.0]CTA认证--去掉通话记录功能

开发平台基本信息

芯片: 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;
-    }
-}
 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值