From a2e0dadca3e2a5d0169a3c90f29eb40fae38fab0 Mon Sep 17 00:00:00 2001
From: Nolen Johnson <johnsonnolen@gmail.com>
Date: Fri, 5 Sep 2025 01:40:30 -0400
Subject: [PATCH] NvCPL: Wire up RECEIVER_EXPORTED parameter

* Except for x.smali, which is problematic and will
  be addressed in a followup patch.
---
 smali/com/nvidia/NvCPLSvc/NvCPLService.smali     | 7 ++++---
 smali/com/nvidia/NvCPLSvc/NvCPLUserTracker.smali | 5 +++--
 smali/com/nvidia/NvCPLSvc/power/a0.smali         | 5 +++--
 smali/com/nvidia/NvCPLSvc/power/f.smali          | 5 +++--
 smali/com/nvidia/NvCPLSvc/stats/c.smali          | 5 +++--
 5 files changed, 16 insertions(+), 11 deletions(-)

diff --git a/smali/com/nvidia/NvCPLSvc/NvCPLService.smali b/smali/com/nvidia/NvCPLSvc/NvCPLService.smali
index 80685dd..0294674 100644
--- a/smali/com/nvidia/NvCPLSvc/NvCPLService.smali
+++ b/smali/com/nvidia/NvCPLSvc/NvCPLService.smali
@@ -1167,7 +1167,7 @@
 .end method
 
 .method public onCreate()V
-    .locals 4
+    .locals 5
 
     sget-object v0, Lcom/nvidia/NvCPLSvc/NvCPLService;->u:Lcom/nvidia/NvCPLSvc/a0/a;
 
@@ -1381,7 +1381,8 @@
 
     const/4 v3, 0x2
 
-    invoke-virtual {p0, v2, v1, v3}, Landroid/app/Service;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;
+    const/4 v4, 0x2
+    invoke-virtual {p0, v2, v1, v3, v4}, Landroid/app/Service;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;
 
     new-instance v1, Lcom/nvidia/NvCPLSvc/NvCPLService$4;
 
@@ -1405,7 +1406,7 @@
 
     const/4 v3, 0x2
 
-    invoke-virtual {p0, v2, v1, v3}, Landroid/app/Service;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;
+    invoke-virtual {p0, v2, v1, v3, v4}, Landroid/app/Service;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;
 
     iget-object v1, p0, Lcom/nvidia/NvCPLSvc/NvCPLService;->l:Lcom/nvidia/NvCPLSvc/NvCPLUserTracker;
 
diff --git a/smali/com/nvidia/NvCPLSvc/NvCPLUserTracker.smali b/smali/com/nvidia/NvCPLSvc/NvCPLUserTracker.smali
index 25bad70..25a6a1c 100644
--- a/smali/com/nvidia/NvCPLSvc/NvCPLUserTracker.smali
+++ b/smali/com/nvidia/NvCPLSvc/NvCPLUserTracker.smali
@@ -27,7 +27,7 @@
 
 # virtual methods
 .method public a()V
-    .locals 2
+    .locals 3
 
     invoke-static {}, Landroid/app/ActivityManager;->getCurrentUser()I
 
@@ -49,7 +49,8 @@
 
     iget-object v1, p0, Lcom/nvidia/NvCPLSvc/NvCPLUserTracker;->a:Landroid/content/Context;
 
-    invoke-virtual {v1, p0, v0}, Landroid/content/Context;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;
+    const/4 v2, 0x2
+    invoke-virtual {v1, p0, v0, v2}, Landroid/content/Context;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;
 
     return-void
 .end method
diff --git a/smali/com/nvidia/NvCPLSvc/power/a0.smali b/smali/com/nvidia/NvCPLSvc/power/a0.smali
index 1eba72d..c30261d 100644
--- a/smali/com/nvidia/NvCPLSvc/power/a0.smali
+++ b/smali/com/nvidia/NvCPLSvc/power/a0.smali
@@ -59,7 +59,7 @@
 .end method
 
 .method public constructor <init>(Landroid/content/Context;Z)V
-    .locals 2
+    .locals 3
 
     invoke-direct {p0}, Ljava/lang/Object;-><init>()V
 
@@ -115,7 +115,8 @@
 
     invoke-direct {p0, p2}, Landroid/content/IntentFilter;-><init>(Ljava/lang/String;)V
 
-    invoke-virtual {p1, v0, p0}, Landroid/content/Context;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;
+    const/4 v2, 0x2
+    invoke-virtual {p1, v0, p0, v2}, Landroid/content/Context;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;
 
     :cond_0
     return-void
diff --git a/smali/com/nvidia/NvCPLSvc/power/f.smali b/smali/com/nvidia/NvCPLSvc/power/f.smali
index e8648d9..028bad0 100644
--- a/smali/com/nvidia/NvCPLSvc/power/f.smali
+++ b/smali/com/nvidia/NvCPLSvc/power/f.smali
@@ -901,7 +901,7 @@
 .end method
 
 .method public i(Ljava/lang/String;)V
-    .locals 2
+    .locals 3
 
     const/4 v0, 0x0
 
@@ -971,7 +971,8 @@
 
     invoke-direct {v0, v1}, Landroid/content/IntentFilter;-><init>(Ljava/lang/String;)V
 
-    invoke-virtual {p1, p0, v0}, Landroid/content/Context;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;
+    const/4 v2, 0x2
+    invoke-virtual {p1, p0, v0, v2}, Landroid/content/Context;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;
 
     :cond_3
     :goto_1
diff --git a/smali/com/nvidia/NvCPLSvc/stats/c.smali b/smali/com/nvidia/NvCPLSvc/stats/c.smali
index a85a4e2..52a4a49 100644
--- a/smali/com/nvidia/NvCPLSvc/stats/c.smali
+++ b/smali/com/nvidia/NvCPLSvc/stats/c.smali
@@ -625,7 +625,7 @@
 
 # virtual methods
 .method protected n(Z)V
-    .locals 7
+    .locals 8
 
     const/4 v0, 0x0
 
@@ -719,7 +719,8 @@
 
     iget-object v1, p0, Lcom/nvidia/NvCPLSvc/stats/c;->h:Landroid/content/BroadcastReceiver;
 
-    invoke-virtual {v0, v1, p1}, Landroid/content/Context;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;
+    const/4 v7, 0x2
+    invoke-virtual {v0, v1, p1, v7}, Landroid/content/Context;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;
 
     const/4 p1, 0x1
 
-- 
2.43.0

