Skip to main content
Stack Overflow
  1. About
  2. For Teams

Return to Question

Post Timeline

added 18 characters in body
Source Link

Scenario: I'm

I'm working on a Device Owner app that sets Factory Reset Protection (FRP) using DevicePolicyManager.setFactoryResetProtectionPolicy() on a device (Android 13+). The app becomes Device Owner successfully, and the FRP policy is applied and confirmed. The strange issue is:

After factory reset, the FRP screen does appear, BUT it asks for a different (unknown) Google account, NOT the one I explicitly set in the FRP policy.

After factory reset, the FRP screen does appear, BUT it asks for a different (unknown) Google account, NOT the one I explicitly set in the FRP policy.

Steps I followed: 1

1.Started with a fresh device, no Google account present.

FRP Account: [email protected]

FRP Account: [email protected]

adb shell settings get secure factory_reset_protection_accounts [email protected]

adb shell settings get secure factory_reset_protection_accounts
[email protected]

My Question: Why

Why does the device enforce FRP using a different Google account than the one set in setFactoryResetProtectionPolicy()? Is this a device-specific issue, a timing/sync issue, or is there a hidden requirement for FRP enforcement to work reliably?

Scenario: I'm working on a Device Owner app that sets Factory Reset Protection (FRP) using DevicePolicyManager.setFactoryResetProtectionPolicy() on a device (Android 13+). The app becomes Device Owner successfully, and the FRP policy is applied and confirmed. The strange issue is:

After factory reset, the FRP screen does appear, BUT it asks for a different (unknown) Google account, NOT the one I explicitly set in the FRP policy.

Steps I followed: 1.Started with a fresh device, no Google account present.

FRP Account: [email protected]

adb shell settings get secure factory_reset_protection_accounts [email protected]

My Question: Why does the device enforce FRP using a different Google account than the one set in setFactoryResetProtectionPolicy()? Is this a device-specific issue, a timing/sync issue, or is there a hidden requirement for FRP enforcement to work reliably?

Scenario:

I'm working on a Device Owner app that sets Factory Reset Protection (FRP) using DevicePolicyManager.setFactoryResetProtectionPolicy() on a device (Android 13+). The app becomes Device Owner successfully, and the FRP policy is applied and confirmed. The strange issue is:

After factory reset, the FRP screen does appear, BUT it asks for a different (unknown) Google account, NOT the one I explicitly set in the FRP policy.

Steps I followed:

1.Started with a fresh device, no Google account present.

FRP Account: [email protected]
adb shell settings get secure factory_reset_protection_accounts
[email protected]

My Question:

Why does the device enforce FRP using a different Google account than the one set in setFactoryResetProtectionPolicy()? Is this a device-specific issue, a timing/sync issue, or is there a hidden requirement for FRP enforcement to work reliably?

added 48 characters in body; edited title
Source Link

FRP Policy Applied via DevicePolicyManager, but After Reset, Device Asks for Unknown Google Account Instead of the One I Set as FRP Email

List frpAccounts = Collections.singletonList("[email protected]");

if (devicePolicyManager.isDeviceOwnerApp(getPackageName())) { Log.d("FRP", "Setting FRP policy...");

List<String> frpAccounts = Collections.singletonList("[email protected]");
if (devicePolicyManager.isDeviceOwnerApp(getPackageName())) {
 Log.d("FRP", "Setting FRP policy...");
 devicePolicyManager.setFactoryResetProtectionPolicy(componentName,
 new FactoryResetProtectionPolicy.Builder()
 .setFactoryResetProtectionAccounts(frpAccounts)
 .build());
FactoryResetProtectionPolicy policy = devicePolicyManager.getFactoryResetProtectionPolicy(componentName);
if (policy != null) {
 for (String acc : policy.getFactoryResetProtectionAccounts()) {
 Log.d("FRP", "FRP Account: " + acc);
 }
 }
}

}

FRP Policy Applied via DevicePolicyManager, but After Reset, Device Asks for Unknown Google Account Instead of Set FRP Email

List frpAccounts = Collections.singletonList("[email protected]");

if (devicePolicyManager.isDeviceOwnerApp(getPackageName())) { Log.d("FRP", "Setting FRP policy...");

devicePolicyManager.setFactoryResetProtectionPolicy(componentName,
 new FactoryResetProtectionPolicy.Builder()
 .setFactoryResetProtectionAccounts(frpAccounts)
 .build());
FactoryResetProtectionPolicy policy = devicePolicyManager.getFactoryResetProtectionPolicy(componentName);
if (policy != null) {
 for (String acc : policy.getFactoryResetProtectionAccounts()) {
 Log.d("FRP", "FRP Account: " + acc);
 }
}

}

FRP Policy Applied via DevicePolicyManager, but After Reset, Device Asks for Unknown Google Account Instead of the One I Set as FRP Email

List<String> frpAccounts = Collections.singletonList("[email protected]");
if (devicePolicyManager.isDeviceOwnerApp(getPackageName())) {
 Log.d("FRP", "Setting FRP policy...");
 devicePolicyManager.setFactoryResetProtectionPolicy(componentName,
 new FactoryResetProtectionPolicy.Builder()
 .setFactoryResetProtectionAccounts(frpAccounts)
 .build());
FactoryResetProtectionPolicy policy = devicePolicyManager.getFactoryResetProtectionPolicy(componentName);
if (policy != null) {
 for (String acc : policy.getFactoryResetProtectionAccounts()) {
 Log.d("FRP", "FRP Account: " + acc);
 }
 }
}
added 11 characters in body
Source Link

Scenario: I'm working on a Device Owner app that sets Factory Reset Protection (FRP) using DevicePolicyManager.setFactoryResetProtectionPolicy() on a Walton NEXG N74device (Android 10+13+). The app becomes Device Owner successfully, and the FRP policy is applied and confirmed. The strange issue is:

After factory reset, the FRP screen does appear, BUT it asks for a different (unknown) Google account, NOT the one I explicitly set in the FRP policy.

Steps I followed: 1.Started with a fresh device, no Google account present.

2.Installed my Device Owner app and set Device Owner via:

adb shell dpm set-device-owner com.myapp/.MyDeviceAdminReceiver

3.Added a known Gmail account (morledave@gmailmyKnownAccount@gmail.com) via device Settings.

4.Synced the account and rebooted once.

5.Then called this code to apply the FRP policy:

List frpAccounts = Collections.singletonList("morledave@gmail"myKnownAccount@gmail.com");

if (devicePolicyManager.isDeviceOwnerApp(getPackageName())) { Log.d("FRP", "Setting FRP policy...");

devicePolicyManager.setFactoryResetProtectionPolicy(componentName,
 new FactoryResetProtectionPolicy.Builder()
 .setFactoryResetProtectionAccounts(frpAccounts)
 .build());
FactoryResetProtectionPolicy policy = devicePolicyManager.getFactoryResetProtectionPolicy(componentName);
if (policy != null) {
 for (String acc : policy.getFactoryResetProtectionAccounts()) {
 Log.d("FRP", "FRP Account: " + acc);
 }
}

}

6.Log confirms correct FRP account is set:

FRP Account: [email protected]

7.Confirmed via ADB:

adb shell settings get secure factory_reset_protection_accounts [email protected]

The Problem:

a)After factory reset (via hardware key), FRP screen appears, but it says:

""This device was reset. To continue, sign in with the device owner's Google Account that was previously synced on this device.""

b)However, it does NOT accept morledave@gmailmyKnownAccount@gmail.com — which was the only account on the device, and the only one listed in the FRP policy.

c)It seems Android is enforcing FRP based on a different (unrelated or cached) Google account, ignoring the one explicitly set in policy.

What I’ve Tried:

i.Verified that only morledave@gmailmyKnownAccount@gmail.com was ever added.

ii.Synced account before applying FRP.

iii.Used wipeData(WIPE_RESET_PROTECTION_DATA) before applying FRP policy.

iv.Rebooted after each major step.

v.Confirmed through logs and ADB that FRP policy is set correctly.

My Question: Why does the device enforce FRP using a different Google account than the one set in setFactoryResetProtectionPolicy()? Is this a device-specific issue, a timing/sync issue, or is there a hidden requirement for FRP enforcement to work reliably?

Scenario: I'm working on a Device Owner app that sets Factory Reset Protection (FRP) using DevicePolicyManager.setFactoryResetProtectionPolicy() on a Walton NEXG N74 (Android 10+). The app becomes Device Owner successfully, and the FRP policy is applied and confirmed. The strange issue is:

After factory reset, the FRP screen does appear, BUT it asks for a different (unknown) Google account, NOT the one I explicitly set in the FRP policy.

Steps I followed: 1.Started with a fresh device, no Google account present.

2.Installed my Device Owner app and set Device Owner via:

adb shell dpm set-device-owner com.myapp/.MyDeviceAdminReceiver

3.Added a known Gmail account (morledave@gmail.com) via device Settings.

4.Synced the account and rebooted once.

5.Then called this code to apply the FRP policy:

List frpAccounts = Collections.singletonList("morledave@gmail.com");

if (devicePolicyManager.isDeviceOwnerApp(getPackageName())) { Log.d("FRP", "Setting FRP policy...");

devicePolicyManager.setFactoryResetProtectionPolicy(componentName,
 new FactoryResetProtectionPolicy.Builder()
 .setFactoryResetProtectionAccounts(frpAccounts)
 .build());
FactoryResetProtectionPolicy policy = devicePolicyManager.getFactoryResetProtectionPolicy(componentName);
if (policy != null) {
 for (String acc : policy.getFactoryResetProtectionAccounts()) {
 Log.d("FRP", "FRP Account: " + acc);
 }
}

}

6.Log confirms correct FRP account is set:

FRP Account: [email protected]

7.Confirmed via ADB:

adb shell settings get secure factory_reset_protection_accounts [email protected]

The Problem:

a)After factory reset (via hardware key), FRP screen appears, but it says:

""This device was reset. To continue, sign in with the device owner's Google Account that was previously synced on this device.""

b)However, it does NOT accept morledave@gmail.com — which was the only account on the device, and the only one listed in the FRP policy.

c)It seems Android is enforcing FRP based on a different (unrelated or cached) Google account, ignoring the one explicitly set in policy.

What I’ve Tried:

i.Verified that only morledave@gmail.com was ever added.

ii.Synced account before applying FRP.

iii.Used wipeData(WIPE_RESET_PROTECTION_DATA) before applying FRP policy.

iv.Rebooted after each major step.

v.Confirmed through logs and ADB that FRP policy is set correctly.

My Question: Why does the device enforce FRP using a different Google account than the one set in setFactoryResetProtectionPolicy()? Is this a device-specific issue, a timing/sync issue, or is there a hidden requirement for FRP enforcement to work reliably?

Scenario: I'm working on a Device Owner app that sets Factory Reset Protection (FRP) using DevicePolicyManager.setFactoryResetProtectionPolicy() on a device (Android 13+). The app becomes Device Owner successfully, and the FRP policy is applied and confirmed. The strange issue is:

After factory reset, the FRP screen does appear, BUT it asks for a different (unknown) Google account, NOT the one I explicitly set in the FRP policy.

Steps I followed: 1.Started with a fresh device, no Google account present.

2.Installed my Device Owner app and set Device Owner via:

adb shell dpm set-device-owner com.myapp/.MyDeviceAdminReceiver

3.Added a known Gmail account (myKnownAccount@gmail.com) via device Settings.

4.Synced the account and rebooted once.

5.Then called this code to apply the FRP policy:

List frpAccounts = Collections.singletonList("myKnownAccount@gmail.com");

if (devicePolicyManager.isDeviceOwnerApp(getPackageName())) { Log.d("FRP", "Setting FRP policy...");

devicePolicyManager.setFactoryResetProtectionPolicy(componentName,
 new FactoryResetProtectionPolicy.Builder()
 .setFactoryResetProtectionAccounts(frpAccounts)
 .build());
FactoryResetProtectionPolicy policy = devicePolicyManager.getFactoryResetProtectionPolicy(componentName);
if (policy != null) {
 for (String acc : policy.getFactoryResetProtectionAccounts()) {
 Log.d("FRP", "FRP Account: " + acc);
 }
}

}

6.Log confirms correct FRP account is set:

FRP Account: [email protected]

7.Confirmed via ADB:

adb shell settings get secure factory_reset_protection_accounts [email protected]

The Problem:

a)After factory reset (via hardware key), FRP screen appears, but it says:

""This device was reset. To continue, sign in with the device owner's Google Account that was previously synced on this device.""

b)However, it does NOT accept myKnownAccount@gmail.com — which was the only account on the device, and the only one listed in the FRP policy.

c)It seems Android is enforcing FRP based on a different (unrelated or cached) Google account, ignoring the one explicitly set in policy.

What I’ve Tried:

i.Verified that only myKnownAccount@gmail.com was ever added.

ii.Synced account before applying FRP.

iii.Used wipeData(WIPE_RESET_PROTECTION_DATA) before applying FRP policy.

iv.Rebooted after each major step.

v.Confirmed through logs and ADB that FRP policy is set correctly.

My Question: Why does the device enforce FRP using a different Google account than the one set in setFactoryResetProtectionPolicy()? Is this a device-specific issue, a timing/sync issue, or is there a hidden requirement for FRP enforcement to work reliably?

Source Link
Loading
default

AltStyle によって変換されたページ (->オリジナル) /