Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ed8bca0b authored by Muhammad Qureshi's avatar Muhammad Qureshi
Browse files

Add TelephonyCommonStatsLog

Add TelephonyCommonStatsLog to framework-telephony-common-sources to
replace StatsLog call in TelephonyPermissions. This allows
TelephonyPermissions to be part of frameworks.jar after being jarjar'ed and also be included
statically in Mainline modules.

Bug: 145952197
Test: m frameworks-minus-apex
Test: fastboot flashall
Test: atest TelephonyCommonTests
Change-Id: I0b9e946e2b4a64a05acaf3132dffd8fc22f7d51d
parent e4a81f01
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -191,12 +191,20 @@ filegroup {
    path: "telephony/java",
}

genrule {
    name: "statslog-telephony-common-java-gen",
    tools: ["stats-log-api-gen"],
    cmd: "$(location stats-log-api-gen) --java $(out) --module telephony_common"
        + " --javaPackage com.android.internal.telephony --javaClass TelephonyCommonStatsLog",
    out: ["com/android/internal/telephony/TelephonyCommonStatsLog.java"],
}

filegroup {
    name: "framework-telephony-common-sources",
    srcs: [
        "telephony/common/**/*.java",
        ":statslog-telephony-common-java-gen",
    ],
    path: "telephony/common",
}

filegroup {
+2 −1
Original line number Diff line number Diff line
@@ -255,7 +255,8 @@ message Atom {
        PermissionGrantRequestResultReported permission_grant_request_result_reported =
            170 [(module) = "permissioncontroller"];
        BluetoothSocketConnectionStateChanged bluetooth_socket_connection_state_changed = 171;
        DeviceIdentifierAccessDenied device_identifier_access_denied = 172;
        DeviceIdentifierAccessDenied device_identifier_access_denied =
                172 [(module) = "telephony_common"];
        BubbleDeveloperErrorReported bubble_developer_error_reported = 173;
        AssistGestureStageReported assist_gesture_stage_reported = 174;
        AssistGestureFeedbackReported assist_gesture_feedback_reported = 175;
+2 −3
Original line number Diff line number Diff line
@@ -31,7 +31,6 @@ import android.os.UserHandle;
import android.telephony.SubscriptionManager;
import android.telephony.TelephonyManager;
import android.util.Log;
import android.util.StatsLog;

import com.android.internal.annotations.VisibleForTesting;

@@ -393,8 +392,8 @@ public final class TelephonyPermissions {
                invokedMethods = sReportedDeviceIDPackages.get(callingPackage);
            }
            invokedMethods.add(message);
            StatsLog.write(StatsLog.DEVICE_IDENTIFIER_ACCESS_DENIED, callingPackage, message,
                    isPreinstalled, false);
            TelephonyCommonStatsLog.write(TelephonyCommonStatsLog.DEVICE_IDENTIFIER_ACCESS_DENIED,
                    callingPackage, message, isPreinstalled, false);
        }
        Log.w(LOG_TAG, "reportAccessDeniedToReadIdentifiers:" + callingPackage + ":" + message
                + ":isPreinstalled=" + isPreinstalled);