1/*
2 * Copyright 2014 The Android Open Source Project
3 *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8     *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10     * Unless required by applicable law or agreed to in writing, software
11     * distributed under the License is distributed on an "AS IS" BASIS,
12     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package com.android.server.pm;
18
19import android.os.Binder;
20
21class KeySetHandle extends Binder{
22    private final long mId;
23    private int mRefCount;
24
25    protected KeySetHandle(long id) {
26        mId = id;
27        mRefCount = 1;
28    }
29
30    /*
31     * Only used when reading state from packages.xml
32     */
33    protected KeySetHandle(long id, int refCount) {
34        mId = id;
35        mRefCount = refCount;
36    }
37
38    public long getId() {
39        return mId;
40    }
41
42    protected int getRefCountLPr() {
43        return mRefCount;
44    }
45
46    /*
47     * Only used when reading state from packages.xml
48     */
49    protected void setRefCountLPw(int newCount) {
50         mRefCount = newCount;
51         return;
52    }
53
54    protected void incrRefCountLPw() {
55        mRefCount++;
56        return;
57    }
58
59    protected int decrRefCountLPw() {
60        mRefCount--;
61        return mRefCount;
62    }
63}
64