diff --git a/automotive/audiocontrol/2.0/default/AudioControl.cpp b/automotive/audiocontrol/2.0/default/AudioControl.cpp
index eac3514..7a121f5 100644
--- a/automotive/audiocontrol/2.0/default/AudioControl.cpp
+++ b/automotive/audiocontrol/2.0/default/AudioControl.cpp
@@ -16,12 +16,16 @@
 
 #include "AudioControl.h"
 
-#include <android-base/logging.h>
-#include <android-base/strings.h>
-#include <hidl/HidlTransportSupport.h>
-
 #include <stdio.h>
 
+#include <android-base/logging.h>
+#include <android-base/parseint.h>
+#include <android-base/strings.h>
+
+#include <hidl/HidlTransportSupport.h>
+#include <hwbinder/IPCThreadState.h>
+#include <private/android_filesystem_config.h>
+
 #include "CloseHandle.h"
 
 namespace android::hardware::automotive::audiocontrol::V2_0::implementation {
@@ -104,6 +108,8 @@
     std::string option = options[0];
     if (EqualsIgnoreCase(option, "--help")) {
         cmdHelp(fd);
+    } else if (EqualsIgnoreCase(option, "--request")) {
+        cmdRequestFocus(fd, options);
     } else {
         dprintf(fd, "Invalid option: %s\n", option.c_str());
     }
@@ -121,6 +127,66 @@
     dprintf(fd, "Usage: \n\n");
     dprintf(fd, "[no args]: dumps focus listener status\n");
     dprintf(fd, "--help: shows this help\n");
+    dprintf(fd,
+            "--request <USAGE> <ZONE_ID> <FOCUS_GAIN>: requests audio focus for specified "
+            "usage (int), audio zone ID (int), and focus gain type (int)\n");
+}
+
+void AudioControl::cmdRequestFocus(int fd, const hidl_vec<hidl_string>& options) {
+    if (!checkCallerHasWritePermissions(fd) || !checkArgumentsSize(fd, options, 3)) return;
+
+    hidl_bitfield<AudioUsage> usage;
+    if (!safelyParseInt(options[1], &usage)) {
+        dprintf(fd, "Non-integer usage provided with request: %s\n", options[1].c_str());
+        return;
+    }
+    int zoneId;
+    if (!safelyParseInt(options[2], &zoneId)) {
+        dprintf(fd, "Non-integer zoneId provided with request: %s\n", options[2].c_str());
+        return;
+    }
+    hidl_bitfield<AudioFocusChange> focusGain;
+    if (!safelyParseInt(options[3], &focusGain)) {
+        dprintf(fd, "Non-integer focusGain provided with request: %s\n", options[3].c_str());
+        return;
+    }
+
+    if (mFocusListener == nullptr) {
+        dprintf(fd, "Unable to request focus - no focus listener registered\n");
+        return;
+    }
+
+    mFocusListener->requestAudioFocus(usage, zoneId, focusGain);
+    dprintf(fd, "Requested focus for usage %d, zoneId %d, and focusGain %d\n", usage, zoneId,
+            focusGain);
+}
+
+bool AudioControl::checkCallerHasWritePermissions(int fd) {
+    // Double check that's only called by root - it should be be blocked at the HIDL debug() level,
+    // but it doesn't hurt to make sure...
+    if (hardware::IPCThreadState::self()->getCallingUid() != AID_ROOT) {
+        dprintf(fd, "Must be root\n");
+        return false;
+    }
+    return true;
+}
+
+bool AudioControl::checkArgumentsSize(int fd, const hidl_vec<hidl_string>& options,
+                                      size_t expectedSize) {
+    // options includes the command, so reducing size by one
+    size_t size = options.size() - 1;
+    if (size == expectedSize) {
+        return true;
+    }
+    dprintf(fd, "Invalid number of arguments: required %zu, got %zu\n", expectedSize, size);
+    return false;
+}
+
+bool AudioControl::safelyParseInt(std::string s, int* out) {
+    if (!android::base::ParseInt(s, out)) {
+        return false;
+    }
+    return true;
 }
 
 }  // namespace android::hardware::automotive::audiocontrol::V2_0::implementation
diff --git a/automotive/audiocontrol/2.0/default/AudioControl.h b/automotive/audiocontrol/2.0/default/AudioControl.h
index 6a3f21b..1cd7cbc 100644
--- a/automotive/audiocontrol/2.0/default/AudioControl.h
+++ b/automotive/audiocontrol/2.0/default/AudioControl.h
@@ -43,10 +43,14 @@
   private:
     sp<IFocusListener> mFocusListener;
 
+    static bool checkArgumentsSize(int fd, const hidl_vec<hidl_string>& options, size_t minSize);
+    static bool checkCallerHasWritePermissions(int fd);
     static bool isValidValue(float value);
+    static bool safelyParseInt(std::string s, int* out);
 
     void cmdDump(int fd, const hidl_vec<hidl_string>& options);
     void cmdHelp(int fd) const;
+    void cmdRequestFocus(int fd, const hidl_vec<hidl_string>& options);
     void dump(int fd);
 };
 
