Allow setting password during provisioning if FRP is not supported

On devices without PersistentDataBlock support, we should
always allow setting up password during provisioning.

Bug: 157451551
Test: make RunSettingsRoboTests
      ROBOTEST_FILTER=com.android.settings.password
Test: On cuttlefish, file ACTION_SET_NET_PASSWORD before SUW completes
Change-Id: Ic7b5d99b38e6427750ce70fa7e38f7ef6054d4ad
This commit is contained in:
Rubin Xu
2020-05-26 20:15:00 +01:00
parent 86b5034215
commit 5e51ed6a89
3 changed files with 16 additions and 44 deletions

View File

@@ -1,42 +0,0 @@
/*
* Copyright (C) 2020 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.settings.testutils.shadow;
import android.service.persistentdata.PersistentDataBlockManager;
import org.robolectric.annotation.Implementation;
import org.robolectric.annotation.Implements;
import org.robolectric.annotation.Resetter;
@Implements(PersistentDataBlockManager.class)
public class ShadowPersistentDataBlockManager {
private static int sDataBlockSize = 0;
@Resetter
public static void reset() {
sDataBlockSize = 0;
}
@Implementation
protected int getDataBlockSize() {
return sDataBlockSize;
}
public static void setDataBlockSize(int dataBlockSize) {
sDataBlockSize = dataBlockSize;
}
}