19509d27252b16f69b6fd2ebb2c552201c34e5c0cJeff Sharkey/*
29509d27252b16f69b6fd2ebb2c552201c34e5c0cJeff Sharkey * Copyright (C) 2012 The Android Open Source Project
39509d27252b16f69b6fd2ebb2c552201c34e5c0cJeff Sharkey *
49509d27252b16f69b6fd2ebb2c552201c34e5c0cJeff Sharkey * Licensed under the Apache License, Version 2.0 (the "License");
59509d27252b16f69b6fd2ebb2c552201c34e5c0cJeff Sharkey * you may not use this file except in compliance with the License.
69509d27252b16f69b6fd2ebb2c552201c34e5c0cJeff Sharkey * You may obtain a copy of the License at
79509d27252b16f69b6fd2ebb2c552201c34e5c0cJeff Sharkey *
89509d27252b16f69b6fd2ebb2c552201c34e5c0cJeff Sharkey *      http://www.apache.org/licenses/LICENSE-2.0
99509d27252b16f69b6fd2ebb2c552201c34e5c0cJeff Sharkey *
109509d27252b16f69b6fd2ebb2c552201c34e5c0cJeff Sharkey * Unless required by applicable law or agreed to in writing, software
119509d27252b16f69b6fd2ebb2c552201c34e5c0cJeff Sharkey * distributed under the License is distributed on an "AS IS" BASIS,
129509d27252b16f69b6fd2ebb2c552201c34e5c0cJeff Sharkey * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
139509d27252b16f69b6fd2ebb2c552201c34e5c0cJeff Sharkey * See the License for the specific language governing permissions and
149509d27252b16f69b6fd2ebb2c552201c34e5c0cJeff Sharkey * limitations under the License.
159509d27252b16f69b6fd2ebb2c552201c34e5c0cJeff Sharkey */
169509d27252b16f69b6fd2ebb2c552201c34e5c0cJeff Sharkey
179509d27252b16f69b6fd2ebb2c552201c34e5c0cJeff Sharkey#ifndef __CUTILS_MULTIUSER_H
189509d27252b16f69b6fd2ebb2c552201c34e5c0cJeff Sharkey#define __CUTILS_MULTIUSER_H
199509d27252b16f69b6fd2ebb2c552201c34e5c0cJeff Sharkey
2046ac0ef00b7df5432d1704b221738e51234bedc5Jeff Sharkey#include <sys/types.h>
2146ac0ef00b7df5432d1704b221738e51234bedc5Jeff Sharkey
229509d27252b16f69b6fd2ebb2c552201c34e5c0cJeff Sharkey#ifdef __cplusplus
239509d27252b16f69b6fd2ebb2c552201c34e5c0cJeff Sharkeyextern "C" {
249509d27252b16f69b6fd2ebb2c552201c34e5c0cJeff Sharkey#endif
259509d27252b16f69b6fd2ebb2c552201c34e5c0cJeff Sharkey
269509d27252b16f69b6fd2ebb2c552201c34e5c0cJeff Sharkey// NOTE: keep in sync with android.os.UserId
279509d27252b16f69b6fd2ebb2c552201c34e5c0cJeff Sharkey
289509d27252b16f69b6fd2ebb2c552201c34e5c0cJeff Sharkey#define MULTIUSER_APP_PER_USER_RANGE 100000
299509d27252b16f69b6fd2ebb2c552201c34e5c0cJeff Sharkey
309509d27252b16f69b6fd2ebb2c552201c34e5c0cJeff Sharkeytypedef uid_t userid_t;
319509d27252b16f69b6fd2ebb2c552201c34e5c0cJeff Sharkeytypedef uid_t appid_t;
329509d27252b16f69b6fd2ebb2c552201c34e5c0cJeff Sharkey
339685194fc94510a33201aee9b80c23f206ccfe67Jeff Sharkeyextern userid_t multiuser_get_user_id(uid_t uid);
349685194fc94510a33201aee9b80c23f206ccfe67Jeff Sharkeyextern appid_t multiuser_get_app_id(uid_t uid);
359685194fc94510a33201aee9b80c23f206ccfe67Jeff Sharkeyextern uid_t multiuser_get_uid(userid_t userId, appid_t appId);
369509d27252b16f69b6fd2ebb2c552201c34e5c0cJeff Sharkey
379509d27252b16f69b6fd2ebb2c552201c34e5c0cJeff Sharkey#ifdef __cplusplus
389509d27252b16f69b6fd2ebb2c552201c34e5c0cJeff Sharkey}
399509d27252b16f69b6fd2ebb2c552201c34e5c0cJeff Sharkey#endif
409509d27252b16f69b6fd2ebb2c552201c34e5c0cJeff Sharkey
419509d27252b16f69b6fd2ebb2c552201c34e5c0cJeff Sharkey#endif /* __CUTILS_MULTIUSER_H */
42