I am trying to build Aosp Launcher app with android studio.
packages/apps/Launcher3/src/full_lib/com/android/launcher3/icons/SimpleIconCache.java
@Override
protected long getSerialNumberForUser(UserHandle user) {
synchronized (mUserSerialMap) {
int index = mUserSerialMap.indexOfKey(user.getIdentifier());
if (index >= 0) {
return mUserSerialMap.valueAt(index);
}
long serial = mUserManager.getSerialNumberForUser(user);
mUserSerialMap.put(user.getIdentifier(), serial);
return serial;
}
}
After building the source code, I can get see error "cannot find symbol method getIdentifier()".
However function getIdentifier() is defined in UserHandle class.
android-29/android/os/UserHandle.java
@SystemApi
@TestApi
public @UserIdInt int getIdentifier() {
return mHandle;
}
Error occured because the function is defined with @SystemAPI annotation.
Is there any way to call functions that have systemapi annotation?