en ko

How It Works

The core process of using the fake provider is:

  1. Put the desired values in the extras Bundle
  2. Call call()
  3. The values are reflected in the response of that same call.

The injection and retrieval happen together in a single call(), it is not a two-step set-then-get process.

Kotlin

val uri = Uri.parse("content://com.sec.android.app.samsungapps.provider.FakeASAA")

// 1) Inject the desired response values into extras
val extras = Bundle().apply {
    putString("userStatus", "SUPERVISED")
    putInt("ageLower", 13)                      // Int on request
    putInt("ageUpper", 15)
    putString("mostRecentApprovalDate", "2026-07-07")
    putString("installID", "test_install_id")
}

// 2) Call — the injected values come back in the response
val result = contentResolver.call(uri, "getAgeSignalResult", null, extras)

// 3) Read the result
val code       = result?.getInt("result_code")      // 0 = success
val userStatus = result?.getString("userStatus")
val ageLower   = result?.getString("ageLower")     // response is String
val ageUpper   = result?.getString("ageUpper")
val installId  = result?.getString("installID")

Java

Uri uri = Uri.parse("content://com.sec.android.app.samsungapps.provider.FakeASAA");

// 1) Inject the desired response values into extras
Bundle extras = new Bundle();
extras.putString("userStatus", "SUPERVISED");
extras.putInt("ageLower", 13);                      // Int on request
extras.putInt("ageUpper", 15);
extras.putString("mostRecentApprovalDate", "2026-07-07");
extras.putString("installID", "test_install_id");

// 2) Call — the injected values come back in the response
Bundle result = getContentResolver().call(uri, "getAgeSignalResult", null, extras);

// 3) Read the result (age is String in the response)
if (result != null) {
    int code          = result.getInt("result_code");   // 0 = success
    String userStatus = result.getString("userStatus");
    String ageLower   = result.getString("ageLower");
    String installId  = result.getString("installID");
}