Files
frameworks_base/errorprone/tests/res/android/os/Binder.java
Jeff Sharkey 1561df4a9b Detector for Binder.clearCallingIdentity() bugs.
Binder maintains thread-local identity information about any remote
caller, which can be temporarily cleared while performing operations
that need to be handled as the current process. However, it's
important to restore the original remote calling identity after
carefully scoping this work inside a try/finally block, to avoid
obscure security vulnerabilities.

Bug: 155703208
Test: atest error_prone_android_framework_test
Change-Id: I568771a50af27637e4984950dcada2248ce16afe
2020-10-05 16:03:10 -06:00

32 lines
987 B
Java

/*
* 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 android.os;
public class Binder {
public static int getCallingUid() {
throw new UnsupportedOperationException();
}
public static long clearCallingIdentity() {
throw new UnsupportedOperationException();
}
public static void restoreCallingIdentity(long token) {
throw new UnsupportedOperationException();
}
}